easyMultiple Choice
CAS-004 Secure secret storage method Practice Question
Which of the following is a secure method for storing secrets (e.g., API keys, passwords) in a cloud-native application?
⚠ Common exam trap
CompTIA often tests the misconception that base64 encoding or environment variables are 'secure enough' because they hide the secret from casual view, but the trap is that neither provides encryption, access control, or rotation, which are required for secure secret storage in cloud-native applications.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a secrets management service
A dedicated secrets management service (e.g., AWS Secrets Manager, Azure Key Vault, HashiCorp Vault) provides encryption at rest and in transit, automatic rotation, fine-grained access control via IAM policies, and audit logging. This prevents secrets from being exposed in configuration files, environment dumps, or version control, which is essential for cloud-native applications that must adhere to the principle of least privilege and compliance standards like SOC 2 or PCI DSS.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Encode secrets in base64 in configuration files
Why it's wrong here
Base64 is reversible encoding, not encryption, so anyone reading the configuration file recovers the secret instantly. It is tempting because it obfuscates values from casual viewing and is genuinely useful for transporting binary data through text-based configuration formats.
- ✗
Store secrets in environment variables
Why it's wrong here
Environment variables leak through process listings, crash dumps, logs and child processes, and cannot be audited or rotated centrally. They are tempting because they keep secrets out of source code and are the standard mechanism for injecting configuration into containerised workloads.
- ✓
Use a secrets management service
Why this is correct
A dedicated secrets management service stores credentials encrypted, controls access through fine-grained policies and audit logging, and issues short-lived dynamic secrets. Embedding keys in code, environment variables or config files exposes them to leaks, so centralised vaulting satisfies the secure-storage constraint.
- ✗
Hardcode secrets in the source code
Why it's wrong here
Hardcoding places credentials directly in source, exposing them to anyone with repository access and to every build artefact, with no rotation path. It is tempting because it is the quickest way to get a prototype running locally, where no shared version control or CI pipeline exists.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The CAS-005 exam frequently reuses these exact scenarios with slightly different constraints.
✓Use a secrets management serviceCorrect answer▾
Why this is correct
A dedicated secrets management service stores credentials encrypted, controls access through fine-grained policies and audit logging, and issues short-lived dynamic secrets. Embedding keys in code, environment variables or config files exposes them to leaks, so centralised vaulting satisfies the secure-storage constraint.
✗Encode secrets in base64 in configuration filesWrong answer — click to see why▾
Why this is wrong here
Base64 is not encryption; it is easily reversible and does not protect secrets.
✗Store secrets in environment variablesWrong answer — click to see why▾
Why this is wrong here
Environment variables can be exposed via process listings, logs, or debug interfaces; they are not encrypted.
✗Hardcode secrets in the source codeWrong answer — click to see why▾
Why this is wrong here
Hardcoding secrets is insecure as they can be read from version control or decompiled code.
Analysis generated from the official CAS-005blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
About these practice questions
This CAS-005 question is part of Courseiva's 973-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CAS-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CAS-005 exam.