Proposal: Support secret refs to decouple secret/provider definition and use
#509
brian-dlee
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
I don't think I like this design but I understand the problem |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Proposal
I really like
fnoxand the combination withmise. Coming fromasdfanddirenv, I'm finding elegant solutions for many issues I've experienced over the few years of using these tools. As I dug intofnox, I found myself looking for one feature that is yet to exist, a way to defining the parameters of a secret without forcing that secret to be active. I'm calling thisrefs.Background / How I use
fnoxWhen I started reading up on
fnox, it read like a great tool that allowed me to declare that a certain project requires a key to run effectively. In my world, this is often in Pulumi apps for projects. If my project maintains a Temporal resource then I need to communicate to the team thatTEMPORAL_CLOUD_API_KEYmust be defined for this project forpulumi upto work. The pattern I wanted was to publish documentation or a simple shell tool to tell my infrastructure team about the relevant administrative tokens/keys they would need to deploy different services. They could use the mechanism that works for them (fnoxhas great provider support) and when they enter a directory or usefnox execthe environment is properly hydrated automatically due to anfnox.tomlfile committed to the project. Most of this works excellent and appears to match the vision. And theif_missingbehavior matches my need very well to grant surface missing credentials early.Issues
The issue I've found is that when a developer runs
fnox set(the most convenient and intuitive way to define a missing value) it wants to edit thefnox.tomlfile. I tried stubbing the thefnox.tomlfiles withSECRET = {}. I was hoping this would work fulfill my need but when a user runsfnox setorfnox listit still wants to change the secret config in the file andfnox listdoesn't offer great details on where the secret is coming from if it is set because it is influenced by the empty brackets in the local file. I'm afraid of thesefnox.tomlfile modifications will cause churn and confusion as engineers configure their systems.Secondly, if I define secrets globally I can set them once and kind of reference them in projects using the stub format I mentioned previously but when I do that they are active and I risk them being available in cases where I may not want them which increases the chance of leaking them through arbitrary servers, running agent harnesses or any other execution in the directory space that inherits the secrets.
Proposal
My
refsproposal grants me the ability to define/declare the secrets once and then separately define when they should be active. It also allows me to separate the provider configuration and other parameters from the secret usage. Connecting this tofnox setandfnox listwould allowfnoxto follow the parameters back to how I've defined them and indicate their status without me having put any of that information in the projectfnox.tomlfile.Global config
Workspace config
Project config
This system makes my
fnox.tomlfiles stable. I can commit them and each engineer can choose to configure them in a waythat works for them and their machine.
In my vision for this feature,
fnox setandfnox listwould follow therefback to the original definition as if it were inlinehere. In my example,
fnox set TEMPORAL_CLOUD_API_KEY ...from the project would attempt to set the 1Passwordfield
op://Private/temporal_cloud_api_key/password. Similarly,fnox listwouldn't show a genericstored value, but insteadit would actually show where the value is sourced as it it were inlined.
Related discussions
I briefly looked through other discussions. I think this proposal could be an elegant solution to a couple discussions or work well with
them: #163 and #146. It contains some similar ideas to #85 and perhaps could help it along.
Honestly, I think it's a bit strange to propose a feature/change at such a core/fundamental area of the tool. I understand there is a
guiding vision I'm unaware of and I have no way of knowing if it conflicts or fits nicely. To me, it seems like a home run but that's
only from my narrow view. Any feedback would be greatly appreciated! I'm going to test my idea a bit in a private fork of the tool.
All reactions