Skip to content
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

[bug] tls: bad certificate when gatekeeper cert gets rotated #821

Closed
1 task
fseldow opened this issue May 11, 2023 · 1 comment · Fixed by #831
Closed
1 task

[bug] tls: bad certificate when gatekeeper cert gets rotated #821

fseldow opened this issue May 11, 2023 · 1 comment · Fixed by #831
Labels
bug Something isn't working

Comments

@fseldow
Copy link
Contributor

fseldow commented May 11, 2023

What happened in your environment?

When i manually rotate the gatekeeper cert, the ratify will not trust the new cert, reporting tls bad certificate. If i restart the ratify, everything will be working. It seems that we only load the cert when pod inits and will not update it.

Below is my steps:

  1. Followed the quick start to install gatekeeper and ratify
  2. Install constraint template and constraint, and it can pass the signed image
  3. Mannually edit the secret gatekeeper-webhook-server-cert with a new cert and update the gatekeeper validating webhook configuration CA bundle. This step is to monitor the gatekeeper cert rotation
  4. try kubectl run demo --image=wabbitnetworks.azurecr.io/test/notary-image:signed and reports error
    Error from server: admission webhook "mutation.gatekeeper.sh" denied the request: failed to resolve external data placeholders: failed to send external data request to provider ratify-mutation-provider: failed to send external data request: Post "https://ratify.gatekeeper-system:6001/ratify/gatekeeper/v1/mutate": remote error: tls: bad certificate
  5. restart the ratify pod and re-run the sign image, everything becomes healthy

What did you expect to happen?

Since from ratify side, it cannot know when gatekeeper cert is updated. Maybe we should add mechanism to sync the cert for the server.
The question might also happen on ratify's cert.

What version of Kubernetes are you running?

1.26

What version of Ratify are you running?

v1.0.0-rc.3

Anything else you would like to add?

No response

Are you willing to submit PRs to contribute to this bug fix?

  • Yes, I am willing to implement it.
@fseldow fseldow added the bug Something isn't working label May 11, 2023
@akashsinghal
Copy link
Collaborator

Thanks for pointing this out @fseldow. We will start discussions at next week's community call and aim to prioritize a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants