Skip to content

Commit

Permalink
fix(validator): fix regression in PSS202
Browse files Browse the repository at this point in the history
  • Loading branch information
WitoDelnat committed Oct 2, 2023
1 parent acd9b27 commit 5d3a3ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-files-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@monokle/validation": patch
---

fix regression in PSS202
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const privilegeEscalation = defineRule({
validatePodSpec(resources, (resource, pod, prefix) => {
pod.initContainers?.forEach((container, index) => {
const allowPrivilegeEscalation = container.securityContext?.allowPrivilegeEscalation;
const valid = !allowPrivilegeEscalation;
const valid = allowPrivilegeEscalation !== undefined && !allowPrivilegeEscalation;

if (valid) return;

Expand All @@ -28,7 +28,7 @@ export const privilegeEscalation = defineRule({

pod.ephemeralContainers?.forEach((container, index) => {
const allowPrivilegeEscalation = container.securityContext?.allowPrivilegeEscalation;
const valid = !allowPrivilegeEscalation;
const valid = allowPrivilegeEscalation !== undefined && !allowPrivilegeEscalation;
if (valid) return;

report(resource, {
Expand All @@ -38,7 +38,7 @@ export const privilegeEscalation = defineRule({

pod.containers.forEach((container, index) => {
const allowPrivilegeEscalation = container.securityContext?.allowPrivilegeEscalation;
const valid = !allowPrivilegeEscalation;
const valid = allowPrivilegeEscalation !== undefined && !allowPrivilegeEscalation;
if (valid) return;

report(resource, {
Expand Down

0 comments on commit 5d3a3ba

Please sign in to comment.