惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Securelist
C
Cybersecurity and Infrastructure Security Agency CISA
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security Affairs
Hacker News: Ask HN
Hacker News: Ask HN
L
Lohrmann on Cybersecurity
PCI Perspectives
PCI Perspectives
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
月光博客
月光博客
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recorded Future
Recorded Future
The GitHub Blog
The GitHub Blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
TaoSecurity Blog
TaoSecurity Blog
P
Proofpoint News Feed
Google DeepMind News
Google DeepMind News
F
Full Disclosure
U
Unit 42
Jina AI
Jina AI
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
The Hacker News
The Hacker News
The Last Watchdog
The Last Watchdog
T
Troy Hunt's Blog
腾讯CDC
T
Threatpost
H
Hacker News: Front Page
P
Palo Alto Networks Blog
博客园 - 聂微东
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
Help Net Security
Help Net Security
L
LINUX DO - 热门话题
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Spread Privacy
Spread Privacy

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Making Maven Builds Security-Aware: AppSec Checks Without CI/CD Drift
Nikolay Kuzi · 2026-05-07 · via DEV Community

The problem was never that Maven projects could not run security tools.

They could.

A pipeline can run tests, Dependency-Check, CycloneDX, and SonarQube with a few commands. A pom.xml can hold plugin blocks. A team can copy a working configuration from one service to another and call it a standard.

For a while, that works.

Then the small differences start showing up.

One service has JaCoCo but does not pass the XML report to SonarQube. Another produces Dependency-Check output only as HTML. One multi-module project generates an SBOM from the root aggregator and misses the shape of the real runtime application. Another pipeline forgets merge request metadata, so SonarQube analysis is technically successful but practically incomplete.

That is security build drift.

It looks like automation. It behaves like inconsistency.

I built secure-maven-extension to solve that problem for Maven projects.

Not by replacing the scanners.

By making the Maven lifecycle carry the security workflow.

The problem I wanted to remove

A typical Maven CI/CD setup starts like this:

script:
  - ./mvnw test
  - ./mvnw org.owasp:dependency-check-maven:check
  - ./mvnw org.cyclonedx:cyclonedx-maven-plugin:makeBom
  - ./mvnw sonar:sonar

Enter fullscreen mode Exit fullscreen mode

For one repository, this is fine.

Across many services, it becomes a maintenance pattern nobody really owns.

Some configuration lives in CI/CD. Some lives in pom.xml. Some lives in copied documentation. Some depends on environment variables that are not obvious to local developers. Every new service has to rediscover the same setup decisions.

The result is not only duplicated YAML.

The result is lower confidence.

If local runs do not match CI/CD, developers push just to test the security workflow. If reports are produced in different places, security teams waste time normalizing artifacts. If multi-module projects are wired differently, nobody knows whether the SBOM actually describes the deployable artifact.

At that point, the build is not security-aware. The pipeline is just calling scanners around it.

Why the usual approach is inconvenient

The usual approach puts too much responsibility into pipeline scripts.

CI/CD should be the shared execution layer. It should run clean builds, publish artifacts, enforce gates, and provide auditability.

But when CI/CD also owns all scanner configuration, every repository becomes a custom integration point.

That makes local development awkward.

A developer can run:

mvn verify

Enter fullscreen mode Exit fullscreen mode

but the pipeline may run a different set of goals, with different properties, report formats, and SonarQube metadata. So the developer cannot fully trust the local result.

This is the gap I wanted to close.

The Maven command should stay familiar, but the lifecycle should carry the same AppSec behavior locally and in CI/CD.

The design principle

The core rule was this:

keep the Maven user experience native,
but inject repeatable security behavior into the lifecycle.

Enter fullscreen mode Exit fullscreen mode

Developers should not need a separate security script for every service. CI/CD should not need to reimplement scanner conventions. Security teams should not need to explain report paths and plugin settings repository by repository.

The build should know how to do the boring parts.

