-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubewarden policy to validate cosign images #1183
Comments
I've pinged the kubewarden team as I could not find any policy for cosign in https://hub.kubewarden.io/, if that's the case we should implement our own policy |
I've checked in with @flavio and at the moment this doesn't seems to be technically possible with Kubewarden but it's in the roadmap. Let's postpone this as there is no pressure for it right now, in the case we need a temporary solution to verify cosign images we can write a custom admission controller for the purpose or use https://artifacthub.io/packages/helm/sigstore/cosigned and replace it later with a kubewarden policy. |
This seems to be possible now |
This is the kubewarden policy that implements image verification: https://github.com/kubewarden/verify-image-signatures Feel free to reach out if something is missing or if you want to propose improvements |
From a preliminary test the policy seems sufficient as it is gating upgrades. I'm checking out now if I can make an upgrade going through it and documenting all the steps. So far looks promising |
Bug was found along the way. Blocked by kubewarden/verify-image-signatures#20 |
Seems to be fixed upstream now, having a look at it again |
With latest kubewarden I get a strange error on the validation policy pod:
Weirdly enough, dns resolution seem to work just fine in the cluster. When I describe the job that creates the pod, I see in the events:
Digging still 👀 ... |
The DNS resolution failure seems weird to be fair. I wonder if it is a fluke. We just released v0.1.5 of the policy. It has a new The policy with this settings should work: apiVersion: policies.kubewarden.io/v1alpha2
kind: ClusterAdmissionPolicy
metadata:
name: verify-image-signatures-policy
spec:
module: registry://ghcr.io/kubewarden/policies/verify-image-signatures:v0.1.5
rules:
- apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
operations:
- CREATE
- UPDATE
mutating: true
settings:
signatures:
- image: "quay.io/c3os/*"
github_actions:
owner: "c3os-io"
repo: "c3os" # optional The second error, the mutation one, may have been because the ClusterAdmissionPolicy was missing If one doesn't want the policy to mutate, they can set |
Just tried with a different policy, and I get the dns error too:
I will look into it. |
The DNS error seems to be here because I started the cluster with VPN enabled, and then took it off (thanks to @raulcabello for the hint). I wonder if that was it too in your side @mudler. |
Elemental-toolkit does not provide images anymore, closing this. |
In order to validate images used for upgrades in kubernetes, we can have a kubewarden policy to validate cosign images and prevent upgrades from being pulled and hitting nodes.
Ping Kubewarden team to see if they have already a policy for it and we can just re-use it (and document it)
Action Items
The text was updated successfully, but these errors were encountered: