forked from kyverno/kyverno
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(audit): enable audit logs for kind (kyverno#10822)
Signed-off-by: Khaled Emara <[email protected]>
- Loading branch information
1 parent
bbb1d61
commit b8a69a7
Showing
2 changed files
with
36 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
kubeadmConfigPatches: | ||
- | | ||
kind: ClusterConfiguration | ||
apiServer: | ||
# enable auditing flags on the API server | ||
extraArgs: | ||
audit-log-path: /var/log/kubernetes/kube-apiserver-audit.log | ||
audit-policy-file: /etc/kubernetes/policies/audit-policy.yaml | ||
# mount new files / directories on the control plane | ||
extraVolumes: | ||
- name: audit-policies | ||
hostPath: /etc/kubernetes/policies | ||
mountPath: /etc/kubernetes/policies | ||
readOnly: true | ||
pathType: "DirectoryOrCreate" | ||
- name: "audit-logs" | ||
hostPath: "/var/log/kubernetes" | ||
mountPath: "/var/log/kubernetes" | ||
readOnly: false | ||
pathType: DirectoryOrCreate | ||
# mount the local file on the control plane | ||
extraMounts: | ||
- hostPath: ./scripts/config/kind/audit-policy.yaml | ||
containerPath: /etc/kubernetes/policies/audit-policy.yaml | ||
readOnly: 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: audit.k8s.io/v1 | ||
kind: Policy | ||
rules: | ||
- level: RequestResponse | ||
resources: | ||
- group: "kyverno.io" | ||
resources: ["policies", "clusterpolicies"] |