# 1.19 Ensure That All Expired SSL/TLS Certificates Stored in AWS IAM Are Removed (Automated)

- Source: https://support.icompaas.com/support/solutions/articles/62000233158-1-19-ensure-that-all-expired-ssl-tls-certificates-stored-in-aws-iam-are-removed-automated-
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [AWS CIS V.4 Level 1 Benchmarks](https://support.icompaas.com/support/solutions/62000112671) › [CIS Control 1](https://support.icompaas.com/support/solutions/folders/62000169194)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

### Profile Applicability:

**Level 1**

## Description:

AWS IAM allows users to store SSL/TLS certificates for use with AWS services such as Elastic Load Balancers (ELB) and CloudFront. Certificates must be regularly reviewed and expired certificates must be removed to avoid unintended usage.

## Rationale:

-   Expired certificates may lead to application failures if deployed on AWS services such as ELB, CloudFront, or API Gateway.
    
-   Ensures compliance with security policies requiring the removal of outdated certificates.
    
-   Reduces risk of security incidents, such as man-in-the-middle (MITM) attacks due to outdated cryptographic material.
    

## Impact:

-   Deleting expired certificates may affect applications if they are still in use by AWS services.
    
-   Before removal, verify that the expired certificate is not in use.
    
-   If a certificate is actively used, it should be replaced with a valid one before deletion.
    

## Default Value:

By default:

-   IAM does not automatically delete expired SSL/TLS certificates.
    
-   Expired certificates remain stored in IAM indefinitely until manually removed.
    

## Pre-Requisites:

1.  IAM Administrator Access:
    
    -   Required permissions:
        
        -   iam:ListServerCertificates
            
        -   iam:GetServerCertificate
            
        -   iam:DeleteServerCertificate
            
2.  AWS CLI Installed (optional for automation).
    
3.  Access to AWS ACM (if migrating to managed certificates).
    

## Remediation:

### Test Plan:

**Using CLI**

List all IAM-stored certificates:

 aws iam list-server-certificates --query "ServerCertificateMetadataList\[\*\].\[ServerCertificateName, Expiration\]" --output table

**Review the output:  
**\-------------------------------------------------

|            ListServerCertificates             |

+------------------------+----------------------+

| MyExpiredCert          | 2023-12-01T23:59:59Z |

| ActiveCert2024         | 2024-07-10T23:59:59Z |

+------------------------+----------------------+

-   Check for expired certificates: If the expiration date is in the past, the certificate must be removed.

## Implementation Steps:

**Step 1**: Verify Certificate Usage - Before deleting a certificate, check if it is actively used in:

-   Elastic Load Balancers (ELB)
    
-   CloudFront Distributions
    
-   API Gateway
    

-   Check ELB for expired certificates - List all ELBs and their associated certificates:  
    

aws elb describe-load-balancers --query "LoadBalancerDescriptions\[\*\].{Name:LoadBalancerName,CertArn:ListenerDescriptions\[\*\].Listener.SSLCertificateId}"

-   If the expired certificate is attached, replace it with a valid one before deletion.

**Step 2**: Delete Expired Certificates- Delete an expired certificate:

 aws iam delete-server-certificate --server-certificate-name <CERTIFICATE\_NAME>

 Example:

 aws iam delete-server-certificate --server-certificate-name MyExpiredCert

-   Verify deletion by running the audit command again:

 aws iam list-server-certificates

  

## Backout Plan:

If an expired certificate was mistakenly deleted: Re-upload the certificate to IAM:

aws iam upload-server-certificate --server-certificate-name <CERT\_NAME> --certificate-body file://certificate.pem --private-key file://private-key.pem --certificate-chain file://ca-chain.pem --path /cloudfront/

Verify that the certificate is available again in IAM:

 aws iam list-server-certificates

References:

-   Managing SSL/TLS Certificates in IAM: [AWS Guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html)
    
-   AWS CLI Command for Certificate Deletion: [AWS Documentation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-server-certificate.html)
    
-   AWS Certificate Manager (ACM) Best Practices: [AWS ACM Guide](https://docs.aws.amazon.com/acm/latest/userguide/acm-best-practices.html)
    

## CIS Controls Mapping:

  

<table style="border:none;border-collapse:collapse"><colgroup style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"></colgroup><tbody><tr style="height:40pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:left;margin-bottom:0pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="font-family:Helvetica Neue"><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">CIS Control Version</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:left;margin-bottom:0pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="font-family:Helvetica Neue"><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control ID</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="font-family:Helvetica Neue"><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control Description</span></span></span></p></td></tr><tr style="height:40pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="font-family:Helvetica Neue"><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">CIS v8</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="font-family:Helvetica Neue"><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">3.1</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><strong><span style="font-family:Helvetica Neue"><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">Establish a data management process, including handling and disposal of sensitive data.</span></span></span></strong></p></td></tr><tr style="height:40pt"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="font-family:Helvetica Neue"><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">CIS v7</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="font-family:Helvetica Neue"><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">13.1</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt"><strong><span style="font-size:14px;font-family:&quot;Helvetica Neue&quot;"><span dir="ltr" style="color:rgb(0, 0, 0);font-weight:400">Maintain an inventory of sensitive information stored, processed, or transmitted by the organization's systems.</span></span></strong></p></td></tr></tbody></table>

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
