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

# AWS MQ is publicly accessible

### Synopsis

| Field               | Value                                        |
| ------------------- | -------------------------------------------- |
| Rule Type           | Detection                                    |
| Finding Type        | AWS MQ is publicly accessible                |
| Finding ID          | 60000418                                     |
| Generates a Finding | This detection rule also generates a finding |
| Severity            | High                                         |
| Category            | CONFIGURATION                                |
| Cloud Providers     | AWS                                          |
| Platform Module     | CSPM                                         |
| Asset Types         | AMAZON\_MQ\_BROKER                           |
| ATT\&CK Tactic      | TA0001 (TA0001)                              |
| ATT\&CK Technique   | T1190 (T1190)                                |

### Description

Publicly accessible Amazon MQ brokers expose sensitive data and increase the risk of unauthorized access. Malicious actors can exploit this misconfiguration to gain control of the message broker, potentially leading to data breaches and service disruptions.

Amazon MQ brokers should reside within a Virtual Private Cloud (VPC) for secure communication. Exposing them publicly bypasses network security controls, enabling attackers to intercept messages or inject malicious ones without authentication. This exposes sensitive data transmitted through the broker to unauthorized access.

A publicly accessible Amazon MQ broker compromises data confidentiality and integrity. Maintaining private connectivity through a VPC ensures that only authorized systems within your network can communicate with the broker, significantly reducing the attack surface and protecting sensitive data.

To mitigate this risk, restrict Amazon MQ broker access to your VPC. Configure security groups to allow inbound traffic only from trusted IP addresses or other VPC resources. Regularly review and update security group configurations to maintain strong security posture.

### Remediation

**Manual steps:**

Amazon MQ Broker - This remediation plan addresses the issue of a publicly accessible AWS MQ broker, which poses a security risk by exposing sensitive data to unauthorized access. The plan involves creating a new, private MQ broker and migrating applications to use the new broker's endpoints:

1. **Create a New Private MQ Broker:**
   1. Navigate to the Amazon MQ service in the AWS console.
   2. Select the publicly accessible broker from the list of brokers.
   3. From 'Details' section, copy all the configuration information.
   4. Within 'Users' section, locate and copy the ActiveMQ Web Console access credentials.
   5. Click on 'Brokers' from left panel, click on 'Create broker'.
   6. Configure the new broker using the details copied from the existing broker (refer to steps above).
   7. Provide a unique name for the new broker.
   8. Expand to 'Additional settings' section, select the 'Access type' to 'Private access' under the 'Network settings' section.
   9. Provide the other configurations copied from the existing broker and click 'Next'.
   10. Click on 'Create broker'.
2. **Migrate Applications:**
   1. Once the new private broker is created, update your applications to use the new broker's endpoints.
3. **Delete the Publicly Accessible Broker:**
   1. Select the publicly accessible broker from the list of brokers.
   2. Click on 'Delete'.
   3. Confirm the deletion by entering the broker name and clicking on 'Delete'.

**Note:** Carefully review and test the steps before implementing them to avoid disrupting your applications. Ensure that the new private broker is properly configured and accessible to your applications before deleting the publicly accessible broker.

**CLI code:**

Amazon MQ Broker - This command creates non the publicly accessible Amazon MQ broker:

```bash
aws mq create-broker --broker-name <new_broker_name> --engine-type ActiveMQ --engine-version <engine_version> --host-instance-type <host_instance_type> --no-publicly-accessible --users Username=<username>,Password=<password> --configuration Id=<configuration_id>,Revision=<configuration_revision> --deployment-mode <deployment-mode> --region ${entity}
```

Amazon MQ Broker - This command deletes the publicly accessible Amazon MQ broker identified by the resource ID. This will resolve the security issue by removing the public access point to the broker:

```bash
aws mq delete-broker --broker-id ${entity} --region ${entity}
```

**Terraform code:**

Amazon MQ Broker - This Terraform code snippet modifies the existing 'aws\_mq\_broker' resource to set the 'publicly\_accessible' attribute to 'false'. This will ensure that the MQ broker is no longer accessible from the public internet, addressing the security vulnerability identified by the policy:

```hcl
# Modify existing MQ broker to be private
resource "aws_mq_broker" "example" {
 # ... existing 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-mq-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.
