Search for Well Architected Advice
< All Topics
Print

Validate software integrity

Validating the integrity of software, code, and libraries is crucial to ensuring that only trusted and untampered software is used in your workload. Implementing mechanisms such as code signing and checksums helps verify the authenticity and integrity of the software, preventing the introduction of malicious or altered code. By validating software integrity, you protect your environment from potential security threats that could arise from compromised software or libraries.

  1. Implement code signing: Use code signing to ensure that the software, scripts, and libraries in your workload are from trusted sources and have not been tampered with. Code signing allows you to verify the authenticity of the code’s origin and its integrity. For example, AWS Signer provides a centralized way to manage the code-signing lifecycle, allowing you to sign binaries, scripts, and other artifacts with cryptographic signatures. This helps validate that the software has not been altered since it was signed by the author.
  2. Verify code signing certificates: When using signed software, verify the associated code signing certificates to confirm the author’s identity and ensure that the software has not been tampered with. AWS Signer can manage the signing certificates, including public and private keys, to help ensure that the software in your workload is legitimate and secure.
  3. Validate checksums for downloaded software: For software that you download from third-party providers, always verify the checksum provided by the source against the checksum of the downloaded file. This helps ensure that the software has not been tampered with during transmission. By comparing the calculated checksum of the downloaded software with the checksum provided by the vendor, you can confirm the integrity of the file.
  4. Use advanced patterns for AWS Lambda code signing: When deploying AWS Lambda functions, use AWS Signer to sign your Lambda code packages. This ensures that only trusted code is deployed in your Lambda functions. Code signing in AWS Lambda requires that the function code is signed and verified before deployment, helping prevent unauthorized code from running in your environment.
  5. Automate software integrity checks: Automate the validation of software integrity by incorporating checksum verification, code signing, and certificate validation into your CI/CD pipeline. This ensures that all code and libraries used in your environment are validated before deployment, reducing the risk of introducing malicious or compromised software.
  6. Monitor software integrity in production: Continuously monitor the integrity of the software in your environment. Use tools like AWS CloudWatch and AWS Config to track changes in your software and validate that no unauthorized modifications have occurred.

Supporting Questions:

  • How do you ensure that the software, code, and libraries used in your workload are from trusted sources and have not been tampered with?
  • What mechanisms do you use to validate the integrity of downloaded software or scripts?
  • How do you integrate software integrity validation into your deployment pipeline?

Roles and Responsibilities:

Security Engineer:

  • Responsibilities:
    • Implement code signing and checksum validation mechanisms to ensure the integrity of all software used in the workload.
    • Verify code signing certificates and automate the integrity validation process in CI/CD pipelines.
    • Use AWS Signer to manage code-signing certificates and keys, ensuring that only trusted software is deployed.

Cloud Administrator:

  • Responsibilities:
    • Ensure that all third-party software downloaded for use in the environment has its checksum verified against the provider’s values.
    • Monitor software integrity continuously in production environments using AWS monitoring tools.

Artefacts:

  • Code Signing and Certificate Logs: Records of code signing activities and certificate verifications performed during software deployment, helping ensure that signed software is trusted and intact.
  • Checksum Validation Reports: Logs and reports of checksum verifications performed for downloaded software and libraries, confirming that no tampering has occurred.
  • Code Signing Policies and Procedures: Documentation outlining the procedures for code signing, certificate validation, and checksum verification in the workload.

Relevant AWS Services:

AWS Code Signing and Security Services:

  • AWS Signer: Manages the code-signing lifecycle, allowing you to sign and verify software, scripts, and Lambda functions. AWS Signer ensures that software has not been altered and originates from a trusted source.
  • AWS Lambda Code Signing: Allows you to enforce that Lambda functions are signed and verified before they are deployed, ensuring that only trusted code is executed.
  • AWS Secrets Manager: Helps securely store and manage signing certificates and private keys, ensuring the security of code-signing processes.

Monitoring and Compliance Services:

  • AWS CloudWatch: Monitors deployed software for any changes or anomalies in production, helping ensure that the integrity of the software is maintained.
  • AWS Config: Tracks changes in your environment’s software configurations and can alert you to unauthorized modifications or deviations from expected configurations.
Table of Contents