Dependency & Container Security

Software Composition Analysis (SCA)

3 min read

Modern applications are built on mountains of open-source dependencies. A typical Node.js project has 500+ transitive dependencies. Each one is a potential vulnerability.

The Supply Chain Risk

Your App (100% your code)
    └── express (NPM package)
        └── body-parser
            └── raw-body
                └── iconv-lite
                    └── safer-buffer  ← Vulnerability here affects your app

Key statistics:

  • 96% of codebases contain open-source components
  • 84% of codebases have at least one vulnerability
  • Average project has 500+ dependencies (direct + transitive)
  • Log4Shell (CVE-2021-44228) affected 35,000+ packages

What SCA Does

Software Composition Analysis scans your dependencies to find:

Finding TypeExampleRisk
Known Vulnerabilities (CVEs)Log4j remote code executionCritical
Outdated DependenciesReact 17.x (current: 19.x)Medium
License ComplianceGPL-3.0 in commercial projectLegal
Malicious Packagesua-parser-js compromiseCritical
Abandoned ProjectsNo updates in 2+ yearsMedium

How SCA Works

┌─────────────┐     ┌──────────────┐     ┌─────────────┐
│ Manifest    │ ──▶ │ SCA Engine   │ ──▶ │   Report    │
│ package.json│     │              │     │             │
│ Pipfile     │     │ ┌──────────┐ │     │ CVE-2024-XX │
│ go.mod      │     │ │ Vuln DB  │ │     │ License: GPL│
│ Cargo.toml  │     │ └──────────┘ │     │ Outdated: 5 │
└─────────────┘     └──────────────┘     └─────────────┘

SCA tools:

  1. Parse your dependency manifest files
  2. Resolve the full dependency tree (including transitive)
  3. Query vulnerability databases (NVD, OSV, vendor DBs)
  4. Report findings with remediation advice

Vulnerability Databases

DatabaseCoverageAccess
NVD (NIST)Comprehensive CVEsPublic
OSV (Google)Open source focusedPublic
GitHub AdvisoryGitHub ecosystemPublic
Snyk DBCurated + proprietarySnyk users
VulnDBCommercial intelligencePaid

SBOM: Software Bill of Materials

An SBOM lists every component in your software:

{
  "bomFormat": "CycloneDX",
  "specVersion": "1.5",
  "components": [
    {
      "type": "library",
      "name": "express",
      "version": "4.18.2",
      "purl": "pkg:npm/express@4.18.2",
      "licenses": [{ "license": { "id": "MIT" }}]
    }
  ]
}

Why SBOMs matter:

  • Incident response: Quickly check if you're affected by new CVEs
  • Compliance: Required by US Executive Order 14028 for government software
  • Supply chain transparency: Know what's in your software

Generate SBOMs with:

# Using Syft
syft packages . -o cyclonedx-json > sbom.json

# Using Trivy
trivy fs --format cyclonedx . > sbom.json

SCA vs SAST: Different Targets

AspectSASTSCA
ScansYour codeThird-party code
FindsCode vulnerabilitiesKnown CVEs
InputSource filesManifest files
False positivesHigherLower (CVE is CVE)
RemediationFix codeUpdate dependency

Next, we'll dive into Snyk—the most popular SCA tool for dependency scanning. :::

Quick check: how does this lesson land for you?

Quiz

Module 3: Dependency & Container Security

Take Quiz
FREE WEEKLY NEWSLETTER

Stay on the Nerd Track

One email per week — courses, deep dives, tools, and AI experiments.

No spam. Unsubscribe anytime.