π HIERARKI SUPPLY CHAIN SECURITY β Dari npm install (Level 0) sampai SLSA L4 + Formal Provenance (Level 5)
Satu perintah
pip install,npm i, ataugo getβ dan kamu mengimpor kode dari puluhan maintainer yang tidak kamu kenal. Supply chain attack adalah vektor kompromi paling efektif 2024β2026: satu backdoor di library populer bisa menjangkau 10.000+ project dalam jam. Hirarki ini memetakan evolusi proteksi dari βtidak ada verifikasiβ sampai βbuild provenance terverifikasi kriptografis.β Untuk taksonomi attack surface + SLSA framework, lihat software-supply-chain-security-deepdive.
Cara Baca
Level 0 = tanpa proteksi (hanya
npm install+ doa). Level 5 = SLSA L4 + Sigstore + in-toto. Setiap level menambah lapisan verifikasi β semakin tinggi level, semakin sulit attacker menyusup, tapi semakin mahal untuk build infrastructure-nya.
Tabel Utama β Level 0 sampai Level 5
| π Level | π§ Approach | β‘ Mekanisme | β οΈ Tembok Kematian | π― Kapan Cukup |
|---|---|---|---|---|
| Level 0 β Trust by Default | npm install, pip install tanpa lockfile, tanpa audit. βSiapa pun bisa publish, siapa pun kita percayaβ | Tidak ada verifikasi. Satu maintainer bisa overwrite version, inject backdoor, atau unpublish | Solarwinds (2020), CodeCov (2021), 3CX (2023) β semua attacker inject di pipeline/CI yang tidak diverifikasi. 100% exposure | Development lokal, prototype, personal project tanpa data |
| Level 1 β Lockfile & Integrity Check | package-lock.json, pip freeze > requirements.txt, go.sum, yarn.lock, Cargo.lock | Hash integrity setiap dependency. npm ci ketat: jika hash berbeda dari lockfile β install gagal. Deteksi perubahan tidak sengaja | Lockfile masih bisa di-poison (jika attacker compromise registry dan update package + resign hash). Tidak proteksi dari maintainer compromise | Startup, open source project, project dengan dependencies <50 |
| Level 2 β Dependency Audit & SCA | npm audit, pip audit, Snyk, Dependabot, Renovate, Trivy, Grype, osv-scanner | Software Composition Analysis: scan known CVEs di dependency. Dependabot auto-PR update. Snyk: prioritasi berdasarkan reachability. osv-scanner: Google database CVE open-source | Hanya CVE known. Zero-day supply chain tidak terdeteksi. Proteksi dari maintainer compromise β tidak di-cover β harus Level 3+. False positive tinggi | Mid-size company, staging environment, SDLC tahap awal |
| Level 3 β SBOM + Signature | SPDX/CycloneDX SBOM, Sigstore (Cosign, Fulcio, Rekor), gitsign | SBOM (Software Bill of Materials): inventaris semua komponen. Sigstore: sign container/image dengan kunci ephemeral (Fulcio CA) + bukti publik di log Rekor (transparansi). Cosign: sign container image | Kunci ephemeral juga bisa expire. SBOM perlu update otomatis (masalah kebanyakan SBOM statis usang). Adopsi kontributor masih rendah | Regulated industry, compliance requirement, enterprise production |
| Level 4 β SLSA L3 + Build Provenance | SLSA L3 (build platform terverifikasi), provenance attestation, hardened build pipeline | SLSA L3: build platform terverifikasi (isolasi, reproducibility, no custom steps). Provenance: klaim tentang bagaimana artifact dibangun β diverifikasi kriptografis. in-toto: attestation metadata sepanjang pipeline | SLSA L3 butuh CI/CD maturity tinggi. Reproducible build kadang sulit (Go bagus, C++ susah). Provenance membutuhkan infrastructure dedicated | Tech company mature, platform yang supply chain jadi competitive advantage |
| β οΈ Level 5 β SLSA L4 + Formal Provenance | SLSA L4 (two-person review, hermetic build, reproducible), formal provenance attestation | SLSA L4: perubahan hanya melalui two-person reviewed PR. Build hermetic (tidak bergantung pada source eksternal selain yang di-attest). Provenance di-verifikasi setiap deploy. Build bit-for-bit reproducible | Mahal sekali. Reproducible build untuk semua dependency (termasuk C, Rust dengan native code) hampir mustahil dalam praktik. Hanya organisasi dengan resources besar | Military, critical infrastructure, national security software |
Peta Visual β Proteksi vs Coverage
Proteksi β
L5 β SLSA L4 + Formal Provenance βββββ Security coverage
L4 β SLSA L3 + Build Provenance βββββ
L3 β SBOM + Signature ββββ
L2 β Dependency Audit + SCA ββββ
L1 β Lockfile (Integrity) ββ
L0 β Trust by Default β
ββββββββββββββββββββββββββββ Attack surface coverage
β β β
Dependency Maintainer Build
confusion compromise pipeline
Level 2 (SCA) Adalah Baseline Minimum 2026
Di 2026, tidak ada alasan untuk tidak menjalankan SCA.
npm audit+ Dependabot gratis untuk GitHub.osv-scannergratis untuk semua. Level 0 adalah reckless untuk project yang digunakan orang lain atau menyimpan data. Level 2 adalah minimum viable security.
Kenapa Hirarki Ini Penting
1. Supply Chain Attack Tidak Bisa Dideteksi Di Aplikasi
Backdoor di library populer akan:
- Lolos code review (reviewer tidak audit full library β hanya API call yang dipakai)
- Lolos SAST (static analysis tidak deteksi backdoor intent)
- Lolos unit test (backdoor path tidak dipanggil di test β hanya di production)
- Lolos runtime monitoring (sampai beacon call out)
Satu-satunya pencegahan adalah preventive controls di pipeline: signed artifact, provenance, SLSA.
2. Attack Surface Bukan Cuma Open Source Dependency
| Vector | Contoh | Level Mitigasi |
|---|---|---|
| Typosquatting | requets vs requests | L1 (lockfile) |
| Maintainer takeover | Compromise developer npm account | L3 (signature + SBOM) |
| Build pipeline CI/CD | Inject di GitHub Actions workflow | L4 (SLSA L3) |
| Hardware supply chain | Malicious chip di server | L5+ (beyond scope) |
| Registry compromise | npm/PyPI attacked directly | L3 (signature) |
| Dependency confusion | Internal package name diambil attacker di public registry | L1 (lockfile + prefix) |
3. SLSA = Standar Emas Untuk Supply Chain
SLSA (Supply-chain Levels for Software Artifacts) adalah framework yang dipakai Google, GitHub, OpenSSF. Empat level:
| SLSA | Build Requirement | Proteksi Dari |
|---|---|---|
| L1 | Documentation of build process | β (awareness only) |
| L2 | Hosted build + signed provenance | Dependency confusion |
| L3 | Hardened build (isolation, no custom steps) | Build pipeline poisoning |
| L4 | Two-person review + hermetic + reproducible | Maintainer compromise |
SLSA L4 + Sigstore + in-toto = gold standard. Tapi SLSA L2 + signature sudah mencegah 90% supply chain attack.
Plot Twists
Plot Twist 1: Solarwinds (2020) Adalah Bukti SLSA L4 Penting
Solarwinds: attacker inject backdoor di build pipeline (not source code). Produk Orion di-sign certificate resmi β signature valid, tapi binary berisi backdoor. Jika SLSA L4 di-enforce: two-person review + hermetic build β inject di pipeline mustahil karena perubahan ke build system harus lewat PR reviewed. SLSA L4 bukan teori β dampak langsung ke real incident.
Plot Twist 2: SBOM (L3) Wajib Secara Regulasi di 2025+
US Executive Order 14028 (2021): semua software yang dijual ke government harus punya SBOM. EU Cyber Resilience Act (2024): supply chain transparency wajib. SBOM bukan opsional lagi untuk regulated industry. Indonesia? Belum β tapi global trend tidak terhindarkan untuk export/global product.
Plot Twist 3: Open Source Maintainer Burnout β Attack Surface Naik
58% open source maintainer unpaid (2024 survey). Satu maintainer handle 10+ library. Burnout β security update lambat β attacker exploit window. Supply chain security harus di-support organisasi yang bergantung padanya β via sponsorship, contribution, atau dedicated security team. xz utils backdoor (2024) nyaris sukses karena maintainer tunggal yang kewalahan.
Plot Twist 4: Reproducible Build Susah β Tapi Paling Powerful
Reproducible build: source yang sama β always binary yang identik (bit-for-bit). Jika build tidak reproducible, attacker bisa inject di kompilasi tanpa terdeteksi. Go, Rust bagus untuk reproducible. C/C++ (makro, DATE, PCH) sangat sulit. Tapi reproducible build adalah ultimate verification bahwa build kamu bersih.
Rekomendasi Minimum per Profile
| Profil | Level Minimum | Alasan |
|---|---|---|
| Personal project | L1 (lockfile) | Gratis, proteksi dari accidental change |
| Open source library | L2 (SCA) + publish dengan signature | Tanggung jawab ke konsumen library |
| Startup MVP | L2 (SCA) + Dependabot | Proteksi dari known CVEs |
| Enterprise production | L3 (SBOM + Sigstore) | Compliance + incident response |
| Regulated / Fintech | L4 (SLSA L3 + provenance) | Audit requirement + risk management |
| Critical infrastructure | L5 (SLSA L4 + formal) | Zero trust supply chain |
Sumber & Telusur Lebih Lanjut
- Deep Dive Supply Chain β software-supply-chain-security-deepdive (830 baris β attack surface, SLSA, Sigstore, in-toto)
- CI/CD Pipeline β cicd-shiftleft-shiftright (DevSecOps integration)
- Container Security (Image Signing) β cloud-infrastructure (Level 3β4, container supply chain)
- Threat Directory β comprehensive-threat-directory (supply chain threat actors)
- Hardware Supply Chain β hierarchy-hardware-hacking (Level 6β7 hardware backdoor)
- Master Index β master-index
Hirarki supply chain security adalah biaya trust. Level 0 gratis β tapi membayar dengan trust buta. Level 5 mahal β tapi feedback-nya: βsetiap baris kode yang masuk ke production bisa diverifikasi asal-usulnya.β Pilih level yang sepadan dengan risiko yang bisa ditoleransi.
Supply Chain Security Hierarchy | Level 0 (npm install + Doa) β Level 5 (SLSA L4 + Formal Provenance) Β· Semakin Tinggi, Semakin Terverifikasi Asal-Usul Kode