My EKS E-commerce Infrastructure Project: Repository Setup and Initial Security Review
As part of my ongoing DevOps learning journey, I recently started working on an AWS EKS-based e-commerce infrastructure project
This is a team project, but I also decided to maintain an independent copy under my personal GitHub account. My goal is to understand the infrastructure from the ground up, follow the implementation process carefully, and develop practical experience in cloud infrastructure security.
Rather than rushing into deployment, I decided to take time to understand the existing Terraform configuration and identify potential security concerns.
In this post, I will document my initial progress and some of the things I have learned so far.
1. Setting Up My Personal Project Repository
The first step was to prepare my development environment.
I am working with the following tools:
- Windows 11
- WSL2 running Ubuntu 24.04
- Visual Studio Code connected to WSL
- Git for version control
- Terraform project files
After cloning the original project repository, I followed the team's instructions to remove its existing Git metadata.
This was important because I wanted to initialise a fresh Git repository and manage my own project history independently.
I then configured my Git username and email, created the main branch, and connected the local project to my personal GitHub repository.
At this stage, the repository has been configured locally, but I have not yet committed or pushed the project files. I want to complete an initial review before publishing anything.
This project also builds on my earlier hands-on experience with AWS infrastructure. In a previous project, I explored how EC2 instances, NGINX, an Application Load Balancer, Auto Scaling, and Amazon EFS work together to support a highly available website. You can read about that experience here: How I Built a Highly Available Website on AWS Using EC2, NGINX, ALB, Auto Scaling and EFS
2. Understanding the GitHub OIDC Configuration Script
While reviewing the project files, I came across a Bash script named repo-org-id-gen.sh
The script uses the GitHub REST API to retrieve an organisation ID and repository ID. It requests a GitHub Personal Access Token (PAT) to authenticate its API requests.
I learned that these identifiers can be useful when configuring AWS IAM trust policies for GitHub Actions OpenID Connect (OIDC)
OIDC allows GitHub Actions to obtain temporary AWS credentials without requiring long-lived AWS access keys to be stored in GitHub.
However, I also noticed that the script contained the original organisation and repository names. Since I am maintaining an independent repository, these values will need to be reviewed and updated to match the identity that will actually run my Terraform workflow.
This helped me understand that changing repository names is not just a matter of editing text. The AWS trust relationship must also recognise the correct GitHub identity.
I have also had practical experience working with GitHub Actions through an earlier project where I built an automated website uptime monitoring system using Bash and GitHub Actions. That experience introduced me to workflow automation, execution logs, and troubleshooting CI/CD workflows. You can read about it here: How I Built an Automated Website Uptime Monitoring System with Bash and GitHub Actions
3. My First Security Review: AWS Security Groups
One of the most interesting parts of my initial review was examining the Terraform file responsible for creating an AWS security group. The file was named 07-security.tf
I discovered that the security group allows inbound traffic through four TCP ports:
| Port\ | Purpose\ |
|---|---|
| 22 | SSH remote administration |
| 80 | HTTP web traffic |
| 443 | HTTPS secure web traffic |
| 3000 | Application traffic |
All four inbound rules reference the same Terraform variable:
security_group_ingress_cidrWhen I checked variables.tf, I found that its default value was:
0.0.0.0/0This means that all IPv4 addresses are permitted as the source for those inbound rules.
This raised an important security concern.
Why This Matters
Port 22 – SSH: Allowing SSH from 0.0.0.0/0 exposes the SSH service to the entire internet. A better approach is to restrict administrative access to trusted IP addresses or use a more controlled access method.
Ports 80 and 443 – HTTP and HTTPS: These may need public access because users must reach the web application. However, we should verify which resources actually use this security group.
Port 3000 – Application Traffic: Port 3000 is commonly used by Node.js applications. It should generally be accessible only through the appropriate load balancer or internal network, rather than directly from the internet.
The security group also permits all outbound IPv4 traffic. This is common in initial infrastructure configurations, but I will examine whether unrestricted outbound access is necessary for this project.
4. What I Have Learned So Far
This initial review has helped me understand a few important concepts:
- Why maintaining an independent Git repository requires more than simply cloning an existing project.
- How GitHub OIDC connects GitHub Actions to AWS IAM.
- Why repository identity matters when configuring cloud access.
- How Terraform security groups control inbound and outbound network traffic.
- Why exposing administrative and application ports to the entire internet can introduce security risks.
- Why infrastructure should be reviewed before deployment rather than assuming that an existing configuration is automatically secure.
Most importantly, I am beginning to understand how security considerations fit into infrastructure development.
5. Current Project Status
I am still in the preparation and review stage.
- ✅ Prepared my WSL Ubuntu development environment.
- ✅ Cloned the existing Terraform project.
- ✅ Removed the original Git metadata.
- ✅ Initialised my independent Git repository.
- ✅ Configured my Git identity and personal GitHub remote.
- ✅ Reviewed the GitHub organisation and repository ID generation script.
- ✅ Inspected the initial AWS security group configuration.
- ⬜ Review the EC2 key pair configuration.
- ⬜ Review the EKS cluster and worker node configurations.
- ⬜ Examine storage, EFS, and kubeconfig security.
- ⬜ Review the GitHub Actions Terraform workflow.
- ⬜ Complete an initial security review before committing and pushing.
- ⬜ Review AWS costs before considering deployment.
Important: No AWS infrastructure has been deployed yet.
I am deliberately taking this step by step because I want to understand what each configuration does, what risks it may introduce, and how it should be secured.
Conclusion
This project is giving me an opportunity to move beyond simply running Terraform commands and begin understanding the infrastructure those commands create.
My focus at this stage is learning how the different components work together, identifying security weaknesses, and understanding how to improve them without breaking the intended architecture.
There is still a lot to learn, but I believe documenting the process will help me track my progress and make the experience useful to other beginners following a similar DevOps path.
More updates will follow as I continue reviewing the infrastructure.
This is another step in my journey from learning cloud concepts to understanding how to build and secure real cloud infrastructure.

Comments
Post a Comment