pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

PodSecurityPolicy deprecated in Kubernetes 1.21

Open pietervincken opened this issue 3 years ago • 18 comments

Expected Behavior

The released deployment manifest doesn't have deprecated resources listed in it.

Actual Behavior

PodSecurityPolicy tekton-pipelines is listed in the deployment manifest which is a deprecated resource as of 1.21.

Steps to Reproduce the Problem

  1. Download the latest release yaml (tested with 0.26.0)

Additional Info

  • Kubernetes version: 1.21

    Output of kubectl version: N/A

  • Tekton Pipeline version:

0.26.0

pietervincken avatar Jul 22 '21 08:07 pietervincken

@pietervincken thanks for the issue. Indeed, I think we should just remove this from the config folder (and thus from the released yamls).

/cc @tektoncd/core-maintainers

vdemeester avatar Jul 22 '21 11:07 vdemeester

Some background reading: https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/

dibyom avatar Jul 27 '21 16:07 dibyom

@vdemeester I will move this to the next milestone. Let me know if there is any concern.

afrittoli avatar Oct 18 '21 17:10 afrittoli

Looks like the replacement feature in Kubernetes will be called "PodSecurity Admission". Released as alpha in 1.22

ghost avatar Nov 30 '21 18:11 ghost

/priority important-soon

lbernick avatar Dec 13 '21 20:12 lbernick

Discussed during the Pipeline WG:

  • we shall had support for the new mechanism but keep PSP in parallel
  • both methods can stay together until Pod Security Admission is stable

afrittoli avatar Feb 08 '22 17:02 afrittoli

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar May 09 '22 18:05 tekton-robot

/remove-lifecycle stale still relevant IMHO k8s 1.25 is getting closer ;)

msglueck avatar May 19 '22 14:05 msglueck

If PodSecurityPolicy are removed in 1.25, then we need to either remove it for 0.36 or 0.37 (any release that would be in the 1.25 timeframe more or less) or be able to generate release with and without it. I can re-open https://github.com/tektoncd/pipeline/pull/4122 if need be.

vdemeester avatar May 30 '22 15:05 vdemeester

I think we need to do this soon - we could point users to https://appvia.github.io/psp-migration/ to migrate to an alternate policy engine. We could also see if we can enable https://kubernetes.io/docs/concepts/security/pod-security-admission/

dibyom avatar Jun 28 '22 19:06 dibyom

Resurrecting this again - looks like PodSecurityPolicy has been removed in k8s 1.25, so we need to push this. I'm putting this in the v0.39 milestone, but am going to assume it'll end up slipping to v0.40 just due to time.

abayer avatar Aug 10 '22 15:08 abayer

/priority critical-urgent

Actually, I just put it in v0.40, but am also bumping the priority.

abayer avatar Aug 10 '22 15:08 abayer

@jerop to find someone who can help with this!

pritidesai avatar Aug 23 '22 16:08 pritidesai

The replacement is beta which is reasonable to replace with

pritidesai avatar Aug 23 '22 16:08 pritidesai

/assign

JeromeJu avatar Aug 24 '22 13:08 JeromeJu

Drafted the doc WIP for PSP migration.

According to the references in the doc, here are the aspects according to current PSP that PSA might not cover:

  • The seLinux config requires the privileged level in PSA, which might be different from our privileged setting in PSP.
  • The supplementalGroups/ fsGroup rules are set as a range with mustRunAs rule in PSP but not specified in PSA.

JeromeJu avatar Aug 30 '22 20:08 JeromeJu

I think we should go for the 1st option in the doc of using PSA with OPA as complement for some of the specifications eg. seLinux supplementalGroup fsGroup as the other two options would both introduce more dependencies that we don’t want.

Would appreciate it if people could take a look at this doc and help with some opinions!

JeromeJu avatar Sep 08 '22 16:09 JeromeJu

From Pipelines WG:

  1. Remove PSP
  2. Add a PSA to do as much as the existing PSP can
  3. Document how to achieve the same behavior with an alternative (OPA or another policy)

dibyom avatar Sep 20 '22 16:09 dibyom