Skip to content

Support Grype#1123

Merged
EliSchleifer merged 3 commits intotrunk-io:mainfrom
yu-iskw:support-grype
Apr 28, 2026
Merged

Support Grype#1123
EliSchleifer merged 3 commits intotrunk-io:mainfrom
yu-iskw:support-grype

Conversation

@yu-iskw
Copy link
Copy Markdown
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
Copy Markdown
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

@yu-iskw
Copy link
Copy Markdown
Contributor Author

yu-iskw commented Apr 14, 2026

@EliSchleifer @dfrankland I am sorry for bothering you but I appreciate if you could look into the pull request. Thank you for the great products.

@EliSchleifer EliSchleifer self-requested a review April 28, 2026 17:57
Copy link
Copy Markdown
Member

@EliSchleifer EliSchleifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks

@EliSchleifer EliSchleifer merged commit 227ce30 into trunk-io:main Apr 28, 2026
12 checks passed
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

2 participants