{"id":48979,"date":"2025-04-04T01:36:51","date_gmt":"2025-04-04T01:36:51","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=48979"},"modified":"2025-04-04T01:36:51","modified_gmt":"2025-04-04T01:36:51","slug":"eks-tutorials-types-of-security-groups-created-or-used-in-an-eks-cluster","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/eks-tutorials-types-of-security-groups-created-or-used-in-an-eks-cluster\/","title":{"rendered":"EKS Tutorials: Types of Security Groups Created or Used in an EKS Cluster"},"content":{"rendered":"\n<p>When you <strong>set up an Amazon EKS (Elastic Kubernetes Service) cluster<\/strong>, AWS <strong>automatically creates and\/or requires several security groups<\/strong> to manage access to the <strong>control plane, worker nodes, and other associated components<\/strong>.<\/p>\n\n\n\n<p>Here\u2019s a <strong>complete breakdown<\/strong> of the types of <strong>Security Groups<\/strong> involved during an EKS cluster setup:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd10 Types of Security Groups Created or Used in an EKS Cluster<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>EKS Control Plane Security Group<\/strong> (Optional\/Custom)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\ud83d\udd39 Name<\/th><th>Custom<\/th><\/tr><\/thead><tbody><tr><td>EKS Control Plane Security Group<\/td><td>\u2705 (You define it in the cluster config)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose:<\/strong> Controls communication <strong>from the control plane to worker nodes (EC2\/EKS-managed)<\/strong>.<\/li>\n\n\n\n<li><strong>Traffic direction:<\/strong> Egress traffic from control plane \u2192 worker nodes (TCP 443 by default).<\/li>\n\n\n\n<li><strong>When it&#8217;s defined:<\/strong> You specify this group when creating a cluster using the <code>vpcConfig.securityGroupIds<\/code>.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u2705 This group is <strong>not created automatically<\/strong> \u2013 it\u2019s the <strong>one you pass in during setup<\/strong>.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>EKS Managed Node Group Security Group<\/strong> (Auto-created by EKS)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\ud83d\udd39 Name<\/th><th>Auto-created<\/th><\/tr><\/thead><tbody><tr><td>Node Security Group (Worker Nodes)<\/td><td>\u2705 Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Created when:<\/strong> You launch a <strong>managed node group<\/strong>.<\/li>\n\n\n\n<li><strong>Purpose:<\/strong> Controls traffic <strong>between nodes<\/strong> and <strong>from the nodes to the control plane<\/strong>.<\/li>\n\n\n\n<li>Includes <strong>ingress rules<\/strong> for:\n<ul class=\"wp-block-list\">\n<li>Node-to-node communication<\/li>\n\n\n\n<li>Control plane-to-node communication<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u26a0\ufe0f This security group is <strong>automatically associated<\/strong> with your EC2 worker nodes.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>Cluster Shared Node Security Group<\/strong> (Created Automatically)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\ud83d\udd39 Name<\/th><th>Auto-created<\/th><\/tr><\/thead><tbody><tr><td>Cluster Shared Node Security Group<\/td><td>\u2705 Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose:<\/strong> Used for:\n<ul class=\"wp-block-list\">\n<li>Worker node communication (pods across nodes)<\/li>\n\n\n\n<li>Internal services<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Managed by EKS:<\/strong> You cannot delete this manually.<\/li>\n\n\n\n<li>Shared across multiple node groups in the cluster.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>This SG ensures <strong>pods and services across nodes<\/strong> in the cluster can communicate securely.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>Fargate Pod Execution Role SG<\/strong> (if using Fargate)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\ud83d\udd39 Name<\/th><th>User-defined<\/th><\/tr><\/thead><tbody><tr><td>Fargate Pod ENI Security Group<\/td><td>\u2705 Yes (you must specify)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you&#8217;re using <strong>Fargate profiles<\/strong>, you need to define a <strong>security group<\/strong> that controls the <strong>network interfaces<\/strong> attached to the Fargate pods.<\/li>\n\n\n\n<li>This group handles pod-level network access when no EC2 nodes are used.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>Load Balancer Security Group<\/strong> (Optional)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\ud83d\udd39 Name<\/th><th>Custom or auto<\/th><\/tr><\/thead><tbody><tr><td>Load Balancer SG<\/td><td>\u2705 Yes (by user or created by controller)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For services of type <code>LoadBalancer<\/code>, AWS creates an ELB (Classic\/NLB\/ALB).<\/li>\n\n\n\n<li>This SG controls traffic from the internet or other services to the <strong>service endpoints<\/strong>.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Summary Table<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Security Group Type<\/th><th>Created By<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td>Control Plane SG<\/td><td>User-defined<\/td><td>Allow traffic from control plane to worker nodes<\/td><\/tr><tr><td>Worker Node SG<\/td><td>Auto-created<\/td><td>Allow intra-node and control plane communication<\/td><\/tr><tr><td>Cluster Shared Node SG<\/td><td>Auto-created<\/td><td>Common communication for all nodes<\/td><\/tr><tr><td>Fargate Pod SG<\/td><td>User-defined<\/td><td>Manage traffic for Fargate pod ENIs<\/td><\/tr><tr><td>Load Balancer SG<\/td><td>Controller\/User<\/td><td>Allow external traffic to Kubernetes services<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\udde0 Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Always restrict <strong>Control Plane SG<\/strong> to <strong>only allow required ports (like 443)<\/strong>.<\/li>\n\n\n\n<li>Tag all SGs with <code>kubernetes.io\/cluster\/&lt;cluster-name> = owned<\/code> for EKS to manage them.<\/li>\n\n\n\n<li>Use <strong>Network Policies<\/strong> inside the cluster for fine-grained pod-to-pod security.<\/li>\n\n\n\n<li>Monitor SGs with AWS Config to ensure compliance.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you set up an Amazon EKS (Elastic Kubernetes Service) cluster, AWS automatically creates and\/or requires several security groups to manage access to the control plane, worker nodes, and other&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-48979","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/48979","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=48979"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/48979\/revisions"}],"predecessor-version":[{"id":48980,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/48979\/revisions\/48980"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=48979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=48979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=48979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}