-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Vault Agent Auto-auth Certificate Method #6652
Vault Agent Auto-auth Certificate Method #6652
Conversation
…he certificates should be configured
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.
Thanks for the PR. Great work! Just a few minor comments.
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.
Thanks for the PR! The changes look great. I added one additional request. However, if you don't have time to do the change just let me know. I can still merge your PR and then make the change afterwards. Great work!
} | ||
|
||
if conf.Config != nil { | ||
nameRaw, ok := conf.Config["name"] |
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.
Can we change the configuration parameter, and any matching variables, from name
to role
for clarity? I know the parameter is "name" but the documentation clarifies that it is the name of the role.
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 understand that using role
over name
in the agent configuration would make all of the methods look the same. Unfortunately, the TLS Authentication backend is different when it comes to interacting with them via the api or the cli. Also, I couldn't find the use of role
as a variable name in the certificate authentication code either. The only references are in comments and the documentations about the concept of the Certificate Role. It feels most transparent to use the same name in both places as that would allow a curl test by hand and the agent configuration to look almost identical.
c := &certMethod{ | ||
logger: conf.Logger, | ||
mountPath: conf.MountPath, | ||
name: "", |
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 the zero value so it's not necessary to set it explicitly.
if conf.Config != nil { | ||
nameRaw, ok := conf.Config["name"] | ||
if !ok { | ||
nameRaw = "" |
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 a bit non-idiomatic; just do if ok
then do the conversion and setting in the if block.
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.
Looks good! A few minor things.
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.
Thanks!
Closes #5166 |
Did this get added to Vault agent docs and/or the Vault changelog? |
I just tried this, it doesn't seem to work: [root@gandalf ~]# ./vault agent -config minimal.hcl
Unknown auth method "cert"
[root@gandalf ~]# ./vault --version
Vault v1.1.3 ('9bc820f700f83a7c4bcab54c5323735a581b34eb')
[root@gandalf ~]# cat minimal.hcl
auto_auth {
sink "file" {
config = { path = "/tmp/vault"}
}
method "cert" {}
} edit: silly me, I assumed that 1.1.3 contained this which is not the case. Sorry for the noise! Plus, I think you incorrectly named the docs Markdown file, keeping it from showing up on the official docs. |
@infa-bsurber the docs are not showing up on the website. I will have a fix for it shortly. Tracking it in #7343. |
Looking to implement auto-auth for the certifiacte authentication method.
Should enable: #5166