credsweeper.ml_model package¶
Subpackages¶
- credsweeper.ml_model.features package
- Submodules
- credsweeper.ml_model.features.char_set module
- credsweeper.ml_model.features.feature module
- credsweeper.ml_model.features.file_extension module
- credsweeper.ml_model.features.hartley_entropy module
- credsweeper.ml_model.features.has_html_tag module
- credsweeper.ml_model.features.is_secret_numeric module
- credsweeper.ml_model.features.search_in_attribute module
- credsweeper.ml_model.features.reny_entropy module
- credsweeper.ml_model.features.rule_name module
- credsweeper.ml_model.features.shannon_entropy module
- credsweeper.ml_model.features.word_in module
- credsweeper.ml_model.features.word_in_line module
- credsweeper.ml_model.features.word_in_path module
- credsweeper.ml_model.features.word_in_value module
- credsweeper.ml_model.features.word_in_variable module
- Module contents
Submodules¶
credsweeper.ml_model.ml_validator module¶
- class credsweeper.ml_model.ml_validator.MlValidator(threshold, ml_config=None, ml_model=None, ml_providers=None)[source]¶
Bases:
objectML validation class
- CHAR_INDEX = {'\x00': 0, '\t': 96, '\n': 97, '\x0b': 99, '\x0c': 100, '\r': 98, ' ': 95, '!': 63, '"': 64, '#': 65, '$': 66, '%': 67, '&': 68, "'": 69, '(': 70, ')': 71, '*': 72, '+': 73, ',': 74, '-': 75, '.': 76, '/': 77, '0': 1, '1': 2, '2': 3, '3': 4, '4': 5, '5': 6, '6': 7, '7': 8, '8': 9, '9': 10, ':': 78, ';': 79, '<': 80, '=': 81, '>': 82, '?': 83, '@': 84, 'A': 37, 'B': 38, 'C': 39, 'D': 40, 'E': 41, 'F': 42, 'G': 43, 'H': 44, 'I': 45, 'J': 46, 'K': 47, 'L': 48, 'M': 49, 'N': 50, 'O': 51, 'P': 52, 'Q': 53, 'R': 54, 'S': 55, 'T': 56, 'U': 57, 'V': 58, 'W': 59, 'X': 60, 'Y': 61, 'Z': 62, '[': 85, '\\': 86, ']': 87, '^': 88, '_': 89, '`': 90, 'a': 11, 'b': 12, 'c': 13, 'd': 14, 'e': 15, 'f': 16, 'g': 17, 'h': 18, 'i': 19, 'j': 20, 'k': 21, 'l': 22, 'm': 23, 'n': 24, 'o': 25, 'p': 26, 'q': 27, 'r': 28, 's': 29, 't': 30, 'u': 31, 'v': 32, 'w': 33, 'x': 34, 'y': 35, 'z': 36, '{': 91, '|': 92, '}': 93, '~': 94, 'ÿ': 101}¶
- MAX_LEN = 160¶
- NON_ASCII = 'ÿ'¶
- NUM_CLASSES = 102¶
- extract_common_features(candidates)[source]¶
Extract features that are guaranteed to be the same for all candidates on the same line with same value.
- Return type:
- extract_features(candidates)[source]¶
extracts common and unique features from list of candidates
- Return type:
- extract_unique_features(candidates)[source]¶
Extract features that can be different between candidates. Join them with or operator.
- Return type:
- get_group_features(candidates)[source]¶
np.newaxis used to add new dimension if front, so input will be treated as a batch