[DL.CS.2] Sign code artifacts after each build
Category: RECOMMENDED
Code signing is the process of attaching a digital signature to build artifacts like binaries, containers, and other forms of packaged code to enable verifying its integrity and authenticity. Signing code artifacts minimizes risk of using or distributing tampered or counterfeit software.
Cryptographically sign code artifacts during the build
process. Ideally this occurs after testing and before
publishing to production. Follow
best
practices for timestamping
Store signatures in a location accessible to users and systems
that need to verify signed code artifacts. When
using Open
Containers Initiative (OCI)
After a signature has been stored, it should be immutable so that the signature cannot be tampered with or replaced. Use fine-grained access controls to ensure that only authorized entities can push or modify artifacts and their corresponding signatures. Regularly back up your digital signatures. Having a backup ensures you can still verify the integrity and authenticity of your artifacts in the event of storage failures. All access and operations on stored signatures should be logged to support forensic analysis and to adhere to compliance requirements.
Implement cryptographic signing of artifacts during the build process. Ideally this occurs after testing and before publishing to production. This helps ensure the integrity of the artifacts and confirms their authenticity. We recommend using a managed service like AWS Signer to reduce the complexity that comes with managing public key infrastructure. Refer to AWS Signer workflows for guidance that fits your use case.
For more control over the signing process or for complex use
cases, you can create and manage your own code signing
platform using Public Key Infrastructure (PKI). While this
approach offers precise control, it requires consistent upkeep
and adherence to best practices.
AWS Private Certificate Authority
Related information: