credsweeper.common package
Submodules
credsweeper.common.constants module
- class credsweeper.common.constants.Base(value)[source]
Bases:
EnumStores types of character sets in lower case
- ascii_lowercase = 'ascii_lowercase'
- ascii_uppercase = 'ascii_uppercase'
- base16lower = 'base16lower'
- base16upper = 'base16upper'
- base32 = 'base32'
- base36 = 'base36'
- base64 = 'base64'
- base64std = 'base64std'
- base64url = 'base64url'
- digits = 'digits'
- hex = 'hex'
- class credsweeper.common.constants.Chars(value)[source]
Bases:
EnumStores three types characters sets.
- BASE16LOWER = '0123456789abcdef'
- BASE16UPPER = '0123456789ABCDEF'
- BASE32_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
- BASE36_CHARS = 'abcdefghijklmnopqrstuvwxyz1234567890'
- BASE64STD_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
- BASE64URL_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'
- BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
- HEX_CHARS = '0123456789ABCDEFabcdef'
- class credsweeper.common.constants.Confidence(value)[source]
Bases:
EnumConfidence of candidate
- MODERATE = 'moderate'
- STRONG = 'strong'
- WEAK = 'weak'
- static get(confidence: str | Confidence) Confidence | None[source]
returns Confidence value from string or None
- class credsweeper.common.constants.DiffRowType(value)[source]
Bases:
EnumDiff type of row
- ADDED = 'added'
- DELETED = 'deleted'
- class credsweeper.common.constants.GroupType(value)[source]
Bases:
EnumGroup type - used in Group constructor for load predefined set of filters
- DEFAULT = 'default'
- KEYWORD = 'keyword'
- PATTERN = 'pattern'
- class credsweeper.common.constants.KeyValidationOption(value)[source]
Bases:
EnumAPI validation state
- INVALID_KEY = 0
- NOT_AVAILABLE = 3
- UNDECIDED = 2
- VALIDATED_KEY = 1
- credsweeper.common.constants.ML_HUNK = 80
//docs.python.org/3/library/codecs.html
- Type:
values according https
- class credsweeper.common.constants.RuleType(value)[source]
Bases:
EnumRule type
- KEYWORD = 'keyword'
- MULTI = 'multi'
- PATTERN = 'pattern'
- PEM_KEY = 'pem_key'
- class credsweeper.common.constants.Severity(value)[source]
Bases:
EnumSeverity of candidate
- CRITICAL = 'critical'
- HIGH = 'high'
- INFO = 'info'
- LOW = 'low'
- MEDIUM = 'medium'
credsweeper.common.keyword_checklist module
- class credsweeper.common.keyword_checklist.KeywordChecklist[source]
Bases:
objectKeywordsChecklist contains words 3 or more letters length
- KEYWORD_PATH = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/credsweeper/checkouts/v1.9.5/credsweeper/common/keyword_checklist.txt')
- MORPHEME_PATH = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/credsweeper/checkouts/v1.9.5/credsweeper/common/morpheme_checklist.txt')
credsweeper.common.keyword_pattern module
- class credsweeper.common.keyword_pattern.KeywordPattern[source]
Bases:
objectPattern set of keyword types
- auth_keywords = '( ?(oauth|bot|basic|bearer|apikey|accesskey) )?'
- key_left = '(\\\\[nrt])?(?P<variable>(([`\'\\"]+[^:=\'\\"`}<>\\\\/&?]*|[^:=\'\\"`}<>\\s()\\\\/&?;,]*)(?P<keyword>'
- key_right = ')[^:=\'\\"`<>{?!&]*)[`\'\\"]*)'
- left_quote = '(?P<value_leftquote>((?P<esq>\\\\{1,8})?[`\'\\"]){1,4}))?'
- right_quote = '(?(value_leftquote)(?P<value_rightquote>(?<!\\\\)(?P=value_leftquote)|\\\\$|(?<=[0-9a-z+_/-])$)|(?(wrap)[\\]\\)\\},;]))'
- separator = '(\\s|\\\\+[tnr])*\\]?(\\s|\\\\+[tnr])*(?P<separator>:( [a-z]{3,9}[?]? )?=|:|=(>|>|\\\\u0026gt;)|!=|===|==|=)(\\s|\\\\+[tnr])*'
- string_prefix = '(((b|r|br|rb|u|f|rf|fr|l|@)(?=(\\\\*[`\'\\"])))?'
- value = '(?P<value>(?(value_leftquote)((?!(?P=value_leftquote))(?(esq)((?!(?P=esq)[\'`\\"]).)|((?!(?P=value_leftquote)).)))|(\\\\+([ tnr]|[^\\s`\'\\"])|[^\\s`\'\\",;\\\\])){3,8000}|(\\{[^}]{3,8000}\\})|(<[^>]{3,8000}>))'
- wrap = '(?P<wrap>((new(\\s|\\\\+[tnr])+)?([0-9a-z_.]|-(>|(&|\\\\\\\\*u0026)gt;))*[\\[\\(\\{](\\s|\\\\+[tnr])*([0-9a-z_]{1,32}=)?)+)?'