Skip to content

Commit

Permalink
fix: cover empty securityContext in container_deny_escalation (#449)
Browse files Browse the repository at this point in the history
Co-authored-by: Russell Brown <russell.brown@sony.com>
  • Loading branch information
rjbrown57 and Russell Brown authored Nov 2, 2023
1 parent 531afc8 commit a1ab112
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/container-deny-escalation/src.rego
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ container_allows_escalation(c) {
c.securityContext.allowPrivilegeEscalation == true
}

container_allows_escalation(c) {
core.missing_field(c, "securityContext")
}

container_allows_escalation(c) {
core.missing_field(c.securityContext, "allowPrivilegeEscalation")
}

0 comments on commit a1ab112

Please sign in to comment.