-
Notifications
You must be signed in to change notification settings - Fork 4
fix(security): harden containers with read-only root filesystems (Kubescape C-0017) #2455
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
4916a63
fix(security): harden containers with read-only root filesystems (Kubβ¦
devantler dc03d67
Merge remote-tracking branch 'origin/main' into claude/security-conteβ¦
devantler 930fc64
fix(security): cap new emptyDirs and scope the kubescape privileged eβ¦
devantler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
k8s/bases/infrastructure/cluster-security-exceptions/kubescape-privileged.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| --- | ||
| # Workload-scoped privileged exception for the two Kubescape components that | ||
| # genuinely need host access β deliberately NOT a namespace exception, because the | ||
| # kubescape namespace also hosts the operator, kubevuln, and the scheduler, which | ||
| # run fine hardened and must stay visible to these controls. | ||
| # - node-agent (DaemonSet): eBPF runtime detection β privileged, hostPath, hostPID. | ||
| # - storage (Deployment): the aggregated APIserver writes its backing store at | ||
| # runtime, so it cannot run a read-only root. | ||
| # The CSE resources match is kind+name only (no namespace field in the CRD); both | ||
| # names are unique among non-exempted namespaces β every other similarly-named | ||
| # workload (e.g. Coroot's node agent) lives in a namespace already covered by | ||
| # infrastructure-privileged.yaml. | ||
| apiVersion: kubescape.io/v1beta1 | ||
| kind: ClusterSecurityException | ||
| metadata: | ||
| name: kubescape-privileged | ||
| spec: | ||
| reason: >- | ||
| Kubescape's node-agent needs privileged host access (eBPF runtime detection) | ||
| and the storage aggregated APIserver writes its backing store at runtime; | ||
| scoped to those two workloads so the operator, kubevuln, and scheduler in the | ||
| same namespace stay subject to these controls. | ||
| posture: | ||
| - controlID: C-0057 | ||
| action: ignore | ||
| - controlID: C-0048 | ||
| action: ignore | ||
| - controlID: C-0045 | ||
| action: ignore | ||
| - controlID: C-0041 | ||
| action: ignore | ||
| - controlID: C-0038 | ||
| action: ignore | ||
| - controlID: C-0044 | ||
| action: ignore | ||
| - controlID: C-0046 | ||
| action: ignore | ||
| - controlID: C-0016 | ||
| action: ignore | ||
| - controlID: C-0013 | ||
| action: ignore | ||
| - controlID: C-0017 | ||
| action: ignore | ||
| - controlID: C-0055 | ||
| action: ignore | ||
| match: | ||
| resources: | ||
| - apiGroup: apps | ||
| kind: DaemonSet | ||
| name: node-agent | ||
| - apiGroup: apps | ||
| kind: Deployment | ||
| name: storage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 17 additions & 11 deletions
28
k8s/bases/infrastructure/cluster-security-exceptions/pod-security-mutations.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.