-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Global flag that outputs minimum policy HCL required for an operation #14899
Conversation
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.
This is awesome! Some notes/questions in a few areas. Resolving the sudo
permission is an interesting problem to solve!
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.
This is awesome! And works great. Thanks for the cc :) just a few suggestions, mainly focussed around the UX for errors/incorrect usage.
* Use precompiled regexes and move OpenAPI call to tests * Remove commented out code * Remove legacy MFA paths * Remove unnecessary use of client * Move sudo paths map to plugin helper * Remove unused error return * Add explanatory comment * Remove need to pass in address * Make {name} regex less greedy * Use method and path instead of info from retryablerequest * Add test for IsSudoPaths, use more idiomatic naming
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.
This is fantastic stuff, really nice work piecing all of this together!
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.
Great job, this will be an awesome feature! 👍
Implementation of an idea that was added to the KV path discrepancy discussions by @tomhjp !
This is implemented in the same way as
-output-curl-string
, except instead of producing a curl example, it produces an example of the minimum policy HCL needed to run that command.The "sudo" capability is determined by querying the OpenAPI spec endpoint for paths that have "x-vault-sudo" set to true.