VAULT-ASSOCIATE-002 · Question #91
Which statements correctly describe the command below. Choose TWO correct answers. vault write transit/decrypt/password \ ciphertext=vault:v1:8SDd3WHDOjf7mq69CyCqYjBXAiQQAVZRkFM13ok481zoCmHnSeD…
The correct answer is B. Returns base64-encoded plaintext C. Decrypts the ciphertext if the token permits. The vault write transit/decrypt/password command decrypts the provided ciphertext using the Transit secrets engine, returning the base64-encoded plaintext if the executing token has the necessary permissions.
Question
Options
- AReturns an error due to missing encryption key name
- BReturns base64-encoded plaintext
- CDecrypts the ciphertext if the token permits
- DReturns the ciphertext
- ERequires sudo capability on the transit/decrypt/password path
How the community answered
(43 responses)- A5% (2)
- B70% (30)
- D16% (7)
- E9% (4)
Why each option
The `vault write transit/decrypt/password` command decrypts the provided ciphertext using the Transit secrets engine, returning the base64-encoded plaintext if the executing token has the necessary permissions.
The command does not return an error due to a missing encryption key name; the key name 'password' is correctly specified as part of the `transit/decrypt/password` path.
The Transit secrets engine's decryption endpoint returns the decrypted content as a base64-encoded string, which is the plaintext representation of the original encrypted data.
This command invokes the `transit/decrypt` endpoint, specifically using the encryption key named 'password' derived from the path. If the token used for execution has the appropriate capabilities (e.g., `update`) for this path, the ciphertext will be successfully decrypted.
The command's purpose is to decrypt, so it returns the *plaintext* (base64-encoded), not the original ciphertext itself.
While `sudo` capability would grant permission, the standard capability required for `transit/decrypt` operations is `update` on the specified path, not necessarily `sudo`.
Concept tested: Vault Transit secrets engine decryption
Source: https://developer.hashicorp.com/vault/docs/secrets/transit#decrypting-data
Topics
Community Discussion
No community discussion yet for this question.