DevSecOps Pipeline - AWS
Author: Damien Burks
Know Before You Go
This project is a little expense, and you will rack up a nice bill in AWS if you leave all your resources created. Therefore, I recommend that you TEAR IT ALL DOWN when you're done. Do not leave your EKS cluster running, you'll be charged for it.
Prerequisities
- Before you begin this, you will want to have some knowledge of AWS services and how they work, as well as prior knowledge of Terraform. You can take a look at Building Cloud DevSecOps Pipelines (In Theory) for more information.
- You will also want to ensure that you have an AWS account created. You can go through the account creation process here: AWS Account Creation Process
- Make sure you have the following installed on your local machine:
Overview
So you've decided to go down the path of building your own Cloud Native DevSecOps pipeline within AWS? Well, hell... welcome! This is the one of my favorite projects where I'm going to show you how to setup your own AWS pipeline using Terraform Cloud. Unlike the DevSecOps Home Lab, we're just focused on developing the pipeline and deploying an application into Elastic Kubernetes Service (EKS).
Luckily for you all, you won't need to do anything. I've taken the liberty of developing all of the code for you. These are the two GitHub repositories that you need to look at before we get started:
- DevSecOps Pipeline: https://github.com/The-DevSec-Blueprint/aws-devsecops-pipeline
- FastAPI Application: https://github.com/The-DevSec-Blueprint/awsome-fastapi
Architecture Diagram
Architecture Breakdown
At a VERY high level, the architecture represents an automated CI/CD pipeline leveraging several AWS services to deploy containerized applications:
- AWS CodePipeline: Manages the end-to-end flow of code changes, automating build, test, and deployment stages.
- AWS CodeBuild: Builds and tests the application code, generating deployable artifacts, and executing Security Scans with Snyk and Trivy.
- Amazon S3: Stores artifacts like build outputs and deployment files.
- AWS Systems Manager (SSM) Parameter Store: Securely manages configuration data and secrets used for Snyk.
- Amazon EKS: Serves as the deployment environment for containerized workloads, providing scalability and orchestration.
Flow Overview:
- CodePipeline orchestrates the process.
- CodeBuild validates, scans, and compiles the code while also interacting with SSM.
- Artifacts are stored in S3.
- Applications are deployed to the EKS cluster.
This architecture ensures automation, security, and scalability for modern DevSecOps workflows.