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

Stop Reporting NPM Packages with a "prepare" Script #313

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions guarddog/analyzer/sourcecode/npm-install-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ rules:
patterns:
- pattern-inside: |
"scripts": {...}
# note that on some cases installing a package can lead to the execution of some "prepare" scripts
# (typically when a dependency is a git repository, see https://github.com/npm/cli/issues/6031#issuecomment-1449119423)
# however this happens pretty rarely so reporting every package with a "prepare" script would be too noisy;
# see https://github.com/DataDog/guarddog/issues/308
- pattern-either:
- pattern: |
"preinstall": "..."
- pattern: |
"install": "..."
- pattern: |
"postinstall": "..."
- pattern: |
"prepare": "..."
languages:
- json
paths:
include:
- "*/package.json"
- "*/npm-install-script.json" # unit test
severity: WARNING
severity: WARNING