Supply chain security
Signing proves provenance. The provenance was the problem.
A layered defence for the Python and conda supply chain, from signing to runtime containment.
Kevin Keller · kevinkeller.org
Why it matters
3 hours
that a backdoored LiteLLM was live on PyPI in March 2026
A package with 95 million monthly downloads. Every install harvested SSH keys, cloud tokens, Kubernetes secrets and crypto wallets.
The uncomfortable truth
Signing would not have stopped the LiteLLM attack
- The attacker stole the maintainer's CI/CD credentials.
- They published through the legitimate pipeline.
- With signing enforced, the backdoor would have been validly signed.
Signing is necessary, but not sufficient.
How packages get compromised
Four attack vectors dominate
- Account takeover: phishing, expired email domains, stolen CI/CD tokens.
- Typosquatting and slopsquatting: names close to popular packages, or hallucinated by LLMs.
- Dependency confusion: public packages named like private ones.
- Malicious updates: backdoors in packages thousands already trust.
What signing covers
Signing stops tampering, not trusted insiders gone bad
| Signing protects against | Signing does not stop |
|---|---|
| Mirror and CDN tampering | Compromised maintainer credentials |
| Man-in-the-middle | Malicious code in legitimate updates |
| Build tampering, with Trusted Publishing | Typosquats signed by the attacker |
Do this today
The tools available now already give strong protection
- Lockfiles:
pixi.lockpins every dependency to a version and hash - Audit before you update: review the diff and changelog
- Attest your own packages:
--generate-attestation - Scan: CVEs, SAST and secrets before building
- Generate SBOMs for audit and compliance
Curation and rebuilds
Two complementary ways to vet what you consume
| Anaconda | Chainguard | |
|---|---|---|
| Approach | Human-curated CVE review, TUF signing | Rebuilt from source, SLSA L3 |
| Coverage | Conda, conda-forge, PyPI | 16,000+ PyPI packages, container images |
| Best for | Enterprise Python and data science | Production containers |
Rebuilding from source prevented 98% of 3,025 known malicious packages in testing.
The principle
Assume the code is compromised. Design the environment so it doesn't matter.
Prevention reduces probability. Containment limits consequence.
Runtime containment
Four layers stop a payload even after it runs
- Network isolation: default-deny egress, so exfiltration fails.
- Filesystem isolation: chroot and namespaces, so lateral movement fails.
- System call restriction: seccomp-bpf, so privilege escalation fails.
- Identity-bound execution: code sees only what its role permits.
The reference architecture
Produce, consume and run, each mapped to a framework
| Stage | Framework | Pixi and conda mapping |
|---|---|---|
| Produce | SLSA L3 | rattler-build with Sigstore attestation |
| Consume | S2C2F | Quarantine, CVE scan, pixi.lock |
| Trust | Sigstore | CEP 27 attestations |
| Run | Containment | Egress control, sandbox, RBAC |
What's next
The tools are mature. The orchestration is missing.
- Typosquat checks, threat intelligence, CVE audits, SAST, signing and SBOMs still run as separate manual steps.
- An agentic builder could run them in order as a build-time gate.
- Humans stay in the loop for code-level decisions.
The takeaway
No single layer is enough: prevention and containment together.
Kevin Keller · kevinkeller.org