This rule ensures that the security group for AWS EKS cluster is not overly permissive to all traffic.
Rule | Ensure AWS EKS cluster security group is not overly permissive to all traffic |
Framework | CloudDefense.AI Security |
Severity | ✔ High |
AWS EKS Cluster Security Group Rule for CloudDefense
Description:
AWS Elastic Kubernetes Service (EKS) clusters require a security group rule to regulate inbound and outbound traffic. The security group should be configured to allow only necessary traffic for the CloudDefense service, preventing unauthorized access and potential security breaches.
Rule Policy:
The rule policy enforces restricting the security group associated with the AWS EKS cluster to only allow traffic necessary for the CloudDefense service. This ensures a more secure environment by disallowing overly permissive access.
Troubleshooting Steps (if applicable):
If you encounter any issues with this rule, follow these troubleshooting steps to resolve them:
Necessary Code/Policy (if applicable):
Below is an example of the required security group rule using AWS CLI command:
aws ec2 authorize-security-group-ingress --group-id <security_group_id> --protocol tcp --port <port_number> --source <source_IP_range>
Replace
<security_group_id>
with the actual security group ID associated with your EKS cluster. <port_number>
should be replaced with the specific port number required for CloudDefense, and <source_IP_range>
should be the IP range or CIDR block from which CloudDefense operates.Step-by-step Guide for Remediation:
Using AWS CLI:
Step 1: Retrieve the security group ID:
Use the following AWS CLI command to retrieve the security group ID associated with the EKS cluster:
aws eks describe-cluster --name <cluster_name> --query 'cluster.resourcesVpcConfig.clusterSecurityGroupId' --output text
Replace
<cluster_name>
with the name of your EKS cluster.Step 2: Modify the security group rule:
Run the following AWS CLI command to add the necessary security group rule:
aws ec2 authorize-security-group-ingress --group-id <security_group_id> --protocol tcp --port <port_number> --source <source_IP_range>
Replace
<security_group_id>
with the security group ID retrieved in Step 1. Update <port_number>
with the specific port number required for CloudDefense, and <source_IP_range>
with the IP range or CIDR block from which CloudDefense operates.Using AWS Management Console:
Step 1: Retrieve the security group ID:
Step 2: Modify the security group rule:
Conclusion:
By enforcing this rule, you restrict the AWS EKS cluster's security group to only allow essential traffic for CloudDefense. This ensures a more secure environment by preventing unauthorized access and potential security breaches.