-
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
ssh secrets engine identity templating for allowed_domains #10943
Comments
Hi @nvx ! Thanks for submitting this issue! We discussed this internally, and this is certainly a change that seems valid to us. I think implementing this along the lines of how |
Sounds good. I'm going to focus on updating PR #7277 first, but once that's merged I'll definitely move on to this one next! |
sounds great, and thanks!! :) |
Hello, Many thanks, |
Hi guys, I looked at this issue, and it turns out this is already possible to due a feature/bug. Essentially enabling In the coming days, I will push a PR that adds the |
…s_template field in SSH role configuration, closes hashicorp#10943
…for SSH role (hashicorp#16056) * impr(ssh): fix bug with allowed_users_template and add allowed_domains_template field in SSH role configuration, closes hashicorp#10943 * chore: add changelog entry
Is your feature request related to a problem? Please describe.
The PKI secrets engine allows identity templating in the
allowed_domains
, and the SSH secrets engine allows identity for theallowed_users
field. Unfortunately the SSH secrets engine does not allow identity templating for theallowed_domains
field yet.The use case for this is similar to the existing PKI
allowed_domains
templating, or SSH secrets engineallowed_users
templating to allow a generic role to fill data from auth identity information.Describe the solution you'd like
Allowing identity templating in the SSH secrets engine
allowed_domains
field. This should be disabled by default with a new flagallowed_domains_template
on the SSH role to enable this behaviour. This matches the behaviour and naming of the existing functionality in PKI and SSH secrets engines.This should also allow partial matching, eg
allowed_domains = "{{ identity.entity.name }}.example.com"
(related to #10388)Describe alternatives you've considered
Creating a role or policy for every system can be used instead, but this requires more configuration and increases the likelihood of human error and increases management overhead so is a less than ideal solution.
Explain any additional use-cases
A system can have the hostname in identity information (eg, an AppRole auth secret_id could be created with metadata including the hostname). This can allow policies to enable that system to obtain a signed SSH server certificate automatically. This is analogous to an existing use-case that is already met with the PKI secrets engine allowing a host to obtain certificates for its hostname.
Additional context
SSH secrets engine create role docs: https://www.vaultproject.io/api/secret/ssh#create-role
PKI secrets engine create role docs: https://www.vaultproject.io/api-docs/secret/pki#create-update-role
The text was updated successfully, but these errors were encountered: