You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Policy names in general work in a case-insensitive way. However, when you try to read a specific policy name that you've created with Capital Letters, nothing is returned. This contradicts Vault's normal behavior which is to just automatically translate it into the lower-case version.
Example:
// Write a policy with Capital Letters in the name
$ vault policy-write CapPolicy policy.hcl
Policy 'CapPolicy' written.
// List policies and the new policy shows up converted into lowercase
$ vault policies
cappolicy
default
root
// Create a new token using any mixture of CAPS and lowercase and it will translate into the lowercase version of the policy
$ vault token-create -policy=CapPolicy
Key Value
--- -----
token 4316f873-bb06-f1bd-6b3a-ee4e148f7f09
token_accessor 643b78bb-1866-6520-7d2a-40f44bd69d65
token_duration 768h0m0s
token_renewable true
token_policies [cappolicy default]
// Bug: Try listing the policy by name using the Capitalized version and nothing is returned (doesn't map back to lowercase version as it did for other Vault commands)
$ vault policies CapPolicy
<blank output>
Previously we lowercased names on ingress but not on lookup or delete
which could cause unexpected results. Now, just unilaterally lowercase
policy names on write and delete. On get, to avoid the performance hit
of always lowercasing when not necessary since it's in the critical
path, we have a minor optimization -- we check the LRU first before
normalizing. For tokens, because they're already normalized when adding
policies during creation, this should always work; it might just be
slower for API calls.
Fixes#3187
Previously we lowercased names on ingress but not on lookup or delete
which could cause unexpected results. Now, just unilaterally lowercase
policy names on write and delete. On get, to avoid the performance hit
of always lowercasing when not necessary since it's in the critical
path, we have a minor optimization -- we check the LRU first before
normalizing. For tokens, because they're already normalized when adding
policies during creation, this should always work; it might just be
slower for API calls.
Fixes#3187
Policy names in general work in a case-insensitive way. However, when you try to read a specific policy name that you've created with Capital Letters, nothing is returned. This contradicts Vault's normal behavior which is to just automatically translate it into the lower-case version.
Example:
Environment:
Vault Config File:
cluster_name = "vaultron"
storage "consul" {
address = "172.17.0.5:8500"
path = "vault/"
disable_clustering = "false"
service_tags = "vaultron"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = "1"
}
The text was updated successfully, but these errors were encountered: