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

   _Claude Code on behalf of Claus Ibsen_
   
   [CAMEL-27340](https://issues.apache.org/jira/browse/CAMEL-27340): the CVE 
audit of the TUI (#30551) as a command, for a script, a CI job or an AI agent. 
**Stacked on #30551**: the base is its branch; retarget to main when it is 
merged.
   
   ```
   $ camel dependency audit
    SEVERITY  SCORE  CVE             ARTIFACT                               FIX 
    VIA           USED  SUMMARY
    CRITICAL    9.8  CVE-2022-42889  org.apache.commons:commons-text:1.9    
1.10.0                      Arbitrary code execution in Apache Commons Text
    HIGH        8.3  CVE-2022-1471   org.yaml:snakeyaml:1.33                2.0 
                        SnakeYaml Constructor Deserialization Remote Code 
Executi…
    MEDIUM      6.5  CVE-2025-48924  org.apache.commons:commons-lang3:3.11  
3.18.0  commons-text        Apache Commons Lang is vulnerable to Uncontrolled 
Recursi…
   
   3 vulnerabilities in 3 of 27 dependencies of the project (1 CRITICAL, 1 
HIGH, 1 MEDIUM)
   ```
   (the `security/cve-audit` example of apache/camel-jbang-examples#143)
   
   - **`camel dependency audit`** audits the dependencies of the project files, 
with the transitive ones (resolved as Maven does), or with `--integration=<name 
or pid>` the classpath of a running integration. Same columns as the CVE Audit 
screen: FIX (the version of the line the JAR is on), VIA (the chain), USED (the 
routes have an endpoint of the component that brings it in).
   - `--by-artifact` (the version that fixes all CVEs of a JAR), `--json` (one 
document), `--severity` (lowest to list), `--offline` (the Camel advisories of 
the catalog only).
   - **Exit code**: 1 when a vulnerability at or above `--fail-on` is found 
(default `low`: any; `none` never), 2 for a bad severity, 3 for an unknown 
integration, per the CLI exit code contract.
   - The OSV.dev client and the scan move from the TUI plugin to 
camel-jbang-core (`common.cve`: `CveAudit`, `CveFinding`, `CveArtifact`, 
`OsvClient`, ...), shared by the TUI and the command. The TUI keeps the 
drawing, the details and the AI prompts.
   
   **A gap found on the way, fixed here:** the `jvm` action returns the JVM 
classpath only, but `camel run` adds the dependencies it downloads 
(`camel.jbang.dependencies`, `//DEPS`, `--dep`) to an application class loader 
of its own. So the CVE Audit screen (and the Classpath and Heap Histogram tabs) 
did not see commons-text 1.9 or snakeyaml 1.33 of the example. The CLI 
connector's `jvm` action now also returns `applicationClasspath` (the file URLs 
of that `URLClassLoader`), which the TUI and the command merge with the 
classpath. An older integration keeps the JVM classpath only.
   
   The command extends `DependencyList`, so like `camel dependency list` its 
help lists the export options too.
   
   Tested:
   - unit tests for the command (fail-on levels, options, tables, the status of 
a running integration), the offline audit against the advisories of the 
catalog, and the moved scan tests; core 3412 tests, TUI 2666, connector 130
   - by hand against the example: `--integration` on the running example (171 
JARs, with the downloaded ones), and the project files (27 dependencies), 
`--by-artifact`, `--json`, `--offline`, `--severity`, exit codes 0/1/2/3
   
   Found, not fixed here: with the test plugin installed, `camel dependency 
list` (and so `audit`) fails in a directory with a Citrus `test/` folder 
(`IllegalArgumentException: argument "in" is null` in citrus-jbang's 
`CodeAnalyzer`); the same with the released CLI.
   
   🤖 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