Repository navigation
CM-72593: Surface malicious package detections in SCA scan output - #545
Merged
omer-roth merged 3 commits intoNov 1, 2026
Merged
Conversation
AradTraub
force-pushed
the
CM-72593-malicious-package-cli-output
branch
2 times, most recently
from
November 1, 2026 09:06
aede77e to
c34997c
Compare
omer-roth
reviewed
Nov 1, 2026
omer-roth
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed for DRY / KISS / YAGNI. Scope and approach look good; comments below are about duplication and test overlap, none blocking except the remediation one, which also resolves the "Known nit" in the description.
Collaborator
|
@AradTraub thanks, the follow-up commit covers the review. I resolved the threads. Can you rebase on |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AradTraub
force-pushed
the
CM-72593-malicious-package-cli-output
branch
from
November 1, 2026 10:01
0c76a81 to
82f6eaa
Compare
omer-roth
approved these changes
Nov 1, 2026
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.
Renders the "Malicious package found" SCA policy (
1fe6d83a-19de-48a2-a5ba-a80fe648489b) in scan output, and adds the scan option needed for the backend to run the detector at all.Mirrors CM-68446 (unmaintained packages), which is the template for every file here.
Changes
consts.pyMALICIOUS_PACKAGE_POLICY_IDcli_types.pyScaScanTypeOption.MALICIOUS_PACKAGESscan_command.pymalicious-packagesadded to the--sca-scandefault setscan_parameters.pymalicious_packageswire parametersca_policy_details.pyAdvisory+Remediationrows (remediation from the policy'sremediation_guidelines), registered in_DETAILS_BY_POLICYsca_table_printer.pyAdvisorycolumn,Malicious PackagestitleREADME.mdtext_printerandrich_printerboth consume_DETAILS_BY_POLICY, so they need no changes.Why the scan option is required
ScaScanDetectorBase.ShouldRunDetectorruns a detector only when no[ScaScanDetector]option is mentioned, or when that detector's own option is explicitly true. The CLI always sendspackage_vulnerabilities/license_compliance/maintainability, so the "no opinion" path is already closed — withoutmalicious_packagesthe detector never runs. The, False)default when the option is deselected is deliberate for the same reason.Deliberate omission: no GHSA row
The ticket asks for a "GHSA- ID (if present)". That data does not exist: threat-service's
packages/batchprojects only the cluster's primary id (MAL-→CVE-→GHSA-), so there is exactly onethreat_idto render. A GHSA row would always be empty.Verification
Verified end to end against a live backend —
cycode scan -t sca --sca-scan malicious-packageson a fixture containingflatmap-stream@0.1.1:102 unit tests pass (
tests/cli/printers,tests/cli/commands/scan).🤖 Generated with Claude Code