Skip to content

Instantly share code, notes, and snippets.

@bthomas2622
Last active September 6, 2023 18:22
Show Gist options
  • Select an option

  • Save bthomas2622/527eb67ce4e2fbb22751fd5084b68c56 to your computer and use it in GitHub Desktop.

Select an option

Save bthomas2622/527eb67ce4e2fbb22751fd5084b68c56 to your computer and use it in GitHub Desktop.
Open Source Dependency License Management with Dependabot

Open Source Dependency License Management with Dependabot

Free Tier

Dependency Graph is a GitHub Repository feature that builds a detailed mapping of the manifest and lock files stored in the repository. Exploring the dependencies with Dependency Graph.

The Dependency Graph includes open source license information for your dependencies via the GitHub API (Example GraphQL Query).

Dependency Graph also supports exporting a software bill of materials (SBOM) for your repository which includes license data.

Integrations that use the Dependency Graph API

  1. The Policy as Code (PaC) GitHub Action (Marketplace Listing) written by a member of the GitHub Advanced Security team aggregates GitHub API endpoints for Code Scanning, Secret Scanning and Dependabot Security. One if it's features allows you to define License usage compliance requirements within a "Policy as Code" config file (yaml) in your repository. These compliance requirements are run as a GitHub Action "Check" on pushes/PRs or any other trigger defined in your PaC workflow file.
  1. The Generate Dependency Data File GitHub Marketplace Action generates a csv file that contains a list of the dependencies detected for each of the specified repos. This includes license information.

  2. The gh-dependency-report is a GitHub CLI extension for generating a report on repository dependencies.

GitHub Enterprise Cloud Tier

One item the Dependency Graph tracks is license usage of the open source dependencies in a repository. This means the license usage for the entire organization can be viewed/filtered in Dependency Insights.

GitHub Advanced Security Tier

The GitHub Dependency Review Action is an automated pull request check that allows you to configure open source dependency license policies via allow-licenses to permit or deny-licenses to reject.

Extras

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment