Profile Applicability
- Level 2
Description
Unrestricted access to Kafka clusters, allowing connections from 0.0.0.0/0 (IPv4) or ::/0 (IPv6), poses a significant security risk. This configuration exposes clusters to unauthorized access, brute-force attacks, and potential misuse. To safeguard sensitive data and ensure only trusted clients connect, Kafka clusters must have unrestricted access disabled, restricting access to specific trusted IP ranges or private networks.
Rationale
Enhanced Security: Prevents unauthorized connections to Kafka clusters.
Risk Mitigation: Protects against malicious activities, including brute-force attacks and data breaches.
Compliance: Aligns with security best practices and regulatory requirements.
Impact
Pros:
Safeguards Kafka clusters from unauthorized access.
Reduces the risk of data theft and exploits.
Enhances security posture by limiting public exposure.
Cons:
May require configuration changes for secure access methods, such as private networks or VPNs.
Could temporarily disrupt workflows if public access was previously used.
Default Value
By default, Kafka clusters may permit unrestricted access if not explicitly configured.
Pre-Requisite
IAM Permissions:
kafka:DescribeCluster
kafka:UpdateClusterConfiguration
AWS CLI installed and configured.
Remediation
Test Plan:
Using AWS Console:
Sign in to the AWS Management Console.
Navigate to the MSK Dashboard.
Select Clusters from the left-hand menu.
Verify the access control configurations for each cluster and ensure unrestricted access (0.0.0.0/0 or ::/0) is disabled.
Using AWS CLI:
Identify Unrestricted Access:
aws kafka describe-cluster --cluster-arn <cluster-arn> --query "ClusterInfo.BrokerNodeGroupInfo.SecurityGroups"
Verify that security groups associated with the cluster do not allow unrestricted access.
Implementation Steps:
Using AWS Console:
Sign in to the AWS Management Console.
Navigate to the MSK Dashboard.
Select the Kafka cluster to update.
Edit the network configuration to restrict access to trusted IP ranges or private subnets.
Save the changes.
Using AWS CLI:
Update the Security Group to Restrict Access:
aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol tcp --port <kafka-port> --cidr 0.0.0.0/0 aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol tcp --port <kafka-port> --cidr ::/0
Add Secure Rules for Trusted IP Ranges (if necessary):
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port <kafka-port> --cidr <trusted-cidr>
Backout Plan
Using AWS Console:
If restricting access causes issues, sign in to the AWS Management Console.
Navigate to Amazon MSK, select the cluster, and review the security group and network settings.
Revert the security group or VPC settings to their previous configuration (allowing broader access) to restore functionality, though this is not recommended from a security standpoint.
Save the changes and monitor the Kafka cluster to ensure access is restored as expected.
Using AWS CLI:
If access restrictions cause issues, revert the security group changes by allowing broader access (e.g., opening up the IP range):
aws ec2 authorize-security-group-ingress --region <REGION> --group-id <SECURITY_GROUP_ID> --protocol tcp --port 9092 --cidr 0.0.0.0/0
Verify that the cluster is accessible again and troubleshoot as necessary:
aws ec2 describe-security-groups --group-ids <SECURITY_GROUP_ID> --region <REGION>
References