Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SINT-2736] Support scanning github actions #526

Closed

Conversation

juliendoutre
Copy link
Contributor

@juliendoutre juliendoutre commented Jan 30, 2025

A contribution to run NPM scans over GitHub projects.

This allows scanning Github actions which are not released on NPM but for which JS/TS semgrep rules are still relevant.

You can try running the following to see it in action:

poetry run guarddog --log-level debug npm scan https://github.com/actions/checkout.git --version v4.2.2 -x npm_metadata_mismatch -x empty_information -x typosquatting -x release_zero

Note that I'm forced to exclude some rules relying on NPM's API to run since in the case of github actions there's no actual package released to NPM.


return data, unzippedpath

def _parse_git_url(self, package_name: str) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: would be good to have an unit test for that one (not a blocker though)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, updated one existing (but skipped) test in b20a248.

@juliendoutre juliendoutre marked this pull request as ready for review January 30, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants