feat: Implement DevSecOps pipeline with security scanning + Automated Ollama Deployment#10
Open
agiledevopsguru wants to merge 43 commits intoTrainWithShubham:dockerfrom
Open
feat: Implement DevSecOps pipeline with security scanning + Automated Ollama Deployment#10agiledevopsguru wants to merge 43 commits intoTrainWithShubham:dockerfrom
agiledevopsguru wants to merge 43 commits intoTrainWithShubham:dockerfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Overview
This PR adds a complete DevSecOps CI/CD pipeline on top of the existing Docker setup, implementing comprehensive security scanning, automated deployment, enhanced monitoring, and automated Ollama model pulling with production-grade deployment architecture.
Base Branch
Building on top of the
dockerbranch which already includes:What This PR Adds
DevSecOps Pipeline
Infrastructure & Deployment
.env.exampletemplateEnhancements
DevSecOps Pipeline Flow
🆕 Ollama Automation - Two Deployment Methods
Method 1: All-in-One (Local/Development)
Architecture:
docker-compose.ymlollama-pull-modelservice auto-pulls tinyllamaMethod 2: Separate Ollama Tier (Production - DEFAULT)
Architecture:
app-tier.yml🔧 Key Files Added
DevSecOps Pipeline
.github/workflows/- 11 CI/CD workflow filesPIPELINE_FLOW.md- Pipeline documentation.trivyignore,trivy.yaml- Security scan config.zap/rules.tsv- DAST rulessuppression.xml- Dependency check configDockerfile.multistage- Optimized build🆕 Ollama Automation
scripts/ollama-setup.sh- EC2 User Data script for automated Ollama installationapp-tier.yml- Production deployment file (MySQL + BankApp only)METHOD2_SETUP.md- Complete setup guide for separate Ollama EC2DEPLOYMENT_METHODS.md- Quick comparison of both methodsDEPLOYMENT_GUIDE.md- Detailed deployment instructions📸 Screenshots
1️⃣ GitHub Actions – All pipelines passing ✅
2️⃣ EC2 Deployment – Live Application Running
3️⃣ Enhanced Dashboard – With stats cards
4️⃣ SAST Report – Semgrep results & DAST Report – OWASP ZAP findings (Artifacts)
5️⃣ NVD API Key Generation for OWASP Dependency Checks
6️⃣ No Leaks Detected & Pipeline Summary
7️⃣ EC2 Instances
8️⃣ GITHUB SECRETS
9️⃣ GITHUB VARIABLES
🔟 Docker Image created, Docker Process running
Security Improvements
🆕 Ollama Automation Benefits
Testing
Required Secrets (for deployment)
DOCKERHUB_TOKENEC2_SSH_HOSTEC2_SSH_USERubuntu)EC2_SSH_PRIVATE_KEYDB_USERNAMEDB_PASSWORDDB_ROOT_PASSWORDOLLAMA_URLhttp://172.31.x.x:11434) - Required for Method 2DOCKERHUB_USER🎯 What Changed in This Update
Before: Manual Ollama setup required
After: Fully automated via Docker Compose (Method 1) or EC2 User Data (Method 2)
Before: Single deployment method
After: Two methods with production-grade architecture as default
Before: No production-grade AI tier separation
After: Dedicated Ollama EC2 for production scalability
📚 Documentation
README.md- Updated with Method 2 as defaultMETHOD2_SETUP.md- Step-by-step production setup guideDEPLOYMENT_METHODS.md- Quick comparison tableDEPLOYMENT_GUIDE.md- Detailed instructions for both methodsThank You :)