This rule ensures the Security Group attached to EC2 instance restricts inbound traffic to TCP port 9300.
Rule | Ensure Security Group attached to EC2 instance does not allow inbound traffic from all to TCP port 9300 (Elasticsearch) |
Framework | CloudDefense.AI Security |
Severity | ✔ High |
Rule Description:
The rule ensures that the Security Group attached to the EC2 instance does not allow inbound traffic from all sources to TCP port 9300, which is commonly used for Elasticsearch. By restricting access to this port, it helps to maintain the security and integrity of the EC2 instance and the Elasticsearch service.
Troubleshooting Steps:
Identify the Security Group associated with the EC2 instance:
Check existing inbound rules:
Verify the rule origin:
Remediation Steps:
Open the AWS Management Console.
Navigate to the EC2 service.
Select the target EC2 instance.
Note the Security Group(s) attached to the instance.
Click on the associated Security Group.
In the Inbound Rules section, locate the rule that allows TCP traffic on port 9300 from all sources.
Select the rule and click on the "Actions" button.
From the drop-down menu, choose "Edit inbound rules".
Locate the rule that allows inbound traffic to TCP port 9300 from all sources.
Click the "Remove" button next to the rule.
Review the remaining inbound rules to ensure the necessary access is still permitted for your use case.
Once the changes are reviewed, click on "Save rules" to apply the updated Security Group configuration.
Note: Make sure to consider any other applications or services that might require access to TCP port 9300 and add specific rules to allow access from their respective sources.
Example AWS CLI command:
aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol tcp --port 9300 --source 0.0.0.0/0
Replace
<security-group-id>
with the actual ID of the Security Group associated with the EC2 instance.Additional Notes:
It is important to regularly review and update the Security Group rules based on the specific requirements of your applications and services. Restricting access to only necessary ports and sources helps to minimize the attack surface and ensures the overall security of your infrastructure.