Assessing the impact of GitHub Secret Protection

Measure how GitHub Secret Protection reduces secret exposure across your organization, so you can demonstrate value and identify areas to strengthen your security posture.

Introduction

After enabling GitHub Secret Protection (GHSP) for your organization, you'll want to assess its impact and understand how it's protecting your organization. This tutorial walks you through accessing secret-related data and interpreting the results to measure GHSP performance.

In this tutorial, you'll learn how to:

If you don't have a historic SRA report from before your GHSP rollout, you can still assess GHSP's effectiveness. Skip ahead to Step 4: Analyze security overview data trends.

Prerequisites

Step 1: Access the organization-level security overview

The security overview provides real-time data about secret scanning alerts across your organization.

  1. On GitHub, navigate to the main page of the organization.
  2. Under your organization name, click the Security and quality tab.
  3. On the security overview page, click the Risk tab to view secret scanning data.
    The overview shows:

Step 2: View your secret risk assessment report

If you previously ran a SRA report, you can access the report to establish a baseline.

  1. On GitHub, navigate to the main page of the organization.
  2. Under your organization name, click the Security and quality tab.
  3. In the sidebar, under "Security", click Assessments.
  4. Review the key metrics from the assessment, including:

The SRA report represents a point-in-time snapshot of your secret exposure before or during your GHSP implementation.

Step 3: Compare SRA data with current security overview

The SRA report is a point-in-time snapshot taken before or during your GHSP rollout, while the security overview shows real-time data that updates as alerts are opened and resolved. To make a meaningful comparison, you need to ensure both datasets cover the same secret types.

Filter to comparable pattern types

The SRA report only detects provider patterns and generic patterns. The security overview, however, may also include results from custom patterns you've configured since enabling GHSP. To ensure an accurate comparison, filter the security overview to the same pattern types the SRA covers.

Using the UI

In the security overview Risk tab, use the filter bar to narrow results to provider and generic patterns only, excluding any custom patterns.

Using the API

Alternatively, you can use the REST API to programmatically retrieve alerts filtered by secret type. For example, to list only default (provider) secret scanning alerts for a repository:

gh api \
  -H "Accept: application/vnd.github+json" \
  /orgs/ORG/secret-scanning/alerts --paginate

This returns alerts for default patterns only. To also include generic patterns in your results, pass the specific token names using the secret_type parameter.

For more information, see REST API endpoints for secret scanning.

Build your comparison

  1. Using the filtered data, create a comparison table with these key metrics:

    Metric SRA report (Baseline) Current security overview (Filtered) Change
    Total exposed secrets [SRA number] [Current number] [Difference]
    Critical alerts [SRA number] [Current number] [Difference]
    Affected repositories [SRA number] [Current number] [Difference]
  2. Calculate the percentage change for each metric:

  3. Note any significant differences in:

Even without an SRA report, you can assess GHSP effectiveness by analyzing trends in the security overview.

  1. On GitHub, navigate to the main page of the organization.

  2. Under your organization name, click the Security and quality tab.

  3. In the security overview Risk tab, look at the trend graph showing secret scanning alerts over time.

  4. Identify patterns:

  5. Click on individual repositories to drill down into specific alert details.

  6. Review the alert resolution rate:

Step 5: Interpret the results and take action

Based on your analysis, determine the next steps.

If you're seeing areas for improvement

Ongoing monitoring