Ayodele AjimatiContact ↗
09 · DevOps & Infrastructure← All projects

End-to-End DevSecOps Pipeline

A complete DevSecOps CI/CD pipeline — build, SAST, container security scan, deploy to Kubernetes, and Prometheus/Grafana observability — where security and monitoring are defaults, not additions.

GitHub repository ↗7 tools · 4 measured outcomes
End-to-End DevSecOps Pipeline

Problem

Security and observability are typically bolted on after incidents. This project builds a pipeline where they are enforced from the start: every commit is statically analysed, every image is scanned for vulnerabilities, and every deployment ships with monitoring already wired in.

Approach

  1. 01

    Built a Jenkins pipeline with 8 stages: Checkout → Build → SAST (SonarQube) → Docker Build → Trivy Image Scan → Push → Deploy to Kubernetes → Smoke Test.

  2. 02

    Configured SonarQube quality gate to fail the pipeline on critical code issues.

  3. 03

    Ran Trivy to scan the built Docker image and fail the pipeline on CRITICAL CVEs.

  4. 04

    Deployed to Kubernetes using kubectl with a rolling update strategy.

  5. 05

    Provisioned Prometheus ServiceMonitor and Grafana dashboard as code — deployed alongside the application.

  6. 06

    Smoke test stage hits the service health endpoint post-deploy and fails the pipeline if unreachable.

Results

Pipeline stages
8 (build → monitor)
Security gates
SonarQube + Trivy
CRITICAL CVE policy
Hard fail
Time commit to monitored deploy
< 12 minutes

Code

Jenkins declarative pipeline with SonarQube gate, Trivy scan, and K8s deploy.

pipeline {
  agent any
  stages {
    stage('SAST') {
      steps {
        withSonarQubeEnv('sonarqube') {
          sh 'mvn sonar:sonar'
        }
        timeout(time: 5, unit: 'MINUTES') {
          waitForQualityGate abortPipeline: true
        }
      }
    }
    stage('Trivy Scan') {
      steps {
        sh 'trivy image --exit-code 1 --severity CRITICAL myapp:$BUILD_NUMBER'
      }
    }
    stage('Deploy') {
      steps {
        sh 'kubectl set image deployment/myapp app=myapp:$BUILD_NUMBER'
        sh 'kubectl rollout status deployment/myapp'
      }
    }
  }
}

Stack

  • Jenkins
  • SonarQube
  • Trivy
  • Docker
  • Kubernetes
  • Prometheus
  • Grafana

Why it matters

  • Pipeline fails on CRITICAL vulnerabilities — no manual override.
  • Grafana dashboards provisioned as code alongside the application on every deploy.
  • Smoke test runs post-deploy; broken services are caught before the pipeline reports success.