- Newest
- Most votes
- Most comments
To verify your software is running from your AWS Marketplace AMI, you can implement a runtime check using the instance identity document. Here's how to approach this securely:
For basic verification, you can check the marketplaceProductCodes field in the instance identity document to confirm it matches your product code. This can be retrieved via the instance metadata service using either IMDSv2 (recommended) or IMDSv1.
Regarding the verification of the document's authenticity using AWS public certificates, you have several options:
-
Certificate Handling: AWS public certificates used for instance identity verification are region-specific and vary based on the verification method (PKCS7, base64-encoded, or RSA-2048 signatures).
-
Certificate Rotation: While the documentation doesn't explicitly state a rotation policy for these certificates, AWS designed this system for long-term stability. The certificates are fundamental to EC2 infrastructure and any changes would be managed carefully to avoid disrupting dependent services.
-
Recommended Approach: Instead of baking certificates into your AMI, consider:
- Retrieving the certificates dynamically at runtime from the official AWS documentation URL
- Implementing a fallback mechanism that uses locally cached certificates only if the dynamic retrieval fails
- Including a notification system that alerts you if certificate verification fails, allowing you to update your software if needed
- Alternative Approach: If you prefer a simpler implementation, you can focus on just verifying the presence of your marketplace product code in the instance identity document. While this doesn't provide cryptographic verification, it's a practical approach that many marketplace products use.
By implementing these practices, you can reliably verify your software is running from your marketplace AMI while maintaining flexibility for any potential future changes to AWS certificates.
Sources
Best practices for building AMIs for use with AWS Marketplace - AWS Marketplace
Verify the instance identity document for an Amazon EC2 instance - Amazon Elastic Compute Cloud
AWS public certificates for instance identity document signatures - Amazon Elastic Compute Cloud
Instance identity documents for Amazon EC2 instances - Amazon Elastic Compute Cloud
Know if the EC2 resources in my AWS account are for Marketplace products | AWS re:Post
Relevant content
- asked 2 years ago
- asked 3 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
