Skip to content

doyindevops/secure-banking-cicd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure Banking CI/CD Pipeline

This is a production-grade DevSecOps pipeline for securely delivering containerized applications using GitHub Actions, AWS Fargate, and industry-standard security tools.


📺 Walkthrough Video

▶️ Watch on YouTube

🧭 Project Objective

With this project I demonstrated how to build and deploy a secure, scalable, and observable CI/CD pipeline tailored for cloud-native applications in regulated or high-security environments such as banking or finance.

I integrated automated testing, static/dynamic code analysis, container orchestration, and multi-environment infrastructure provisioning—all using infrastructure-as-code and GitHub Actions.


💼 Why This Project Matters

Modern banking applications require:

  • Zero-downtime deployments
  • Infrastructure reproducibility
  • Secure software supply chain
  • Real-time security and code quality checks

This CI/CD project addresses all of these needs, serving as a robust template for real-world DevOps teams or production teams in regulated industries.


🔨 Architecture Overview

The pipeline consists of:

  • Three GitHub Actions workflows (dev, stage, prod)
  • Terraform-managed AWS infrastructure (modular)
  • Security gates via SonarCloud (SAST) and OWASP ZAP (DAST)
  • Container builds with Docker and hosted on DockerHub
  • Fargate ECS deployments
  • Slack notifications for deployment visibility

⚙️ Stack & Technologies

  • Language/Framework: Python (Flask)
  • Containerization: Docker
  • CI/CD Automation: GitHub Actions
  • Security Scanning:
    • Static: SonarCloud
    • Dynamic: OWASP ZAP
  • Infrastructure as Code: Terraform
  • Cloud Platform: AWS (ECS, VPC, IAM, S3, DynamoDB)
  • State Management: S3 + DynamoDB locking
  • Notifications: Slack

📊 CI/CD Workflow Summary

Branch Trigger Type Actions Performed
dev Push Linting, SonarCloud, OWASP ZAP, Plan Only
stage Push Full scan, build, ECS deploy to staging
main Push Full scan, build, ECS production deploy + Slack

📁 Repository Structure

.
├── app/                    # Flask App
│   ├── app.py
│   └── Dockerfile
├── terraform/
│   ├── envs/
│   │   ├── dev/
│   │   ├── stage/
│   │   └── prod/
│   └── modules/
│       ├── ecs/
│       ├── vpc/
│       └── security/
├── .github/workflows/      # GitHub Actions Pipelines
│   ├── dev-pipeline.yml
│   ├── stage-pipeline.yml
│   └── prod-pipeline.yml
└── README.md

🔐 GitHub Secrets

Secret Name Description
AWS_ACCESS_KEY_ID AWS IAM access for Terraform
AWS_SECRET_ACCESS_KEY AWS IAM secret for Terraform
SONAR_TOKEN Token for SonarCloud SAST integration
SONAR_HOST_URL URL to SonarCloud API
SLACK_WEBHOOK_URL Slack incoming webhook for notifications

📸 Screenshots (Infra, Pipelines, ECS)

Included are all key screenshots for:

  • ECS cluster and tasks running
  • SonarCloud dashboard
  • Slack deployment alert
  • Terraform backend: S3 + DynamoDB
  • GitHub Actions runs for each environment

🖼️ Image Gallery

Browse all related screenshots used in this project with explanations:

👉 Click here to view the full Gallery


🧪 Notable Errors & Debugging Journey

  1. ❌ OWASP ZAP Failure to Scan Docker App (Exit Code 3) Error Message:
SonarQube & OWASP ZAP Scanning  
failed to scan the target: Error: The process '/usr/bin/docker' failed with exit code 3  
No files were found with the provided path: owasp-zap-report.html. No artifacts will be uploaded.

Cause: This issue occurred due to GitHub-hosted runners not being able to properly execute Docker-based scans under certain job constraints. The OWASP ZAP container scan couldn't bind to the exposed Flask app.

Resolution: ✅ Temporarily bypassed this by allowing the pipeline to continue (continue-on-error: true) while logging and preserving the error for future action.

🔧 Why it wasn’t resolved immediately: Because this project involved deploying real AWS infrastructure (ECS, S3, DynamoDB, etc.), I was mindful of incurring unnecessary AWS charges. I chose to defer deep debugging in order to decommission the stack quickly and avoid cost accumulation.

📌 Next steps for future fix:

Ensure the Flask app is fully initialized before ZAP runs (via health checks or sleep).

Explore using Docker Compose to coordinate app and ZAP containers locally before deploying.

Test OWASP integration in a more cost-efficient sandbox environment.

✅ Achievements & Highlights

  • Successfully deployed a multi-environment infrastructure using modular Terraform
  • Enabled DevSecOps best practices with automated SAST and DAST checks
  • Fully integrated Slack notifications for release observability
  • Delivered reproducible IaC provisioning via remote state and locking
  • Demonstrated secure app deployment using ECS Fargate

📌 Future Enhancements that I might continue on

  • Introduce GitHub PR feedback via SonarCloud
  • Add manual approval gates before production deploy
  • Integrate Route53 domain and HTTPS via ACM + ALB
  • Deploy more complex workloads (e.g., microservices)

🙌 Credits

This project is Created by @doyindevops — as part of a full-scale DevOps portfolio initiative.

About

Secure, production-ready CI/CD pipeline with SonarQube, ZAP, Terraform, and AWS Fargate — built for DevSecOps excellence.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors