credsweeper.scanner package¶
Subpackages¶
Submodules¶
credsweeper.scanner.scanner module¶
- class credsweeper.scanner.scanner.Scanner(config, rule_path)[source]¶
Bases:
object
Advanced Credential Scanner base class.
- Parameters:
rules – list of rule objects to check
min_pattern_len – minimal length specified in all pattern rules
min_keyword_len – minimal possible length for a string to be matched by any keyword rule
min_len – Smallest between min_pattern_len and min_keyword_len
TargetGroup – Type for List[Tuple[AnalysisTarget, str, int]]
- TargetGroup¶
alias of
List
[Tuple
[AnalysisTarget
,str
,int
]]
- keywords_required_substrings_check(text)[source]¶
check whether text has any required substring for all keyword type rules
- Return type:
- scan(provider)[source]¶
Run scanning of list of target lines from ‘targets’ with set of rule from ‘self.rules’.
- Parameters:
provider (
ContentProvider
) – objects with data to analyze: line, line number, filepath and all lines in file- Return type:
- Returns:
list of all detected credential candidates in analyzed targets