I have started a vault server in dev mode.
started pki engine at pki and an intermediate pki ca at pki_int
I have created a role:
vault write -address=“http://0.0.0.0:8200” pki_int/roles/acc1234_tenant3456_pog allowed_domains=www.vaultclient.com cn_validations=hostname enforce_hostnames=false allow_localhost=false allow_ip_sans=false
Reading it back:
/ # vault read pki_int/roles/acc1234_tenant3456_pog
Key Value
allow_any_name false
allow_bare_domains false
allow_glob_domains false
allow_ip_sans false
allow_localhost false
allow_subdomains false
allow_token_displayname false
allow_wildcard_certificates true
allowed_domains [www.vaultclient.com]
allowed_domains_template false
allowed_other_sans
allowed_serial_numbers
allowed_uri_sans
allowed_uri_sans_template false
basic_constraints_valid_for_non_ca false
client_flag true
cn_validations [hostname]
code_signing_flag false
country
email_protection_flag false
enforce_hostnames false
ext_key_usage
ext_key_usage_oids
generate_lease false
issuer_ref default
key_bits 2048
key_type rsa
key_usage [DigitalSignature KeyAgreement KeyEncipherment]
locality
max_ttl 0s
no_store false
not_after n/a
not_before_duration 30s
organization
ou
policy_identifiers
postal_code
province
require_cn true
server_flag true
signature_bits 256
street_address
ttl 0s
use_csr_common_name true
use_csr_sans true
use_pss false
But cannot generate certificate :
vault write -address=“http://0.0.0.0:8200” pki_int/issue/acc1234_tenant3456_pog common_name=www.vaultclient.com
Error writing data to pki_int/issue/acc1234_tenant3456_pog: Error making API request.
URL: PUT http://0.0.0.0:8200/v1/pki_int/issue/acc1234_tenant3456_pog
Code: 400. Errors:
- common name www.vaultclient.com not allowed by this role
/ # vault write -address=“http://0.0.0.0:8200” pki_int/issue/acc1234_tenant3456_pog common_name=vaultclient
Error writing data to pki_int/issue/acc1234_tenant3456_pog: Error making API request.
URL: PUT http://0.0.0.0:8200/v1/pki_int/issue/acc1234_tenant3456_pog
Code: 400. Errors:
- common name vaultclient not allowed by this role
I have tried every single thing I can think of. Disabling cn_validations, enabling them back, disabling localhost, disabling ip_sans, use vaultclient, www.vaultclient.com, vault-client as allowed_domains to test for different formats etc …
This is a very basic use case. Why is vault not able to pass “vaultclient” == “vaultclient” ? What am I doing wrong.