HCVA0-003 practice question 31 of 35

Mike’s Cereal Shack uses Vault to encrypt customer data to ensure it is always stored securely. They are developing a new application integration to…

Full set: 285 questions
Mike’s Cereal Shack uses Vault to encrypt customer data to ensure it is always stored securely. They are developing a new application integration to send new customer data to be encrypted using the following API request: text CollapseWrapCopy $ curl \ --header "X-Vault-Token: hvs.sf4vj1rFV5PvQSV3M9dcv832brxQFsfbXA" \ --request POST \ --data @data.json \ https://vault.mcshack.com:8200/v1/transit/encrypt/customer-data What would be contained within the data.json file?
Answer options
A: Transit secrets engine configuration file
B: Ciphertext to be decrypted
C: The encryption key to be used for encrypting the data
D: Cleartext customer data to be encrypted Correct answer
Correct Answer:
D. Cleartext customer data to be encrypted
Explanation

The API endpoint /v1/transit/encrypt/customer-data is used to encrypt data with the Transit secrets engine using a named key, in this case, customer-data. The HTTP POST method is used to send data to the server for processing. The --data @data.json flag in the curl command specifies that the content of the data.json file is the request's payload. For this specific encryption endpoint, the required payload is a JSON object containing the plaintext (cleartext) data that needs to be encrypted. Vault receives this plaintext, encrypts it using the key stored securely within Vault, and returns the resulting ciphertext.

Why Incorrect

A. Transit secrets engine configuration is managed via different API endpoints (e.g., /sys/mounts/ or /transit/keys/), not the /encrypt endpoint.
B. Ciphertext is sent as a payload to the /transit/decrypt/{keyname} endpoint for decryption, not the /encrypt endpoint.
C. The encryption key (customer-data) is specified in the URL. The core principle of the Transit engine is that the key never leaves Vault and is not sent by the client.

References

1. HashiCorp Vault Official Documentation, "Encrypt Data (POST /transit/encrypt/:name)" API Reference. This document specifies the required payload for the encryption endpoint. The plaintext parameter is listed as a required string, which is the "plaintext data to be encrypted." The data must be base64-encoded.

Source: HashiCorp Vault API Documentation, Secret: Transit, Section: "Encrypt Data".

Reference: developer.hashicorp.com/vault/api-docs/secret/transit#encrypt-data

2. HashiCorp Learn, "Encryption as a Service: The Transit Secrets Engine" Tutorial. This official tutorial provides a practical example of using the encrypt endpoint. In "Step 4: Encrypt some data," it demonstrates a curl command where the payload is a JSON object containing a plaintext key with base64-encoded secret data.

Source: HashiCorp Learn, Vault Tutorials.

Reference: developer.hashicorp.com/vault/tutorials/encryption-as-a-service/eaas-transit, Section: "Step 4: Encrypt some data".

Scroll to Top