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
the policy is working properly for mutating webhook, but authorization webhook seems to not be working, it stills reads the secret. Nothing was there when i try to check opa pod logs when hitting 'oc get secret'.
# Kubernetes API version
apiVersion: v1
# kind of the API object
kind: Config
# clusters refers to the remote service.
clusters:
- name: opa-server
cluster:
# CA for verifying the remote service.
certificate-authority: /var/lib/minishift/openshift.local.config/master/ca-bundle.crt
# URL of remote service to query. Must use 'https'. May not include parameters.
server: https://opa.opa.svc
# users refers to the API Server's webhook configuration.
users:
- name: opa-user
user:
client-certificate: /var/lib/minishift/openshift.local.config/master/master.kubelet-client.crt # cert for the webhook plugin to use
client-key: /var/lib/minishift/openshift.local.config/master/master.kubelet-client.key # key matching the cert
# kubeconfig files require a context. Provide one for the API Server.
current-context: opa-webhook
contexts:
- context:
cluster: opa-server
user: opa-user
name: opa-webhook
configmap in opa namespace
package authorization
import data.k8s.matches
##############################################################################
#
# Policy : denies cluster-admin users access to read secrets in administrative projects
#
#
#
##############################################################################
deny[{
"id": "unreadable-secret",
"resource": {"kind": "secrets", "namespace": namespace, "name": name},
"resolution": {"message": "cluster administrator are not allowed to read secrets in non-administrative namespaces"},
}] {
matches[["secrets", namespace, name, resource]]
resource.spec.resourceAttributes.verb = "get"
resource.spec.group[_] = "cluster-admin"
not re_match("^(openshift-*|kube-*)", resource.spec.resourceAttributes.namespace)
}
The text was updated successfully, but these errors were encountered:
letthefireflieslive
changed the title
How to debug a non-working authorization webhook?
Authorization webhook not going into opa pod
Dec 18, 2019
I turned on audit log, I can see logs here when i tried to run oc get secret or oc describe xxx secret. If authorization webhook mode is configured properly, should I expect a log with SubjectAccessReview string in the logs?
the policy is working properly for mutating webhook, but authorization webhook seems to not be working, it stills reads the secret. Nothing was there when i try to check opa pod logs when hitting 'oc get secret'.
openshift v3.9.0+2e78773-56
kubernetes v1.9.1+a0ce1bc657
etcd 3.2.16
/var/lib/minishift/openshift.local.config/master/master-config.yaml
/var/lib/minishift/openshift.local.config/master/opa-policy-controller.kubeconfig
configmap in opa namespace
The text was updated successfully, but these errors were encountered: