MBMihir Bhavsar
All work

Security gates in a Jenkins-to-Kubernetes pipeline

A Jenkins pipeline with security gates at build and deploy, shipping a three-tier Java app to self-managed Kubernetes on every push.

Pipeline stages

  1. GitHub webhook
  2. Maven build
  3. SonarQube
  4. OWASP Dependency-Check
  5. Docker image
  6. Trivy scan
  7. Kubernetes deploy

Context

A personal project: a CI/CD pipeline with security gates built into its build and deploy stages. It ships a three-tier Java application to a self-managed Kubernetes cluster, and it runs on every push.

Architecture

Every push runs the pipeline; three of its stages are security gates

Pick one to light up the parts behind it.

  • Jenkins pipeline · Runs on every push

    • Maven build · Java app
    • SonarQube · static analysis
    • Dependency-Check · OWASP scan
    • Docker image
    • Trivy · image scan
    • Deploy · to Kubernetes
  • GitHub · push webhook
  • Kubernetes cluster · Self-managed

    • Three-tier Java app

Connections

  • GitHub to Jenkins pipeline
  • Maven build to SonarQube
  • SonarQube to Dependency-Check
  • Dependency-Check to Docker image
  • Docker image to Trivy
  • Trivy to Deploy
  • Deploy to Kubernetes cluster

A push to GitHub fires a webhook, and Jenkins runs the pipeline. Maven builds the application, SonarQube runs static analysis on the code, and OWASP Dependency-Check scans its dependencies. The pipeline then builds a Docker image, Trivy scans that image, and the application is deployed to the cluster. SonarQube, Dependency-Check and Trivy are the security gates.

What I built

My part

  • The Jenkins pipeline from end to end, with its three security gates.
  • The GitHub webhook that starts it on every push.
  • The deployment to the self-managed Kubernetes cluster.

Results

Every push starts the pipeline automatically, and the whole build-scan-deploy workflow runs without a manual step.