ExamGecko
Home Home / HashiCorp / Vault Associate 002

HashiCorp Vault Associate 002 Practice Test - Questions Answers, Page 6

Question list
Search
Search

Running the second command in the GUI CLI will succeed.

A.
True
A.
True
Answers
B.
False
B.
False
Answers
Suggested answer: B

Explanation:

Running the second command in the GUI CLI will fail. The second command is vault kv put secret/creds passcode=my-long-passcode. This command attempts to write a secret named creds with the value passcode=my-long-passcode to the secret path, which is the default path for the kv secrets engine. However, the kv secrets engine is not enabled at the secret path, as shown by the first command vault secrets list, which lists the enabled secrets engines and their paths. The only enabled secrets engine is the transit secrets engine at the transit path. Therefore, the second command will fail with an error message saying that no secrets engine is mounted at the path secret/. To make the second command succeed, the kv secrets engine must be enabled at the secret path or another path, using the vault secrets enable command. For example, vault secrets enable -path=secret kv would enable the kv secrets engine at the secret path.Reference:kv - Command | Vault | HashiCorp Developer,vault secrets enable - Command | Vault | HashiCorp Developer


Use this screenshot to answer the question below:

When are you shown these options in the GUI?

A.
Enabling policies
A.
Enabling policies
Answers
B.
Enabling authentication engines
B.
Enabling authentication engines
Answers
C.
Enabling secret engines
C.
Enabling secret engines
Answers
D.
Enabling authentication methods
D.
Enabling authentication methods
Answers
Suggested answer: D

Explanation:

This screenshot is shown when you are enabling authentication methods in the GUI. Authentication methods are the ways users and applications authenticate with Vault. Vault supports many different authentication methods, including username and password, GitHub, and more. You can enable one or more authentication methods from the grid of options, which are divided into three categories: Generic, Cloud, and Infra. Each option has a name, a description, and a logo. You can also enable authentication methods using the Vault CLI or API.

Enabling policies, authentication engines, and secret engines are different tasks that are not related to this screenshot. Policies are rules that govern the access to Vault resources, such as secrets, authentication methods, and audit devices. Authentication engines are components of Vault that perform authentication and assign policies to authenticated entities. Secret engines are components of Vault that store, generate, or encrypt data. These tasks have different GUI pages and options than the screenshot.

[Authentication | Vault | HashiCorp Developer]

[Policies | Vault | HashiCorp Developer]

[Authentication | Vault | HashiCorp Developer]

[Secrets Engines | Vault | HashiCorp Developer]

Examine the command below. Output has been trimmed.

Which of the following statements describe the command and its output?

A.
Missing a default token policy
A.
Missing a default token policy
Answers
B.
Generated token's TTL is 60 hours
B.
Generated token's TTL is 60 hours
Answers
C.
Generated token is an orphan token which can be renewed indefinitely
C.
Generated token is an orphan token which can be renewed indefinitely
Answers
D.
Configures the AppRole auth method with user specified role ID and secret ID
D.
Configures the AppRole auth method with user specified role ID and secret ID
Answers
Suggested answer: B, C

Explanation:

The command shown in the image is:

vault token create -policy=approle -orphan -period=60h

This command creates a new token with the following characteristics:

It has the policy ''approle'' attached to it, which grants or denies access to certain paths and operations in Vault according to the policy rules.The policy can be defined by using the vault policy write command or the sys/policy API endpoint12.

It is an orphan token, which means it has no parent token and it will not be revoked when its parent token is revoked.Orphan tokens can be useful for creating long-lived tokens that are not affected by the token hierarchy3.

It has a period of 60 hours, which means it has a renewable TTL of 60 hours. This means that the token can be renewed indefinitely as long as it does not go past the 60-hour mark from the last renewal time. The token's TTL will be reset to 60 hours upon each renewal.Periodic tokens are useful for creating tokens that have a fixed lifetime and can be easily revoked4.

The key/value v2 secrets engine is enabled at secret/ See the following policy:

Which of the following operations are permitted by this policy? Choose two correct answers.

A.
vault kv get secret/webapp1
A.
vault kv get secret/webapp1
Answers
B.
vault kv put secret/webapp1 apikey-'ABCDEFGHI] K123M'
B.
vault kv put secret/webapp1 apikey-'ABCDEFGHI] K123M'
Answers
C.
vault kv metadata get secret/webapp1
C.
vault kv metadata get secret/webapp1
Answers
D.
vault kv delete secret/super-secret
D.
vault kv delete secret/super-secret
Answers
E.
vault kv list secret/super-secret
E.
vault kv list secret/super-secret
Answers
Suggested answer: A, C

Explanation:

The policy shown in the image is:

path ''secret/data/webapp1'' { capabilities = [''create'', ''read'', ''update'', ''delete'', ''list''] }

path ''secret/data/super-secret'' { capabilities = [''deny''] }

This policy grants or denies access to the key/value v2 secrets engine mounted at secret/ according to the following rules:

The path ''secret/data/webapp1'' has the capabilities of ''create'', ''read'', ''update'', ''delete'', and ''list''. This means that the policy allows performing any of these operations on the secrets stored under this path.The data/ prefix is used to access the actual secret data in the key/value v2 secrets engine5.Therefore, the policy permits the operation of vault kv get secret/webapp1, which reads the secret data at secret/data/webapp16.

The path ''secret/data/super-secret'' has the capability of ''deny''. This means that the policy denies performing any operation on the secrets stored under this path. The policy overrides any other policy that might grant access to this path.Therefore, the policy does not permit the operations of vault kv delete secret/super-secret and vault kv list secret/super-secret, which delete and list the secret data at secret/data/super-secret respectively6.

The policy does not explicitly define any rules for the path ''secret/metadata''.The metadata/ prefix is used to access the metadata of the secrets in the key/value v2 secrets engine, such as the number of versions, the deletion status, the creation time, etc5.By default, if the policy grants any of the capabilities of ''create'', ''read'', ''update'', or ''delete'' on the data/ path, it also grants the same capabilities on the corresponding metadata/ path7.Therefore, the policy permits the operation of vault kv metadata get secret/webapp1, which reads the metadata of the secret at secret/metadata/webapp18.

You are performing a high number of authentications in a short amount of time. You're experiencing slow throughput for token generation. How would you solve this problem?

A.
Increase the time-to-live on service tokens
A.
Increase the time-to-live on service tokens
Answers
B.
Implement batch tokens
B.
Implement batch tokens
Answers
C.
Establish a rate limit quota
C.
Establish a rate limit quota
Answers
D.
Reduce the number of policies attached to the tokens
D.
Reduce the number of policies attached to the tokens
Answers
Suggested answer: B

Explanation:

Batch tokens are a type of tokens that are not persisted in Vault's storage backend, but are encrypted blobs that carry enough information to perform Vault actions. Batch tokens are extremely lightweight and scalable, and can improve the throughput for token generation. Batch tokens are suitable for high-volume and ephemeral workloads, such as containers or serverless functions, that require short-lived and non-renewable tokens. Batch tokens can be created by using the -type=batch flag in the vault token create command, or by configuring the token_type parameter in the auth method's role or mount options. Batch tokens have some limitations compared to service tokens, such as the lack of renewal, revocation, listing, accessor, and cubbyhole features.Therefore, batch tokens should be used with caution and only when the trade-offs are acceptable.Reference: https://developer.hashicorp.com/vault/tutorials/tokens/batch-tokens1, https://developer.hashicorp.com/vault/docs/commands/token/create2, https://developer.hashicorp.com/vault/docs/concepts/tokens#token-types3

When looking at Vault token details, which key helps you find the paths the token is able to access?

A.
Meta
A.
Meta
Answers
B.
Path
B.
Path
Answers
C.
Policies
C.
Policies
Answers
D.
Accessor
D.
Accessor
Answers
Suggested answer: C

Explanation:

When looking at Vault token details, the policies key helps you find the paths the token is able to access. Policies are a declarative way to grant or forbid access to certain paths and operations in Vault. Policies are written in HCL or JSON and are attached to tokens by name. Policies are deny by default, so an empty policy grants no permission in the system. A token can have one or more policies associated with it, and the effective policy is the union of all the individual policies. You can view the token details by using the vault token lookup command or the auth/token/lookup API endpoint. The output will show the policies key with a list of policy names that are attached to the token. You can also view the contents of a policy by using the vault policy read command or the sys/policy API endpoint. The output will show the rules key with the HCL or JSON representation of the policy.The rules will specify the paths and the capabilities (such as create, read, update, delete, list, etc.) that the policy allows or denies.Reference: https://developer.hashicorp.com/vault/docs/concepts/policies4, https://developer.hashicorp.com/vault/docs/commands/token/lookup5, https://developer.hashicorp.com/vault/api-docs/auth/token#lookup-a-token6, https://developer.hashicorp.com/vault/docs/commands/policy/read7, https://developer.hashicorp.com/vault/api-docs/system/policy8

A developer mistakenly committed code that contained AWS S3 credentials into a public repository. You have been tasked with revoking the AWS S3 credential that was in the code. This credential was created using Vault's AWS secrets engine and the developer received the following output when requesting a credential from Vault.

Which Vault command will revoke the lease and remove the credential from AWS?

A.
vault lease revoke aws/creds/s3-access/f3e92392-7d9c-99c8-c921-57Sd62fe89d8
A.
vault lease revoke aws/creds/s3-access/f3e92392-7d9c-99c8-c921-57Sd62fe89d8
Answers
B.
vault lease revoke AKIAI0WQXTLW36DV7IEA
B.
vault lease revoke AKIAI0WQXTLW36DV7IEA
Answers
C.
vault lease revoke f3e92392-7d9c-O9c8-c921-575d62fe80d8
C.
vault lease revoke f3e92392-7d9c-O9c8-c921-575d62fe80d8
Answers
D.
vault lease revoke access_key-AKIAI0WQXTLW36DV7IEA
D.
vault lease revoke access_key-AKIAI0WQXTLW36DV7IEA
Answers
Suggested answer: A

Explanation:

The correct answer is A because the lease ID is the unique identifier for the credential. The lease ID is used to revoke the credential using the vault lease revoke command. This command will invalidate the credential immediately and prevent any further renewals.It will also delete the access key and secret key from AWS, rendering them useless1. The access key and secret key are not sufficient to revoke the credential, as they are not recognized by Vault. The lease ID is composed of the path of the secrets engine, the role name, and a random UUID. In this case, the path is aws/creds, the role name is s3-access, and the UUID is f3e92392-7d9c-99c8-c921-57Sd62fe89d8.

lease revoke - Command | Vault | HashiCorp Developer

Total 57 questions
Go to page: of 6