-
Notifications
You must be signed in to change notification settings - Fork 209
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
Secrets design proposal #1989
Secrets design proposal #1989
Conversation
95e2c6e
to
d30f866
Compare
Codecov Report
@@ Coverage Diff @@
## main #1989 +/- ##
==========================================
+ Coverage 57.15% 57.18% +0.03%
==========================================
Files 422 422
Lines 85734 85514 -220
==========================================
- Hits 49002 48904 -98
+ Misses 30452 30371 -81
+ Partials 6280 6239 -41
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review, with comments made as I thought of things. It's a good read, lots of decisions to make though!
docs/hugo/content/design/secrets.md
Outdated
delete: false # Optional: defaults to true | ||
``` | ||
|
||
Conclusion: TBD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically triggering purge on delete seems like a problem to me - intentionally defeating the feature that KeyVault added to prevent very common user disruption issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user has deleted the resource the secret corresponds to though - there's no resource left so the secret is meaningless.
Imagine the scenario where the user has a storage account and puts theirs keys into KeyVault. Then they delete their storage account. Does it make sense to leave those keys in KeyVault (and not purge them?). That just means that if you wanted to recreate the storage account you'd need to use a different secret name as the old one is taken for 90 days until it is purged.
The keys there have no value though because even if you recreate the exact same named storage account, it'll have different keys.
Still, the proposal here is to by default leave them there (and thus make customers use a different name when recreating), but they can optionally purge them, which is useful especially for cases like testing where you'll probably be creating and deleting similarly named resources and secrets regularly.
d30f866
to
6e22f32
Compare
Given ASO's approach as a low level toolkit providing the ability to create Azure resources, at least | ||
at this time we should avoid the added complexity of generating user secrets. | ||
|
||
### Prefer Managed Identity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do want to give users an option of not using managed identity? Are we just limited by resources supporting managed identity or is there customer value in being able to choose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are "good reasons" to not use managed identity. For example we use service principal for our ASO test environment, because managed identity requires you to run in Azure, which is annoying when you could otherwise kick the tires/test outside of Azure.
There are also some resources that don't support managed identity, or more often don't support it for all scenarios.
but I think it's mostly that the service itself doesn't force you to use managed identity. If we for example forced all users of Azure storage to use managed identity, it would preclude users who just want to lift+shift their stuff into ASO and have it adopt their existing resources, but weren't using managed identity. Just like in Azure core, the users are free to choose what makes sense for them.
With that said, this preference for managed identity here means we shouldn't default to pulling secrets and we should probably (as best we can) document with managed identity first.
|
||
We have to be _very_ careful about support for KeyVault secrets (or certs, keys, etc), as the whole point of KeyVault is as a secure place to store your | ||
secrets. | ||
If you're instead creating those secrets via the operator then you have by definition also located the secret in Kubernetes, which somewhat defeats the purpose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Do we then create a KeyVault operator to essentially do the role of the secret store CSI driver, or is there anything else we can add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what the right story is here honestly. It kinda feels like, if you want keyvault for security reasons, then you by definition do not want your secrets in Kubernetes and so no Kubernetes based solution for storing (or creating) the secrets can work for you.
If you want KeyVault because Azure "makes" you for some case or another, then you might not care and an ASO KeyVault Key resource that takes a k8s Secret
as input might make sense for that case. We'd need to be sure that case was common enough that we care about it though, and I am not 100% sure it is.
Note: This doesn't stop us from putting the secrets we get from Azure into KeyVault (which this proposal suggests support for). That's fine because we can bypass Kubernetes secrets entirely and then the user could use the KeyVault CSI driver to inject those same secrets that ASO created in KeyVault (via ListKeys
on storage for example) into their pod. This means we would compose well with CSI driver.
This is also very similar to what I would imagine that the app connector (meeting we had yesterday) would do in Kubernetes (if it supported Kubernetes) - which is why I was saying we'd really need to understand what the use case for it is, because if it's just "we make secrets in KeyVault and then the user can inject them with CSI driver" ASO can (basically) already do that in a k8s native way without any need for a special Azure resource or anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushing partial review in preparation for discussion.
docs/hugo/content/design/secrets.md
Outdated
# Other spec fields elided... | ||
forOperator: | ||
secrets: | ||
primaryKeyDestination: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be a list with names rather than a map, for better compliance with the k8s guidelines? I guess we still have a lot of maps that we inherit from ARM, but it's probably worth not making it worse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intent at least was that it is an object, not an open ended map.
99c39cc
to
137cb2c
Compare
137cb2c
to
797e5b9
Compare
797e5b9
to
56d178c
Compare
56d178c
to
abd02e0
Compare
abd02e0
to
751a824
Compare
/ok-to-test sha=751a824 |
751a824
to
130f792
Compare
/ok-to-test sha=130f792 |
This is related to #1471.