diff --git a/.secureli.yaml b/.secureli.yaml index 542f0dc6..84f85a5e 100644 --- a/.secureli.yaml +++ b/.secureli.yaml @@ -9,5 +9,8 @@ repo_files: - .png - .jpg max_file_size: 1000000 +scan_patterns: + custom_scan_patterns: + - foo telemetry: api_url: https://log-api.newrelic.com/log/v1 diff --git a/secureli/modules/custom_scanners/custom_regex_scanner/custom_regex_scanner.py b/secureli/modules/custom_scanners/custom_regex_scanner/custom_regex_scanner.py index 87d30d14..5dce1eb9 100644 --- a/secureli/modules/custom_scanners/custom_regex_scanner/custom_regex_scanner.py +++ b/secureli/modules/custom_scanners/custom_regex_scanner/custom_regex_scanner.py @@ -9,6 +9,7 @@ from pathlib import Path import pydantic +from secureli.modules.shared.models.exit_codes import ExitCode import secureli.modules.shared.models.scan as scan from secureli.modules.shared.abstractions.echo import EchoAbstraction from secureli.modules.shared.abstractions.version_control_repo import ( @@ -140,7 +141,10 @@ def _generate_scan_failures( for file in custom_regex_found_files: failures.append( scan.ScanFailure( - id="custom_regex_scan", file=file, repo=SECURELI_GITHUB + id="custom_regex_scan", + file=file, + repo=SECURELI_GITHUB, + exitCode=ExitCode.CUSTOM_REGEX_SCAN_ISSUES_DETECTED.name, ) ) return failures diff --git a/secureli/modules/custom_scanners/pii_scanner/pii_scanner.py b/secureli/modules/custom_scanners/pii_scanner/pii_scanner.py index 51d556ab..130a11d1 100644 --- a/secureli/modules/custom_scanners/pii_scanner/pii_scanner.py +++ b/secureli/modules/custom_scanners/pii_scanner/pii_scanner.py @@ -12,6 +12,7 @@ from pathlib import Path import pydantic +from secureli.modules.shared.models.exit_codes import ExitCode import secureli.modules.shared.models.scan as scan from secureli.modules.shared.abstractions.echo import EchoAbstraction from secureli.modules.shared.abstractions.version_control_repo import ( @@ -154,7 +155,7 @@ def _generate_scan_failures( id="pii_scan", file=pii_found_file, repo=SECURELI_GITHUB, - exitCode="PII_SCAN_ISSUES_DETECTED", + exitCode=ExitCode.PII_SCAN_ISSUES_DETECTED.name, ) ) return failures diff --git a/secureli/modules/shared/models/exit_codes.py b/secureli/modules/shared/models/exit_codes.py index 01015f5f..9408fc25 100644 --- a/secureli/modules/shared/models/exit_codes.py +++ b/secureli/modules/shared/models/exit_codes.py @@ -10,3 +10,4 @@ class ExitCode(Enum): CONFIG_ERROR = 8 DICT_ERROR = 9 MISSING_ERROR = 10 + CUSTOM_REGEX_SCAN_ISSUES_DETECTED = 11