rules package¶
Submodules¶
rules.rule module¶
- class credsweeper.rules.rule.Rule(config, rule_template)[source]¶
Bases:
object
Regular expression to detect some credential type.
- Class contains regular expression to detect some credential type, credential name, assumed severity
and details on how detection should be processed
- Parameters:
rule_name – Name displayed if rule
rule_type – RuleType used for this rule
severity – critical/high/medium/low
filters – List of Filter objects that can be used to filters False detections based on rules
patterns – Regular expressions that can be used for detection
pattern_type – single_pattern/multi_pattern/pem_key_pattern. single_pattern for simple single line credentials multi_pattern for credentials span for rew lines. pem_key_pattern for PEM like credentials
use_ml – Should ML work on this credential or not. If not prediction based on regular expression and filter only
validations – List of Validation objects that can check this credential using external API
required_substrings – Optional list of substrings. Scanner would only apply this rule if line contain at least one of this substrings
min_line_len – Optional minimal line length. Scanner would only apply this rule if line is equal or longer
- MULTI_PATTERN = 'multi_pattern'¶
- PEM_KEY_PATTERN = 'pem_key_pattern'¶
- SINGLE_PATTERN = 'single_pattern'¶
- property validations: List[Validation]¶
validations getter
- Return type: