dd_sds/
lib.rs

1// This blocks accidental use of `println`. If one is actually needed, you can
2// override with `#[allow(clippy::print_stdout)]`.
3#![deny(clippy::print_stdout)]
4#![allow(clippy::new_without_default)]
5
6mod encoding;
7mod event;
8mod match_action;
9
10mod ast_utils;
11mod event_json;
12mod match_validation;
13mod normalization;
14mod observability;
15mod parser;
16mod path;
17mod proximity_keywords;
18mod rule_match;
19mod scanner;
20pub(crate) mod scoped_ruleset;
21mod secondary_validation;
22mod simple_event;
23mod stats;
24mod tokio;
25mod validation;
26
27pub use simple_event::SimpleEvent;
28
29// This is the public API of the SDS core library
30pub use encoding::{EncodeIndices, Encoding, Utf8Encoding};
31pub use event::{Event, EventVisitor, VisitStringResult};
32pub use match_action::{MatchAction, PartialRedactDirection};
33
34pub use match_validation::{
35    config::AwsConfig,
36    config::AwsType,
37    config::CustomHttpConfig,
38    config::HttpMethod,
39    config::HttpStatusCodeRange,
40    config::HttpValidatorOption,
41    config::InternalMatchValidationType,
42    config::MatchValidationType,
43    config::RequestHeader,
44    config_v2::{
45        BodyMatcher, CustomHttpConfigV2, HttpCallConfig, HttpRequestConfig, HttpResponseConfig,
46        MatchPairingConfig, PairedValidatorConfig, ResponseCondition, ResponseConditionResult,
47        ResponseConditionType, StatusCodeMatcher, TemplateVariable, TemplatedMatchString,
48        is_valid_body_matcher_path,
49    },
50    match_status::{HttpErrorInfo, MatchStatus, UnknownResponseTypeInfo, ValidationError},
51};
52pub use observability::labels::Labels;
53pub use path::{Path, PathSegment};
54pub use rule_match::{ReplacementType, RuleMatch};
55pub use scanner::shared_pool::{SharedPool, SharedPoolGuard};
56
57pub use scanner::suppression::Suppressions;
58pub use scanner::{
59    CompiledRule, MatchEmitter, Precedence, RootCompiledRule, RootRuleConfig, RuleResult,
60    RuleStatus, ScanOptionBuilder, Scanner, ScannerBuilder, SharedData, StringMatch,
61    StringMatchesCtx,
62    config::RuleConfig,
63    error::{CreateScannerError, ScannerError},
64    regex_rule::config::{
65        ClaimRequirement, JwtClaimsValidatorConfig, ProximityKeywordsConfig, RegexRuleConfig,
66        SecondaryValidator,
67    },
68    regex_rule::{RegexCacheKey, RegexCacheValue, RegexCaches, SharedRegex, get_memoized_regex},
69    scope::Scope,
70};
71pub use scoped_ruleset::ExclusionCheck;
72pub use tokio::TOKIO_RUNTIME;
73pub use validation::{
74    RegexValidationError, get_regex_complexity_estimate_very_slow, validate_regex,
75};
76
77pub use scanner::debug_scan::debug_scan;
78
79#[cfg(any(feature = "testing", feature = "bench"))]
80pub use crate::{
81    scoped_ruleset::{ContentVisitor, RuleIndexVisitor, ScopedRuleSet},
82    secondary_validation::{LuhnChecksum, Validator},
83};