-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Security Self-Assessment: [STRIDE-MULTIPLE] Secure Cluster Class for Cluster API (MVP) #6329
Comments
/milestone v1.2 |
@PushkarJ I don't think this requires a KEP @chrischdi might be you are interested in this work |
@fabriziopandini: The label(s) In response to this:
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. |
/area topology |
Sounds good from my side as well. I think we can start with adding the ClusterClass first and after that's done discuss how we can integrate it with clusterctl. I'm not 100% sure but it could be realistic to just extend our existing quickstart ClusterClass with a "secure" (name TBD) variable. We have to experiment a bit, but if that works I would prefer doing that vs. having a separate ClusterClass (after all the goal of ClusterClass is to avoid requiring a lot of different ClusterClasses for different use cases) |
I pretty much like the secure by default idea. What if we just apply the baseline config by default which would be:
I assume we would break stuff if we just improve the default cluster class generated? We could then allow users of
|
I'm not sure how much we actually break as it's scoped to CAPD and that's for dev purposes. But I think we should get a good impression after we have a PR which just enables it. We can do the same with our e2e test ClusterClass and see if the e2e tests are still green or not. But I think it's easy to decide later if the variable which enables it is per default on or off. The whole story becomes way more complicated if we consider adding a fancy integration with clusterctl. clusterctl just does an envsubst today on the template and it's easy to pass through strings that way. Currently there is no way to do more, like passing in an object or a file, ... (although a JSON string might work to pass an object as variable value). |
/assign @PushkarJ |
@PushkarJ @chrischdi can we close this now that we have a secure cluster class MVP? |
/triage accepted @PushkarJ we can eventually re-open if more work is required |
@fabriziopandini: Closing this issue. In response to this:
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. |
Thanks for taking care of this @fabriziopandini. @chrischdi would you be interested in writing a short blog post about this with me? |
Hi @PushkarJ, seems like I've missed the message. If you are still interested in writing a short blog post, I'd be happy to help 😀 |
Secure Cluster Class for Cluster API
Create a secure cluster class, that allows end users to spin "secure by default" clusters with sane defaults which are configurable.
Motivation
Goals
MVP (Minimum Viable Product) goal is to support pod security admission with baseline pod security standard enforced at cluster level.
Demo: https://asciinema.org/a/477476
Non-Goals/Future Work
Post MVP can include features like but not limited to support for:
Any complex Pod Security Configurations that are not supported by built-in pod security admission controller are out of scope.
Proposal
To enable pod security admission with baseline pod security standard at cluster level, API server needs to be passed an
extraArgs
parameter that points toAdmissionConfiguration
file that defines the cluster level pod security standard with exemptions.This file needs to be present on the control plane nodes where API server is running. If running as a pod this file needs to be mounted from host inside the pod or generated within the pod before API server binary is executed
An example of a ClusterClass Configuration for Cluster API Provider - Docker can be found here
To auto-generate this file we need to add a new feature to
clusterctl generate
that takes as input these parameters:Few possible CLI UX options are as follows:
Secure with sane defaults
By default
clusterctl
will enforcebaseline
pod security standard &audit
andwarn
onrestricted
an exemptkube-system
namespace andversion
will default tolatest
Secure with configurable defaults
This needs to be confirmed for OpenAPI schema compatability
Secure with configurable defaults via environment substring
The outcome of the either of the above UX would be generation of the
cluster-level-pss.yaml
file which is accessible to API server during start up.Implementation Notes
Example Cluster Class configuration
Click to view full content
Demo shell script
Click to view full content
Pre-requisites
Cluster level Pod Security Admission configuration
Content of
/tmp/pss/cluster-level-pss.yaml
Example pod yaml
Passes baseline but warns on restricted pod security standard
Content of
/tmp/pss/nginx-pod.yaml
Happy to open a CAEP after initial discussion and community feedback on this issue
/kind feature
/sig cluster-lifecycle security
/area security
/cc @fabriziopandini @sbueringer
The text was updated successfully, but these errors were encountered: