A developer is setting up an AWS CodeBuild project that needs to pull dependency packages from a third-party private repository. The credentials for this repository must be rotated automatically every 30 days. The developer needs to configure the build environment to securely retrieve these credentials during the build process.
Which configuration should the developer implement to meet these requirements with the lowest operational overhead?
- AStore the credentials as a SecureString parameter in Systems Manager Parameter Store. Reference the parameter using the parameter-store mapping under the env sequence in the buildspec.yml file.
- Store the credentials in AWS Secrets Manager with automatic rotation. In the buildspec.yml file, reference the secret using the secrets-manager mapping under the env sequence.Cevap
- CStore the credentials in AWS Secrets Manager with automatic rotation. Update the CodeBuild service role's trust policy to include an Allow statement for the secretsmanager.amazonaws.com service principal.
- DStore the credentials in a buildspec.yml file located in the project's subfolder /configuration and configure CodeBuild to automatically search the directory structure to locate and run the build specification.
Cevap
Store the credentials in AWS Secrets Manager with automatic rotation. In the buildspec.yml file, reference the secret using the secrets-manager mapping under the env sequence.
Storing the credentials in AWS Secrets Manager is the correct approach because it natively supports automatic rotation of secrets. Referencing the secret in the env/secrets-manager section of the buildspec.yml file allows CodeBuild to securely retrieve the credentials at build time without exposing them in plaintext.
Adım Adım Çözüm
Anahtar Kavram
Secure credential retrieval and buildspec configuration in AWS CodeBuild
Tahmini Süre:2m 0s