davsclaus opened a new pull request, #30562:
URL: https://github.com/apache/camel/pull/30562

   ## Description
   
   [CAMEL-27348](https://issues.apache.org/jira/browse/CAMEL-27348): the CVE 
audit checks the Camel JARs against the Apache Camel security advisories that 
ship with the catalog. That copy is only as new as the release (and on main it 
was 61 advisories behind, fixed by #30561), so an older CLI or plugin misses 
the Camel CVEs published after it. Now the audit also **checks them online**, 
from the camel-website repository on GitHub where they are published 
(`content/security/CVE-*.md`), and merges both, **with the catalog as the 
fallback**.
   
   **Stacked on #30558 → #30557 → #30556 → #30555.** Retarget to `main` once 
those merge; until then CI runs no full build here. Independent of #30561 (it 
keeps the catalog copy in sync), but both touch `UpdateSecurityAdvisoriesMojo` 
in different places.
   
   ### How it works
   
   - `OnlineAdvisories` (camel-catalog-cve): one GitHub API call lists 
`content/security`; only the advisories that are new or changed (by the `sha` 
of the listing) are downloaded from `raw.githubusercontent.com`, 8 at a time. 
The result is cached in `~/.camel/advisories` and checked again once a day, so 
a check is usually one request. No coordinates of the project are sent.
   - Merged with the advisories of the catalog by CVE id; the online one wins. 
When the check fails, the copy of the day before is used, else those of the 
catalog, with a warning that says why (a 403 names `GITHUB_TOKEN`, which is 
sent to the GitHub API when set).
   - A mirror: the URL or file of a JSON array in the format of the catalog 
(`camel-security-advisories.json`), for machines without access to GitHub; the 
format is told by the content, so a GitHub Enterprise mirror of camel-website 
works too. Through the proxy of the Maven settings or `HTTPS_PROXY` (#30556).
   - The parser of the advisory Markdown moves from the 
`update-security-advisories` goal to `camel-tooling-model` 
(`SecurityAdvisoryParser`, with its test and fixtures), so the build and the 
audit read the advisories the same way. snakeyaml-engine is an optional 
dependency there, so catalog users do not get it. (camel-package-maven-plugin 
is built before camel-catalog, so it cannot use camel-catalog-cve.)
   - `CveAudit.audit(...)` gets an overload with the advisories to check.
   
   ### Where
   
   - `camel dependency audit`: `--advisories-url`; `--offline` checks those of 
the catalog only. A warning when the online check fails; the `--json` document 
has `camelAdvisories` (`total`, `online`, `updated`, `warning`).
   - TUI, CVE Audit screen: the same, cached in the same place; the title says 
`Camel advisories of the catalog` (or of the date of the copy) when the check 
failed.
   - `camel-report:audit`: `advisoriesUrl`, `advisoriesCache` (default 
`~/.camel/advisories`, shared with the CLI); `offline` checks those of the 
catalog only.
   - Docs: a section "The Apache Camel security advisories" on the projects 
page, the plugin page (both copies), the TUI page and its F1 help, and the 
generated command page and golden help.
   
   ### Also in this PR (fix of #30556)
   
   While testing, `OsvClientProxyTest` failed when `OnlineAdvisoriesTest` ran 
before it in the same JVM: the JDK reads 
`jdk.http.auth.tunneling.disabledSchemes` once, at the first HTTP client. That 
pointed at a real gap of #30556: the documentation download of the TUI built a 
client with the proxy login without allowing Basic for the tunnel, so fetching 
the documentation before the first scan left Basic disabled for the session. 
Fixed on #30556 (10600458): `HttpProxy.authenticator()` allows it, so every 
client built with it does, and the tests of camel-catalog-cve run in a JVM per 
class. Merged up the stack.
   
   ## Tests
   
   - `OnlineAdvisoriesTest` (a local HTTP server as the GitHub listing): merged 
with the catalog and the online one wins, drafts left out; cached within a day 
without a request; a day later only the listing is requested, a changed file is 
downloaded again; a failed check uses the copy of the day before with a 
warning, and without a copy those of the catalog; a mirror and a file in the 
format of the catalog.
   - `SecurityAdvisoryParserTest` (moved from 
`UpdateSecurityAdvisoriesMojoTest`), `DependencyAuditTest` (a mirror file 
merged with the catalog, `--offline`, the `--json` object).
   - Live against GitHub: the first check took 5 s for the 137 advisories, a 
cached one 3 ms.
   - End to end, the CLI of this branch on a project with camel-http and 
`--camel-version=4.10.0`: with the catalog of this branch only (76 advisories), 
5 findings with a Camel advisory; with the online advisories merged, 12 (such 
as CVE-2026-78164 and CVE-2026-85317, which the catalog copy does not know).
   - Locally, `mvn -o verify` of camel-tooling-model, 
camel-package-maven-plugin, camel-tooling-maven, camel-catalog-cve, 
camel-report-maven-plugin, camel-jbang-run, camel-jbang-core and 
camel-jbang-plugin-tui: all green. No test reaches the network.
   
   Not changed: the MCP server's advisory tools still use those of the catalog.
   
   _Claude Code on behalf of Claus Ibsen (davsclaus)_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to