- Project Overview
- Repo Structure
- App Features
- UI Preview
- Local Installation & Setup
- Docker Build & Local Testing
- DevSecOps Pipeline
- Images & Screenshots
- Troubleshooting
- Contributing
- Resources
- License
- App: Simple Flask web app with UI and API endpoints
- Pipeline: GitHub Actions → Security Scans → Container Registry → AWS EC2 → Kubernetes (kind) → Argo CD (GitOps)
- Goal: Learn, build, and deploy like a real DevSecOps team!
app/ # Flask app source
templates/ # HTML UI
static/ # CSS
tests/ # Unit tests
Dockerfile # Container build instructions
.github/workflows/ # GitHub Actions pipeline
kubernetes/ # Kubernetes manifests (Deployment/Service)
images/ # Supporting screenshots & diagrams
| Route | Method | Description |
|---|---|---|
/ |
GET | Serves the UI page (index.html) |
/api/status |
GET | Returns JSON status (used by UI button) |
/health |
GET | Health endpoint for readiness checks |
Why
/health?
Used by load balancers, Kubernetes probes, and uptime monitors.
The web UI running locally at http://localhost:5000
- Commit & Push Changes
git add . git commit -m "describe what you changed" git push origin main
- Sync with Remote (Rebase)
git pull --rebase origin main
Keeps history clean by replaying your commits on top of the latest remote changes.
git clone https://github.com/<your-username>/<repo-name>.git
cd <repo-name>cd app
pip install -r requirements.txtpython main.py- Access the app at: http://localhost:5000
pytest ../tests- Never share your personal access token!
If exposed, revoke it immediately.
- Go to: GitHub → Settings → Developer settings → Personal access tokens
- Recommended scopes:
read:packageswrite:packagesrepo(if needed)
- Go to: Repo → Settings → Secrets and variables → Actions
- Add:
GHCR_TOKENGHCR_USERNAME
- Name: devsecops-demo
- OS: Ubuntu 22.04
- Type: t3.medium
- Storage: 20–30 GB
- Security Group: Allow SSH (22), HTTP (80), and custom ports (5000, 30080, 9000)
ssh -i ~/Documents/devsecops.pem ubuntu@<EC2_PUBLIC_IP>sudo apt update
sudo apt install docker.io -y
sudo usermod -aG docker ubuntu
newgrp docker
docker --version
docker ps- Login to GHCR (if private):
docker login ghcr.io
- Run the app:
docker run -d -p 5000:5000 ghcr.io/<github-username>/<image-name>:latest
- Check:
docker ps curl http://localhost:5000/health
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.31.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
kind version
kind create cluster --name devsecops-democurl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
kubectl version --client
kubectl config current-context
kubectl get nodeskubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl get pods -n argocd -wkubectl get svc -n argocd
kubectl port-forward svc/argocd-server -n argocd 9000:443 --address 0.0.0.0- Open:
https://<EC2_PUBLIC_IP>:9000
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo- Username: admin
- Password: (output above)
export GHCR_TOKEN="paste_token_here"
kubectl create secret docker-registry github-container-registry \
--docker-server=ghcr.io \
--docker-username=<github-username> \
--docker-password=<github-token> \
--docker-email=<email>
unset GHCR_TOKEN- Add your Kubernetes manifests to
kubernetes/ - Create an Argo CD Application pointing to that folder
- Argo will sync automatically
- Push a commit and pipeline will run successfully
docker build -t devsecops-webui:latest .docker run -d -p 5000:5000 devsecops-webui:latest- Access the app at: http://localhost:5000
curl http://localhost:5000/health- Docker login fails:
- Check token scopes and registry URL
- Argo CD UI not reachable:
- Check port-forward and EC2 security group
- Kubernetes can’t pull image:
- Ensure secret exists and is referenced in your Deployment
For more help, see GitHub Discussions or open an issue.
We welcome contributions! Please follow these steps:
- Fork the repository (cybraman/devsecops-project)
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m "Add your feature") - Push to your branch (
git push origin feature/your-feature) - Open a Pull Request (PRs)
- Use the provided issue template for bug reports and feature requests (Issues)
- Use the PR template for clear, descriptive pull requests (PRs)
For more help, see GitHub Discussions or open an issue.
MIT License — see LICENSE for details.
Happy DevSecOps-ing! 🚀


















