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

New approach to referencing content in code blocks. #469

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/reference/monitor-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ The `mode` is an attribute included in the `ClusterAdmissionPolicy` and `Admissi
There are two values that the `mode` attribute can assume: `monitor` and `protect`.
The `mode` defaults to `protect` if omitted.

To create a policy in `monitor mode` you to need include the `mode: monitor` as part of the specification of the resource.
For example, as highlighted, in this `ClusterAdmissionPolicy`:
To create a policy in `monitor mode` you to need to include the statement `mode:
monitor` in the specification of the resource. For example, in the
`spec` section (marked ➀), of this `ClusterAdmissionPolicy`:

```yaml
apiVersion: policies.kubewarden.io/v1alpha2
kind: ClusterAdmissionPolicy
metadata:
name: psp-capabilities
spec:
// highlight-next-line
mode: monitor
mode: monitor # ➀
policyServer: reserved-instance-for-tenant-a
module: registry://ghcr.io/kubewarden/policies/psp-capabilities:v0.1.3
rules:
Expand All @@ -60,6 +60,9 @@ spec:
- NET_ADMIN
```

➀ The `mode: monitor` attribute in the `spec` section.
<hr/>

## Changing policy mode

For security purposes, a user with `UPDATE` permissions on policy resources can make the policy more restrictive.
Expand All @@ -69,7 +72,7 @@ However, you can't change the `mode` of an existing `ClusterAdmissionPolicy` or

So, to change the `mode` of a policy from `protect` to `monitor`,
you need to delete the policy and re-create it in `monitor` mode.
Switching a policy from `protect` to `monitor` is effectively the same as deleting the policy so this approach ensures that the user has policy delete permissions.
Switching a policy from `protect` to `monitor` is the same as deleting the policy so this approach ensures that the user has policy delete permissions.

## A note on mutating policies

Expand Down