Credsweeper package

CredSweeper

class credsweeper.app.CredSweeper(rule_path=None, ml_validation=False, api_validation=False, json_filename=None, use_filters=True, pool_count=1, ml_batch_size=16, ml_threshold=None)[source]

Bases: object

Advanced credential analyzer base class.

Parameters
  • credential_manager – CredSweeper credential manager object

  • scanner – CredSweeper scanner object

  • pool_count (int) – number of pools used to run multiprocessing scanning

  • config – dictionary variable, stores analyzer features

  • json_filename (Optional[str]) – string variable, credential candidates export filename

property config: Dict
Return type

Dict

export_results()[source]

Save credential candidates to json file or print them to a console.

Return type

None

file_scan(file_provider)[source]

Run scanning of file from ‘file_provider’.

Parameters

file_provider (ContentProvider) – file provider object to scan

Return type

List[Candidate]

Returns

list of credential candidates from scanned file

pool_initializer()[source]

Ignore SIGINT in child processes.

Return type

None

post_processing()[source]

Machine learning validation for received credential candidates.

Return type

None

run(content_provider)[source]

Run an analysis of ‘content_provider’ object.

Parameters

content_provider (List[ContentProvider]) – path objects to scan

Return type

None

scan(file_providers)[source]

Run scanning of files from an argument “file_providers”.

Parameters

file_providers (List[ContentProvider]) – file objects to scan

Return type

None