kubewarden / allow-privilege-escalation-psp-policy

A Kubewarden Pod Security Policy that controls usage of allowPrivilegeEscalation
https://kubewarden.io
Apache License 2.0
6 stars 7 forks source link

allowPrivilegeEscalation enabled behaviour #58

Open fooltruth opened 1 year ago

fooltruth commented 1 year ago

Is there an existing issue for this?

Current Behavior

When allowPrivilegeEscalation is enabled (set to true) on SecurityContext, the following error is encountered regardless of the value set for DefaultAllowPrivilegeEscalation (true or false).

one of the containers has privilege escalation enabled

Expected Behavior

If allowPrivilegeEscalation is set to true and DefaultAllowPrivilegeEscalation is set to true, should not presented with an error.

Steps To Reproduce

  1. Set DefaultAllowPrivilegeEscalation to true for allow-privilege-escalation-psp-policy
  2. Set the following on one of the containers:
    securityContext:
      allowPrivilegeEscalation: true

Environment

- OS: Linux

Anything else?

This block of code appears to disallow/reject a container with securityContext enabled. Even if `DefaultAllowPrivilegeEscalation is true. Should not the container allowed?