312-97 practice question 22 of 35

(Gabriel Jarret has been working as a senior DevSecOps engineer in an IT company located in Houston, Texas. He is using Vault to manage secrets and…

Full set: 100 questions
(Gabriel Jarret has been working as a senior DevSecOps engineer in an IT company located in Houston, Texas. He is using Vault to manage secrets and protect sensitive dat a. On February 1, 2022, Gabriel wrote the secret using vault kv put secret/wejskt command. On February 10, 2022, his team detected a brute-force attack using Splunk monitoring tool. Gabriel would like to delete the secrets in the vault that he wrote on February 1, 2022. Which of the following commands should Gabriel use to delete a secret in Vault secret management tool?)
Answer options
A: vault kv -delete secret/wejskt.
B: vault kv del secret/wejskt.
C: vault kv -del secret/wejskt.
D: vault kv delete secret/wejskt. Correct answer
Correct Answer:
D. vault kv delete secret/wejskt.
Explanation

The correct command to delete a secret using the HashiCorp Vault Command Line Interface (CLI) for the Key-Value (KV) secrets engine is vault kv delete. The command structure requires the subcommand delete followed by the path to the secret. In this scenario, the path to the secret is secret/wejskt. Therefore, the full and accurate command Gabriel should use is vault kv delete secret/wejskt. The other options use incorrect syntax for the delete operation.

Why Incorrect

A. -delete is incorrect syntax. Command-line arguments are typically preceded by hyphens, but delete is a subcommand, not an argument or flag.
B. del is not the standard subcommand for deletion in the Vault CLI. The correct and fully documented subcommand is delete.
C. -del is incorrect syntax. It improperly combines a hyphen with a non-standard abbreviation for the delete subcommand.

References

1. HashiCorp Vault Official Documentation, "KV - Secrets Engines". The documentation for the delete command explicitly shows the syntax: vault kv delete [options] PATH. (Source: https://developer.hashicorp.com/vault/docs/commands/kv/delete, Command Syntax section).

2. HashiCorp Vault Official Documentation, "KV Version 2 - Secrets Engines". The examples provided for deleting secret versions also use the delete subcommand, such as vault kv delete secret/foo. (Source: https://developer.hashicorp.com/vault/docs/secrets/kv/kv-v2, "Deleting Versions" section).

Scroll to Top