enhancements icon indicating copy to clipboard operation
enhancements copied to clipboard

KEP-24: Promote Apparmor to GA

Open mccormickt opened this issue 3 years ago • 19 comments
trafficstars

KEP-24: Promote Apparmor to GA

New updated KEP outlining requirement for Apparmor to move to GA.

  • Issue link: #24

Supersedes #1444

mccormickt avatar May 07 '22 13:05 mccormickt

Welcome @jan0ski!

It looks like this is your first PR to kubernetes/enhancements 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/enhancements has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar May 07 '22 13:05 k8s-ci-robot

Hi @jan0ski. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar May 07 '22 13:05 k8s-ci-robot

/assign @tallclair

dchen1107 avatar Jun 21 '22 17:06 dchen1107

Before we graduate this, can we check whether https://kubernetes.io/docs/tutorials/security/apparmor/ is current? That page talks a lot about requiring Kubernetes v1.4 or later, so my guess is that it does need an update.

sftim avatar Jul 17 '22 11:07 sftim

Tim agreed to review and approve this for 1.26. Thanks!

dchen1107 avatar Jul 28 '22 21:07 dchen1107

Before we graduate this, can we check whether https://kubernetes.io/docs/tutorials/security/apparmor/ is current? That page talks a lot about requiring Kubernetes v1.4 or later, so my guess is that it does need an update.

I would concur we need to revamp the website documentation. We could remove the references to PodSecurityPolicy regarding AppArmor and recommend something OPA/Admission Controller based for controlling what profiles can/can't be used.

pjbgf avatar Jul 29 '22 07:07 pjbgf

We may want to mention on this KEP what we want to do about the PodSecurityPolicy enforcements around AppArmor. We can: 1) do nothing 2) extend enforcements to the proposed new fields.

I am of the opinion we should do nothing, given that PodSecurityPolicy is sunsetting and there is little point changing anything on its functionality. Either way, it feels reasonable to call this out in the KEP. Similarly to what we did on the Seccomp route to GA, however for that we took a different path.

pjbgf avatar Jul 29 '22 07:07 pjbgf

From v1.25 onwards, there is no PodSecurityPolicy API.

sftim avatar Jul 29 '22 10:07 sftim

From v1.25 onwards, there is no PodSecurityPolicy API.

@sftim There is a residual PSP code currently in main that overlaps with AppArmor. The code provides the ability of defining the default AppArmor profile across the cluster, and also to set what AppArmor profiles are allowed. They are defined via annotations "apparmor.security.beta.kubernetes.io/defaultProfileName" and "apparmor.security.beta.kubernetes.io/allowedProfileNames":

https://github.com/kubernetes/kubernetes/blob/2c1c1b75465e93ecc49d0cd59efdfa1b0bdb3bbc/staging/src/k8s.io/api/core/v1/annotation_key_constants.go#L59-L62 https://github.com/kubernetes/kubernetes/blob/3ffdfbe286ebcea5d75617da6accaf67f815e0cf/pkg/apis/policy/validation/validation.go#L143

I think this KEP should at least mention it and clarify what happens with that functionality.

pjbgf avatar Aug 14 '22 10:08 pjbgf

/ok-to-test

tallclair avatar Aug 30 '22 18:08 tallclair

We may want to mention on this KEP what we want to do about the PodSecurityPolicy enforcements around AppArmor. We can: 1) do nothing 2) extend enforcements to the proposed new fields.

I am of the opinion we should do nothing, given that PodSecurityPolicy is sunsetting and there is little point changing anything on its functionality. Either way, it feels reasonable to call this out in the KEP. Similarly to what we did on the Seccomp route to GA, however for that we took a different path.

Good call out. I've added a mention to this in ac8121e

mccormickt avatar Sep 28 '22 12:09 mccormickt

@tallclair: GitHub didn't allow me to request PR reviews from the following users: discussion, for, Pod.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Something that we should discuss for the transition to GA:

