You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And despite this, the audit process is generating audit violations for resources in these namespaces:
{"level":"info","ts":1698266075.7612457,"logger":"controller",
"msg":"container <calico-apiserver> is not dropping all required capabilities. Container must drop all of [...] or \"ALL\"",
"process":"audit","audit_id":"2023-10-25T20:34:20Z",
"details":{},
"event_type":"violation_audited",
"constraint_group":"constraints.gatekeeper.sh","constraint_api_version":"v1beta1","constraint_kind":"K8sPSPCapabilities","constraint_name":"psp-capabilities","constraint_namespace":"","constraint_action":"deny",
"constraint_annotations":{"meta.helm.sh/release-name":"gkopa-constraints-dev-constraints","meta.helm.sh/release-namespace":"kube-system","objectset.rio.cattle.io/id":"default-gkopa-constraints-dev-constraints"},
"resource_group":"","resource_api_version":"v1","resource_kind":"Pod","resource_namespace":"calico-apiserver","resource_name":"calico-apiserver-544c8fd886-rxbz9",
"resource_labels":{"apiserver":"true","k8s-app":"calico-apiserver","pod-template-hash":"544c8fd886"}
}
What did you expect to happen:
Audit should be completely ignoring resources in (in this example) the calico-system namespace, because I have processes: ['*'] set in the Config excluded namespaces spec.
Anything else you would like to add:
This isn't just happening with one or two isolated namespaces. Audit is auditing EVERYTHING in the cluster, including kube-system... it's like it's completely ignoring the Config resource's exclusions.
I took a cursory dive into the 3.12 code. AFAICT, the auditFromCache branch does not actually have a skipExcludedNamespace check on the objects it receives from its special lister.
Ah ha...so auditing "from cache" just takes the resources that were synced, and just blindly audits all of them, without regard to whether they match the spec.match in the Config resource. I would rather not audit against the kube-apiserver, so I suppose I will need to wait for a bugfix on this.
What steps did you take and what happened:
I have configured the Config resource with a list of excluded namespaces:
And despite this, the audit process is generating audit violations for resources in these namespaces:
What did you expect to happen:
Audit should be completely ignoring resources in (in this example) the
calico-system
namespace, because I haveprocesses: ['*']
set in the Config excluded namespaces spec.Anything else you would like to add:
This isn't just happening with one or two isolated namespaces. Audit is auditing EVERYTHING in the cluster, including
kube-system
... it's like it's completely ignoring the Config resource's exclusions.Environment:
kubectl version
): Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.8", GitCommit:"395f0a2fdc940aeb9ab88849e8fa4321decbf6e1", GitTreeState:"clean", BuildDate:"2023-08-24T00:43:07Z", GoVersion:"go1.20.7", Compiler:"gc", Platform:"linux/amd64"}The text was updated successfully, but these errors were encountered: