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: enforce privileged for openshift-dns namespace #298

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

s-urbaniak
Copy link
Contributor

Starting with OpenShift 4.10 we are introducing PodSecurity admission (https://github.com/kubernetes/enhancements/tree/master/keps/sig-auth/2579-psp-replacement).

Currently, all pods are marked as privileged, however, over time we want to enforce at least baseline, admirably restricted as default. In order not to break control plane workloads this allows workloads in openshift-dns namespace to run privileged pods.

See openshift/enhancements#899 for more details (and excuse the eventual consistency of updates).

/cc @stlaz

@openshift-ci openshift-ci bot requested a review from stlaz October 1, 2021 09:06
@aojea
Copy link

aojea commented Oct 1, 2021

/assign @Miciah

@s-urbaniak
Copy link
Contributor Author

/cc @deads2k

@openshift-ci openshift-ci bot requested a review from deads2k October 1, 2021 14:24
@candita
Copy link
Contributor

candita commented Oct 1, 2021

You will need to add the generated files to satisfy the verify test.

@@ -10,3 +10,6 @@ metadata:
openshift.io/run-level: "0"
# allow openshift-monitoring to look for ServiceMonitor objects in this namespace
openshift.io/cluster-monitoring: "true"
pod-security.kubernetes.io/enforce: privileged
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment for these new labels?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@candita fixed, ptal :-)

@candita
Copy link
Contributor

candita commented Oct 6, 2021

numerous ContainerExit code/137

/test e2e-upgrade

@candita
Copy link
Contributor

candita commented Oct 6, 2021

Currently, all pods are marked as privileged, however, over time we want to enforce at least baseline, admirably restricted as default. In order not to break control plane workloads this allows workloads in openshift-dns namespace to run privileged pods.

Just checking, lest I miss an opportunity to learn new jargon, is "admirably restricted" supposed to be "at most restricted"?

@@ -10,3 +10,8 @@ metadata:
openshift.io/run-level: "0"
# allow openshift-monitoring to look for ServiceMonitor objects in this namespace
openshift.io/cluster-monitoring: "true"
# allow node-resolver daemonset to pass baseline pod security admission.
# It uses host networking, host path volumes, and is a privileged.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# It uses host networking, host path volumes, and is a privileged.
# It uses host networking, host path volumes, and is privileged.

@candita
Copy link
Contributor

candita commented Oct 6, 2021

Just a grammar nit, and need to wait for successful CI test, but otherwise
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 6, 2021

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Oct 6, 2021
@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-merge-robot openshift-merge-robot merged commit 708fb4d into openshift:master Oct 6, 2021
@Miciah
Copy link
Contributor

Miciah commented Oct 9, 2021

@s-urbaniak,

Currently, all pods are marked as privileged, however, over time we want to enforce at least baseline, admirably restricted as default. In order not to break control plane workloads this allows workloads in openshift-dns namespace to run privileged pods.

The openshift-dns namespace specifies openshift.io/run-level: "0" to skip admission entirely so as to avoid a cyclic dependency between DNS and admission; see 27a4f94 by @deads2k. Is the intent eventually to remove openshift.io/run-level: "0" from the namespace? If so, how will we prevent a cyclic dependency without specifying run-level? I don't see this addressed in https://github.com/openshift/enhancements/blob/master/enhancements/authentication/pod-security-admission.md.

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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants