Skip to content

Instantly share code, notes, and snippets.

@felickz
Last active April 30, 2024 18:12
Show Gist options
  • Save felickz/9688dd0f5182cab22386efecfa41eb74 to your computer and use it in GitHub Desktop.
Save felickz/9688dd0f5182cab22386efecfa41eb74 to your computer and use it in GitHub Desktop.
Count the secret scanning patterns from GHAS
# Install the PowerShell-yaml module if not already installed
if (-not (Get-Module -Name PowerShell-yaml -ListAvailable)) {
Install-Module -Name PowerShell-yaml -Scope CurrentUser
}
# Read the YAML file from https://github.com/github/docs/blob/main/data/secret-scanning.yml
$url = 'https://raw.githubusercontent.com/github/docs/main/data/secret-scanning.yml'
$data = Invoke-RestMethod -Uri $url | ConvertFrom-Yaml
$inventory = @()
foreach ($node in $data) {
$inventory += New-Object PSObject -Property @{
'Provider' = $node.provider
'SecretType' = $node.secretType
'HasPushProtection' = $node.hasPushProtection
#'OrigHasValidityCheck' = $node.hasValidityCheck
'HasValidityCheck' = $node.hasValidityCheck.ToString() -ne 'False'
}
}
#$inventory | Format-Table -AutoSize
$Providers = $inventory | Select-Object -Property Provider -Unique
$Push = $inventory | Where-Object { $_.HasPushProtection -eq $true } | Measure-Object | Select-Object -Property Count
$Validity = $inventory | Where-Object { $_.HasValidityCheck -eq $true } | Measure-Object | Select-Object -Property Count
Write-Host "Secret Scanning Inventory $($(Get-Date -AsUTC).ToString('u'))"
Write-Host "Number of Secret Types: $($inventory.Count)"
Write-Host "Number of Unique Providers: $($Providers.Count)"
Write-Host "Number of Secret Types with Push Protection: $($Push.Count)"
Write-Host "Number of Secret Types with Validity Check: $($Validity.Count)"
Write-Host "See: [Inventory Commit History](https://github.com/github/docs/commits/main/data/secret-scanning.yml) and [Secret Scanning Changelog](https://github.blog/changelog/label/secret-scanning)"
@felickz
Copy link
Author

felickz commented Nov 5, 2023

Secret Scanning Inventory 11/05/2023 03:06:39
Number of Secret Types: 239
Number of Unique Providers: 112
Number of Secret Types with Push Protection: 148
Number of Secret Types with Validity Check: 16
See: Inventory Commit History

@felickz
Copy link
Author

felickz commented Dec 15, 2023

Secret Scanning Inventory 12/15/2023 17:11:44
Number of Secret Types: 239
Number of Unique Providers: 112
Number of Secret Types with Push Protection: 148
Number of Secret Types with Validity Check: 18
See: Inventory Commit History

@felickz
Copy link
Author

felickz commented Jan 11, 2024

Secret Scanning Inventory 01/11/2024 16:27:29
Number of Secret Types: 241
Number of Unique Providers: 114
Number of Secret Types with Push Protection: 150
Number of Secret Types with Validity Check: 20
See: Inventory Commit History

@felickz
Copy link
Author

felickz commented Jan 26, 2024

Secret Scanning Inventory 2024-01-26 16:56:35Z
Number of Secret Types: 241
Number of Unique Providers: 114
Number of Secret Types with Push Protection: 150
Number of Secret Types with Validity Check: 21
See: Inventory Commit History and Secret Scanning Changelog

@felickz
Copy link
Author

felickz commented Feb 6, 2024

Secret Scanning Inventory 2024-02-06 22:47:39Z
Number of Secret Types: 243
Number of Unique Providers: 116
Number of Secret Types with Push Protection: 152
Number of Secret Types with Validity Check: 22
See: Inventory Commit History and Secret Scanning Changelog

Secret scanning adds validity checks for Stripe, Telegram, SendGrid, and more

@felickz
Copy link
Author

felickz commented Feb 16, 2024

Secret Scanning Inventory 2024-02-16 16:17:35Z
Number of Secret Types: 243
Number of Unique Providers: 116
Number of Secret Types with Push Protection: 152
Number of Secret Types with Validity Check: 24
See: Inventory Commit History and Secret Scanning Changelog

@felickz
Copy link
Author

felickz commented Apr 5, 2024

Secret Scanning Inventory 2024-04-05 20:58:52Z
Number of Secret Types: 249
Number of Unique Providers: 121
Number of Secret Types with Push Protection: 157
Number of Secret Types with Validity Check: 24
Non-Partner Patterns: 8
See: Inventory Commit History and Secret Scanning Changelog

@felickz
Copy link
Author

felickz commented Apr 30, 2024

Secret Scanning Inventory 2024-04-30 18:12:15Z
Number of Secret Types: 250
Number of Unique Providers: 121
Number of Secret Types with Push Protection: 158
Number of Secret Types with Validity Check: 26
Non-Partner Patterns: 8
See: Inventory Commit History and Secret Scanning Changelog
PS C:

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