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

AUTH-133: manifests/deployment: comply to restricted pod security level #616

Merged
merged 1 commit into from
May 9, 2022

Conversation

s-urbaniak
Copy link
Contributor

Starting from OpenShift 4.11 pod security admission is being activated. In OpenShift the default pod security admission level is going to be restricted. This PR fixes workloads from this repository. Concretely, the following violations have been detected:

{
  "objectRef": "openshift-insights/deployments/insights-operator",
  "pod-security.kubernetes.io/audit-violations": "would violate PodSecurity \"restricted:latest\": allowPrivilegeEscalation != false (container \"insights-operator\" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabili
ties (container \"insights-operator\" must set securityContext.capabilities.drop=[\"ALL\"]), runAsNonRoot != true (pod or container \"insights-operator\" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container \"insights-op
erator\" must set securityContext.seccompProfile.type to \"RuntimeDefault\" or \"Localhost\")"
}

/cc @stlaz

@openshift-ci openshift-ci bot requested a review from stlaz April 29, 2022 14:25
@tremes
Copy link
Contributor

tremes commented May 2, 2022

Hi @s-urbaniak thanks for the PR. Can you please elaborate about the violation? I am not sure I fully understand. What is runAsUser: 65534 (looks like magic number to me :)) please?

@s-urbaniak
Copy link
Contributor Author

With Kubernetes 1.24 and OpenShift 4.11 we are enabling pod security admission:

  1. upstream KEP https://github.com/kubernetes/enhancements/blob/master/keps/sig-auth/2579-psp-replacement/README.md
  2. Initial downstream OEP: https://github.com/openshift/enhancements/blob/master/enhancements/authentication/pod-security-admission.md
  3. The Pod Security Admission label syncer for SCCs (not relevant for you workload as insights operator is core): authentication: add enhancement on PSa autolabeling enhancements#1010
  4. @stlaz 's email on aos-devel [aos-devel] [IMPORTANT] Pod Admission Changes from Wed, Apr 20

65534 is simply the nobody user on RHCOS (and most linux system)

@s-urbaniak
Copy link
Contributor Author

With these settings here your workload will comply to the restricted pod security level as per https://kubernetes.io/docs/concepts/security/pod-security-standards/.

@tremes
Copy link
Contributor

tremes commented May 3, 2022

/approve

@tremes
Copy link
Contributor

tremes commented May 3, 2022

/retest

@openshift-ci
Copy link

openshift-ci bot commented May 3, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: s-urbaniak, tremes

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 3, 2022
@stlaz
Copy link

stlaz commented May 5, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2022
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@s-urbaniak s-urbaniak changed the title manifests/deployment: comply to restricted pod security level AUTH-133: manifests/deployment: comply to restricted pod security level May 9, 2022
@s-urbaniak
Copy link
Contributor Author

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label May 9, 2022
@s-urbaniak
Copy link
Contributor Author

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label May 9, 2022
@s-urbaniak
Copy link
Contributor Author

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label May 9, 2022
@s-urbaniak
Copy link
Contributor Author

Setting labels here as this will be covered by PX, QE, Docs under the umbrella of the https://issues.redhat.com/browse/AUTH-133 epic.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link

openshift-ci bot commented May 9, 2022

@s-urbaniak: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit e039215 into openshift:master May 9, 2022
@s-urbaniak s-urbaniak deleted the psa branch May 9, 2022 18:12
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. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants