-
Notifications
You must be signed in to change notification settings - Fork 46
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
Certificate Duration Minimums #60
Comments
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/178849355 The labels on this github issue will be updated when the story is started. |
@anEXPer I agree with these concerns. Waiting to see where you take this. +1 |
@bruce-ricard @peterhaochen47 @anEXPer Hello team, We summarized points 2 and 3 under i1. We have some questions about the requirements and also wanted to discuss the different approaches to implement the CLI requirement. Requirements
Implementation approaches for the CLI requirement
Ask
|
@pvaramballypivot There's probably a way to preserve the original json response format while also returns a message to the CLI user. Currently, according to the doc, the CredHub API response to a generate request looks like:
And the CLI response looks similar, but with the Another consideration is the API response itself, as users can interact with CredHub API directly without CredHub CLI. In that case, we also want to give users the "override notice" as well in the raw API response, right? And Option 1 & 2 do not cover the raw API response. Another option is to add a new top level field in the raw API response, which is your original option 3, which you said "might break any code that is parsing this response and expecting a fixed set of fields." But I'm thinking that an additive field does not constitute a breaking change, since most API users should just parse the response and extract the keys they look for, instead of expecting a fixed set of fields? This article agrees. We might have to bump CredHub's minor version if we go for this option though. I'll ask my teammate @bruce-ricard to also chime in. |
Your description of the I agree that adding new fields to an API response should not constitute a breaking change. However, I have a vague memory of adding a new field to one of the Ops Manager API responses in the past that ended up breaking something the It is quite possible I'm misremembering what the situation actually was, however. In general I'd be in favor of adding a new field to the API response if ya'll do not think it's risky to do so. The implementation approaches we presented were mostly to get around having to add to the response. |
Yeah, the |
@peterhaochen47 Proposed Release Notes: Release Notes:Improvements:
Behavioral Changes:
|
I've updated the issue to accurately describe the conclusions we've reached. Great work, errybody. |
Closing this issue as the feature has been implemented. |
Use Case
Operators with complex sets of BOSH deployments using Credhub as a config server do not always have control or insight into every manifest generated in their foundation, especially in cases where On Demand Brokers are in play. This greatly complicates certificate policy management, and makes it difficult to manage the frequency of certificate rotations, for both leaf and CA certs.
Certificate rotations can be complex, difficult, heavily manual, risky processes, and operators would like to be able to place upper bounds on their frequency by placing lower bounds on generated certificate durations.
Proposal
We would like to add two properties to the credhub spec:
credhub.certificates.minimum_ca_duration
credhub.certificates.minimum_leaf_cert_duration
Both would be specified in days, consistent with the
parameters.duration
request field on the Credhub API and theduration
generation option for certificates in the BOSH variable definition/config server system.The minimum server-side behavior looks something like this:
Let's say, if we stop here, that we have Iteration 0 (i0) of the design - enough to satisfy the immediate concern, but with some work left to do to clean up the edge cases and implications.
I'll list some some of the i0 behaviors that I consider problems as if they were part of the specified behavior, and then move on to expanding the spec to deal with them:
i0
This results in the perverse case that the certificate will be regenerated in a case where the requested duration is changed to match the duration that the currently stored certificate was actually generated with.
It's also, of course, very confusing from an audit/troubleshooting perspective. There may not even be a log line recording the strange behavior of the generation system, and even if there was, the log line would likely be lost to time.
A stronger design would store the fact that the certificate was overridden, report it in at least the CLI, specify logging behavior, and discuss and design for what happens when this override is turned off after having been used to generate some certificates. These require storing override options in the database.
I am submitting this issue for tracking/linking/discussion, but intend to expand it with at least one additional iteration better-resolving these issues and more thoroughly explaining the use-case.
i1
So how can we address these problems? Here, the fact that I'm still ramping on the underlying code might become more apparent, but hopefully nothing I'm assuming is too different from how the system currently works, and while the code changes to make this happen might be a little broader, I think we can get a much more satisfactory system.
If we store the fact that there was a minimum override in place when the credential was generated, we can refer to the stored alternative when testing equality, while preserving the original requested value.
This also opens our options in terms of what we do when handling changes to the configured overrides.
So we need additional design constraints for safety:
Based on how Credhub actually works, the i0 description doesn't really apply, and these additional constraints are easy to satisfy. If we had known this going into writing this issue, we might not have raised the whole i0 idea at all.
Specifically, Credhub does not store the duration a certificate was generated with - to the extent it is used elsewhere (for instance, in "regenerate" request with no duration specified) it is derived from the not-valid-before and valid-until dates in the actual stored certificate. The additional clauses necessary to the original set of behaviors in order to satisfy the i1 constraints are
This would be a global behavioral change,
but might be considered a fix rather than a feature in the first place,
as duration is arguably not appropriate to converge on, anyway.
and
The final spec for this change, which satisfies all above constraints, is:
The text was updated successfully, but these errors were encountered: