Use this screenshot to answer the question below:
When are you shown these options in the GUI?
Enabling policies
Enabling authentication engines
Enabling secret engines
Enabling authentication methods
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.
References:
An organization wants to authenticate an AWS EC2 virtual machine with Vault to access a dynamic database secret. The only authentication method which they can use in this case is AWS.
True
False
The statement is false. An organization can authenticate an AWS EC2 virtual machine with Vault to access a dynamic database secret using more than one authentication method. The AWS auth method is one of the options, but not the only one. The AWS auth method supports two types of authentication: ec2 and iam. The ec2 type uses the signed EC2 instance identity document to authenticate the EC2 instance. The iam type uses the AWS Signature v4 algorithm to sign a request to the sts:GetCallerIdentity API and authenticate the IAM principal. However, the organization can also use other auth methods that are compatible with EC2 instances, suchas AppRole, JWT/OIDC, or Kubernetes. These methods require the EC2 instance to have some sort of identity material, such as a role ID, a secret ID, a JWT token, or a service account token, that can be used to authenticate to Vault. The identity material can be provisioned to the EC2 instance using various mechanisms, such as user data, metadata service, or cloud-init scripts. The choice of the auth method depends on the use case, the security requirements, and the trade-offs between convenience and control. References: AWS - Auth Methods | Vault | HashiCorp Developer, AppRole - Auth Methods | Vault | HashiCorp Developer, JWT/OIDC - Auth Methods | Vault | HashiCorp Developer, Kubernetes - Auth Methods | Vault | HashiCorp Developer
What command creates a secret with the key "my-password" and the value "53cr3t" at path "my-secrets" within the KV secrets engine mounted at "secret"?
vault kv put secret/my-secrets/my-password 53cr3t
vault kv write secret/my-secrets/my-password 53cr3t
vault kv write 53cr3t my-secrets/my-password
vault kv put secret/my-secrets »y-password-53cr3t
The vault kv put command writes the data to the given path in the K/V secrets engine. The command requires the mount path of the K/V secrets engine, the secret path, and the key-value pair to store. The mount path can be specified with the -mount flag or as part of the secret path. The key-value pair can be given as an argument or read from a file or stdin. The correct syntax for the command is:
vault kv put -mount=secret my-secrets/my-password 53cr3t
or
vault kv put secret/my-secrets my-password=53cr3t
The other options are incorrect because they use the deprecated vault kv write command, or they have the wrong order or format of the arguments. References: https://developer.hashicorp.com/vault/docs/commands/kv/put 3, https://developer.hashicorp.com/vault/docs/commands/kv 4
An authentication method should be selected for a use case based on:
The auth method that best establishes the identity of the client
The cloud provider for which the client is located on
The strongest available cryptographic hash for the use case
Compatibility with the secret engine which is to be used
An authentication method should be selected for a use case based on the auth method that best establishes the identity of the client. The identity of the client is the basis for assigning a set of policies and permissions to the client in Vault. Different auth methods have different ways of verifying the identity of the client, such as using passwords, tokens, certificates, cloud credentials, etc. Depending on the use case, some auth methods may be more suitable or convenient than others. For example, for human users, the userpass or ldap auth methods may be easy to use, while for machines or applications, the approle or aws auth methods may be more secure and scalable. The choice of the auth method should also consider the trade-offs between security, performance, and usability. References: Auth Methods | Vault | HashiCorp Developer, Authentication - Concepts | Vault | HashiCorp Developer
What is a benefit of response wrapping?
Log every use of a secret
Load balanc secret generation across a Vault cluster
Provide error recovery to a secret so it is not corrupted in transit
Ensure that only a single party can ever unwrap the token and see what's inside
Response wrapping is a feature that allows Vault to take the response it would have sent to a client and instead insert it into the cubbyhole of a single-use token, returning that token instead. The client can then unwrap the token and retrieve the original response. Response wrapping has several benefits, such as providing cover, malfeasance detection, and lifetime limitation for the secret data. One of the benefits is to ensure that only a single party can ever unwrap the token and see what’s inside, as the token can be used only once and cannot be unwrapped by anyone else, even the root user or the creator of the token. This provides a way to securely distribute secrets to the intended recipients and detect any tampering or interception along the way5.
The other options are not benefits of response wrapping:
References: 5(https://developer.hashicorp.com/vault/docs/concepts/response-wrapping), 6(https://developer.hashicorp.com/vault/docs/secrets), 7(https://developer.hashicorp.com/vault/docs/secrets), (https://developer.hashicorp.com/vault/tutorials/secrets-management/cubbyhole-response-wrapping)
Which of the following statements are true about Vault policies? Choose two correct answers.
The default policy can not be modified
You must use YAML to define policies
Policies provide a declarative way to grant or forbid access to certain paths and operations in Vault
Vault must be restarted in order for a policy change to take an effect
Policies deny by default (empty policy grants no permission)
Vault policies are written in HCL or JSON format and are attached to tokens or roles by name. Policies define the permissions and restrictions for accessing and performing operations on certain paths and secrets in Vault. Policies are deny by default, which means that an empty policy grants no permission in the system, and any request that is not explicitly allowed by a policy is implicitly denied1. Some of the features and benefits of Vault policies are:
The default policy is a built-in policy that is attached to all tokens by default and cannot be deleted. However, the default policy can be modified by using the vault policy write command or the sys/policy API endpoint. The default policy provides common permissions for tokens, such as renewing themselves, looking up their own information, creating and managing response-wrapping tokens, etc7.
You do not have to use YAML to define policies, as Vault supports both HCL and JSON formats. HCL is a human-friendly configuration language that is also JSON compatible, which means that JSON can be used as a valid input for policies as well8.
Vault does not need to be restarted in order for a policy change to take effect, as policies are stored and evaluated in memory. Any change to a policy is immediately reflected in the system, and any token or role that has that policy attached will be affected by the change.
References: 1(https://developer.hashicorp.com/vault/docs/concepts/policies), 2(https://developer.hashicorp.com/vault/docs/concepts/policies), 3(https://developer.hashicorp.com/vault/docs/concepts/policies), 4(https://developer.hashicorp.com/vault/docs/concepts/policies), 5(https://developer.hashicorp.com/vault/docs/concepts/policies), 6(https://developer.hashicorp.com/vault/docs/commands/lease), 7(https://developer.hashicorp.com/vault/docs/concepts/policies), 8(https://developer.hashicorp.com/vault/docs/concepts/policies), (https://developer.hashicorp.com/vault/docs/concepts/policies#policy-updates)
Which of these are a benefit of using the Vault Agent?
Vault Agent allows for centralized configuration of application secrets engines
Vault Agent will auto-discover which authentication mechanism to use
Vault Agent will enforce minimum levels of encryption an application can use
Vault Agent will manage the lifecycle of cached tokens and leases automatically
Vault Agent is a client daemon that provides the following features:
One of the benefits of using the Vault Agent is that it will manage the lifecycle of cached tokens and leases automatically. This means that the agent will handle the token renewal and revocation logic, as well as the lease renewal and revocation logic for the secrets that are cached by the agent. This reduces the burden on the application developers and operators, and ensures that the tokens and secrets are always valid and up-to-date. References: Vault Agent | Vault | HashiCorp Developer, Caching - Vault Agent | Vault | HashiCorp Developer
Which of the following is a machine-oriented Vault authentication backend?
Okta
AppRole
Transit
GitHub
AppRole is a machine-oriented authentication method that allows machines or applications to authenticate with Vault using a role ID and a secret ID. The role ID is aunique identifier for the application, and the secret ID is a single-use credential that can be delivered to the application securely. AppRole is designed to provide secure introduction of machines and applications to Vault, and to support the principle of least privilege by allowing fine-grained access control policies to be attached to each role1.
Okta, GitHub, and Transit are not machine-oriented authentication methods. Okta and GitHub are user-oriented authentication methods that allow users to authenticate with Vault using their Okta or GitHub credentials23. Transit is not an authentication method at all, but a secrets engine that provides encryption as a service4.
References:
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?
Increase the time-to-live on service tokens
Implement batch tokens
Establish a rate limit quota
Reduce the number of policies attached to the tokens
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. References: https://developer.hashicorp.com/vault/tutorials/tokens/batch-tokens 1, https://developer.hashicorp.com/vault/docs/commands/token/create 2, https://developer.hashicorp.com/vault/docs/concepts/tokens#token-types 3
What are orphan tokens?
Orphan tokens are tokens with a use limit so you can set the number of uses when you create them
Orphan tokens are not children of their parent; therefore, orphan tokens do not expire when their parent does
Orphan tokens are tokens with no policies attached
Orphan tokens do not expire when their own max TTL is reached
Orphan tokens are tokens that are root of their own token tree. This means that they do not have any parent token associated with them, and they do not expire when their parent token expires. Orphan tokens are useful for scenarios where you need a short-lived and independent token, such as for testing or debugging purposes. Orphan tokens can also be used to create temporary access tokens for applications or services that need to communicate with Vault without using a long-lived root token. References: Tokens | Vault | HashiCorp Developer, Vault cli: how to create orphan token with role - HashiCorp Discuss
When creating a policy, an error was thrown:
Which statement describes the fix for this issue?
Replace write with create in the capabilities list
You cannot have a wildcard (" • ") in the path
sudo is not a capability
The error was thrown because the policy code contains an invalid capability, “write”. The valid capabilities for a policy are “create”, “read”, “update”, “delete”, “list”, and “sudo”. The “write” capability is not recognized by Vault and should be replaced with “create”, which allows creating new secrets or overwriting existing ones. The other statements are not correct, because the wildcard (*) and the sudo capability are both valid in a policy. The wildcard matches any number of characters within a path segment, and the sudo capability allows performing certain operations that require root privileges.
References:
When unsealing Vault, each Shamir unseal key should be entered:
Sequentially from one system that all of the administrators are in front of
By different administrators each connecting from different computers
While encrypted with each administrators PGP key
At the command line in one single command
When unsealing Vault, each Shamir unseal key should be entered by different administrators each connecting from different computers. This is because the Shamir unseal keys are split into shares that are distributed to trusted operators, and no single operator should have access to more than one share. This way, the unseal process requires the cooperation of a quorum of key holders, and enhances the security and availability of Vault. The unseal keys can be entered via multiple mechanisms from multiple client machines, and the process is stateful. The order of the keys does not matter, as long as the threshold number of keys is reached. The unseal keys should not be entered at the command line in one single command, as this would expose them to the history and compromise the security. The unseal keys should not be encrypted with each administrator’s PGP key, as this would prevent Vault from decrypting them and reconstructing the master key. References: https://developer.hashicorp.com/vault/docs/concepts/seal 3, https://developer.hashicorp.com/vault/docs/commands/operator/unseal
When an auth method is disabled all users authenticated via that method lose access.
True
False
The statement is true. When an auth method is disabled, all users authenticated via that method lose access. This is because the tokens issued by the auth method are automatically revoked when the auth method is disabled. This prevents the users from performing any operation in Vault using the revoked tokens. To regain access, the users have to authenticate again using a different auth method that is enabled and has the appropriate policies attached. References: Auth Methods | Vault | HashiCorp Developer, auth disable - Command | Vault | HashiCorp Developer
Which of the following statements describe the CLI command below?
S vault login -method-1dap username-mitche11h
Generates a token which is response wrapped
You will be prompted to enter the password
By default the generated token is valid for 24 hours
Fails because the password is not provided
The CLI command vault login -method ldap username=mitchellh generates a token that is response wrapped. This means that the token contains a base64-encoded response wrapper, which is a JSON object that contains information about the token, such as its policies, metadata, and expiration time. The response wrapper is used to verify the authenticity and integrity of the token, and to prevent replay attacks. The response wrapper also allows Vault to automatically renew the token when it expires, or to revoke it if it is compromised. The -method ldap option specifies that the authentication method is LDAP, which requires a username andpassword to be provided. The username mitchellh is an example of an LDAP user name, and the password will be hidden when entered. References: Vault CLI Reference | Vault | HashiCorp Developer, Vault CLI Reference | Vault | HashiCorp Developer
The following three policies exist in Vault. What do these policies allow an organization to do?
Separates permissions allowed on actions associated with the transit secret engine
Nothing, as the minimum permissions to perform useful tasks are not present
Encrypt, decrypt, and rewrap data using the transit engine all in one policy
Create a transit encryption key for encrypting, decrypting, and rewrapping encrypted data
The three policies that exist in Vault are:
These policies allow an organization to perform useful tasks such as:
Security requirements demand that no secrets appear in the shell history. Which command does not meet this requirement?
generate-password | vault kv put secret/password value
vault kv put secret/password value-itsasecret
vault kv put secret/password value=@data.txt
vault kv put secret/password value-SSECRET_VALUE
The command that does not meet the security requirement of not having secrets appear in the shell history is B. vault kv put secret/password value-itsasecret. This command would store the secret value “itsasecret” in the key/value secrets engine at the path secret/password, but it would also expose the secret value in the shell history, which could be accessed by other users or malicious actors. This is not a secure way of storing secrets in Vault.
The other commands are more secure ways of storing secrets in Vault without revealing them in the shell history. A. generate-password | vault kv put secret/password value would use a pipe to pass the output of the generate-password command, which could be a script or a tool that generates a random password, to the vault kv put command, which would store the password in the key/value secrets engine at the pathsecret/password. The password would not be visible in the shell history, only the commands. C. vault kv put secret/password value=@data.txt would use the @ syntax to read the secret value from a file named data.txt, which could be encrypted or protected by file permissions, and store it in the key/value secrets engine at the path secret/password. The file name would be visible in the shell history, but not the secret value. D. vault kv put secret/password value-SSECRET_VALUE would use the -S syntax to read the secret value from the environment variable SECRET_VALUE, which could be set and unset in the shell session, and store it in the key/value secrets engine at the path secret/password. The environment variable name would be visible in the shell history, but not the secret value.
References:
Which of the following are replication methods available in Vault Enterprise? Choose two correct answers.
Cluster sharding
Namespaces
Performance Replication
Disaster Recovery Replication
The replication methods available in Vault Enterprise are performance replication and disaster recovery replication. These methods allow critical data to be replicated across clusters to support horizontally scaling and disaster recovery workloads.
Copyright © 2014-2024 Certensure. All Rights Reserved