XenonStack Recommends

Cyber Security

Amazon EKS Security and its Best Practices | A Beginner's Guide

Navdeep Singh Gill | 28 October 2022

Amazon EKS Security and its Best Practices

Introduction to Amazon EKS Security?

It is a managed service that lets you run Kubernetes on Amazon web services without having to set up, administer, or maintain your control plane or nodes.  Kubernetes is an open-source framework for automating containerized application deployment, scaling, and administration.

  • AWS Availability Zones.
  • Control plane instances are automatically scaled on the bases ofload. Unhealthy or faulty control plane instances are observed, detected, and replaced, and patching and automated version upgrades are done.
  • It could be integrated into various other services to give the scalability of your application, including the following features:
  • Container images on Amazon ECR.
  • Load distribution with elastic load balancing.
  • For authentication, IAM is used.
  • Isolation with VPC.
  • Runs the most recent versions of the open-source Kubernetes software, allowing you to take advantage of the community's current plugins and tooling. Apps on EKS are fully compatible with applications that run on any standard Kubernetes environment, whether in on-premises data centers or public clouds. Any typical Kubernetes application may be migrated to it without requiring code changes.
A serverless interactive query service or interactive data analysis tool which is used for processing complex queries and in a lesser amount of time. Click to explore about our, Amazon Athena Architecture

What is Amazon EKS Security?

It is considered one of the top focused areas of AWS. As an AWS customer, you have access at different levels, like a data center and network architecture designed to complete the needs of the most conscious businesses.

Security of the Cloud: AWS is in charge of safeguarding the infrastructure that runs AWS services in the AWS Cloud. The Kubernetes control plane, which includes the control plane nodes and etcd database, is handled by it. Third-party auditors frequently test and verify the effectiveness of our security as part of the AWS compliance programs.

Security in the cloud: You are in charge of the following areas.

  1. The data plane's setup includes the groups allowing traffic to flow from it control plane into the customer VPC.
  2. The containers' configuration and the nodes' configuration
  3. The operating system of the node.
  4. Other software for related applications:
    Network controls, such as firewall rules, are set up and managed.
    Platform-level identity and access management, either in addition to or instead of IAM
  • Your data's sensitivity, your company's needs, and applicable laws and regulations

Security and compliance are considered joint responsibilities when employing a managed service like it. In general, AWS is in charge of the cloud, while you, the client, are in charge of security "in" the cloud. AWS is in charge of operating the EKS-controlled Kubernetes control plane with Elastic Kubernetes Service. This comprises the Kubernetes masters, ETCD database, and other infrastructure required by AWS to provide a secure and dependable service.

As you progress from self-managed workers to managed node groups to Fargate, AWS will take on more responsibility regarding infrastructure security. With Fargate, for example, AWS is in charge of protecting the underlying instance/runtime your Pods run on.

An executable workflow of the machine learning task, helps to optimize, build, and manage ML workflows.Click to explore about our, Amazon SageMaker

What are the best practices?

AWS' managed Kubernetes service is Amazon Elastic Kubernetes Service (EKS). The Kubernetes masters are hosted and managed by AWS, while the user is in charge of generating the worker nodes, which operate on EC2 instances. While Kubernetes provides several tools for managing workload security, these services aren't enabled by default, even in EKS. To protect their Elastic Kubernetes Service clusters, the user must configure and manage them effectively.

All additional security best practices for using AWS cloud services, particularly EC2, must be followed in addition to the cluster management items below.

EKS Cluster Architecture

For high availability, Elastic Kubernetes Service masters automatically span three Availability Zones. For the workloads, the user is responsible for constructing the node groups as AWS Autoscaling Groups of EC2 instances. These node groups should be put in private subnets in the VPC with NAT Gateways for egress and span multiple AZs. If Internet ingress is necessary for cluster services, public subnets in the VPC can be used to host ELBs.

Cluster Networking

All EKS clusters use the AWS VPC Container Network Interface (CNI) for Kubernetes pod networking. The VPC CNI uses AWS Elastic Network Interfaces (ENI) for pod networking. While this method offers the advantage of directly connecting the pods to the VPC network, it has several disadvantages:

  • For Kubernetes deployment workloads, it does not allow AWS Network Policies or any other method of creating firewall rules. While I can have their EC2 security groups, the CNI only supports security groups per node, which does not correspond to how pods are scheduled on nodes. Because of this shortcoming, the CNI is inappropriate for multi-tenant clusters, and limiting the blast radius if a pod is abused is difficult.
  • The number of ENIs an EC2 instance can support is limited, limiting the number of pods scheduled on a node. The number varies depending on the instance type.

The first issue, a lack of support for network segmentation between workloads in a cluster, is fortunately easy to resolve. The Calico CNI can be installed in Elastic Kubernetes Service with the VPC CNI to support Kubernetes Network Policies.

Protecting the infrastructure

Replace your workers instead of performing in-place updates when a new patch or update becomes available. You can either add instances to an existing auto-scaling group as needed using the latest AMI and gradually drain nodes until all nodes in the group are replaced with the latest AMI, or you can replace all nodes in the group with the latest AMI. Alternatively, you can add instances to a new node group while sequentially cordoning and draining nodes from the old node group until all nodes are replaced.

Identity and Access Management

It is an Amazon Web Service that manages authorization and authentication for other AWS resources. It assigns roles to different users based on permissions and policies, which govern their privileges and actions when using various AWS resources. One of the best security practices when working with EKS is to follow the 'Least Privilege Principle,' which states that users should not be given more permissions than required. Only the necessary permissions to complete a task are granted in this manner.

A type of business analytics cloud-based service which can be used to build visualizations, perform ad hoc analysis. Click to explore about our, Amazon Redshift and Amazon QuickSight

Conclusion

You take on additional security responsibilities when you run workloads on EKS or any Kubernetes cluster. While Kubernetes offers tools to secure your clusters, you are still in charge of how you use them. When supplemented with security best practices such as the Principle of Least Privilege and limiting potential explosion radiuses, these starting ideas should steer you in the correct direction.