<aside>
š This article provides a detailed exploration of a CI/CD pipeline implemented using Jenkins for a Java web application. Through a sequence of steps, it demonstrates the integration of tools such as Maven, SonarQube, Trivy, Snyk, Docker, ACR, Helm, AKS, and OWASP ZAP. The pipeline ensures quality, security, and efficient deployment.
</aside>
Table of contents
Global Architecture of the pipeline

Create your own architecture using draw.io
Overview
- Developer makes changes to the application source code.
- Developer commits the code changes to GitHub.
- Jenkins will Fetch code from our GitHub repo.
- Jenkins will Build the project artifact using Maven.
- Jenkins will Perform Static Application Security Testing (SAST) with SonarQube and pass through the Quality Gate.
- Jenkins will Perform Software Composition Analysis (SCA) with Snyk.
- Jenkins will Build a Docker image using our Dockerfile.
- Jenkins will Perform image scanning using Trivy for vulnerabilities.
- Jenkins will Upload the Docker image to Azure Container Registry (ACR).
- Jenkins will Create a Helm chart for Kubernetes deployment.
- Jenkins will Install the Helm chart in our Azure Kubernetes Service (AKS) cluster.
- Jenkins will Run Dynamic Application Security Testing (DAST) using OWASP Zed Attack Proxy (ZAP) on our application already deplyed .
Tools used
- Azure Kubernetes Service (AKS): Simplify the deployment, management, and operations of Kubernetes.
- Container Registry: Store and manage container images across all types of Azure deployments.
- Maven : Building our application using pom.xml file .
- SonarQube: It is used for continuous analysis of source code quality by performing analysis on your code to detect duplications, bugs, security vulnerabilities and code smells on programming languages.
- Docker : It is an open source containerization platform.
- Trivy : It is a simple and comprehensive vulnerability and secret scanner for containers and other artifacts. Trivy detects vulnerabilities of OS packages. It also scans Infrastructure as Code(IAC) files such as Terraform and Kubernetes, to detect potential configuration issues that expose your deployments to the risk of attack. It also scans hard like passwords, API keys and tokens.
- Snyk: is an open-source security platform for finding out vulnerabilities in the source code of an application.
- OWASP ZAP: is anĀ open sourceĀ webĀ application security scanner
- Helm: is an automation tool that streamlines the creation, packaging, configuration, and deployment of Kubernetes applications
Pre-requisites
Jenkins instance is setup and running
First we should install Jenkins following the officiel documentation (We will install Jenkins on the local machine (Ubuntu 22) and set up Username and Password for login and install the wizard plugins.https://www.jenkins.io/doc/book/installing/linux/

Now weāll set up the personal acess token that Jenkins will use to interact with our Repository .In GitHub account >Settings>Developer Settings>Personal Access Tokens>Ā Generate New Token


Next, we will copy that Token and go to "Manage Jenkins" > "Manage Credentials" > "Add Credentials" Chose Username and Password and give an ID
Let's proceed with creating our pipeline. In the Jenkins dashboard, click on "Create an item," choose a name for the pipeline, select the pipeline option, and then click "OK.ā

In the pipeline section, we'll choose "Pipeline Script from SCM" for the Definition and "Git" for SCM. Paste our GitHub project URL, set Credentials to use our newly created GitHub Credentials, and then click on "Saveā.