Skip to content

Commit

Permalink
feat: opa exception support
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <[email protected]>
  • Loading branch information
chen-keinan committed Feb 8, 2024
1 parent 68dcb68 commit 59d3ce7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/configauditreport/controller/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,20 @@ func evaluate(ctx context.Context, policies *policy.Policies, resource client.Ob
if cd.ReportRecordFailedChecksOnly() && result.Status() == scan.StatusPassed {
continue
}
currentCheck := getCheck(result, id)
if len(currentCheck.Messages) == 0 || (len(currentCheck.Messages) == 1 && len(strings.TrimSpace(currentCheck.Messages[0])) == 0) {
continue
}
if infraCheck(id) {
if strings.HasPrefix(id, "N/A") {
continue
}
if k8sCoreComponent(resource) {
infraChecks = append(infraChecks, getCheck(result, id))
infraChecks = append(infraChecks, currentCheck)
}
continue
}
checks = append(checks, getCheck(result, id))
checks = append(checks, currentCheck)
}
kind := resource.GetObjectKind().GroupVersionKind().Kind
if kube.IsRoleTypes(kube.Kind(kind)) && !c.MergeRbacFindingWithConfigAudit {
Expand Down

0 comments on commit 59d3ce7

Please sign in to comment.