Case Studies

GitHub's Supply Chain Security Features

A comprehensive look at GitHub's evolving supply chain security toolkit, from Dependabot to code scanning, and how these features are reshaping how developers manage dependency risk.

Shadab Khan
Security Engineer
7 min read

GitHub hosts over 100 million developers and hundreds of millions of repositories. That position makes them both the largest target for supply chain attacks and the most influential platform for improving supply chain security practices. The features they build become de facto standards because of sheer adoption scale.

Over the past several years, GitHub has assembled a comprehensive supply chain security toolkit. Understanding what these features do, what they don't do, and how they fit together is essential for any organization using GitHub for software development.

Dependabot: Automated Dependency Updates

Dependabot started as an independent service before GitHub acquired it in 2019. It automatically creates pull requests to update dependencies when new versions are available or when vulnerabilities are disclosed.

What it does well:

Dependabot monitors your dependency files (package.json, Gemfile, requirements.txt, etc.) and creates pull requests when updates are available. For security updates, it prioritizes patches for known vulnerabilities and includes CVE information in the PR description. The PRs include compatibility scores based on CI pass rates from other repositories, giving developers a signal about update safety.

For many organizations, Dependabot is their first line of defense against known vulnerability accumulation. Before Dependabot, keeping dependencies current required manual effort that most teams didn't prioritize. Automating the process turned "we should update that library someday" into "here's a PR ready for review."

What it misses:

Dependabot focuses on known vulnerabilities in declared dependencies. It doesn't detect malicious packages that haven't been reported as vulnerabilities. It doesn't analyze whether your code actually uses the vulnerable function in a library. And it can create PR fatigue: teams that receive dozens of Dependabot PRs weekly sometimes stop reviewing them carefully, which is worse than not having them at all.

Dependabot also doesn't handle all ecosystems equally. Some package managers are better supported than others. And the compatibility scoring, while useful, isn't a guarantee. A PR that passed CI in other repositories might still break your specific configuration.

GitHub Advisory Database

The GitHub Advisory Database is a curated, open-source database of security vulnerabilities in open-source software. It feeds Dependabot alerts and is available through the GitHub API.

What makes it valuable:

The database aggregates information from multiple sources: the National Vulnerability Database (NVD), security advisories from package registries, and community contributions. GitHub employs security researchers who curate and verify entries, reducing noise from incorrect or duplicate advisories.

The advisory database also maps vulnerabilities to specific version ranges and ecosystems, which is more useful than raw CVE data. Knowing that CVE-2023-XXXXX affects library-name versions 2.0.0 through 2.3.4 is actionable. Knowing that a CVE exists for a library without version information is not.

Limitations:

The database has a time lag between vulnerability disclosure and entry. Zero-day vulnerabilities aren't covered. And the mapping between CVEs and affected packages isn't always accurate for complex dependency scenarios, particularly with language-specific packaging quirks.

Secret Scanning

GitHub scans repositories for accidentally committed secrets: API keys, authentication tokens, private keys, and other credentials. When a secret is detected, the repository administrator is notified, and in many cases, the secret provider is also notified so the credential can be revoked.

Why it matters for supply chain security:

Committed secrets are one of the most common supply chain attack vectors. The SolarWinds attackers used credentials found in a repository. Uber's 2016 breach started with AWS keys in a GitHub repo. Secret scanning catches these before (or shortly after) they're exposed.

GitHub's secret scanning supports patterns from dozens of service providers, and partners with those providers to automatically revoke leaked credentials. This automated revocation is perhaps the most impactful feature: even if a developer doesn't notice the alert, the leaked credential is invalidated.

Gaps:

Secret scanning uses pattern matching and is limited to known credential formats. Custom internal credentials, database passwords, and other non-standard secrets may not be detected. The push protection feature (blocking pushes that contain secrets) helps prevent new leaks but doesn't address secrets already in repository history.

Code Scanning and CodeQL

GitHub's code scanning, powered by CodeQL, performs static analysis on code to find security vulnerabilities. CodeQL is particularly powerful because it treats code as data, allowing complex queries about code behavior.

Supply chain security applications:

CodeQL can detect patterns associated with supply chain attacks: unsafe deserialization, injection points where dependency output flows into sensitive operations, and authentication bypass patterns that could be exploited through a compromised dependency.

For organizations producing open-source software, CodeQL scanning provides a layer of assurance that their code doesn't contain vulnerabilities that could affect downstream consumers.

Practical considerations:

CodeQL analysis is computationally expensive and can be slow for large repositories. The query language has a learning curve. And like all static analysis tools, CodeQL produces false positives that require human triage. Organizations need to invest in tuning their CodeQL configurations to get signal without drowning in noise.

Dependency Graph and Dependency Review

GitHub's dependency graph maps the complete dependency tree for a repository, including transitive dependencies. Dependency review shows how pull requests change the dependency graph, flagging new dependencies that have known vulnerabilities.

The dependency review action runs during pull requests and can block merges that introduce vulnerable dependencies. This catches supply chain risk at the earliest possible point: before the dependency enters the codebase.

Limitations:

The dependency graph is only as accurate as the package manager's lock file. If lock files aren't committed (a surprisingly common practice), the graph may be incomplete. Transitive dependency resolution can also vary between local development environments and CI, creating discrepancies.

npm Package Provenance

GitHub now supports npm package provenance, linking published packages to their source code and build process. When you install a package with provenance, you can verify that it was built from a specific commit in a specific repository using a specific build system.

This directly addresses the class of supply chain attacks where an attacker publishes a package that doesn't match its stated source code. With provenance, the link between source and package is cryptographically verified.

Provenance is still optional and not yet widely adopted. But it represents the direction the industry is moving: toward verifiable, transparent software supply chains.

Putting It All Together

GitHub's supply chain security features are most effective when used together:

  1. Dependency graph provides visibility into what you depend on.
  2. Dependabot keeps those dependencies updated and alerts on known vulnerabilities.
  3. Dependency review prevents new vulnerable dependencies from being introduced.
  4. Secret scanning catches leaked credentials before they're exploited.
  5. Code scanning finds vulnerability patterns in your own code.
  6. Package provenance verifies that packages are what they claim to be.

No single feature is sufficient. The combination provides defense in depth across the software supply chain lifecycle.

What's Missing

Despite the breadth of features, gaps remain:

Runtime behavior analysis. All of GitHub's tools operate on static artifacts: source code, dependency files, and package metadata. None of them analyze how dependencies behave at runtime.

Malicious package detection. The features focus on known vulnerabilities, not unknown malicious packages. A newly published malicious package without a CVE won't trigger Dependabot alerts.

Cross-repository analysis. Organizations using multiple repositories can't easily get a unified view of their dependency landscape across all repositories.

Policy enforcement. GitHub provides information and alerts but limited policy enforcement. Blocking a merge for a vulnerable dependency requires setting up the dependency review action, which many organizations haven't done.

How Safeguard.sh Helps

Safeguard.sh complements GitHub's built-in features by providing the cross-repository visibility, policy enforcement, and runtime context that GitHub doesn't offer natively. The platform aggregates dependency information across all your repositories into a unified dashboard, applies organizational policies that go beyond what GitHub's per-repository settings allow, and provides prioritized vulnerability management that considers your specific architecture and business context. Where GitHub gives you the building blocks, Safeguard.sh provides the orchestration layer that turns those building blocks into a coherent supply chain security program.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.