Conversation
Co-Authored-By: Claude Opus 5 <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.
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, 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:75 unit tests pass (
tests/cli/printers,tests/cli/commands/scan).Known nit
The
Remediationconstant reads "…Remove it from your dependencies immediately." while the policy's seededremediation_guidelines— and therefore the PR comment — says "…Remove it from your dependencies." Left as-is intentionally; happy to align if reviewers prefer.🤖 Generated with Claude Code