I am trying to set up Vault as a CA. I am trying to configure it such that a user can request certificates, but can only get certificates for their own name. As I understand the PKI engine supports templating for Allowed Domains. I have tried using {{identity.entity.metadata.username}} as the template, but so far it seems that despite the “Allow templates in allowed domains” flag being set, Vault does not seem to evaluate the template. (I have also set the template flag and template for the allowed SAN)
If I try to generate a certificate for a user, I get an error. When I try the literal string ’ {{identity.entity.metadata.username}} ’ it happily signs it.
Am I doing something wrong or should I report this as a bug?
The certificate was issued as expected. Moreover, a certificate for {{identity.entity.metadata.username}} literally, was rejected, as it should be, when allowed_domains_template is turned on.