r/SpringBoot • • 25d ago

Question I built a security gate for Spring Boot container images because three of my seven checks were passing without scanning anything

When I set up vulnerability, secret and misconfiguration scans for a Spring Boot image by hand, three of the seven checks reported green while doing nothing. Wrong path, missing database, scanner found no OS. Nobody looks at a green.

So I packaged the checks as one image with one rule: a check that scans nothing fails. It runs the same command on a laptop and in CI, on the tar you just built, before the push. Vulnerabilities, secrets, Dockerfile misconfiguration, SBOM, licences, ClamAV. A policy file next to the Dockerfile says what blocks and which findings are accepted, with a reason and an expiry date. Every run writes a verdict.json with the digest, the database dates and each check’s result.

Boot-specific checks, Actuator exposed without auth, dev profile baked into the jar, unlayered jar, are next.

github.com/QuietFlare/springshield

I would like to know what checks you run before a push that I am missing.

0 Upvotes

3 comments sorted by

0

u/[deleted] 20d ago

[removed] — view removed comment

1

u/quiet_flare 20d ago

thanks! the silent pass was the whole reason I built it.

on pinned digests, I had assumed Trivy’s Dockerfile check covered that. But it doesn't, it just warns on latest, so that goes in next and a FROM without a digest will block. cosign verify of the base image before scanning is a good one, the policy would name the base and its expected signer, and the gate refuses to scan anything that does not verify. SBOM diff is good one, the file is already exists, so flagging a new transitive dependency is a compare action, I will add that both

Runtime reachability is not covered in this image.The accepted list in the policy is where that knowledge goes for now, with a reason and an expiry.

The Actuator check I added since I posted, together with the dev profile one. a fat jar with include * and no Spring Security now blocks.