Delve into key concepts of secret management within Infrastructure as Code, focusing on safe handling, encryption, and retrieval using systems like Vault, SSM, and KMS. This quiz gauges your expertise in securely integrating secrets with automation tools and best practices.
Which approach is generally considered most secure for managing application passwords in Infrastructure as Code templates?
Explanation: Referencing an encrypted secrets store at deployment time ensures that sensitive information is never exposed in plaintext and can be centrally controlled. Hardcoding passwords or storing them in version control systems as plain text can lead to accidental leaks and is insecure. Prompting for the password during every build reduces automation and can be error-prone. Only using a secure, encrypted store aligns with best practices for secret management.
In the context of secret management within an automated pipeline, why is automatic rotation of encryption keys and secrets important?
Explanation: Automatic rotation of encryption keys and secrets reduces the duration a compromised secret can be used by an attacker. Improving application speed or reducing memory usage is not a direct benefit of secret rotation. Ensuring secrets are permanently valid would actually contradict the goals of secure secret management. Regular rotation limits risks and supports compliance with security policies.
When configuring role-based access control for a secrets management service used in Infrastructure as Code, what is the main benefit of assigning the least privilege necessary?
Explanation: Assigning the least privilege necessary ensures that users and systems can only access what they actually need, reducing the risk of misuse or accidental exposure. Accelerating retrieval speed is not significantly impacted by access control configuration. Granting unlimited access undermines security, and increasing the risk of unauthorized access is the opposite of the principle of least privilege.
What is the most secure way for an automation script to retrieve an API key from a secret management system?
Explanation: Requesting the API key at runtime with authorized credentials ensures the key is only accessed by trusted processes when needed and avoids exposure. Saving the key as an environment variable or embedding it in source code increases the risk of accidental leaks. Echoing the key in logs is insecure, as logs could be accessed by unauthorized users. Dynamic, authenticated retrieval is the safest approach.
Which statement best describes the difference between envelope encryption and single-layer encryption using a key management system?
Explanation: Envelope encryption operates by having a master key encrypt a separate data encryption key, which is then used to encrypt the actual data, improving scalability and key management. Single-layer encryption may not scale as well, but is not necessarily inherently less secure; security depends on key management practices. Envelope encryption often supports automated key rotation, not only manual. Speed depends on the implementation, not the number of layers.