Skip to content

I built this end-to-end DevSecOps pipeline to demonstrate how I’d run secure, observable, and automated software delivery in a real engineering organization — from commit to cloud, with zero secrets in version control and full compliance guardrails.

Notifications You must be signed in to change notification settings

wizzfi1/FullStack_DevSec

Repository files navigation

🚀 FullStack DevSecOps Demo

A production-grade fullstack pipeline showcasing modern DevSecOps practices — from secure CI/CD to observability and Infrastructure-as-Code (IaC).
This project demonstrates how to take a simple Node.js/Express app and wrap it with a battle-tested DevSecOps workflow used in real companies.


🌟 Highlights

  • CI/CD Pipeline: GitHub Actions with linting, testing, dependency audits, Docker builds, Trivy scans, Gitleaks, CodeQL, Checkov & Terrascan
  • Secure Containerization: Hardened Dockerfiles with non-root users and HEALTHCHECK instructions
  • Runtime Security: Gitleaks (secret scanning), CodeQL (static analysis), npm audit (dependency vulnerabilities)
  • Observability Stack:
    • Prometheus for metrics collection
    • Grafana dashboards (CPU %, memory, HTTP request rates, error rate, latency)
    • Alertmanager + Slack for real-time alerts
    • Sentry for application-level error monitoring and release tracking
  • Environments:
    • Staging: auto-deploy on develop
    • Production: auto-deploy on main
  • IaC Versioning: Full render.yaml and Helm manifests for portability to Kubernetes (k3s, GKE, EKS)

🏗️ Architecture

flowchart TD
    A[GitHub Push] -->|GitHub Actions| B[CI/CD Pipeline]
    B -->|Docker Build + Scan| C[Docker Hub]
    B -->|IaC Scans| D[Checkov & Terrascan]
    B -->|Deploy| E[Render Staging/Prod]
    E -->|App Metrics| F[Prometheus]
    F --> G[Grafana Dashboards]
    F --> H[Alertmanager -> Slack]
    E -->|Errors| I[Sentry]
Loading

🔄 CI/CD Workflow

✅ Lint & Test

  • ESLint → code quality
  • Jest → unit tests

🔒 Security Scans

  • npm audit - dependency vulnerabilities
  • Trivy - container vulnerabilities
  • Gitleaks - secrets detection
  • CodeQL - static analysis
  • Checkov + Terrascan - IaC security

🐳 Build & Push

  • Docker image pushed to Docker Hub with commit + latest tags

🚀 Deployments

Staging (develop branch)

🔗 Live Staging App: https://mydev-staging.onrender.com

Production (main branch)

🔗 Live Production App: https://mydev-prod.onrender.com

🔔 Notifications

Slack messages for staging/prod deployments with build status:


📊 Observability

Prometheus

  • Scrapes app /metrics endpoint (via prom-client)
  • Collects:
    • Default Node.js process metrics
    • http_requests_total counter
    • Latency histogram

🔗 See live link here: https://prometheus-4d0b.onrender.com

Grafana Dashboards

Includes panels for:

  • CPU %
  • Memory usage
  • HTTP requests/sec
  • 5xx error rate
  • 95th percentile latency

🔗 See live link here: https://grafana-iyio.onrender.com

Alertmanager

  • Sends alerts to Slack via webhook
  • Starter rules:
    • CPU > 80% for 2 minutes
    • Error rate > 5% over 5 minutes

Sentry

  • Captures unhandled exceptions
  • Tied to GitHub Actions release versions
  • Shows "Deployed to Staging/Prod" in release timeline

📸 Project in Action

✅ Lint & Tests Passing

Lint + Tests

🚀 Render Staging Deployment

Render Staging Deploy

🌍 Staging Deployment

Staging App

🌍 Production Deployment

Production App

🔔 Slack Notifications

Slack Notifications

📊 Observability with Prometheus & Grafana

Prometheus Dashboard

🐳 Docker Hardening

All service images include:

  • HEALTHCHECK instructions
  • Non-root user execution
  • Minimal base images (node:18-alpine, alpine:3.20, etc.)

☸️ Kubernetes (Future-Ready)

Helm charts included for:

  • myapp (Node.js/Express)
  • Prometheus
  • Grafana
  • Alertmanager

Secrets Management

Secrets managed via K8s Secret resources (Slack webhook, Grafana admin password).

Supported Deployment Environments

  • Local dev: k3s / kind
  • Cloud: GKE, EKS, AKS

⚡ Quick Start (Render)

  1. Fork this repo
  2. Set GitHub Actions secrets:
    • DOCKERHUB_USERNAME, DOCKERHUB_TOKEN
    • RENDER_API_KEY, RENDER_SERVICE_ID, RENDER_SERVICE_ID_PROD
    • SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT
    • SLACK_WEBHOOK_URL
  3. Push to develop → staging deploy
  4. Merge to main → production deploy

📂 Repository Structure


├── src/                    # Node.js app (Express + Sentry + Prometheus metrics)
├── infra/                  # Infra services
│   ├── prometheus/
│   ├── grafana/
│   └── alertmanager/
├── helm/                   # Helm charts for k8s migration
├── .github/workflows/      # CI/CD pipelines
├── render.yaml             # Render IaC config
└── Dockerfile              # App Dockerfile

🎯 Why This Matters

Feature Benefit
Full DevSecOps pipeline Integrated security, monitoring, and alerting
Cloud-native ready Helm charts → easy migration to Kubernetes
Production realism Error tracking, observability, secrets mgmt, IaC scanning
Team collaboration Slack notifications + Sentry releases → transparency
Hands-on expertise End-to-end modern DevSecOps toolchain experience

📬 Contact

Interested in how I can bring end-to-end DevSecOps expertise to your team? Let’s connect!

Built with ❤️ to demonstrate modern DevSecOps practices

GitHub stars License: MIT

About

I built this end-to-end DevSecOps pipeline to demonstrate how I’d run secure, observable, and automated software delivery in a real engineering organization — from commit to cloud, with zero secrets in version control and full compliance guardrails.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published