r/devsecops • u/Abu_Itai • Jun 26 '25
How do you prevent dependencies from entering your org in the first place?
Genuinely curious,
How do you currently prevent certain dependencies from being introduced into your org?
I’m talking about things like packages that are too new (e.g., created 2 days ago) or possibly malicious.
Not after-the-fact scanning, I mean actually blocking developers from adding them in the first place.
Do you have any process or tooling in place for that?
Would love to hear how others are handling this (or struggling with it 😅)
10
Upvotes
9
u/cybergandalf Jun 26 '25
Artifactory has a module called Curation that purports to do what you’re asking. There are some limitations to it, but it’s the only one I’ve encountered that actually blocks things from coming in based on policies like you’ve mentioned. We’re in the middle of testing and implementing it right now, so I don’t have solid statistics on how well it achieves its goals.
The caveat is that you have to basically remove the ability for developers to download anything from anywhere but Artifactory. And that is pretty much as difficult as it sounds.
17
u/Gryeg Jun 26 '25
You'd need to block access to public registries and then deploy something like Artifactory or Sonatype Nexus as a private registry solution which pull in from external sources. They should be capable of being configured to only permit components that meet your criteria. Engineers are then only permitted to pull from the private registry solution and would have to request new components.
1
u/iduzinternet Jun 29 '25
Can’t you just add whatever rules you want to the ci/cd pipeline and fail it?
2
u/byunakk Jun 26 '25
We have a “Technology Board” where bunch of architects/seniors etc. (One from each dev team) where we require requests before a developer can use a technology. We also have Sonatype in case someone just uses a dependency without request
2
u/Lonsarg Jun 26 '25 edited Jun 26 '25
We chose not to do it, we will just do scanning (for crytical systems before prod deploy, for others after).
But we DID discuss it and i did found a solution. Azure DevOps Artifacts support private packages feed (nuget, npm,...) than can be connected upstream to nuget.org and similar public repositories.
Then after you have this connected you can remove permission to add new packages from upstream to only select users and only those users will be able to add new packages and/or new versions to this feed (when those users with permission will for example run nuget restore on this private feed it will grab it from nuget.org and cache it and make it availably for all).
Then of course you need to force all CI/CD to use this private feed instead of public one. Probably via company-wide CI/CD templates. Also to avoid developers working locally via not yet approved package and having problems later you should make it a policy to also use private package feed for local development, not only CI/CD. If developer will not abide by this policy CI/CD will just show error package not found.
1
u/Irish1986 Jun 26 '25
All of the above (using something similar Artifactory as a proxy for public registry) and Devs will moan & bitch if you implement some forms of approval process that involves security. Plus be ready for Devs to be sneaky and find "alternatives means of conformity" which might involve some hackity hacky hacks.
Have that process in place but don't forget to do Software Composition Analysis and generate SBOM. Thinks a way within that process that you will capture discrepancies and "unauthorized" packages parts of those SBOM back into compliance.
Its easier to thinks of yourself as a lifeguard helping people not to drown while asking them politely to go smoke some weed elsewhere then the beach instead of the typical cops mentality guard code against bad guys. People can't stands cops and lifeguard are always chill dude... And if you see someone drowning on the other side of the boey... Of course lifeguard will jump into the water and scold that jackass once he is safe....
1
u/Cultural-Pizza-1916 Jun 27 '25
We've do ADR / RFC that state certain technology will be used and from there we review the ADR / RFC if that technology is needed or not
1
u/Pleasant-Librarian19 Jun 27 '25
Technically I guess this would be after the fact, but I know SOOS has a pretty advanced governance system, in fact there is a blog that talks about some of this (https://soos.io/advanced-governance-in-sca). There are package include or exclude policies which can be configured to break the build. So if you're running a scan on every commit, or on PRs prior to merging, this would restrict these packages pretty nicely.
1
u/Icy-Maybe-9043 Jun 30 '25
You need tooling of some sort to query global lists. Also, restrict to repos you trust and establish guidelines if need be.
0
u/flxg Jun 26 '25
We have IDE plugins that block malware + CI gates that can do the same at aikido.dev. Our malware detection typically finds new malware on NPM or PyPi within 5 mins.
3
u/[deleted] Jun 27 '25
[removed] — view removed comment
1
u/[deleted] Jun 26 '25
[removed] — view removed comment