<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[KkInTech15]]></title><description><![CDATA[KkInTech15]]></description><link>https://kkintech15.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 16 Oct 2026 07:22:37 GMT</lastBuildDate><atom:link href="https://kkintech15.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[🛡️ Building a DevSecOps Pipeline – Phase 1: Local Testing with Maven, SonarQube, Trivy & JFrog Artifactory]]></title><description><![CDATA[🔍 Hands-on. Real-world. Secure-by-default. This post documents how I locally built and tested a DevSecOps pipeline using industry-standard tools before moving to Jenkins automation.
🏗️ Objective
To build and validate a local DevSecOps workflow that...]]></description><link>https://kkintech15.hashnode.dev/building-a-devsecops-pipeline-phase-1-local-testing-with-maven-sonarqube-trivy-and-jfrog-artifactory</link><guid isPermaLink="true">https://kkintech15.hashnode.dev/building-a-devsecops-pipeline-phase-1-local-testing-with-maven-sonarqube-trivy-and-jfrog-artifactory</guid><category><![CDATA[Devops]]></category><category><![CDATA[DevSecOps]]></category><category><![CDATA[sonarqube]]></category><category><![CDATA[trivy]]></category><category><![CDATA[jfrog]]></category><category><![CDATA[maven]]></category><category><![CDATA[cicd]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Build In Public]]></category><category><![CDATA[#learning-in-public]]></category><category><![CDATA[Hashnode]]></category><dc:creator><![CDATA[KkInTech15]]></dc:creator><pubDate>Mon, 07 Jul 2025 00:08:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1751845752714/4f626e6b-224b-44b4-be20-33bf0739c950.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>🔍 Hands-on. Real-world. Secure-by-default. This post documents how I locally built and tested a DevSecOps pipeline using industry-standard tools before moving to Jenkins automation.</p>
<h2 id="heading-objective">🏗️ Objective</h2>
<p>To build and validate a local DevSecOps workflow that mimics a secure CI/CD pipeline. The tools were installed on separate EC2 instances, integrated manually, and tested end-to-end.</p>
<h2 id="heading-tech-stack">🔧 Tech Stack</h2>
<p><code>⚙️ Maven – Java build tool for compiling, testing, and packaging</code><br /><code>🔬 SonarQube – Code quality and static analysis (via JaCoCo)</code><br /><code>🛡️ Trivy – Dependency scanning and vulnerability management</code><br /><code>📦 JFrog Artifactory OSS – Artifact storage (Maven .jar deployment)</code></p>
<h2 id="heading-infrastructure-architecture">💻 Infrastructure Architecture</h2>
<ul>
<li><p><strong>EC2 Instance 1</strong> (t2.medium):</p>
<ul>
<li><p>OS: Ubuntu 24.04</p>
</li>
<li><p>Installed and configured SonarQube 10.5.1 with Nginx reverse proxy</p>
</li>
<li><p>Used embedded database for simplicity</p>
</li>
<li><p>SonarQube UI accessible via public IP/domain</p>
</li>
</ul>
</li>
<li><p><strong>EC2 Instance 2</strong> (t2.large):</p>
<ul>
<li><p>Tools installed: OpenJDK 17, Maven, Trivy, JFrog Artifactory OSS 7.71.23</p>
</li>
<li><p>Artifactory uses Derby (embedded DB)</p>
</li>
<li><p>Local Maven builds &amp; Trivy scans performed here</p>
</li>
<li><p>Artifactory web UI running on port 8082</p>
</li>
</ul>
</li>
</ul>
<h2 id="heading-tool-configuration-amp-highlights">⚙️ Tool Configuration &amp; Highlights</h2>
<p>✅ Maven Build &amp; Deploy</p>
<pre><code class="lang-plaintext">mvn clean
mvn test 
mvn package
mvn deploy
</code></pre>
<p><strong>distributionManagement in pom.xml</strong></p>
<pre><code class="lang-plaintext">&lt;distributionManagement&gt;
  &lt;repository&gt;
    &lt;id&gt;jfrog-artifactory&lt;/id&gt;
    &lt;name&gt;JFrog Maven Local Repository&lt;/name&gt;
    &lt;url&gt;http://&lt;your-artifactory-ip&gt;:8082/artifactory/maven-local&lt;/url&gt;
  &lt;/repository&gt;
&lt;/distributionManagement&gt;
</code></pre>
<h2 id="heading-sonarqube-static-analysis">✅ SonarQube Static Analysis</h2>
<ul>
<li><p>Used jacoco-maven-plugin for code coverage</p>
</li>
<li><p>Results published to SonarQube UI</p>
</li>
<li><p>Triggered using Maven goal:</p>
<pre><code class="lang-plaintext">  mvn clean verify sonar:sonar \
    -Dsonar.login=$SONAR_TOKEN \
    -Dsonar.host.url=http://&lt;sonarqube-ip&gt;:9000 \
    -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
</code></pre>
</li>
</ul>
<p><a target="_blank" href="http://sonar-project.properties">sonar-project.properties</a></p>
<pre><code class="lang-plaintext">sonar.projectKey=my-app
sonar.projectName=My App
sonar.projectVersion=1.0

sonar.host.url=http://&lt;sonarqube-ip&gt;:9000
sonar.sources=src/main/java
sonar.tests=src/test/java
sonar.java.binaries=target/classes
sonar.java.test.binaries=target/test-classes
sonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751846681225/9670bd7b-383f-4eb3-bab9-5a3de2b86234.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-trivy-vulnerability-scanning">✅ Trivy Vulnerability Scanning</h2>
<p>Scanned the source dependencies (not JAR directly — best practice):</p>
<pre><code class="lang-plaintext">trivy fs --exit-code 1 --severity HIGH,CRITICAL .
</code></pre>
<p>Also generated SBOM using Syft + Trivy:</p>
<pre><code class="lang-plaintext">syft ./target/my-app-1.0-SNAPSHOT.jar -o spdx-json &gt; sbom.spdx.json
trivy sbom sbom.spdx.json
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751846698137/499e0989-594a-485a-b507-64acda7234b9.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-jfrog-artifactory-setup-highlights">✅ JFrog Artifactory Setup (Highlights)</h2>
<ul>
<li><p>Installed Artifactory OSS 7.71.23</p>
</li>
<li><p>Chose this version because it uses embedded Derby DB, simplifying setup</p>
</li>
<li><p>Manual startup:</p>
</li>
</ul>
<pre><code class="lang-plaintext">/opt/jfrog/app/bin/artifactory.sh start
</code></pre>
<ul>
<li><p>Verified via:</p>
<pre><code class="lang-plaintext">  curl http://localhost:8082
</code></pre>
</li>
</ul>
<ul>
<li><p>Exposed via EC2 IP + port</p>
</li>
<li><p>Configured Maven settings.xml with credentials and repository info</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751846725225/5eb7b2ae-40ea-4ba5-8e67-aff9a0b576db.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-local-testing-summary">🧪 Local Testing Summary</h2>
<p>✔️ Build: mvn clean test package<br />✔️ Static Analysis: SonarQube (via Jacoco)<br />✔️ Security Scan: Trivy (on FS and dependencies)<br />✔️ Artifact Deploy: mvn deploy to JFrog Artifactory<br />✔️ Validation: All tool UIs confirmed expected outputs</p>
<h2 id="heading-ia"> </h2>
<p>🔜 What’s Next?</p>
<p><strong>🚧 Phase 2 – Jenkins Automation:</strong></p>
<p>Now that local testing is validated, I’ll automate the full DevSecOps flow using Jenkins:</p>
<ul>
<li><p>Build → Test → Static Scan → Security Scan → Artifact Deploy</p>
</li>
<li><p>All triggered via Git-based Webhook pipeline</p>
</li>
</ul>
<p>Stay tuned — I’ll share that in my next post!</p>
<h2 id="heading-lets-connect">🤝 Let’s Connect</h2>
<p>I’m building and learning in public to stay focused, attract meaningful DevOps opportunities, and grow in the open. You can also connect with me on [LinkedIn](<a target="_blank" href="https://www.linkedin.com/in/kkintech15/">https://www.linkedin.com/in/kkintech15/</a>) where I post DevOps projects regularly.</p>
<p>Thanks for reading!</p>
<h2 id="heading-tags">🔖 Tags</h2>
<p>#DevOps #DevSecOps #SonarQube #Trivy #JFrog #Maven #CI/CD #AWS #BuildInPublic #LearningInPublic #Hashnode</p>
]]></content:encoded></item></channel></rss>