feat: add vulnerability CLI commands for ext-vulnerability-reporting#288
Merged
Conversation
Adds a dedicated `limacharlie vulnerability` command set that wraps the ext-vulnerability-reporting extension's RPC actions (query_cves, query_cve, query_cve_vuln_hosts, query_cve_vuln_packages, query_endpoints, query_host_vuln_packages, query_dashboard, scan_packages) behind typed SDK and Click surfaces. Subscription management stays under `limacharlie extension`; this group is purely the user-facing query / scan-trigger surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds an opt-in unwrap parameter to limacharlie.sdk.extensions.Extensions.request
that returns the inner data field of the standard {data, error, retry}
extension envelope instead of the whole response. Default stays False to keep
existing callers (feedback, cases, configs, the extension request CLI)
byte-compatible.
The new vulnerability SDK opts in everywhere so its CLI surfaces clean
payloads — JMESPath filters can now address fields directly (e.g.
'results[*].cve' instead of 'data.results[*].cve') and --output table
renders rows instead of '{N keys}'.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
/gcbrun |
The simulate flag was a debug knob from the extension's testing pipeline; it doesn't belong in the user-facing CLI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a dedicated
limacharlie vulnerabilitycommand set that wraps theext-vulnerability-reportingextension's RPC actions behind typed SDK and Click surfaces.
The extension keeps a per-org index of OS packages reported by sensors and
joins it against a CVE database; this PR exposes the public actions of that
index as first-class CLI commands instead of forcing users through
limacharlie extension request.CLI surface
vulnerability scan --sid <SID>— trigger an on-demandos_packagesscanvulnerability dashboard [--sort-asc]— per-org dashboard graphsvulnerability cve list— CVEs observed across the orgvulnerability cve get <CVE-ID>— raw NVD recordvulnerability cve hosts <CVE-ID>— hosts affected by a CVEvulnerability cve packages <CVE-ID>—(name, version)pairs affected by a CVEvulnerability host list— endpoints with vulnerability countsvulnerability host packages <SID>— vulnerable packages on one hostThe list-style commands share a common option block (
--cursor,--limit,--sort-by,--sort-asc,--filter KEY=VALUErepeats,--filters-jsonescape hatch,
--search-field/--search-op/--search-value,--include-tags)mirroring the extension's
VulnQueryRequestschema.Subscription management stays under
limacharlie extension; this group ispurely the user-facing query / scan-trigger surface.
Envelope unwrap
Adds an opt-in
unwrapflag toExtensions.request(...). The extensionframework returns
{data, error, retry}; withunwrap=Truethe SDK returnsjust the inner
data. The newVulnerabilitySDK passesunwrap=Trueeverywhere so the CLI surfaces clean payloads — JMESPath filters can address
fields directly (
results[*].cveinstead ofdata.results[*].cve) and--output tablerenders rows instead of{N keys}. Default staysFalseto keep
feedback,cases,configs, andextension requestbyte-compatible.Example output (against
lc_demo)Files
limacharlie/sdk/extensions.py— addunwrapflag torequest()limacharlie/sdk/vulnerability.py—VulnerabilitySDK class wrapping the eight RPC actionslimacharlie/commands/vulnerability.py— Click group + subgroups +register_explainentrieslimacharlie/cli.py— registervulnerabilityin_COMMAND_MODULE_MAPtests/unit/test_sdk_extensions.py— 3 envelope/unwrap teststests/unit/test_sdk_vulnerability.py— 12 SDK teststests/unit/test_cli_vulnerability.py— 19 CLI teststests/unit/test_cli_lazy_loading_regression.py— extend snapshots for the new commandTest plan
python -m pytest tests/unit -p no:benchmarkpasseslc_demo(dashboard, cve list/get/hosts/packages, host list/packages)limacharlie vulnerability scan --sid <SID>--filterworks directly on payload (nodata.prefix needed)🤖 Generated with Claude Code