This rule ensures the EC2 instance security group does not allow all inbound traffic to TCP port 6379 (Redis).
Rule | Ensure Security Group attached to EC2 instance does not allow inbound traffic from all to TCP port 6379 (Redis) |
Framework | CloudDefense.AI Security |
Severity | ✔ High |
Description
The security group attached to an EC2 instance should have a rule that restricts inbound traffic on TCP port 6379 (Redis) to improve security and prevent unauthorized access to the EC2 instance. The rule ensures that only specific IP addresses or security groups are allowed to access the Redis service running on the EC2 instance.
Troubleshooting Steps
If you encounter any issues related to the security group not allowing inbound traffic from all to TCP port 6379, follow these troubleshooting steps:
Verify security group rules:
Update the security group rule:
Test connectivity:
Necessary Codes
No specific codes are required for this rule.
Remediation Guide
Follow the steps below to resolve the issue of the security group allowing inbound traffic from all to TCP port 6379:
Log in to the AWS Management Console.
Go to the EC2 service.
Select "Security Groups" from the left sidebar.
Find the security group associated with the target EC2 instance where Redis is running.
Select the security group and click on the "Inbound rules" tab.
Identify the rule allowing inbound traffic from all IP addresses to TCP port 6379.
Click on the "Actions" button and select "Edit inbound rules."
Locate the rule allowing traffic on TCP port 6379 from all sources and remove it.
Add new inbound rules to allow access only from the specific IP addresses or security groups that require access to the Redis service:
Click on "Save rules" to apply the changes to the security group.
Test connectivity to ensure the Redis service is accessible only from the intended sources by trying to connect to TCP port 6379 from the specified IP addresses or security groups.
Conclusion
Following these steps, you can ensure the security group attached to the EC2 instance does not allow inbound traffic from all to TCP port 6379 (Redis) for CloudDefense. By restricting access to specific IP addresses or security groups, you enhance the security posture of your EC2 instance and protect it from unauthorized access.