upvote
I understand, but I would argue its better to have an in-house 1K lines of code that only does what we need and nothing else, it well tested and under our control, than to depend on some 50K lines of code (of which we might only use 10% of functionality and the others just getting in the way) that random's on the internet can modify, sometimes pulling in transient dependencies that we would really not have in a server environment, telemetry and other gremlins. It goes without saying that opensource packages will become even more juicy targets for malware/hackers to get into your systems like we've seen in the past month (and it will only become worse - you will be forced to pay technical debt or die).

The only "third-party" packages that we want to ideally allow/support would be provided from LTS versions of our runtime (in this case, packages provided by the dotnet team and audited by microsoft). So we will always try to build around what the framework provides. Second choice is our own code, third choice is open-source packages, fouth choice is a separate application/appliance (lets say ZenDesk for ticketing). Over time, we will reduce this footprint to only have dotnet team code and our own.

Remember most CVE's can be hidden on servers that are not publicly routable and don't have a real exploitation paths. The bits that are public (lets say a linux edge server with a web server on it, some firewalls, a couple of open ports) - these should be hardened to the max and not allow full access to all the services running behind it. We don't even give our internal services public IP addresses to make near impossible to route traffic to them.

Our git repo's are also not on public infrastructure (serious, think carefully about hosting on public services and if you really need it), never mind making the repo public.

We also have a dedicated secrets/certs manager, so no credentials are in codebases or pipelines. Very strict in this regard.

reply
> on some 50K lines of code

also some 3rd party libraries are overdesigned/overcomplicated because everybody wants the library to do everything for everybody.

This overcomplication can easily introduce security problems that is not present in the 1K solution.

reply
> overdesigned/overcomplicated because everybody wants the library to do everything for everybody.

Also a source of significant dependency churn even excluding security bugs.

Whereas with my own code I don't have to worry about scheduling work that's only arisen because somebody outside my organisation has decided to make a breaking change in a dependency. Paying that tax got old over a decade ago, and my patience with it now is close to zero.

reply
100% our thinking too.
reply
cough OpenSSL cough
reply
Similar to distroless containers & statically linking all dependencies
reply
It has been proofed again and again that you cannot trust npm/cargo not even AUR, implement you own minimalist functionality without dependencies and just for you own needs seems to be a much better solution.
reply
I feel like security by obfuscation might actually be valuable in the age of llm attacks
reply
on the other hand you are not exposed to supply chain attacks
reply
One problem I’ve seen with third-party libraries, especially in the JS ecosystem, is that to fix a CVE, you often need to jump a major version or three, and that entails quite a bit of work to adapt to breaking changes. Porting a fix back on your own and keeping your own fork is the same as supporting a first-party library, except it’s not really first party, and you’re not familiar with its innards.
reply
>Avoiding 3rd party libraries seems like a false sense of security.

What a bullshit.

It's different scenario, different trade offs.

You mitigate risk of library being sold to malicious 3rd party, you avoid risk of your supply chain being hacked, you avoid API/behaviour breaks, etc.

The trade off is that you have to maintain it.

That's why dotnet's ecosystem is so loved due to MS providing 90% of needed libraries, so you avoid some 3rd parties maintained by single person.

reply
This is the way! What also affects the decision is what the code will be doing, and how much extra functionality that you will never use (extra attack surface) you will get by importing external library after library.

Often it can be a very good choice to write the functionality yourself and not rely on external libraries.

reply
Same approach here.

And since we now have coding assistants, maintaining in-house costs near nothing now. Nobody else can break us, only ourselves.

reply