View a markdown version of this page

SEC06-BP04 Validate software integrity - AWS Well-Architected Framework

SEC06-BP04 Validate software integrity

Software artifacts can be altered between when a vendor publishes them and when your workload runs them. Use cryptographic signatures to confirm an artifact was not altered and came from its claimed source. Sign your own code and images so your compute environments run only what you approved.

Desired outcome:

  • You obtain all artifacts from trusted sources and validate vendor website certificates before downloading.

  • You cryptographically verify downloaded artifacts against the publisher's signature, not only a hash.

  • You cryptographically sign your own software, code, and libraries.

  • Your compute environments verify those signatures before running your code.

Common anti-patterns:

  • Teams trust a reputable vendor site but ignore certificate expiration warnings and download anyway.

  • Teams validate a site certificate but never verify the signature of the artifact they downloaded.

  • Integrity checks rely on a hash alone, which proves the file is unchanged but says nothing about its source.

  • Internally built software, code, and libraries go unsigned, even when used only in the team's own deployments.

Benefits of establishing this best practice:

  • Verifying artifact integrity helps keep malware out of your compute environments.

  • Signing your own software guards against unauthorized code running in those environments.

  • Signature verification establishes provenance, which a hash cannot.

  • A signed, verified supply chain gives auditors and responders a clear chain of trust.

Level of risk exposed if this best practice is not established: Medium

Implementation guidance

Many operating system images, container images, and code artifacts ship with a digest or hash. You compute the hash of what you downloaded and compare it to the published value. This confirms the bytes did not change in transit but does not identify who produced the changed bytes. If an unauthorized party replaces both the artifact and its published hash, the check still passes. Provenance, or proof that an artifact came from a specific source, requires a signature made with a private key that only the trusted publisher holds.

A certificate issued by a recognized authority binds the signing key to an identity. Validate the certificate, including its expiration, as part of the check. When you obtain software from a vendor, look for a published public key and verification instructions. Many publishers, including AWS, provide both for the agents and tools they distribute.

The code and images your teams build are also artifacts. Anyone with unauthorized access can take advantage of unsigned internal software. When you sign your own artifacts, your compute environments can refuse anything unsigned or altered. Manage the code-signing lifecycle: generate and protect signing keys, sign during the build, and verify at deployment and at run time. Automate these steps in your CI/CD pipeline to keep the practice consistent. As cryptographic standards evolve, verify that your signing and verification tooling is up to date so you can adopt stronger algorithms without disrupting your release process.

In the AWS Cloud, use AWS Signer to manage the code-signing lifecycle and verify signatures. AWS Lambda and Amazon ECR integrate with Signer to verify signatures before code or images run.

Implementation steps

  1. Verify downloaded artifacts before use: For each vendor artifact, validate the site certificate, obtain the publisher's public key, and verify the signature, not just a hash, before the artifact enters your build or runtime. Follow the publisher's documented verification steps, such as those for the AWSTOE installer, the SSM Agent, and the CloudWatch agent.

  2. Fold verification into image hardening: Add signature verification to the processes that obtain and build your images, so unverified artifacts never reach a hardened image.

  3. Establish a code-signing lifecycle for your own artifacts: Use AWS Signer to generate and protect signing keys and to sign your code and images during the build.

  4. Verify your signatures at deployment and run time: Configure code signing for AWS Lambda and container image signing for Amazon ECR so only signed, unaltered artifacts run in your compute environments.

  5. Automate signing and verification in CI/CD: Wire signing and verification into your pipelines, so every build is signed and every deployment is checked without manual steps.

Resources

Related best practices:

Related documents:

Related examples:

Related tools: