Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PodSecurity: Add runAsUser check to restricted policy #105857

Merged
merged 4 commits into from Oct 26, 2021

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Oct 23, 2021

What type of PR is this?

/kind feature

Which issue(s) this PR fixes:

Fixes #105186

  1. Add a runAsUser restricted check that forbids setting runAsUser=0 in 1.23+ (previously this would have resulted in a runtime error, now it results in an admission error)
  2. Update the test version from 1.22 to 1.23
  3. Generate fixtures for 1.23
PodSecurity: in 1.23+ restricted policy levels, pods and containers which set runAsUser=0 are forbidden at admission-time; previously, they would be rejected at runtime

/assign @tallclair
/sig auth

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. sig/auth Categorizes an issue or PR as relevant to SIG Auth. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 23, 2021
@k8s-ci-robot
Copy link
Contributor

@liggitt: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 23, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt

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

The pull request process is described 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 23, 2021
@liggitt liggitt changed the title Run as non root run as user Make runAsNonRoot pod-security check runAsUser-aware Oct 23, 2021
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 23, 2021
@liggitt
Copy link
Member Author

liggitt commented Oct 23, 2021

/hold

version-aware alternatives:

  • limit all new runAsUser logic to 1.23+
  • tolerate runAsUser!=0 in older versions, and only forbid runAsUser=0 in 1.23+

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 23, 2021
@liggitt liggitt added this to the v1.23 milestone Oct 23, 2021
@liggitt liggitt added this to In Review in SIG-Auth: PodSecurity via automation Oct 23, 2021
@liggitt
Copy link
Member Author

liggitt commented Oct 23, 2021

/retest

@enj enj added this to Needs Triage in SIG Auth Old Oct 25, 2021
@enj enj moved this from Needs Triage to In Progress in SIG Auth Old Oct 25, 2021
@liggitt
Copy link
Member Author

liggitt commented Oct 25, 2021

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 25, 2021
@liggitt
Copy link
Member Author

liggitt commented Oct 25, 2021

docs in kubernetes/website#30225

@liggitt liggitt mentioned this pull request Oct 25, 2021
@liggitt liggitt force-pushed the runAsNonRoot-runAsUser branch 2 times, most recently from 6b1fd50 to 75cd113 Compare October 25, 2021 20:03
@liggitt liggitt changed the title Make runAsNonRoot pod-security check runAsUser-aware PodSecurity: Add runAsUser check to restricted policy Oct 25, 2021
Copy link
Member

@tallclair tallclair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 25, 2021
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

1 similar comment
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit dba9975 into kubernetes:master Oct 26, 2021
SIG Auth Old automation moved this from In Progress to Closed / Done Oct 26, 2021
SIG-Auth: PodSecurity automation moved this from In Review to Done (1.23, Beta) Oct 26, 2021
@liggitt liggitt deleted the runAsNonRoot-runAsUser branch October 26, 2021 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/auth Categorizes an issue or PR as relevant to SIG Auth. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Archived in project
SIG-Auth: PodSecurity
Done (1.23, Beta)
SIG Auth Old
Closed / Done
Development

Successfully merging this pull request may close these issues.

PodSecurity: do not require runAsNonRoot: true if a non-zero runAsUser value is provided
4 participants