HCVA0-003 practice question 34 of 35
What command would have created the token displayed below? $ vault token lookup hvs.nNeZ2I64ALCxuO7dqQEJGPrO Key: policies Value: [default dev]…
Full set: 285 questionsThe vault token lookup output displays three key attributes: policies: [default dev], numuses: 5, and creationttl: 768h. The command in option A, vault token create -policy=dev -use-limit=5, correctly generates a token with these properties.
1. Policies: The -policy=dev flag adds the dev policy. By default, Vault also attaches the default policy to all new tokens unless explicitly suppressed, matching the output.
2. Use Limit: The -use-limit=5 flag sets the token's number of uses to 5, matching numuses: 5.
3. TTL: The command does not specify a TTL. In this case, Vault applies the system's default TTL, which is 768 hours (32 days), matching the creationttl value.
B. This command does not set the use limit. The resulting token would have numuses: 0 (unlimited), which contradicts the required value of 5.
C. This command also omits the use limit, resulting in an unlimited-use token (numuses: 0), which is incorrect.
D. This command fails to set the required use limit of 5. The resulting token would have unlimited uses, which does not match the lookup output.
1. HashiCorp Vault Official Documentation, "Create a token - Command Options": The documentation for the vault token create command specifies the -policy and -use-limit flags. It also describes the -no-default-policy flag, which confirms that the default policy is attached automatically if the flag is not used.
Source: HashiCorp, "Vault CLI: token create", developer.hashicorp.com/vault/docs/commands/token/create. Accessed November 2023.
2. HashiCorp Vault Official Documentation, "Tokens - Token Policies": This document states, "By default, tokens are created with the default policy attached." This supports the reasoning that -policy=dev results in a token with both default and dev policies.
Source: HashiCorp, "Vault Concepts: Tokens", developer.hashicorp.com/vault/docs/concepts/tokens#token-policies. Accessed November 2023.
3. HashiCorp Vault Official Documentation, "Token Auth Method (API)": This documentation specifies the default configuration for the token authentication backend. It states, "The default TTL for tokens created against this backend is 32 days." (768 hours). This confirms that omitting the -ttl flag results in the creationttl shown in the output.
Source: HashiCorp, "Token Auth Method (API)", developer.hashicorp.com/vault/api-docs/auth/token#create-token. Accessed November 2023.
Keep practicing
Take the free HCVA0-003 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other HCVA0-003 practice questions
- Question 1Which two characters can be used when writing a policy to reflect a wildcard or path segm…
- Question 2You have multiple Vault clusters in your environment, one for test and one for production…
- Question 3Short-lived, dynamically generated secrets provide organizations with many benefits. Sele…
- Question 4When Vault is sealed, which are the only two operations available to a Vault administrato…
- Question 6What is the default method of authentication after first initializing Vault?
- Question 7Which two interfaces automatically assume the token for subsequent requests after success…
