Provisioning a Secure EKS Environment in AWS
Discover how we successfully built a secure, scalable, and efficient EKS environment to support social token infrastructure by leveraging advanced AWS services and implementing strong security practices.
Client Overview
Roll is a pioneering platform in the creator economy, providing infrastructure and APIs for digital communities to create and integrate social tokens into financial systems and social platforms. Designed for creators and online communities, Roll empowers users to generate independent units of value and foster community interaction across the web.
Challenge
Complex Networking Components
Navigating the intricacies of VPCs, subnets, and security groups.
IAM Configuration
Properly configuring IAM roles and policies for the EKS cluster and worker nodes.
Robust Security Settings
Ensuring the EKS cluster had strong security settings, including security groups, network ACLs, and encryption.
Role-Based Access Control
Implementing Kubernetes Role-Based Access Control (RBAC) for effective permissions management.
Secrets Management
Managing sensitive data securely within Kubernetes.
Monitoring and Logging
Setting up comprehensive monitoring and logging solutions for the EKS cluster and its workloads.
AWS Service Integration
Integrating EKS with other AWS services such as RDS and S3.
CI/CD Pipelines
Establishing continuous integration and continuous deployment (CI/CD) pipelines for automated deployments to the EKS cluster.
Solution
- To define and manage the infrastructure as code, the client used Terraform and Terragrunt:
Secure connections were critical, so we integrated AWS Client VPN and AWS IAM Identity Center for safe access to private subnets. Adhering to the principle of least privilege, we meticulously crafted IAM roles and policies for both the EKS control plane and worker nodes. Security groups were configured with the minimum required access rules to ensure robust protection.
Granular permissions were achieved through Kubernetes Role-Based Access Control (RBAC), defining specific permissions for users, groups, and service accounts. Workloads were separated into different namespaces, each governed by appropriate RBAC rules. To secure sensitive data, we employed Hashicorp Vault alongside Kubernetes secrets.
For resource management, we implemented the Horizontal Pod Autoscaler (HPA) to scale pod replicas based on CPU usage. SSL certificates were managed with cert-manager, and NGINX served as the ingress controller, securely exposing the application to the Internet. Dynamic volume provisioning was handled by the EBS CSI driver, while IAM Roles for Service Accounts (IRSA) granted Kubernetes pods fine-grained permissions for accessing AWS services.
- For enhanced observability:
- To automate deployments:
These comprehensive measures resulted in stable and secure networking for the EKS cluster, significantly reducing connectivity issues and enhancing overall reliability. Permissions for users and applications were meticulously managed to prevent overexposure, thereby boosting security and compliance. Well-configured security groups and network ACLs further mitigated the risk of unauthorized access and attacks.
Results
Enhanced Stability and Security
Improved reliability and reduced connectivity issues through robust networking practices and secure configurations.
Controlled Access and Permissions
Enhanced security and compliance by managing user and application permissions, and ensuring authorised access to cluster resources.
Mitigated Unauthorised Access Risks
Reduced risks of unauthorised access and attacks with well-configured security groups and network ACLs.
Secure Data Management
Lowered the risk of data breaches by securely managing sensitive data using advanced encryption and secrets management tools.
Optimised Resource Allocation
Automatically adjusted resources based on workload demands, ensuring efficient and cost-effective operations.
Improved Observability and Deployment
Gained deep visibility into cluster performance for proactive maintenance, and accelerated deployment processes for consistent and reliable updates.
Technology Stack
To achieve these results, the following technologies and tools were utilised:- Cloud Computing: VPC, IAM, EKS, EBS, EC2, ECR, Client VPN, Transit Gateway, KMS, S3
- Infrastructure as Code: Terraform, Terragrunt
- CI/CD: Github Actions
- Log Management, Monitoring, and Alerting: Datadog, Slack
- Team Collaboration: Zenhub, Slack
- Source Control: Github, Git