Triage and Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of MQ Brokers having CloudWatch audit logging enabled for AWS Security Groups using the AWS console, follow these steps:
- Access AWS Console: Log in to your AWS Management Console using your credentials.
- Navigate to Amazon MQ Service: Go to the Amazon MQ service by either searching for it in the AWS services search bar or locating it under the “Messaging & Queueing” section.
- Select the MQ Broker: Select the MQ Broker for which you want to remediate the CloudWatch audit logging configuration.
- Modify Broker: Click on the “Actions” dropdown menu and select “Modify Broker”.
- Update Broker Configuration: In the “Broker Details” section, scroll down to the “Logs” section.
- Disable CloudWatch Audit Logging: Locate the “CloudWatch Audit Logging” option and disable it by unchecking the box or selecting “Disabled” from the dropdown menu.
- Save Changes: Scroll to the bottom of the page and click on the “Modify” button to save the changes.
- Verify Configuration: Once the changes are saved, verify that CloudWatch audit logging is disabled for the MQ Broker by checking the broker’s configuration settings.
Using CLI
Using CLI
To remediate the misconfiguration of MQ Brokers having CloudWatch audit logging enabled for AWS Security Groups using AWS CLI, follow these steps:
-
Identify the AWS Security Groups associated with the MQ Brokers:
- Run the following AWS CLI command to list all the AWS Security Groups associated with the MQ Brokers:
- Note down the Security Group IDs associated with the MQ Brokers.
- Run the following AWS CLI command to list all the AWS Security Groups associated with the MQ Brokers:
-
Disable CloudWatch audit logging for the identified Security Groups:
- Run the following AWS CLI command for each Security Group ID to disable CloudWatch audit logging:
<BROKER_ID>
with the actual ID of the MQ Broker associated with the Security Group. - Run the following AWS CLI command for each Security Group ID to disable CloudWatch audit logging:
-
Verify the changes:
- Run the following AWS CLI command to describe the MQ Broker and verify that CloudWatch audit logging is disabled for the Security Group:
<BROKER_ID>
with the actual ID of the MQ Broker associated with the Security Group. - Run the following AWS CLI command to describe the MQ Broker and verify that CloudWatch audit logging is disabled for the Security Group:
-
Repeat for other Security Groups:
- If there are multiple Security Groups associated with the MQ Brokers, repeat steps 2 and 3 for each Security Group.
Using Python
Using Python
To remediate the misconfiguration of MQ Brokers having CloudWatch audit logging enabled for AWS Security Groups using Python, you can follow these steps:
- Identify the Security Groups: First, you need to identify the Security Groups associated with your MQ Brokers.
- Disable CloudWatch Audit Logging: You can use the AWS SDK for Python (Boto3) to disable CloudWatch audit logging for the identified Security Groups. Here is a sample Python code snippet to achieve this:
- Run the Python Script: Save the above Python script in a file (e.g.,
remediate_security_groups.py
) and execute it using Python. Make sure you have the necessary IAM permissions to modify the Security Groups.