Commit 6da122a
authored
Unify weekly + per-PR security scanning into a single workflow (#1460)
## Summary
Consolidates security scanning into one workflow with one job
(`securityScan.yml`). Replaces `vulnerabilityCatcher.yml`. Adds
OSV-Scanner alongside the existing OWASP check, plus cyclonedx SBOM
generation so OSV scans the actually-resolved local dependency tree.
This bundles the work that was originally split across (now-closed) PRs
#1458 (suppressions + email-notification fix) and #1459 (per-PR gate).
One unified workflow file, one set of suppression rules, one place to
look.
### Design: single job, terminal steps gated by event
```
Triggers: pull_request, schedule (weekly cron), workflow_dispatch
│
├─ shared: checkout, JDK, JFrog OIDC, maven config
├─ shared: NVD database cache (saves ~2 min)
├─ shared: mvn package (generates cyclonedx aggregate SBOM)
├─ shared: OWASP dependency-check (continue-on-error)
├─ shared: install + run OSV-Scanner
├─ shared: Collect findings (writes job summary; sets outputs)
│
├─ if pull_request + findings ⇒ fail the job
└─ if schedule|dispatch + findings ⇒ send email + fail the job
```
No duplicated steps across jobs. Same scan logic for every trigger; only
the notification mechanism differs.
### What changed
| File | Change |
|---|---|
| `.github/workflows/vulnerabilityCatcher.yml` | **Removed.** Superseded
by `securityScan.yml`. |
| `.github/workflows/securityScan.yml` | **New.** Single job with
event-gated terminal steps. Includes NVD database caching for faster
runs. |
| `owasp-suppressions.xml` | **8 new entries** for documented
CPE/ecosystem false positives — Arrow R-only (CVE-2024-52338),
gRPC-Go-only (CVE-2026-33186), protobuf Python-only (CVE-2026-0994), 5
libthrift non-Java bindings. Each entry has a justification comment
block. |
| `osv-scanner.toml` | **New.** Mirrors the OWASP suppressions in TOML
format. Keep the two files in sync when adding/removing entries. |
| `pom.xml` | **cyclonedx-maven-plugin 2.9.1** added, bound to `package`
phase, `skipNotDeployed=false`. Emits an aggregate `target/bom.json` for
OSV to read. |
### Why two scanners
| Scanner | Source | Catches | Misses |
|---|---|---|---|
| OWASP dependency-check | NVD (CPE-based) | Anything with an NVD CPE
entry. Reuses existing `owasp-suppressions.xml` and `failBuildOnCVSS=7`
threshold. | GHSA-only advisories without an NVD CPE (e.g.,
CVE-2025-66566 in lz4-java — the #1455 finding). |
| OSV-Scanner v2.3.8 | OSV.dev (purl-based; federates GHSA + NVD + PyPA
+ RustSec) | The GHSA-only gap. Already turned up a new finding:
**bouncycastle CVE-2026-5598 (severity 8.9)** in bcprov-jdk18on 1.79,
invisible to OWASP. | Findings without a CVSS score (rare for
high-severity). |
### Why cyclonedx SBOM
OSV-Scanner's Maven resolver consults deps.dev's published-artifact
metadata. For the project's *own* GA, that means it sees the
previously-published 3.3.3 pom — not whatever bumps are sitting on
`main`. Result: in CI, OSV would keep showing yesterday's released state
instead of the PR branch's actual dependency tree. Producing a CycloneDX
aggregate SBOM at build time captures the actually-resolved local tree.
### Fixes from #1458 included here
The weekly scan has been failing every Sunday for 7+ consecutive weeks
(since early April 2026) without sending a notification email. Root
cause: the OWASP maven plugin step exits non-zero when CVEs are found
(because `<failBuildOnCVSS>7</failBuildOnCVSS>` is set in
`jdbc-core/pom.xml:357`), short-circuiting the rest of the job. The
subsequent steps never ran.
The new workflow has `continue-on-error: true` on the OWASP step and
routes finding-detection through an explicit `Collect findings` step
that reads the OWASP JSON report directly. Whether the job ultimately
fails (and whether email goes out) is decided after that step, not by
maven's exit code.
### Findings on `main` today
This workflow, run against current `main`, reports unsuppressed findings
that will be addressed in **separate follow-up PRs**:
1. \`org.bouncycastle:bcprov-jdk18on@1.79\` → CVE-2026-5598 (severity
8.9). Fixed in bouncycastle 1.84. **OWASP doesn't see this — OSV-only
finding.**
2. \`org.apache.thrift:libthrift@0.19.0\` → 4 CVEs
(CVE-2026-41603/04/05/43869, max severity 8.2). Cleared by the libthrift
0.19 → 0.23 follow-up (requires regenerating \`TCLIService.java\` with
the matching compiler).
So this PR's own CI is expected to fail on these 2 known findings until
the follow-ups land. Aligned with the rollout plan: add the workflow
now, mark it required-to-merge in branch protection after the burn-down.
### Expected runtime
Each invocation: **~5–7 minutes** (vs ~4 min for the old weekly).
Breakdown:
- `mvn package` (with cyclonedx SBOM): ~45–90s
- OWASP dependency-check (with NVD cache hit): ~1–2 min
- OSV-Scanner install + run: ~15s
- Other steps: ~30s
NVD caching cuts ~2 minutes off OWASP's runtime when the cache is warm.
The cache key rotates daily so we still get fresh CVE data.
### What this PR is NOT
* It is **not** a required check. Branch protection is unchanged — PRs
aren't blocked by the red ❌ yet.
* It does **not** introduce diff-mode (net-new findings only) gating.
Every PR has to ship into a clean codebase; this is the design we agreed
on, to force burn-down rather than just \"not making it worse.\"
* It does **not** include a Phase 2 design (override flags, severity
tiers, auto-issue filing). Phase 2 is deferred until we have ~2 weeks of
operational experience.
### Test plan
- [x] \`mvn package -DskipTests -Ddependency-check.skip=true\` produces
\`target/bom.json\` (69 components, all expected versions).
- [x] \`mvn -pl jdbc-core org.owasp:dependency-check-maven:check\`
reports 4 unsuppressed CVEs (all libthrift; matches expectation).
- [x] \`osv-scanner scan source --config=osv-scanner.toml --format=json
target/bom.json\` + severity≥7 filter reports 2 findings (bouncycastle +
libthrift cluster).
- [x] Findings-step jq logic correctly counts OWASP CVSS>=7 from the
JSON report.
- [x] XML validation of \`owasp-suppressions.xml\`.
- [x] YAML validation of \`securityScan.yml\`.
- [ ] CI run on this PR — expected to fail on the 2 known findings
above. **The CI failure on this PR is the intended outcome.**
- [ ] Manual \`workflow_dispatch\` run post-merge to verify the email
path fires.
NO_CHANGELOG=true
This pull request and its description were written by Isaac.
---------
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>1 parent c2ad803 commit 6da122a
5 files changed
Lines changed: 559 additions & 125 deletions
File tree
- .github/workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
0 commit comments