-
Notifications
You must be signed in to change notification settings - Fork 25
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
Expand security-hardening/ subsection, reorder howtos/ section #562
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
44fdf7f
chore: s/air-gap/air gap/g
viccuad a4f3d9f
chore: Rework title of howtos/airgap/01-requirements.md
viccuad aa5f838
feat: Add landing page to Security section
viccuad d6fb1f5
refactor: Move secure-supply-chain.md under security-hardening/
viccuad 870e26e
refactor: Reorder howtos section
viccuad 04309c2
chore: Mention the reference page in the webhooks-mtls howto
viccuad acfc73b
feat: Expand security-hardening landing page
viccuad 2afa215
Mention restricted PSA for >=1.23
viccuad 1089337
Apply suggestions from code review
viccuad 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 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"label": "Airgap", | ||
"label": "Air gap", | ||
"position": 100, | ||
"collapsed": true | ||
} |
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"label": "Rancher Application Collection", | ||
"position": 120, | ||
"position": 140, | ||
"collapsed": true | ||
} |
This file contains 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 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 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 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"label": "Configuring Policy Servers", | ||
"position": 80, | ||
"position": 32, | ||
"collapsed": true | ||
} |
This file contains 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"label": "Security", | ||
"position": 100, | ||
"position": 90, | ||
"collapsed": true | ||
} |
This file contains 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 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,81 @@ | ||
--- | ||
sidebar_label: Security hardening | ||
sidebar_position: 50 | ||
title: Security hardening | ||
description: Harden the Kubewarden installation | ||
keywords: [kubewarden, kubernetes, security] | ||
doc-persona: [kubewarden-operator, kubewarden-integrator] | ||
doc-type: [howto] | ||
doc-topic: [operator-manual, security] | ||
--- | ||
|
||
Kubewarden strives to be secure with little configuration. | ||
In this section and its subpages you can find hardening tips (with their | ||
trade-offs) to secure Kubewarden itself. | ||
|
||
Please refer to our [threat model](../reference/threat-model) for more information. | ||
|
||
### `kubewarden-defaults` Helm chart | ||
|
||
Operators can obtain a secure deployment by installing all the | ||
Kubewarden Helm charts. It's recommended to install the | ||
`kubewarden-defaults` Helm chart and enable its recommended policies with: | ||
|
||
```console | ||
helm install --wait -n kubewarden kubewarden-defaults kubewarden/kubewarden-defaults \ | ||
--set recommendedPolicies.enabled=True \ | ||
--set recommendedPolicies.defaultPolicyMode=protect | ||
``` | ||
|
||
This provides a default PolicyServer and default policies, in protect mode, to | ||
ensure the Kubewarden stack is safe from other workloads. | ||
|
||
### Verifying Kubewarden artifacts | ||
|
||
See the [Verifying Kubewarden](../tutorials/verifying-kubewarden) tutorial. | ||
|
||
### RBAC | ||
|
||
Kubewarden describes RBAC configurations in different | ||
_Explanations_ sections. Users can fine-tune the needed permissions for the | ||
[Audit Scanner](../explanations/audit-scanner#permissions-and-serviceaccounts) | ||
feature, as well as [per Policy Server](../explanations/context-aware-policies) | ||
Service Account for the context-aware feature. | ||
|
||
The view all Roles: | ||
|
||
```console | ||
kubectl get clusterroles,roles -A | grep kubewarden | ||
``` | ||
|
||
### Per-policy permissions | ||
|
||
For context-aware policies, operators specify fine-grained permissions per | ||
policy under its `spec.contectAwareResources`, and those work in conjuction | ||
with the Service Account configured for the Policy Server where the policy | ||
runs. | ||
|
||
### Workload coverage | ||
|
||
By default, Kubewarden excludes specific Namespaces from Kubewarden coverage. This is | ||
done to simplify first-time use and interoperability with other workloads. | ||
|
||
Security-conscious operators can tune these Namespaces list via the | ||
`.global.skipNamespaces` value for both the `kubewarden-controller` and | ||
`kubewarden-defaults` Helm charts. | ||
|
||
### SecurityContexts | ||
|
||
Starting from 1.23, Kubewarden's stack is able to run in a Namespace | ||
where the [restricted | ||
Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted) | ||
are enforced, with current Pod hardening best practices. | ||
|
||
The `kubewarden-controller` Helm chart configures the SecurityContexts and | ||
exposes them in its `values.yaml`. | ||
|
||
The `kubewarden-defaults` Helm chart allows for configuing the default Policy | ||
Server `.spec.securityContexts` under `.Values.policyServer.securityContexts`. | ||
|
||
For Policy Servers managed by operators, you can configure them via their | ||
[`spec.securityContexts`](https://docs.kubewarden.io/reference/CRDs#policyserversecurity). |
This file contains 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"label": "Rancher UI extension", | ||
"position": 110, | ||
"position": 130, | ||
"collapsed": true | ||
} |
This file contains 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"label": "Workarounds", | ||
"position": 15, | ||
"position": 140, | ||
"collapsed": true | ||
} |
This file contains 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 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 'safe' the right word? Maybe 'partitioned from' or 'separate to'? Just wondering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say it's correct, by deploying the kubewarden-defaults chart we ensure the safety of Kubewarden. It's already partitioned, but if we allow other workloads to deploy with privileges (because the kubewarden-defaults chart is not deployed for example) then Kubewarden, and by extension the rest of the cluster, is not safe.