Skip to content

Commit

Permalink
feat(misconf): Show misconfig ID in output
Browse files Browse the repository at this point in the history
  • Loading branch information
simar7 committed Oct 18, 2024
1 parent 55b5a7e commit edf33d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/report/table/misconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ func (r *misconfigRenderer) renderSummary(misconf types.DetectedMisconfiguration
}
}

// ID
r.printf("%s\r\n", misconf.ID)

// severity
switch misconf.Severity {
case severityCritical:
Expand Down
9 changes: 7 additions & 2 deletions pkg/report/table/misconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ my-file ()
Tests: 1 (SUCCESSES: 0, FAILURES: 1, EXCEPTIONS: 0)
Failures: 1 (LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
AVD-XYZ-0123
HIGH: Oh no, a bad config.
════════════════════════════════════════
Your config file is not good.
Expand Down Expand Up @@ -103,6 +104,7 @@ my-file ()
Tests: 1 (SUCCESSES: 0, FAILURES: 1, EXCEPTIONS: 0)
Failures: 1 (LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
AVD-XYZ-0123
HIGH: Oh no, a bad config.
════════════════════════════════════════
Your config file is not good.
Expand Down Expand Up @@ -174,7 +176,8 @@ my-file ()
Tests: 2 (SUCCESSES: 1, FAILURES: 1, EXCEPTIONS: 0)
Failures: 1 (LOW: 0, MEDIUM: 0, HIGH: 1, CRITICAL: 0)
FAIL: HIGH: Oh no, a bad config.
FAIL: AVD-XYZ-0123
HIGH: Oh no, a bad config.
════════════════════════════════════════
Your config file is not good.
Expand All @@ -188,7 +191,8 @@ See https://google.com/search?q=bad%20config
────────────────────────────────────────
PASS: MEDIUM: Oh no, a bad config AGAIN.
PASS: AVD-XYZ-0456
MEDIUM: Oh no, a bad config AGAIN.
════════════════════════════════════════
Your config file is still not good.
Expand Down Expand Up @@ -312,6 +316,7 @@ terraform-aws-modules/security-group/aws/main.tf (terraform)
Tests: 6 (SUCCESSES: 5, FAILURES: 1, EXCEPTIONS: 0)
Failures: 1 (LOW: 0, MEDIUM: 0, HIGH: 0, CRITICAL: 1)
AVD-AWS-0107
CRITICAL: Security group rule allows ingress from public internet.
════════════════════════════════════════
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
Expand Down

0 comments on commit edf33d5

Please sign in to comment.