mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 12:31:54 +00:00
chore(categories): Add threat detection checks in the loader (#3622)
This commit is contained in:
+1
-10
@@ -6,10 +6,7 @@ from os import environ
|
||||
|
||||
from colorama import Fore, Style
|
||||
|
||||
from prowler.config.config import (
|
||||
get_available_compliance_frameworks,
|
||||
threat_detection_checks,
|
||||
)
|
||||
from prowler.config.config import get_available_compliance_frameworks
|
||||
from prowler.lib.banner import print_banner
|
||||
from prowler.lib.check.check import (
|
||||
bulk_load_checks_metadata,
|
||||
@@ -173,12 +170,6 @@ def prowler():
|
||||
if checks_from_resources:
|
||||
checks_to_execute = checks_to_execute.intersection(checks_from_resources)
|
||||
|
||||
# Only execute threat detection checks if threat-detection category is set
|
||||
if "threat-detection" not in categories:
|
||||
checks_to_execute = [
|
||||
check for check in checks_to_execute if check not in threat_detection_checks
|
||||
]
|
||||
|
||||
# Sort final check list
|
||||
checks_to_execute = sorted(checks_to_execute)
|
||||
|
||||
|
||||
@@ -27,12 +27,6 @@ valid_severities = ["critical", "high", "medium", "low", "informational"]
|
||||
# Compliance
|
||||
actual_directory = pathlib.Path(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
# AWS CloudTrail Threat Detection checks
|
||||
threat_detection_checks = [
|
||||
"cloudtrail_threat_detection_privilege_escalation",
|
||||
"cloudtrail_threat_detection_enumeration",
|
||||
]
|
||||
|
||||
|
||||
def get_available_compliance_frameworks(provider=None):
|
||||
available_compliance_frameworks = []
|
||||
|
||||
@@ -99,6 +99,11 @@ def load_checks_to_execute(
|
||||
check_name = check_info[0]
|
||||
checks_to_execute.add(check_name)
|
||||
|
||||
# Only execute threat detection checks if threat-detection category is set
|
||||
if "threat-detection" not in categories:
|
||||
for threat_detection_check in check_categories["threat-detection"]:
|
||||
checks_to_execute.discard(threat_detection_check)
|
||||
|
||||
# Check Aliases
|
||||
checks_to_execute = update_checks_to_execute_with_aliases(
|
||||
checks_to_execute, check_aliases
|
||||
|
||||
Reference in New Issue
Block a user