SEC09-BP01 Implement secure key and certificate management
Transport Layer Security (TLS) certificates are used to secure network communications and establish the identity of websites, resources, and workloads over the internet, as well as private networks.
Desired outcome: A secure certificate management system that can provision, deploy, store, and renew certificates in a public key infrastructure (PKI). A secure key and certificate management mechanism prevents certificate private key material from disclosure and automatically renews the certificate on a periodic basis. It also integrates with other services to provide secure network communications and identity for machine resources inside of your workload. Key material should never be accessible to human identities.
Common anti-patterns:
-
Performing manual steps during the certificate deployment or renewal processes.
-
Paying insufficient attention to certificate authority (CA) hierarchy when designing a private CA.
-
Using self-signed certificates for public resources.
Benefits of establishing this best practice:
-
Simplify certificate management through automated deployment and renewal
-
Encourage encryption of data in transit using TLS certificates
-
Increased security and auditability of certificate actions taken by the certificate authority
-
Organization of management duties at different layers of the CA hierarchy
Level of risk exposed if this best practice is not established: High
Implementation guidance
Modern workloads make extensive use of encrypted network communications using PKI protocols such as TLS. PKI certificate management can be complex, but automated certificate provisioning, deployment, and renewal can reduce the friction associated with certificate management.
AWS provides two services to manage general-purpose PKI
certificates:
AWS Certificate Manager and
AWS Private Certificate Authority (AWS Private CA). ACM is the
primary service that customers use to provision, manage, and
deploy certificates for use in both public-facing as well as
private AWS workloads. ACM issues private certificates using AWS Private CA and
integrates
with many other AWS managed services to provide secure TLS
certificates for workloads. ACM can also issue publicly trusted
certificates from
Amazon
Trust Services
AWS Private CA allows you to establish your own root or subordinate certificate authority and issue TLS certificates through an API. You can use these kinds of certificates in scenarios where you control and manage the trust chain on the client side of the TLS connection. In addition to TLS use cases, AWS Private CA can be used to issue certificates to Kubernetes pods, Matter device product attestations, code signing, and other use cases with a custom template. You can also use IAM Roles Anywhere to provide temporary IAM credentials to on-premises workloads that have been issued X.509 certificates signed by your Private CA.
In addition to ACM and AWS Private CA, AWS IoT Core provides specialized support for provisioning, managing and deploying PKI certificates to IoT devices. AWS IoT Core provides specialized mechanisms for onboarding IoT devices into your public key infrastructure at scale.
Some AWS services, such as Amazon API Gateway and Elastic Load Balancing, offer their own capabilities for using certificates to secure application connections. For example, both API Gateway and Application Load Balancer (ALB) support mutual TLS (mTLS) using client certificates that you create and export using the AWS Management Console, CLI, or APIs.
Considerations for establishing a private CA hierarchy
When you need to establish a private CA, it's important to take special care to properly design the CA hierarchy upfront. It's a best practice to deploy each level of your CA hierarchy into separate AWS accounts when creating a private CA hierarchy. This intentional step reduces the surface area for each level in the CA hierarchy, making it simpler to discover anomalies in CloudTrail log data and reducing the scope of access or impact if there is unauthorized access to one of the accounts. The root CA should reside in its own separate account and should only be used to issue one or more intermediate CA certificates.
Then, create one or more intermediate CAs in accounts separate from the root CA's account to issue certificates for end users, devices, or other workloads. Finally, issue certificates from your root CA to the intermediate CAs, which will in turn issue certificates to your end users or devices. For more information on planning your CA deployment and designing your CA hierarchy, including planning for resiliency, cross-region replication, sharing CAs across your organization, and more, see Planning your AWS Private CA deployment.
Implementation steps
-
Determine the relevant AWS services required for your use case:
-
Many use cases can leverage the existing AWS public key infrastructure using AWS Certificate Manager. ACM can be used to deploy TLS certificates for web servers, load balancers, or other uses for publicly trusted certificates.
-
Consider AWS Private CA when you need to establish your own private certificate authority hierarchy or need access to exportable certificates. ACM can then be used to issue many types of end-entity certificates using the AWS Private CA.
-
For use cases where certificates must be provisioned at scale for embedded Internet of things (IoT) devices, consider AWS IoT Core.
-
Consider using native mTLS functionality in services like Amazon API Gateway or Application Load Balancer.
-
-
Implement automated certificate renewal whenever possible:
-
Use ACM managed renewal for certificates issued by ACM along with integrated AWS managed services.
-
-
Establish logging and audit trails:
-
Enable CloudTrail logs to track access to the accounts holding certificate authorities. Consider configuring log file integrity validation in CloudTrail to verify the authenticity of the log data.
-
Periodically generate and review audit reports that list the certificates that your private CA has issued or revoked. These reports can be exported to an S3 bucket.
-
When deploying a private CA, you will also need to establish an S3 bucket to store the Certificate Revocation List (CRL). For guidance on configuring this S3 bucket based on your workload's requirements, see Planning a certificate revocation list (CRL).
-
Resources
Related best practices:
Related documents:
Related videos:
Related examples:
-
IOT Device Management Workshop
(including device provisioning)
Related tools: