-
Notifications
You must be signed in to change notification settings - Fork 1k
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
for npm security alerts, devDependencies
should be ignored by default or configurable
#4146
Comments
I think there are several things at play:
|
I completely agree that it's preferable to catch these things rather than potentially ignore a security vulnerability. As it currently stands, a lot of repositories (especially those with lots of dev dependencies, like react apps) get a ridiculous amount of dependabot spam. I definitely agree that this is unwise for a default, but personally I would like to globally configure dependabot to not tell me about devDependency issues. It's not really dependabots fault, I don't think - it's more to do with how npm is rather generous with its security disclosures. As it stands though, this results in an annoying amount of spam on repositories that I would really love to opt out of (but still get real-dependency security vuln notifications). |
Totally get the noise issue, and I agree it's partially our fault and partially the fault of how ecossytems operate and are used. I know npm is considering this as well, e.g.: I agree that we want some form of global configuration, though we don't have any concrete ideas on how to make this work (e.g. are settings additive or do they get overridden by more specific configs, or does this depend on the setting). If you have suggestions on how you'd like to see this work, I'd appreciate any thoughts. |
This is actually a bit more complicated than I thought to wire up a global config file. This post got way longer than I anticipated, whoops. In short, I think things like these should be as predictable as possible and avoid things like setting-specific mergings. My proposal is for a simple separate dependabot-defaults file (that goes, somewhere, i guess?) and if a local configuration exists for that ecosystem, it should replace the defaults. Copying existing format for a defaults fileI don't think you could reuse the dependabot format in whole, and then package-ecosystem as a key?Maybe a separate UI could work, using # dependabot-defaults.yml -- goes... somewhere?
defaults:
npm:
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-name: "lodash" Then that should apply to all repositories where dependabot thinks NPM is relevant. That said... Merging with repository specific overridesIf a repository has a dependabot.yml file that configures it, the two need to merge predictably. I think it might actually be for the best that no merging takes place. That is, if I'm not sure how in-line that is with the rest of githubs configurations, merging could take place, but I'm skeptical of how it would have to merge arrays when you might want to override an array entirely, or try and exclude a prop defined in # dependabot.yml
version: 2
updates:
- package-ecosystem: "npm"
schedule:
interval: "weekly" viz. If this was present in a repository, the only configuration dependabot would see for NPM is exactly that. The defaults explicitly would not apply if a local configuration exists. Advantages:
Disadvantages:
|
The likely place is in a
While I think I agree conceptually, there are going to be cases where we will need some form of inheritance, for example, many large organizations want to define their private registries once and have them available to all repos.
I think that the combo of I think the right model might be "we will inherit any settings that aren't explicitly overridden." As an example:
Note that the registry could be overridden in the repo (for just the repo), which is also potentially bad, but I don't have a good way to prevent this (maybe we show a check run failure?). In your case, this would allow you to:
|
You might well be right. The To be honest, I don't use dependabot enough (or at an enterprise level) and I think you will probably have a better idea of what design will mesh better with github. Regardless, that solution looks very comfortable! |
I'm here to make sure that the solutions work for you, so your feedback is critical :) I'll keep this issue open, and it will likely get implemented along with org-wide registries, since the functionality is similar. |
I appreciate it! Thanks for responding. |
I believe this issue is relevant to an issue in |
More or less, yeah. |
I have no idea why this isn't the default, here are some threads on the issues: dependabot/dependabot-core#4146 dependabot/dependabot-core#2521 facebook/create-react-app#11174
…endency vulnerabilities I have no idea why this isn't the default, here are some threads on the issues: dependabot/dependabot-core#4146 dependabot/dependabot-core#2521 facebook/create-react-app#11174
…endency vulnerabilities (#5304) I have no idea why this isn't the default, here are some threads on the issues: dependabot/dependabot-core#4146 dependabot/dependabot-core#2521 facebook/create-react-app#11174
Is there any update on the status of this? I was looking to enable dependabot alerts org-wide, but am concerned that majority of alerts will be about ReDOS in dev deps etc. |
I think this should be implemented |
Would love to see this implemented dependabot spam is a pain. |
I endorse this too. It'd be very nice to just ignore dev dependencies, especially because we don't really care if some test packages bring hundreds of other packages together, for example, if our final package will have zero dependencies. |
It'd be great if It looks like the version: 2
updates:
- package-ecosystem: "npm"
directory: "/**"
schedule:
interval: "daily"
allow:
- dependency-type: "production" npm |
This is keeping us from turning on dependabot as well. |
The clutter from |
To be clear, there was no way to exploit this vulnerability. It was exploited by default, because the actual dev dependency itself was malicious. Like, a malicious version of it was published by the package maintainer: Malicious packages are a categorically different kind of risk that is very relevant. It's helpful to monitor for malicious packages, even in dev deps. But malicious packages are very rare, and my 2¢: I would much rather have dependabot be usable by having it ignore dev deps, rather than not being able to use it because it creates too much noise from vulns which turn out not to be vulns 👦 🐺 . |
Would it be possible to fix this? It looks like it's still not working. You've done a lot of the work already by marking dependencies with a scope. This would make Dependabot much more usable with JavaScript. It's very hard to catch a real vulnerability, with all the false positives. Otherwise, would you be open to a PR for this? |
@kienstra do you use npm or Yarn? It sounds like scopes only works with npm, but I've not tested either. |
Hi @slapbox, |
Hi @jakecoffman, Would it be possible to fix this? If dependabot could ignore devDependencies via Sorry for the random ping, and thanks for any attention you can give this. |
If you're facing this issue when trying to get vuln metrics/KPI, you can use the graphql api to add the scope filter to get the correct aggregate of vulns. something like this:
Curious if this is the same behavior/attitude towards Rust, PHP, etc. as they have the same concepts within those package managers. If so, we have consistency, if not - this is breaking assumptions for Dependabot behavior in conjunction with other languages in an enterprise setting. |
👋 Sorry for the slow update here from the core team. Since this issue was opened, the scope of this repo / issue tracker / team that monitors it has changed... we no longer handle alerts, we now only handle the code that creates PR's to bump versions--whether from cron or from security alerts--but not creating the security alerts themselves. Versus as best I can tell this issue is about limiting/filter the alerts themselves, not the resulting PRs. If so, then given that the team behind alerts doesn't monitor this repo (nor should they) we should probably close this and redirect to a discussion over in https://github.com/community/community/discussions/categories/code-security as that's the best way to reach the team that handles alerts. This is clearly a popular issue, so I'll leave open for a little bit in case I misunderstand something. |
I've been following this issue for some time, so I'll chime in. I want to be able to configure Dependabot to completely ignore devDependencies -- both for PRs and alerts. As of now, I have completely disabled Dependabot PRs for security alerts because of the "PR spam". |
For security PR's (not alerts), did you try setting |
@jeffwidman if it doesn't affect alerts then it isn't really useful to us. An alternative happy medium for us would be to receive ONE weekly alert per repo that contains the alerts for all |
I get it, that kind of noise is annoying. But as I mentioned above, feature requests related to configuring alerts are out of scope for this repo's issue tracker, as this repo and the associated internal service at GitHub only handle creating PR's triggered by cron/alerts, not generating the alerts themselves. The team managing alerts doesn't monitor this repo (nor should they), so feature requests related to alerts need to go to https://github.com/community/community/discussions/categories/code-security. If you do create a discussion there, feel free to drop a breadcrumb link here. |
devDependencies
should be ignored by default or configurable
#3475 and others discuss the ability to do this, but I personally think this should be the default behaviour, since devDependencies aren't going to be public facing, and it causes a ridiculous amount of PR spam even on repositories where I quite literally have 0 dependencies!
The alternative is making a .github/dependabot.yml file in all of my repositories, which seems like it'd get really annoying. If this isn't acceptable as the default behaviour - could we get a way to globally configure dependabot for all of our repositories?
If this already exists, please let me know!
The text was updated successfully, but these errors were encountered: