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

Reviewing 'minimum certificate duration' requirements and handling #3067

Closed
munnerz opened this issue Jul 3, 2020 · 5 comments
Closed

Reviewing 'minimum certificate duration' requirements and handling #3067

munnerz opened this issue Jul 3, 2020 · 5 comments
Labels
area/api Indicates a PR directly modifies the 'pkg/apis' directory lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
Milestone

Comments

@munnerz
Copy link
Member

munnerz commented Jul 3, 2020

As per #3038 (comment), we should ensure that the 'minimum certificate duration' logic we have is a) needed and b) works properly.

/milestone Next
/priority important-longterm
/area api

@jetstack-bot jetstack-bot added this to the Next milestone Jul 3, 2020
@jetstack-bot jetstack-bot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. area/api Indicates a PR directly modifies the 'pkg/apis' directory labels Jul 3, 2020
@meyskens meyskens modified the milestones: Next, v1.0 Aug 5, 2020
@meyskens meyskens added this to To do in v1.0 Aug 7, 2020
@meyskens meyskens self-assigned this Aug 17, 2020
@meyskens
Copy link
Contributor

Tested on the latest alpha and we do seem to enforce it now :) I'll just blame an old cert-manager version with bad validation when I saw this before.

it's also quite a difficult thing for us to enforce given the CA can override the behaviour.
All of cert-manager code needs to tolerate any duration, and can't really rely on this being true.
That said, supposing a CA returns a Certificate valid for 1s, or a user requests a certificate valid for 1s, what would we really want to happen here? That's an excessively short duration, and will lead to cert-manager performing lots of certificate requests.
As a cluster administrator, I'd like to have some guard against this. Perhaps a flag on the controller which is a universal minimum value? (could be enforced by the webhook then?).

I think we should add a minimal duration check, well keep it as it seems to work. Just to prevent user error making 1m and thinking m is months.

How we do handle the case where a user doesn't explicitly set a duration, yet the CA still returns one valid for 1s? Should we go into that tight request loop despite the minimum duration not being met?

Adding a more reasonable edge case the user requests a longer valid cert than it receives and the duration happens to be 1 minute more than the renewBefore? Should we enforce a minimal duration on the CR?

Thinking even further.. what if a CA returns a certificate that is already expired?

How about we do a check on that, if so place the CR in a failed state so it is exponentially retried till the CA fixes their behavior?

@jetstack-bot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to jetstack.
/lifecycle stale

@jetstack-bot jetstack-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 15, 2021
@jetstack-bot
Copy link
Collaborator

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to jetstack.
/lifecycle rotten
/remove-lifecycle stale

@jetstack-bot jetstack-bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 15, 2021
@jetstack-bot
Copy link
Collaborator

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to jetstack.
/close

@jetstack-bot
Copy link
Collaborator

@jetstack-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to jetstack.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates a PR directly modifies the 'pkg/apis' directory lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
No open projects
v1.0
  
To do
Development

No branches or pull requests

3 participants