The baseline and restricted pod security levels (https://kubernetes.io/docs/concepts/security/pod-security-standards/#baseline) currently allow all Localhost profiles. In the case of seccomp, this works as intended, since localhost profiles are installed to a specially designated directory. However in the case of apparmor, any profile loaded on the node is fair game, including profiles for system daemons outside of Kubernetes.

Is this working as intended? Our stance has previously been that if you need finer grained control over localhost profiles, you should use another admission control. If not, do we want to address it in the transition to GA? One way we could address it is by requiring a designated prefix for Kubernetes profiles, but such a large change seems out of scope as defined by your goals. WDYT?

/cc @liggitt for Pod Security discussion

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Sep 29 '22 00:09 k8s-ci-robot

I think the remaining issues are things that can be hashed out in the implementation / API reivew, so I'm comfortable approving this KEP. However, we're past enhancements freeze so this will need an extension if you still want to get it into 1.26. IMO this is a low-risk change, so I don't see any issues with including it.

/lgtm /approve

Thanks! I've submitted an enhancements freeze exception for this KEP to be included in 1.26. :crossed_fingers:

mccormickt avatar Oct 09 '22 16:10 mccormickt

Hi, Thanks for raising the exception request. The exception request has been approved by the 1.26 release team and your updated deadline to make any changes to your KEP is 18:00 PST Tuesday 18 October 2022. /milestone v1.26

leonardpahlke avatar Oct 11 '22 06:10 leonardpahlke

Working on some documentation updates in https://github.com/kubernetes/website/pull/37191 - does this block us from approving the KEP?

If so I think that and a PRR approval are all we need? cc @deads2k @tallclair

mccormickt avatar Oct 13 '22 20:10 mccormickt

The references for PRR look ok to me

/approve

deads2k avatar Oct 18 '22 21:10 deads2k

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deads2k, jan0ski, tallclair Once this PR has been reviewed and has the lgtm label, please assign derekwaynecarr for approval by writing /assign @derekwaynecarr in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Oct 18 '22 21:10 k8s-ci-robot

/assign @derekwaynecarr

mccormickt avatar Oct 18 '22 21:10 mccormickt

/lgtm

This looks good to me. There might be a few more implementation details to iron out, but we can handle those in PR reviews.

Just a heads up: code freeze is coming up in 3 weeks (Nov 8th), so we'll need to move quickly on this.

tallclair avatar Oct 18 '22 22:10 tallclair

/label lead-opted-in /milestone v1.27

dchen1107 avatar Jan 31 '23 19:01 dchen1107

@dchen1107: Can not set label lead-opted-in: Must be member in one of these teams: [release-team-enhancements release-team-leads sig-api-machinery-leads sig-apps-leads sig-architecture-leads sig-auth-leads sig-autoscaling-leads sig-cli-leads sig-cloud-provider-leads sig-cluster-lifecycle-leads sig-contributor-experience-leads sig-docs-leads sig-instrumentation-leads sig-k8s-infra-leads sig-multicluster-leads sig-network-leads sig-node-leads sig-release-leads sig-scalability-leads sig-scheduling-leads sig-security-leads sig-storage-leads sig-testing-leads sig-windows-leads]

In response to this:

/label lead-opted-in /milestone v1.27

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jan 31 '23 19:01 k8s-ci-robot

New changes are detected. LGTM label has been removed.

k8s-ci-robot avatar Jan 31 '23 19:01 k8s-ci-robot

Looks like there are still some PRR questions open. It would be good to get the API changes in for this though. I wonder if we should decouple the API changes from graduation to GA? In other words, implement the fields for v1.27, and punt GA to v1.28?

If you have time to address the open debuggability concerns that works too.

tallclair avatar Feb 02 '23 00:02 tallclair

Please update the Test Plan section in README.md to include updates from the current KEP template

marosset avatar Feb 03 '23 19:02 marosset

Looks like there are still some PRR questions open. ... If you have time to address the open debuggability concerns that works too.

@tallclair can you point these concerns out for me? I might be missing context, and had assumed PRR questions were addressed already. Happy to try and answer whatever I can.

mccormickt avatar Feb 03 '23 21:02 mccormickt

Back in october the PRR was approved https://github.com/kubernetes/enhancements/pull/3298#issuecomment-1283041979

There was a new question added to scalability: https://github.com/kubernetes/enhancements/blob/master/keps/NNNN-kep-template/README.md#scalability , but that should be easy to update.

deads2k avatar Feb 08 '23 16:02 deads2k

All the feedback left on this KEP can be addressed by adding action items into the Graduation Criteria for GA. There is no absolutely blocking comments, mostly work items

SergeyKanzhelev avatar Feb 08 '23 23:02 SergeyKanzhelev

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deads2k, jan0ski, tallclair Once this PR has been reviewed and has the lgtm label, please ask for approval from derekwaynecarr. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Feb 10 '23 01:02 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 24 '23 20:05 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jun 23 '23 21:06 k8s-triage-robot

/remove-lifecycle rotten

pjbgf avatar Jul 04 '23 09:07 pjbgf