Measure how GitHub Secret Protection reduces secret exposure across your organization, so you can demonstrate value and identify areas to strengthen your security posture.
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.
The security overview provides real-time data about secret scanning alerts across your organization.
If you previously ran a SRA report, you can access the report to establish a baseline.
The SRA report represents a point-in-time snapshot of your secret exposure before or during your GHSP implementation.
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.
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.
In the security overview Risk tab, use the filter bar to narrow results to provider and generic patterns only, excluding any custom patterns.
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.
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] |
Calculate the percentage change for each metric:
Note any significant differences in:
Even without an SRA report, you can assess GHSP effectiveness by analyzing trends in the security overview.
On GitHub, navigate to the main page of the organization.
Under your organization name, click the Security and quality tab.
In the security overview Risk tab, look at the trend graph showing secret scanning alerts over time.
Identify patterns:
Click on individual repositories to drill down into specific alert details.
Review the alert resolution rate:
Based on your analysis, determine the next steps.