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

Ignore JSON files, except for NPM package.json files #674

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

tstromberg
Copy link
Collaborator

When we added support for scanning NPM package.json files (https://docs.npmjs.com/cli/v10/configuring-npm/package-json), we enabled scanning for all JSON files.

It turns out a lot of JSON files are just grab-bag lists of weird strings, and we trigger on them thinking they are full of all sorts of malicious content. This PR updates the filetype logic so that we only return a parseable file-type if the JSON file ends with "*package.json".

NOTE: This default still be overridden by passing --all on the command-line.

@tstromberg tstromberg requested review from egibs and imjasonh December 3, 2024 12:41
@tstromberg tstromberg changed the title Ignore non-NPM JSON files by default Ignore JSON files, except for NPM package.json files Dec 3, 2024
@tstromberg tstromberg enabled auto-merge (squash) December 3, 2024 16:06
@tstromberg tstromberg merged commit 900f3fb into chainguard-dev:main Dec 3, 2024
8 checks passed
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