> 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-rds-database-instance-is-publicly-accessible.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS RDS database instance is publicly accessible

### Synopsis

| Field               | Value                                            |
| ------------------- | ------------------------------------------------ |
| Rule Type           | Detection                                        |
| Finding Type        | AWS RDS database instance is publicly accessible |
| Finding ID          | 60000078                                         |
| Generates a Finding | This detection rule also generates a finding     |
| Severity            | High                                             |
| Category            | CONFIGURATION                                    |
| Cloud Providers     | AWS                                              |
| Platform Module     | CSPM                                             |
| Asset Types         | RDS\_DATABASE\_INSTANCE                          |
| ATT\&CK Tactic      | TA0001 (TA0001)                                  |
| ATT\&CK Technique   | T1190 (T1190)                                    |

### Description

Publicly accessible Amazon RDS database instances pose a significant security risk. These instances are directly exposed to the internet, bypassing any network security controls.

Amazon RDS offers a configuration setting to control public accessibility for database instances. Disabling public accessibility ensures that only authorized internal systems can connect. Failure to disable this setting exposes the database to unauthorized access, potentially leading to data breaches, unauthorized modifications, or complete database compromise by malicious actors leveraging untrusted IPs.

The impact of this misconfiguration includes data loss, unauthorized data modification, and potential regulatory fines for non-compliance. Maintaining strong database security is crucial for data integrity and business continuity. Restricting access to only trusted internal networks significantly reduces the attack surface.

To mitigate this, ensure all RDS database instances have public accessibility explicitly disabled. Regularly review and audit the public accessibility settings of all RDS instances. Implement strong network security controls, such as security groups and network ACLs, to further restrict access even if public accessibility is mistakenly enabled.

### Remediation

**Manual steps:**

RDS Database Instance - This remediation plan addresses the security issue of a publicly accessible AWS RDS database instance. Publicly accessible database instances pose a significant risk to data integrity and security. This plan will guide you through the steps to restrict public access to your RDS instance, enhancing its security:

1. **Access the AWS Console:** Log in to your AWS account and navigate to the AWS Management Console.
2. **Select the Region:** From the region dropdown menu in the top right corner of the console, choose the region where the affected RDS instance is located. This region is specified in the alert you received.
3. **Navigate to RDS:** In the AWS console, locate and select the 'Aurora and RDS' service.
4. **Identify the Instance:** In the left navigation pane, click on 'Databases'. From the list of databases, locate and click on the DB identifier (name) of the specific RDS instance mentioned in the alert.
5. **Modify Instance Settings:** Click on the 'Modify' button to access the instance configuration settings.
6. **Restrict Public Accessibility:** Under the 'Connectivity' section expand to 'Additional configuration', locate the 'Public access' setting. Change the value to 'Not publicly accessible' to disable public access to the instance.
7. **Continue and Apply Changes:** Click on 'Continue' to proceed to the next step. Select the desired 'Schedule modifications' option and click on 'Modify DB Instance' to apply the changes.

**Note:** Carefully review and test these steps before implementing them in your production environment. Modifying RDS instance settings can impact your application's functionality. Ensure you have a backup plan in place before making any changes.

**CLI code:**

RDS Database Instance - This command modifies the RDS instance identified by '${entity}' to disable public accessibility. The '--apply-immediately' flag ensures the change takes effect immediately:

```bash
aws rds modify-db-instance --db-instance-identifier ${entity} --no-publicly-accessible --apply-immediately --region ${entity}
```

**Terraform code:**

RDS Database Instance - This Terraform code snippet modifies the 'publicly\_accessible' attribute of the existing 'aws\_db\_instance' resource to 'false', effectively making the RDS database instance inaccessible from the public internet. This addresses the policy violation by ensuring that the database instance is not publicly accessible, enhancing its security:

```hcl
resource "aws_db_instance" "default" {
 # ... other configuration ...
 publicly_accessible = false
}
```


---

# 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-rds-database-instance-is-publicly-accessible.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.
