This rule ensures that EKS clusters endpoint restrict public access to enhance security measures.
Rule | EKS clusters endpoint should restrict public access |
Framework | NIST Cybersecurity Framework (CSF) v1.1 |
Severity | ✔ High |
Rule Description
The rule states that the endpoint of EKS (Elastic Kubernetes Service) clusters should restrict public access to comply with the NIST Cybersecurity Framework (CSF) v1. This is important for maintaining the security and privacy of the clusters.
Troubleshooting Steps
If there are issues with restricting public access to the EKS clusters' endpoint, you can follow these troubleshooting steps:
Necessary Codes
There are certain necessary codes that need to be implemented to restrict public access to the EKS cluster endpoint.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-public-access
spec:
podSelector: {}
policyTypes:
- Ingress
ingress:
- from:
- ipBlock:
cidr: 0.0.0.0/0
This code snippet creates a network policy that denies all incoming traffic from any IP block. It ensures that only private traffic is allowed to access the EKS clusters' endpoint.
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port <port> --source-security-group <source-security-group-id>
This command authorizes inbound traffic from a specific security group only, ensuring that public access is restricted.
Step-by-Step Guide for Remediation
Follow these step-by-step instructions to remediate the issue and restrict public access to the EKS clusters' endpoint:
kubectl apply -f network_policy.yaml
Ensure that the "deny-public-access" network policy is present and has the desired pod selector and ingress rules.kubectl get networkpolicy
<security-group-id>
and <source-security-group-id>
with the appropriate values.By following these steps, you will successfully restrict public access to the EKS cluster's endpoint, meeting the requirements of the NIST Cybersecurity Framework (CSF) v1.