Gatekeeper logs not showing violations #454
Replies: 2 comments 4 replies
-
Audit only scans/logs violations for existing resources on the cluster. Something that gets rejected by the webhook wouldn't be persisted in the cluster and therefore wouldn't show up in audit logs. If you want to see webhook rejections in the webhook pod logs (not the audit pod), setting the |
Beta Was this translation helpful? Give feedback.
-
I'm not seeing the Gatekeeper docker image. Also not seeing the args provided to the Gatekeeper command (which is the main thing I wanted to verify). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I have deployed gatekeeper v3.12.0 via helm chart and constraint template and crd to allow only the whitelisted repos. the policy works fine and blocks the pod from getting created, if I use non-whitelisted image/repo and we get the error message .I also see the violations for the deployments of existing images/repos prior to installing gatekeeper in audit logs, which is not whitelisted in policy. Once we add them in policy those violation disappear in audit logs. But when I try to deploy a pod with non-whitelisted image/repo, gatekeeper blocks it but I don't see the details of violation in logs , why is that ?
Below is some of the logs
│ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520658.3459783,"logger":"controller","msg":"auditing constraints and violations","process":"audit","audit_id":"2023-06-23T11:44:18Z","event_type":"audit_started"} ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520659.396397,"msg":"Waited for 1.040206619s due to client-side throttling, not priority and fairness, request: GET:https://10.100.0.1:443/apis/coordination.k8s.io/v1?timeout=32s\n"} ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520659.4044647,"logger":"controller","msg":"Auditing via discovery client","process":"audit","audit_id":"2023-06-23T11:44:18Z"} ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520660.606831,"logger":"controller","msg":"closing the previous audit reporting thread","process":"audit","audit_id":"2023-06-23T11:44:18Z"} ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520660.6068585,"logger":"controller","msg":"auditing is complete","process":"audit","audit_id":"2023-06-23T11:44:18Z","event_type":"audit_finished"} ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520660.6068735,"logger":"controller","msg":"constraint","process":"audit","audit_id":"2023-06-23T11:44:18Z","resource kind":"K8sAllowedRepos"} ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520660.610798,"logger":"controller","msg":"constraint","process":"audit","audit_id":"2023-06-23T11:44:18Z","count of constraints":1} ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520660.610829,"logger":"controller","msg":"starting update constraints loop","process":"audit","audit_id":"2023-06-23T11:44:18Z","constraints to update":"map[{constraints.gatekeeper.sh K8sAllowedRepos v1beta1 allow-onl ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520660.615326,"logger":"controller","msg":"updating constraint status","process":"audit","audit_id":"2023-06-23T11:44:18Z","constraintName":"allow-only-private-registry"} ││ gatekeeper-audit-679cf8789c-8jbs2 {"level":"info","ts":1687520660.6249003,"logger":"controller","msg":"handling constraint update","process":"constraint_controller","instance":{"apiVersion":"constraints.gatekeeper.sh/v1beta1","kind":"K8sAllowedRepos","name":"allow-only-private- │
Can someone help please ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions