/spring-boot-skills:security-hardeningfrom Spring Boot Skills
Adds DevSecOps checks to Maven projects: OWASP dependency scanning, TruffleHog secrets detection, Trivy container image scanning, CycloneDX SBOM generation, and a GitHub Actions security workflow.
Ships in Spring Boot Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Adds security scanning and supply-chain hardening to an existing Spring Boot 4 project.
SKILL_DIR = directory containing this SKILL.md file.
Load SKILL_DIR/references/hardening-checklist.md before configuring scanners — it covers plugin
config, suppression rules, CI job ordering, and false-positive handling.
| Field | Required | Notes |
|---|---|---|
enableDependencyCheck | No | true (default) — OWASP dependency-check |
enableSecretsScan | No | true (default) — TruffleHog |
enableContainerScan | No | true (default) — Trivy image scan |
enableSbom | No | true (default) — CycloneDX SBOM |
cat pom.xml
ls .github/workflows/ 2>/dev/null
cat Dockerfile 2>/dev/null
ls src/main/resources/ 2>/dev/null
Confirm:
Dockerfile exists (for container scan).Add to pom.xml inside <build><plugins>:
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>13.0.0</version>
<configuration>
<failBuildOnCVSS>7</failBuildOnCVSS>
<suppressionFiles>
<suppressionFile>dependency-check-suppressions.xml</suppressionFile>
</suppressionFiles>
</configuration>
</plugin>
<plugin>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
<version>2.9.3</version>
</plugin>
Before writing, verify the latest versions:
curl -s "https://repo1.maven.org/maven2/org/owasp/dependency-check-maven/maven-metadata.xml" \
| python3 -c "import sys,re; print(re.findall(r'<version>(.*?)</version>', sys.stdin.read())[-1])"
curl -s "https://repo1.maven.org/maven2/org/cyclonedx/cyclonedx-maven-plugin/maven-metadata.xml" \
| python3 -c "import sys,re; print(re.findall(r'<version>(.*?)</version>', sys.stdin.read())[-1])"
Create dependency-check-suppressions.xml:
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<!-- Example:
<suppress>
<notes>False positive for internal-only test dependency</notes>
<cve>CVE-20XX-XXXXX</cve>
</suppress>
-->
</suppressions>
Create or merge .github/workflows/security.yml:
name: Security
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '17 4 * * 1' # weekly Monday 04:17
permissions:
contents: read
actions: read
jobs:
dependency-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
java-version: '25'
distribution: 'temurin'
cache: maven
- name: Run OWASP dependency check
run: ./mvnw dependency-check:check
- uses: actions/upload-artifact@v7
if: always()
with:
name: dependency-check-report
path: target/dependency-check-report.html
secrets-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Secret scan
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: main
head: HEAD
extra_args: --debug --only-verified
container-scan:
runs-on: ubuntu-latest
needs: build-image
steps:
- uses: actions/checkout@v7
- name: Build image
run: docker build -t app:${{ github.sha }} .
- name: Scan image with Trivy
uses: aquasecurity/[email protected]
with:
image-ref: app:${{ github.sha }}
format: sarif
output: trivy-results.sarif
- uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: trivy-results.sarif
sbom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
java-version: '25'
distribution: 'temurin'
cache: maven
- name: Generate SBOM
run: ./mvnw cyclonedx:makeBom
- uses: actions/upload-artifact@v7
with:
name: sbom
path: target/bom.json
Before writing, verify the action tags:
for r in actions/checkout actions/setup-java actions/upload-artifact aquasecurity/trivy-action github/codeql-action; do
printf '%s: ' "$r"
curl -s "https://api.github.com/repos/$r/releases/latest" \
| python3 -c "import json,sys; print(json.load(sys.stdin)['tag_name'])"
done
If a workflow already exists, merge carefully — add jobs, don't remove existing ones.
Create SECURITY.md:
# Security policy
## Supported versions
| Version | Supported |
|---------|-----------|
| main | yes |
## Reporting a vulnerability
Email [email protected] or open a private vulnerability report via GitHub.
Do not open public issues for security bugs.
Replace the contact with a real address or GitHub reporting link.
If Dockerfile exists, verify and harden:
USER.eclipse-temurin:<version>-jre-alpine).-jre-alpine runtime.If the generated Dockerfile from spring-scaffold is present, it already follows these rules. Add a
comment only if something needs changing.
./mvnw dependency-check:check
./mvnw cyclonedx:makeBom
Dependency check downloads an NVD database on first run — it takes several minutes and prints progress. The second run is fast.
Report:
SECURITY.md and dependency-check-suppressions.xml createddependency-check-report.html and triage findings; add justified suppressions to
dependency-check-suppressions.xmlWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dancan254/spring-boot-skills --plugin spring-boot-skills17 skills in this plugin
/api-designAdd OpenAPI docs and REST conventions to an existing Spring Boot 4 Maven project — SpringDoc, API versioning, ProblemDetail error schemas, DTO conventions. Use when asked to add OpenAPI or Swagger, document or version an API, or define REST conventions. Not for auth — use spring-security./devops-scaffoldAdd or update Dockerfile, docker-compose.yml, and GitHub Actions CI for an existing Spring Boot Maven project; reads the project first. Use when asked to dockerize a project, add CI or GitHub Actions, or set up DevOps. Not for security scanning — use security-hardening. Not for new projects — use spring-scaffold./http-resilienceMake outbound HTTP calls resilient in an existing Spring Boot 4 Maven project — circuit breakers, retries, and timeouts with RestClient and Resilience4j, plus tests that prove failures degrade gracefully. Use when asked to add retries or a circuit breaker, call external APIs reliably, or protect against a flaky downstream. Not for inbound rate limiting — use redis-setup./kafka-setupAdd Apache Kafka producers and consumers to an existing Spring Boot 4 Maven project — Spring Kafka config, JSON events, dead-letter topics, Testcontainers tests, compose wiring. Use when asked to add Kafka, Kafka topics, or event streaming. If messaging is requested without naming a broker, ask Kafka or RabbitMQ first./legacy-migrationMigrate a Spring Boot 2.x or 3.x app to Boot 4.x (Maven or Gradle) — audit first, then OpenRewrite-led version hops with a green build per hop, covering Jakarta, Jackson 3, modular starters, and runtime-only breakages. Use when asked to upgrade or migrate Spring Boot, or fix javax imports after an upgrade. Not for new projects./mcp-serverExpose an existing Spring Boot 4 Maven service as an MCP server with Spring AI — transport choice, @McpTool tools, tool hints, endpoint security, and verification with a real MCP client. Use when asked to add MCP, expose tools to an LLM or agent, or let an AI call my backend. Not for RAG — use spring-ai-rag.Other plugins' skills for the same job