Created
December 30, 2020 19:17
-
-
Save developer-guy/abeffa8b3b2735fe579d6600bacd8110 to your computer and use it in GitHub Desktop.
Kubernetes Audit Policy
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
| apiVersion: audit.k8s.io/v1 | |
| kind: Policy | |
| rules: | |
| # do not log requests to the following | |
| - level: None | |
| nonResourceURLs: | |
| - "/healthz*" | |
| - "/logs" | |
| - "/metrics" | |
| - "/swagger*" | |
| - "/version" | |
| # limit level to Metadata so token is not included in the spec/status | |
| - level: Metadata | |
| omitStages: | |
| - RequestReceived | |
| resources: | |
| - group: authentication.k8s.io | |
| resources: | |
| - tokenreviews | |
| # extended audit of auth delegation | |
| - level: RequestResponse | |
| omitStages: | |
| - RequestReceived | |
| resources: | |
| - group: authorization.k8s.io | |
| resources: | |
| - subjectaccessreviews | |
| # log changes to pods at RequestResponse level | |
| - level: RequestResponse | |
| omitStages: | |
| - RequestReceived | |
| resources: | |
| - group: "" # core API group; add third-party API services and your API services if needed | |
| resources: ["pods"] | |
| verbs: ["create", "patch", "update", "delete"] | |
| # log everything else at Metadata level | |
| - level: Metadata | |
| omitStages: | |
| - RequestReceived |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment