Skip to content

Commit

Permalink
improve checks logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sergargar committed Mar 26, 2024
1 parent 888cbd5 commit bacd9c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def execute(self):
report.resource_arn = trail.arn
report.resource_tags = trail.tags
report.status = "FAIL"
report.status_extended = f"Potential privilege escalation detected from source IP {source_ip} with an entropy of {ENTROPY_THRESHOLD}."
report.status_extended = f"Potential enumeration attack detected from source IP {source_ip} with an entropy of {ENTROPY_THRESHOLD}."
findings.append(report)
if not found_potential_enumeration:
report = Check_Report_AWS(self.metadata())
Expand All @@ -149,6 +149,6 @@ def execute(self):
report.resource_arn = trail.arn
report.resource_tags = trail.tags
report.status = "PASS"
report.status_extended = "No potential privilege escalation detected."
report.status_extended = "No potential enumeration attack detected."
findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def execute(self):
for trail in cloudtrail_client.trails.values():
if trail.is_multiregion:
multiregion_trail = trail
break
trails_to_scan = (
cloudtrail_client.trails.values()
if not multiregion_trail
Expand Down Expand Up @@ -105,7 +106,7 @@ def execute(self):
report.resource_arn = trail.arn
report.resource_tags = trail.tags
report.status = "FAIL"
report.status_extended = f"Potential privilege escalation detected from source IP {source_ip} with an entropy of {ENTROPY_THRESHOLD}."
report.status_extended = f"Potential privilege escalation attack detected from source IP {source_ip} with an entropy of {ENTROPY_THRESHOLD}."
findings.append(report)
if not found_potential_privilege_escalation:
report = Check_Report_AWS(self.metadata())
Expand All @@ -114,6 +115,8 @@ def execute(self):
report.resource_arn = trail.arn
report.resource_tags = trail.tags
report.status = "PASS"
report.status_extended = "No potential privilege escalation detected."
report.status_extended = (
"No potential privilege escalation attack detected."
)
findings.append(report)
return findings

0 comments on commit bacd9c9

Please sign in to comment.