Where the Code Comes From
An application is built from far more code than its own team writes. That code is fetched from outside when the app is built, installed or loaded, and it enters the stack from the side.
Why It Matters
Most of an app's code comes from outside the team, and these points explain what that means for a defender. The sections below list every source of outside code, grouped by how it reaches the app, each with its own page.
- Most of an app is packages, bundles of code written by strangers and fetched from a public registry such as npm or PyPI when the app is built. Often hundreds of them arrive through other packages, as transitive dependencies that nobody chose directly.
- A package runs with the rights of whatever installs or runs it. On a laptop it gets the developer's access, on the build server its secrets and signing keys, and in the live app its data and credentials.
- So one bad package reaches everything the app can reach, and every customer who installs the app or its next update.
- Defenders keep a lockfile, which pins the exact version of every package a build installs, and an SBOM (software bill of materials), which lists every component a product contains. They run the ecosystem's audit tool and watch the OSV and GitHub advisory databases for known bad versions. They install through a private mirror or proxy, and they check signed provenance, a record of where and how a package was built, where the ecosystem offers it.
Registries
These are public stores of packages, images and plugins that the team installs from.
npmThe JavaScript package registry behind Node.js apps and many web front ends.
PyPIThe Python package registry that pip installs from by default.
Maven CentralThe main repository of Java libraries, used by Maven and Gradle builds.
NuGetThe package registry for .NET, where Visual Studio and dotnet fetch libraries.
PackagistThe main repository of PHP packages, which Composer installs from.RubyGemsThe Ruby package registry, where Bundler fetches the gems an app needs.
Container ImagesReady-made images from Docker Hub and other registries that containers start from.
Helm ChartsPackaged Kubernetes deployments that decide which images run and what they may touch.
- OS PackagesThe apt and dnf repositories a Linux server installs and updates its software from.
WordPress PluginsAdd-ons from the WordPress.org directory and vendors, with full control of the site.
Build
This is the pipeline that turns code into what ships, and it holds the keys to sign and publish it.
Delivery
This is code a supplier sends straight to running systems, as updates or as scripts the page loads.