That is why this project is a Maven core extension rather than just another command in a pipeline.

Why a Maven core extension

A normal Maven plugin would still require explicit plugin configuration across projects. That can work, but it does not fully remove copy-paste.

A core extension gives an earlier and more powerful integration point.

The extension is loaded from:

.mvn/extensions.xml

Enter fullscreen mode Exit fullscreen mode

Example:

<extensions>
  <extension>
    <groupId>io.github.niki1337.securebuild</groupId>
    <artifactId>secure-maven-extension</artifactId>
    <version>0.1.0</version>
  </extension>
</extensions>

Enter fullscreen mode Exit fullscreen mode

Internally, the extension works during Maven's afterProjectsRead stage.

That timing matters.

At that point, Maven has read the root pom.xml and module POMs. Packaging is known. Modules are visible. Existing plugins and properties can be inspected. But the lifecycle has not started yet.

That is the useful moment to inject conventions.

The extension can decide how to configure coverage, Dependency-Check, CycloneDX, and SonarQube before phases like initialize, package, and verify execute.

What runs under the hood

The extension connects the tools teams already know:

  • jacoco-maven-plugin for coverage;
  • sonar-maven-plugin for SonarQube analysis;
  • dependency-check-maven for dependency risk reports;
  • cyclonedx-maven-plugin for SBOM generation.

The developer still uses Maven:

mvn package
mvn verify
mvn sonar:sonar

Enter fullscreen mode Exit fullscreen mode

The difference is that these commands become security-aware.

For example:

mvn package

Enter fullscreen mode Exit fullscreen mode

can build the application and generate a CycloneDX SBOM.

mvn verify

Enter fullscreen mode Exit fullscreen mode

can run tests, generate JaCoCo coverage, and execute Dependency-Check.

mvn verify sonar:sonar

Enter fullscreen mode Exit fullscreen mode

can send SonarQube analysis with branch, merge request, binary, and coverage metadata already prepared.

That is the whole point: the workflow feels like Maven, not like a pile of scanner commands glued around Maven.

Configuration without forcing one style

Real environments are messy.

Local developers may use -D... properties. CI/CD usually provides environment variables. Some stable project defaults belong in pom.xml.

The extension supports all of those sources:

  • environment variables;
  • Maven user properties;
  • project properties from pom.xml;
  • system properties.

A project can define stable defaults:

<properties>
  <secure.serviceName>payment-api</secure.serviceName>
  <sonar.projectKey>payment-api</sonar.projectKey>
  <sonar.projectName>Payment API</sonar.projectName>
</properties>

Enter fullscreen mode Exit fullscreen mode

CI/CD can provide secrets and environment-specific values:

export SERVICE_NAME="payment-api"
export SONAR_HOST_URL="https://sonarqube.example.com"
export SONAR_PROJECT_KEY="payment-api"
export SONAR_TOKEN="token-value"
export DT_API_URL="https://dependency-track.example.com"

Enter fullscreen mode Exit fullscreen mode

A local developer can override when needed:

mvn verify \
  -Dsecure.serviceName=payment-api \
  -Dsonar.projectKey=payment-api

Enter fullscreen mode Exit fullscreen mode

The goal is not to force one configuration style. The goal is to make the resolved behavior consistent.

Coverage should not require repeated wiring

Coverage is one of those details that quietly breaks AppSec workflows.

SonarQube can run without coverage, but the result is weaker. JaCoCo can generate a report, but if XML output is missing or the path is not passed to SonarQube, the analysis is incomplete.

The extension injects JaCoCo for Java jar and war projects when JaCoCo is not already configured.

It wires the lifecycle like this:

initialize -> jacoco:prepare-agent
verify     -> jacoco:report

Enter fullscreen mode Exit fullscreen mode

The XML report is generated at:

target/site/jacoco/jacoco.xml

Enter fullscreen mode Exit fullscreen mode

Then the extension passes that path into:

sonar.coverage.jacoco.xmlReportPaths

Enter fullscreen mode Exit fullscreen mode

This is not exciting work. That is exactly why it should be automated.

Repeated boilerplate is where drift hides.

SonarQube needs more than a token

A common mistake is treating SonarQube setup as three variables: URL, project key, token.

For Java services, useful analysis also depends on source paths, test paths, compiled binaries, coverage XML, branch metadata, and merge request metadata.

The extension prepares properties such as:

sonar.sources
sonar.tests
sonar.java.binaries
sonar.java.test.binaries
sonar.coverage.jacoco.xmlReportPaths
sonar.exclusions
sonar.test.exclusions
sonar.cpd.exclusions
sonar.coverage.exclusions

Enter fullscreen mode Exit fullscreen mode

In GitLab merge request pipelines, it can map CI variables into pull request analysis:

CI_MERGE_REQUEST_IID                  -> sonar.pullrequest.key
CI_MERGE_REQUEST_SOURCE_BRANCH_NAME   -> sonar.pullrequest.branch
CI_MERGE_REQUEST_TARGET_BRANCH_NAME   -> sonar.pullrequest.base

Enter fullscreen mode Exit fullscreen mode

For normal branch pipelines, it sets branch analysis metadata.

This is the kind of logic that becomes fragile when copied into every pipeline file. Inside a core extension, the behavior is versioned and reusable.

Dependency-Check should produce one predictable shape

Dependency-Check is most useful when the output is predictable.

The extension injects Dependency-Check into the lifecycle:

single-module: verify -> dependency-check:check
multi-module:  verify -> dependency-check:aggregate

Enter fullscreen mode Exit fullscreen mode

It standardizes report formats:

HTML
JSON
SARIF
XML

Enter fullscreen mode Exit fullscreen mode

and writes reports to:

target/reports/dependency-check

Enter fullscreen mode Exit fullscreen mode

By default, it disables network-dependent analyzers such as RetireJS, Node audit, Node package analyzer, OSS Index, and hosted suppressions. In restricted CI/CD environments, depending on external services can make builds slow, flaky, or inconsistent.

When an internal mirror exists, the extension can use it through:

DT_API_URL=https://dependency-track.example.com mvn verify

Enter fullscreen mode Exit fullscreen mode

The default adoption path is visibility first. The build can generate reports without immediately failing by CVSS score. After the team understands the findings and noise level, policy gates can become stricter.

That is how I prefer to roll out AppSec checks: start with reliable data, then enforce deliberately.

SBOM generation should describe the real artifact

An SBOM is not useful just because it exists.

It should describe the thing the team actually ships.

For a single-module Maven application, the extension can run CycloneDX during package:

package -> cyclonedx:makeBom

Enter fullscreen mode Exit fullscreen mode

Reports are written to:

target/reports/cyclonedx

Enter fullscreen mode Exit fullscreen mode

The SBOM focuses on compile and runtime dependencies and avoids test, provided, and system scopes.

Multi-module builds need more care.

The root project is often only an aggregator. Generating an SBOM there can be less meaningful than generating it from the deployable application module. For Spring Boot projects, the extension looks for:

org.springframework.boot:spring-boot-maven-plugin

Enter fullscreen mode Exit fullscreen mode

If it finds a deployable Spring Boot module, it injects CycloneDX there. If not, it falls back to aggregate SBOM generation on the root:

package -> cyclonedx:makeAggregateBom

Enter fullscreen mode Exit fullscreen mode

This keeps SBOM generation tied to the application shape instead of blindly producing a file wherever Maven happens to start.

Multi-module Maven projects need first-class handling

Multi-module Maven builds are where simple CI snippets start to fall apart.

A root project may have pom packaging. Modules may be jar or war. Some modules are deployable, some are libraries, some are test fixtures. Coverage should be generated per Java module. Dependency-Check may need aggregate behavior. SonarQube needs paths that reflect the whole project.

