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

[Standardization] Baseline K8s cluster security (#415) #376

Merged
merged 4 commits into from
Feb 14, 2024
Merged

Conversation

cah-hbaum
Copy link
Contributor

@cah-hbaum cah-hbaum commented Nov 7, 2023

This PR adds a standard for high security setups, which should increase the overall of a Kubernetes cluster.
Edit: After communicating with @joshmue, this is being renamed into "Baseline K8s cluster security", since we only put up a few points which should be important for a starting security setup.

Closes SovereignCloudStack/issues#415

@cah-hbaum cah-hbaum self-assigned this Nov 7, 2023
@cah-hbaum cah-hbaum added Container Issues or pull requests relevant for Team 2: Container Infra and Tooling standards Issues / ADR / pull requests relevant for standardization & certification SCS is standardized SCS is standardized SCS-VP10 Related to tender lot SCS-VP10 labels Nov 7, 2023
@cah-hbaum cah-hbaum force-pushed the issue/415 branch 3 times, most recently from 6ceff67 to 8502cef Compare November 9, 2023 12:33
@cah-hbaum
Copy link
Contributor Author

This standard is written for now but probably needs a rework.
I needed to read a bit about Kubernetes security and hardening. IMO, it all makes sense, but the standard itself isn't really nice to read through, since it only says what to do very general. If someone needs more details for this, they need to read the Design considerations section or go more in-depth in the K8s documents.

Please make some improvements to the text or some proposals about additional hardening steps if they seem useful to you.

What I also found problematic is that this standard is one of those that can't be made MANDATORY (so I couldn't write MUST for the entire standard), since not all clusters need to be "secure" or it's just not possible for specific setups.
I think this makes more sense for clusters that are sold as "High Security", which should adhere to this standard.

Copy link
Member

@garloff garloff left a comment

Choose a reason for hiding this comment

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

Nice work, Hannes!
What we need to do is to start having a discussion with our container team:

  • Do we find consensus on what we recommend and what we require?
  • Can we implement all of this in Cluster Stacks? And could we at least implement this in good old k8s-cluster-api-provider? (We need to decide how much of this we still want to add to old v1 KaaS which has only a limited life time left --things that are risky, very tedious for us or have the effect of breaking users or requiring significant changes on their side are probably not good for our old solution.)

@jschoone - can you take it there?

@jschoone jschoone assigned jschoone and unassigned jschoone Nov 13, 2023
@jschoone jschoone self-requested a review November 13, 2023 09:12
Standards/scs-0216-v1-high-security-setup.md Outdated Show resolved Hide resolved
Standards/scs-0216-v1-high-security-setup.md Outdated Show resolved Hide resolved
Standards/scs-0216-v1-high-security-setup.md Outdated Show resolved Hide resolved
@cah-hbaum cah-hbaum force-pushed the issue/415 branch 2 times, most recently from 5734b98 to e564461 Compare November 20, 2023 12:48
@cah-hbaum cah-hbaum changed the title Kubernetes High Security setup (#415) Baseline K8s cluster security (#415) Nov 24, 2023
@cah-hbaum
Copy link
Contributor Author

Updated the document to be about baseline security measures just how it was exchanged with @joshmue.
CIS benchmark documents aren't included in this for now, since I couldn't read them yet but I will try to get on top of that this week.

@cah-hbaum cah-hbaum changed the title Baseline K8s cluster security (#415) [Standardization] Baseline K8s cluster security (#415) Dec 7, 2023
@jschoone
Copy link
Contributor

Hi @bitkeks, @cah-hbaum and @joshmue. What's the state here? It looks like we have enough approvals to merge before it gets more complicated.

@bitkeks
Copy link
Member

bitkeks commented Jan 23, 2024

LGTM, already approved!

@artificial-intelligence has remaining changes that need to be resolved.

@cah-hbaum
Copy link
Contributor Author

TBF I don't know how to adapt the document to "appeal" more to the requested changes from @artificial-intelligence. Either he suggests some general changes (like he's written in his comment) or approves or we will be stuck here.

@jschoone
Copy link
Contributor

Hi @artificial-intelligence, could you please add suggestions to your change requests? Otherwise we would like to merge, since this is in Draft state we can add improvements later.

@bitkeks bitkeks added the security Issues or pull requests that are security-relevant label Jan 23, 2024
@cah-hbaum
Copy link
Contributor Author

Pinging @artificial-intelligence again, since the last time was two weeks ago. I still don't know how to change the paragraphs up in order to make it compliant with your vision of them.

@artificial-intelligence
Copy link
Contributor

Hi @artificial-intelligence, could you please add suggestions to your change requests? Otherwise we would like to merge, since this is in Draft state we can add improvements later.

I don't find it reasonable to expect from reviewers to redraft completely missing necessary implementation details for a standards document.

This is work that is expected to be done by the authors of the document imho, because that is the main thing which needs to be done, when drafting such a document.

I'll thus remove myself from the reviewers of the document. I don't have currently the time to write the necessary detailed spec to make authn and authz reasonable secure. As this is completely left for the implementer to decide - and people will get this wrong, sooner or later - I guess there is no consensus here on how to do secure RBAC authn/autz, so even if I had the time, I can't write something down when there is no consensus, which is the point of standards.

I wish you good luck with the ongoing effort to secure Kubernetes.

@artificial-intelligence artificial-intelligence removed their request for review February 6, 2024 13:37
@artificial-intelligence
Copy link
Contributor

I don't seem to be able to remove myself from this review somehow. Two days ago I didn't show up when I removed myself. Now I'm again listed as a reviewer.

@cah-hbaum
Copy link
Contributor Author

Worked now it seems like.

Copy link
Contributor

@artificial-intelligence artificial-intelligence left a comment

Choose a reason for hiding this comment

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

It seems I at least need to leave a comment to get out of here, so here you are 🙂

@artificial-intelligence
Copy link
Contributor

It seems github review is totally broken. I need to either request changes (I didn't want to request further changes) or I need to approve the change (I honestly don't want to approve it).
I can't remove myself from the review, at this stage, through the Github UI.

But as we are stuck with this, I just "approved" this now.

cah-hbaum and others added 4 commits February 14, 2024 14:24
This commit adds a standard for high security setups, which should increase the overall of a Kubernetes cluster.

Signed-off-by: Hannes Baum <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Added some notes for the ports and shortened the motivation.

Signed-off-by: Hannes Baum <[email protected]>
Renamed the file to better match its actual intention.

Signed-off-by: Hannes Baum <[email protected]>
@cah-hbaum
Copy link
Contributor Author

Merging this now, we will continue in #475 to address issues brought up here.

@cah-hbaum cah-hbaum merged commit 4c05b90 into main Feb 14, 2024
5 checks passed
@cah-hbaum cah-hbaum deleted the issue/415 branch February 14, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Container Issues or pull requests relevant for Team 2: Container Infra and Tooling SCS is standardized SCS is standardized SCS-VP10 Related to tender lot SCS-VP10 security Issues or pull requests that are security-relevant standards Issues / ADR / pull requests relevant for standardization & certification
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Standardization] K8s cluster baseline security setup (previous: KaaS Increased security setups)
7 participants