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
- add the ability to disable opt-in support for namespace validation
and enforce on across the entire cluster
Signed-off-by: Brian Davis <[email protected]>
Signed-off-by: slimm609 <[email protected]>
To enable the `policy admission webhook` to check for signed images, you will need to add the following label in each namespace that you would want the webhook triggered:
46
+
47
+
Label: `policy.sigstore.dev/include: "true"`
48
+
49
+
```yaml
50
+
apiVersion: v1
51
+
kind: Namespace
52
+
metadata:
53
+
labels:
54
+
policy.sigstore.dev/include: "true"
55
+
kubernetes.io/metadata.name: my-namespace
56
+
name: my-namespace
57
+
spec:
58
+
finalizers:
59
+
- kubernetes
60
+
```
61
+
62
+
### Testing the webhook
63
+
64
+
1. Using Unsigned Images:
65
+
Creating a deployment referencing images that are not signed will yield the following error and no resources will be created:
66
+
67
+
```shell
68
+
kubectl apply -f my-deployment.yaml
69
+
Error from server (BadRequest): error when creating "my-deployment.yaml": admission webhook "policy.sigstore.dev" denied the request: validation failed: invalid image signature: spec.template.spec.containers[0].image
70
+
```
71
+
72
+
2. Using Signed Images: Assuming a signed `nginx` image with a tag `signed` exists on a registry, the resource will be successfully created.
73
+
74
+
```shell
75
+
kubectl run pod1-signed --image=< REGISTRY_USER >/nginx:signed -n testns
0 commit comments