The extension treats a build as multi-module when Maven sees more than one project and simple mode is not forced. It includes Java modules with jar and war packaging and supports filters like:

<properties>
  <secure.includedModules>api,service</secure.includedModules>
  <secure.excludedModules>test-fixtures</secure.excludedModules>
</properties>

Enter fullscreen mode Exit fullscreen mode

In multi-module mode, it configures SonarQube on the root, injects JaCoCo into Java modules, adds module-level paths, runs aggregate Dependency-Check, and generates SBOM output from the most useful module when possible.

That is the difference between running a scanner and owning a build convention.

CI/CD becomes an execution layer

Once Maven owns the conventions, CI/CD can stay small.

A security job can be simple:

security:maven:
  image: eclipse-temurin:17
  stage: test
  script:
    - ./mvnw -B verify
  artifacts:
    when: always
    expire_in: 7 days
    paths:
      - target/reports/dependency-check/
      - target/reports/cyclonedx/
      - "**/target/reports/dependency-check/"
      - "**/target/reports/cyclonedx/"
      - "**/target/site/jacoco/"

Enter fullscreen mode Exit fullscreen mode

SonarQube can run only when a token is available:

sonarqube:maven:
  image: eclipse-temurin:17
  stage: test
  script:
    - ./mvnw -B verify sonar:sonar
  rules:
    - if: '$SONAR_TOKEN'

Enter fullscreen mode Exit fullscreen mode

The pipeline is now readable because the security wiring is no longer scattered through the YAML.

The build owns the behavior. CI/CD runs it.

Where pre-commit and Gitleaks fit

The Maven extension is not the earliest security layer.

For secrets, I want feedback before the commit exists. That is where pre-commit and Gitleaks fit. A local secret scanning hook can stop obvious leaks before code leaves the developer machine.

The Maven extension handles the next layer: build-time checks that understand Java, dependencies, coverage, SBOM generation, and SonarQube metadata.

The model is layered:

before commit
  pre-commit hooks, Gitleaks, fast file checks

local build
  mvn verify, coverage, Dependency-Check, CycloneDX SBOM

CI/CD
  same Maven lifecycle, artifacts, gates, enforcement

Enter fullscreen mode Exit fullscreen mode

This is important because not every check belongs in the same place.

Secret scanning is fast and high-impact, so it belongs very early. Dependency analysis and SBOM generation are heavier and build-aware, so they belong in the build. Final enforcement belongs in CI/CD.

That separation keeps the workflow practical.

What developers get

Developers get to keep using Maven.

They do not need to memorize a custom AppSec script for every repository. They do not need to push a branch just to learn whether Dependency-Check or SonarQube wiring works. They can run familiar lifecycle commands and get security-aware behavior locally.

That makes findings easier to understand. The report appears in the same build context where the code was changed.

This matters because good security tooling is not only about detection. It is also about timing, clarity, and trust.

What the security team gets

The security team gets fewer custom integrations to chase.

Reports are generated in predictable formats and locations. SBOM scope becomes more consistent. Coverage is wired into SonarQube. Merge request metadata is handled in one reusable layer. Multi-module projects stop being a special case every time.

This also makes policy easier to evolve.

The team can start with visibility, collect reports, understand noise, and then introduce stricter gates when the data is reliable.

That is much better than turning on hard failures before anyone trusts the output.

The result

secure-maven-extension is not another security scanner.

It is a build tooling layer for Maven-based Java projects.

It moves repeated AppSec wiring out of CI/CD YAML and into the Maven lifecycle, where developers can run it locally and CI/CD can reproduce it cleanly.

The larger pattern is the same one I use across the whole workflow:

local hooks for fast mistakes
build tooling for repeatable project checks
CI/CD for shared verification and enforcement

Enter fullscreen mode Exit fullscreen mode

When that pattern works, security stops being an external script attached to the project and becomes part of how the project is built.

That is the real goal.

Project links: