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

  1. Account takeover: phishing, expired email domains, stolen CI/CD tokens.
  2. Typosquatting and slopsquatting: names close to popular packages, or hallucinated by LLMs.
  3. Dependency confusion: public packages named like private ones.
  4. Malicious updates: backdoors in packages thousands already trust.

What signing covers

Signing stops tampering, not trusted insiders gone bad

Signing protects againstSigning does not stop
Mirror and CDN tamperingCompromised maintainer credentials
Man-in-the-middleMalicious code in legitimate updates
Build tampering, with Trusted PublishingTyposquats signed by the attacker

Do this today

The tools available now already give strong protection

  • Lockfiles: pixi.lock pins 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

AnacondaChainguard
ApproachHuman-curated CVE review, TUF signingRebuilt from source, SLSA L3
CoverageConda, conda-forge, PyPI16,000+ PyPI packages, container images
Best forEnterprise Python and data scienceProduction 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

  1. Network isolation: default-deny egress, so exfiltration fails.
  2. Filesystem isolation: chroot and namespaces, so lateral movement fails.
  3. System call restriction: seccomp-bpf, so privilege escalation fails.
  4. Identity-bound execution: code sees only what its role permits.

The reference architecture

Produce, consume and run, each mapped to a framework

StageFrameworkPixi and conda mapping
ProduceSLSA L3rattler-build with Sigstore attestation
ConsumeS2C2FQuarantine, CVE scan, pixi.lock
TrustSigstoreCEP 27 attestations
RunContainmentEgress 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.

Read the full article

Kevin Keller · kevinkeller.org