Skip to content

Malicious Code scan command#704

Merged
attiasas merged 7 commits intojfrog:devfrom
attiasas:mal_scan_entitlments
Mar 30, 2026
Merged

Malicious Code scan command#704
attiasas merged 7 commits intojfrog:devfrom
attiasas:mal_scan_entitlments

Conversation

@attiasas
Copy link
Copy Markdown
Collaborator

@attiasas attiasas commented Mar 24, 2026

Enable malicious-scan CLI command

Summary

Enables the malicious-scan (ms) CLI [Beta] command and introduces a dedicated entitlement check (ai_catalog) with a minimum Xray version requirement (3.132.0)

Changes

  • cli/scancommands.go: Uncommented the malicious-scan command registration and its docs import, making the command available in the CLI.
  • commands/maliciousscan/maliciousscan.go:
    • Added MaliciousScanFeatureId (ai_catalog) and MinimumXrayVersionForMaliciousScan (3.132.0) constants.
    • Replaced the generic jas.IsEntitledForJas check with a new IsEntitledForMaliciousScan function that validates entitlement using the ai_catalog feature ID.
    • Added minimum Xray version validation before running the scan.
  • maliciousscan_test.go: Uncommented all integration tests (TestMaliciousScan, TestMaliciousScanWithWorkingDirs) and wired them to the new InitMaliciousScanTest guard and MinimumXrayVersionForMaliciousScan constant.
  • tests/config.go: Added TestMaliciousScan flag (--test.maliciousScan) and included it in the "run all tests" default set.
  • tests/utils/integration/test_integrationutils.go: Added InitMaliciousScanTest helper to skip/gate tests based on the new flag and minimum Xray version.
  • .github/workflows/test.yml: Added --test.maliciousScan flag to the CI test run arguments.

Testing

  • Integration tests for malicious-scan are now active and gated behind the --test.maliciousScan flag.
  • CI workflow updated to run these tests.
  • Tests are passing against JPD
--- PASS: TestMaliciousScan (17.22s)
    --- PASS: TestMaliciousScan/Malicious_scan_with_findings_(Simple_JSON) (8.68s)
    --- PASS: TestMaliciousScan/Malicious_scan_without_findings_(Simple_JSON) (8.53s)
--- PASS: TestMaliciousScanWithWorkingDirs (8.60s)

@attiasas attiasas added ignore for release Automatically generated release notes safe to test Approve running integration tests on a pull request labels Mar 24, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 24, 2026
@attiasas attiasas changed the title Update entitlement feature of mal command Malicious Code scan command Mar 26, 2026
@attiasas attiasas added new feature Automatically generated release notes and removed ignore for release Automatically generated release notes labels Mar 26, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Mar 26, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 26, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Mar 26, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 26, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Mar 26, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 26, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Mar 26, 2026
@attiasas attiasas requested a review from a team March 26, 2026 11:41
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 26, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Mar 30, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Mar 30, 2026
@github-actions
Copy link
Copy Markdown

👍 Frogbot scanned this pull request and did not find any new security issues.


@attiasas attiasas merged commit 70b8e6f into jfrog:dev Mar 30, 2026
163 of 168 checks passed
@attiasas attiasas deleted the mal_scan_entitlments branch March 30, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants