Key management - AWS CodeBuild

Key management

You can protect your content from unauthorized use through encryption. Store your encryption keys in AWS Secrets Manager, and then give CodeBuild permission to obtain the encryption keys from your Secrets Manager account. For more information, see Create and configure an AWS KMS CMK for CodeBuild, Create a build project in AWS CodeBuild, Run a build in AWS CodeBuild, and Tutorial: Storing and retrieving a secret.

Use the CODEBUILD_KMS_KEY environment variable in a build command for your AWS KMS key. For more information, see Environment variables in build environments.

You can use Secrets Manager to protect credentials to a private registry that stores a Docker image used for your runtime environment. For more information, see Private registry with AWS Secrets Manager sample for CodeBuild.