nerdexam
Amazon

SCS-C02 · Question #105

A company's policy requires that all API keys be encrypted and stored separately from source code in a centralized security account. This security account is managed by the company's security team…

The correct answer is C. Create a secret in AWS Secrets Manager in the security account to store the API key using AWS. AWS Secrets Manager in a separate security account with KMS encryption provides centralized, auditable, and cross-account accessible secret storage that satisfies the requirement of keeping secrets separate from source code.

Submitted by lars.no· Mar 6, 2026Data Protection

Question

A company's policy requires that all API keys be encrypted and stored separately from source code in a centralized security account. This security account is managed by the company's security team. However, an audit revealed that an API key is stored with the source code of an AWS Lambda function in an AWS CodeCommit repository in the DevOps account. How should the security team securely store the API key?

Options

  • ACreate a CodeCommit repository in the security account using AWS Key Management Service
  • BStore the API key in an Amazon S3 bucket in the security account using server-side encryption
  • CCreate a secret in AWS Secrets Manager in the security account to store the API key using AWS
  • DCreate an encrypted environment variable for the Lambda function to store the API key using

How the community answered

(46 responses)
  • A
    2% (1)
  • B
    7% (3)
  • C
    76% (35)
  • D
    15% (7)

Why each option

AWS Secrets Manager in a separate security account with KMS encryption provides centralized, auditable, and cross-account accessible secret storage that satisfies the requirement of keeping secrets separate from source code.

ACreate a CodeCommit repository in the security account using AWS Key Management Service

CodeCommit is a source code repository, not a secrets management service; storing API keys there, even encrypted, reintroduces them into a code-accessible context and does not meet the requirement of storing secrets separately from source code.

BStore the API key in an Amazon S3 bucket in the security account using server-side encryption

An S3 bucket can store encrypted files but lacks native secret versioning, automatic rotation, fine-grained access auditing, and the semantic access controls that purpose-built secrets management requires.

CCreate a secret in AWS Secrets Manager in the security account to store the API key using AWSCorrect

Creating a secret in AWS Secrets Manager in the centralized security account encrypts the API key using a KMS CMK, provides fine-grained IAM cross-account access control, enables automatic rotation, and allows the Lambda function in the DevOps account to retrieve the secret at runtime via an IAM role, keeping the key entirely out of the codebase and separate from the source code repository.

DCreate an encrypted environment variable for the Lambda function to store the API key using

Lambda encrypted environment variables are scoped to the specific Lambda function in the DevOps account and are accessible to anyone with Lambda configuration access in that account, keeping the secret coupled to the source code environment rather than centralized in the security account.

Concept tested: Cross-account AWS Secrets Manager for centralized API key storage

Source: https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples_cross.html

Topics

#Secrets Manager#API key storage#cross-account secrets#KMS encryption

Community Discussion

No community discussion yet for this question.

Full SCS-C02 Practice