> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-acm-certificate-with-wildcard-domain-name.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS ACM Certificate with wildcard domain name

### Synopsis

| Field               | Value                                         |
| ------------------- | --------------------------------------------- |
| Rule Type           | Detection                                     |
| Finding Type        | AWS ACM Certificate with wildcard domain name |
| Finding ID          | 60000160                                      |
| Generates a Finding | This detection rule also generates a finding  |
| Severity            | High                                          |
| Category            | CONFIGURATION                                 |
| Cloud Providers     | AWS                                           |
| Platform Module     | CSPM                                          |
| Asset Types         | ACM\_CERTIFICATE                              |
| ATT\&CK Tactic      | TA0005 (TA0005)                               |
| ATT\&CK Technique   | T1553 (T1553)                                 |

### Description

Wildcard certificates in AWS Certificate Manager (ACM) present a significant security risk. Using a wildcard certificate, such as '\*.example.com', protects multiple subdomains with a single certificate. A compromise of this certificate's private key would impact all associated domains and subdomains.

AWS ACM allows the creation of wildcard certificates for convenience, enabling protection of multiple subdomains under a single certificate. However, this centralized approach introduces amplified risk. If an attacker compromises the private key associated with a wildcard certificate, they gain access to all domains covered by that certificate. This could lead to data breaches, unauthorized access, and significant reputational damage.

The impact of a compromised wildcard certificate is far-reaching. A single breach affects all protected subdomains, leading to extensive data exposure and service disruption. Using individual certificates for each domain significantly reduces the blast radius of a compromise. Best practice dictates isolating each domain's security posture.

To mitigate this risk, adopt a strategy of using individual certificates for each domain instead of wildcard certificates. Regularly rotate certificates and implement strong key management practices to minimize the impact of potential compromises.

### Remediation

**Manual steps:**

ACM Certificate - This remediation addresses ACM Certificates using wildcard certificates for wildcard domain names instead of single domain name certificates. Wildcard certificates can be risky because if the private key is compromised, all domains and subdomains using that certificate are potentially affected. This remediation plan will guide you through replacing the wildcard certificate with single domain name certificates for all first-level subdomains and deleting the wildcard certificate:

To resolve this alert, you need to replace the reported wildcard certificate with individual single-domain name certificates for all first-level subdomains. After successfully replacing them, you must delete the original wildcard certificate.

**Create New Single-Domain Certificates**

To resolve this alert, you need to replace the reported wildcard certificate with individual single-domain name certificates for all first-level subdomains. After successfully replacing them, you must delete the original wildcard certificate.

1. **Sign into AWS Console:** Sign into the AWS console.
2. **Select Correct AWS Region:** Select the specific AWS region from the dropdown menu in the top right corner where the alert originated.
3. **Navigate to AWS Certificate Manager (ACM):** Navigate to AWS Certificate Manager (ACM) and click on 'Request certificate' from the left panel.
4. **Choose Certificate Type:** On the 'Request certificate' page, select 'Request a public certificate' as the 'Certificate type' and click 'Next'.
5. **Configure Public Certificate Request:** On the 'Request public certificate' page:
   1. **Specify Domain Name:** In the 'Domain names' section, type the fully qualified domain name (e.g., 'subdomain.yourdomain.com') in the 'Fully qualified domain name' box.
   2. **Select Validation Method:** In the 'Validation method' section, choose the validation method that suits your requirements (e.g., DNS validation or Email validation).
   3. **Choose Key Algorithm:** In the 'Key algorithm' section, select an appropriate encryption algorithm. Be aware that some algorithms may not be supported by all AWS services.
   4. **Review and Request:** Review the domain name and validation method details, then click 'Request'.
6. **Validate and Deploy New Certificate:** Wait for the certificate status to change from 'Pending validation' to 'Issued'. Once issued, access your application's web server configuration and replace the wildcard certificate with the newly issued single-domain name certificate.

**Delete the Wildcard Certificate**

1. **Sign into AWS Console:** Sign into the AWS console.
2. **Select Correct AWS Region:** Select the specific AWS region from the dropdown menu in the top right corner where the alert originated.
3. **Access Certificate List in ACM:** Go to the AWS Certificate Manager (ACM) service and select 'List certificates' from the left panel.
4. **Identify Wildcard Certificate:** Choose the reported wildcard certificate from the list.
5. **Disassociate and Initiate Deletion:** Ensure you disassociate the certificate from all its associated resources (e.g., Load Balancers, CloudFront distributions). After disassociation, click 'Delete'.
6. **Confirm Deletion:** In the 'Delete selected certificates' popup window, click 'Delete' to confirm.

**Note:** Carefully review and test these steps before implementing them. Replacing certificates can impact your website's availability. Ensure you have a backup plan in place before proceeding.

**CLI code:**

ACM Certificate - This command requests a new AWS Certificate Manager (ACM) certificate for a specified domain name. You can specify the validation method (DNS or Email) and other optional parameters like Subject Alternative Names (SANs), key algorithm, and tags. After successful execution, the certificate will be in a 'Pending validation' state until the domain ownership is verified:

```bash
aws acm request-certificate --domain-name <domainName> --validation-method <validationMethod> --key-algorithm <keyAlgorithm> --region ${entity}
```

ACM Certificate - This command deletes the ACM certificate with the specified ARN. This will remove the wildcard certificate and mitigate the risk of a compromised certificate affecting multiple domains:

```bash
aws acm delete-certificate --certificate-arn ${entity} --region ${entity}
```

**Terraform code:**

ACM Certificate - This Terraform code snippet modifies the existing 'aws\_acm\_certificate' resource to replace the wildcard certificate with a single domain name certificate. It updates the 'domain\_name' attribute to specify a specific domain name instead of a wildcard domain name. This remediation addresses the policy violation by ensuring that the certificate is not using a wildcard domain name, reducing the risk of compromising multiple domains and subdomains if the private key is compromised:

```hcl
# This code block will modify the existing ACM certificate resource to replace the wildcard certificate with a single domain name certificate.

resource "aws_acm_certificate" "cert" {

 # Replace the existing wildcard domain name with a single domain name.

 domain_name = [<domain_name>]

 # Other configurations remain the same.

 # ...

}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-acm-certificate-with-wildcard-domain-name.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
