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

Add Security Context, Service Accounts, and PodSecurityPolicy to cert-manager, cluster-api, bootstrap-kubeadm, and control-plane-kubeadm #2934

Closed
voor opened this issue Apr 19, 2020 · 17 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@voor
Copy link
Member

voor commented Apr 19, 2020

User Story

As an operator I would like to run Cluster API's processes on a Kubernetes cluster that has the Pod Security Policy admission controllers turned on.

Detailed Description

Right now the various components of Cluster API are just using the defaults -- default security context, default service account in each namespace, and no PSP setup for those default service accounts. Unfortunately, PSP doesn't accept blanket defaults without explicitly referencing one of the Pod Security Policies installed on the cluster (which is difficult since some distributions just call them privileged and restricted while others don't), or just creating an accompanying policy. For that reason, you sorta need to recreate the privileged or restricted policies or provide a means to pass in the policy name.

Anything else you would like to add:

[Miscellaneous information that will assist in solving the issue.]

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 19, 2020
@fabriziopandini
Copy link
Member

/cc

@vincepri
Copy link
Member

/help

@k8s-ci-robot
Copy link
Contributor

@vincepri:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

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 the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Apr 20, 2020
@vincepri
Copy link
Member

/milestone v0.3.x

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
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.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 21, 2020
@detiber
Copy link
Member

detiber commented Jul 21, 2020

Not sure we want to add PSP, since it is being deprecated, but I think it would be good to keep this open to track equivalent functionality.
/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 21, 2020
@voor
Copy link
Member Author

voor commented Jul 26, 2020

While PSP might be a stretch goal, I would say a MVP and probably the most critical would be to at least have security context for all of the controllers, and make sure they're running as non-root.

@vincepri
Copy link
Member

@voor We're already running as non-root https://github.com/kubernetes-sigs/cluster-api/blob/master/Dockerfile#L56 in all our controllers

@vincepri
Copy link
Member

/milestone v0.4.0

@k8s-ci-robot k8s-ci-robot modified the milestones: v0.3.x, v0.4.0 Jul 31, 2020
@vincepri
Copy link
Member

@detiber To break this up in more issues / actionable items

@invidian
Copy link
Member

BTW, containers are still running as root. On cluster with PSPs enabled, I get the following errors while trying to do clusterctl init:

  Warning  Failed     10m (x5 over 11m)   kubelet            Error: container has runAsNonRoot and image has non-numeric user (nobody), cannot verify user is non-root
  Warning  Failed     10m (x6 over 11m)   kubelet            Error: container has runAsNonRoot and image will run as root

@vincepri
Copy link
Member

vincepri commented Jan 4, 2021

@invidian That seems something we should fix, could you open a different issue?

@invidian
Copy link
Member

invidian commented Jan 5, 2021

@vincepri sure. Reported here: #4046

@vincepri vincepri added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Feb 8, 2021
@vincepri
Copy link
Member

@voor @detiber Is there any updates here?

/milestone Next

@k8s-ci-robot k8s-ci-robot modified the milestones: v0.4.0, Next Feb 19, 2021
@vincepri
Copy link
Member

/close

Closing due to lack of updates

@k8s-ci-robot
Copy link
Contributor

@vincepri: Closing this issue.

In response to this:

/close

Closing due to lack of updates

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.

@voor
Copy link
Member Author

voor commented Oct 24, 2021

This issue is sort of superseded by more specific issues on setting up the security context to run as a non-root user.

Cluster API: #4046
Other providers are referenced in that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

7 participants