Skip to content

Support Grype#1123

Open
yu-iskw wants to merge 1 commit intotrunk-io:mainfrom
yu-iskw:support-grype
Open

Support Grype#1123
yu-iskw wants to merge 1 commit intotrunk-io:mainfrom
yu-iskw:support-grype

Conversation

@yu-iskw
Copy link
Contributor

@yu-iskw yu-iskw commented Mar 23, 2026

Summary

Adds support for Grype as a new security-focused linter for vulnerability scanning across filesystems and lockfiles.

Changes

  • Grype Plugin: Added linters/grype/plugin.yaml defining the grype tool and linter, configured to output SARIF and use a shared cache for its vulnerability database (GRYPE_DB_CACHE_DIR).
  • Integration Tests: Added linters/grype/grype.test.ts and test fixture linters/grype/test_data/Gemfile.lock to verify vulnerability detection.
  • Test Infrastructure: Updated tests/driver/driver.ts and tests/utils/index.ts to support TRUNK_CACHE and XDG_CACHE_HOME environment variables, ensuring proper sandboxing and caching of tool-specific data (like Grype's DB) during tests.
  • Documentation: Updated README.md to include Grype in the list of supported security linters.

Closes #1122.

Signed-off-by: Yu Ishikawa <yu-iskw@users.noreply.github.com>
@yu-iskw yu-iskw marked this pull request as ready for review March 23, 2026 01:42
@yu-iskw
Copy link
Contributor Author

yu-iskw commented Mar 23, 2026

@TylerJang27 I am sorry for bothering you, but I want to support other security tools besides trivy because of the recent incedents. It would be good to support alternatives in trunk.

We have the two failed workflows. However, the errors don't look related to the changes. Should we open another pull request to fix them?

https://github.com/trunk-io/plugins/actions/runs/23417421235/job/68115530526?pr=1123

https://github.com/trunk-io/plugins/actions/runs/23417421235/job/68115523251?pr=1123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add Support for Anchore Grype as a Vulnerability Scanner Alternative

1 participant