Skip to main content

机密扫描模式

支持的机密列表和 GitHub 与之合作的合作伙伴,以防止欺诈性使用意外提交的机密。

谁可以使用此功能?

合作伙伴的机密扫描警报 在 GitHub.com 上的公共存储库和公共 npm 包中自动运行,以向服务提供商通知泄漏的机密情况。

用户拥有的公共存储库可免费使用用户的机密扫描警报。 使用 GitHub Enterprise Cloud 且拥有 GitHub Advanced Security 许可证的组织也可以在其专用存储库和内部存储库上启用 用户的机密扫描警报。 此外,用户的机密扫描警报可(在用户自有的存储库中为 beta 版本)用于具有 Enterprise Managed Users的 GitHub Enterprise Cloud。 有关详细信息,请参阅 “关于机密扫描”和“关于 GitHub 高级安全性”。

有关如何免费试用 GitHub Advanced Security 的信息,请参阅“安装 GitHub Advanced Security 试用版”。

关于 secret scanning 模式

GitHub Enterprise Cloud 维护这些不同的默认 secret scanning 模式:

  1. 合作伙伴模式。 用于检测所有公共存储库和公共 npm 包中的潜在机密。要了解我们的合作伙伴计划,请参阅“密码扫描合作伙伴计划”。

  2. 用户警报模式。 用于检测启用了 用户的机密扫描警报 的存储库中的潜在机密。

  3. 推送保护模式。 用于检测启用了作为推送保护的 secret scanning 的存储库中的潜在机密。

有关所有受支持的模式的详细信息,请参阅下面的“支持的机密”部分。

如果你认为 secret scanning 应检测到提交到存储库的机密,但却尚未检测到,则首先需要检查 GitHub 是否支持你的机密。 有关详细信息,请参阅以下部分。 有关高级故障排除的详细信息,请参阅“排查机密扫描问题”。

关于合作伙伴警报

合作伙伴警报是在机密提供商的机密之一被报告发生泄漏时发送给机密提供商的警报。 GitHub Enterprise Cloud 当前扫描公共存储库和公共 npm 包,以查找由特定服务提供商颁发的机密,并在提交中检测到机密时向相关服务提供商发出警报。 有关 合作伙伴的机密扫描警报 的详细信息,请参阅“关于机密扫描”。

如果访问资源需要配对的凭据,则只有在同一文件中检测到该配对的两个凭据时,机密扫描才会创建警报。 这可确保最关键的泄漏不会隐藏在有关部分泄漏的信息后面。 对匹配还有助于减少误报,因为对的两个元素必须一起使用才能访问提供商的资源。

关于用户 警报

用户警报是针对 GitHub 向用户报告的警报。 当 用户的机密扫描警报 启用时,GitHub 会扫描存储库中多种服务提供商发布的机密,并生成 机密扫描警报。

User 警报可以是以下类型:

  • 高置信度警报,与支持的模式和指定的自定义模式相关。
  • 非提供商警报,其误报率较高,对应于私钥等机密。

GitHub 会将不同列表中的非提供商警报显示为高置信度警报,从而为用户提供更好的会审体验。 有关详细信息,请参阅“管理来自机密扫描的警报”。

注意: 非提供商模式检测目前处于 beta 版本阶段,可能会发生变化。

可以在存储库的“安全性”选项卡上看到这些警报。 有关 用户的机密扫描警报 的详细信息,请参阅“关于机密扫描”。

如果访问资源需要配对的凭据,则只有在同一文件中检测到该配对的两个凭据时,机密扫描才会创建警报。 这可确保最关键的泄漏不会隐藏在有关部分泄漏的信息后面。 对匹配还有助于减少误报,因为对的两个元素必须一起使用才能访问提供商的资源。

如果使用 REST API 进行机密扫描,可以使用 Secret type 报告来自特定颁发者的机密。 有关详细信息,请参阅“适用于机密扫描的 REST API 终结点”。

注意: 还可以为存储库、组织或企业定义自定义 secret scanning 模式。 有关详细信息,请参阅“为机密扫描定义自定义模式”。

关于推送保护警报

推送保护警报是推送保护报告的用户警报。 Secret scanning 作为推送保护,当前扫描存储库,查找部分服务提供商发布的机密。

对于仅通过基于用户的推送保护绕过的机密,不会创建推送保护警报。 有关详细信息,请参阅“用户的推送保护”。

如果访问资源需要配对的凭据,则只有在同一文件中检测到该配对的两个凭据时,机密扫描才会创建警报。 这可确保最关键的泄漏不会隐藏在有关部分泄漏的信息后面。 对匹配还有助于减少误报,因为对的两个元素必须一起使用才能访问提供商的资源。

推送保护可能不支持某些旧版令牌,因为这些令牌生成的误报数可能高于其最新版本。 推送保护也可能不适用于旧令牌。 对于 Azure 存储密钥等令牌,GitHub 仅支持“最近创建”令牌,不支持与旧模式匹配的令牌。 有关推送保护限制的详细信息,请参阅“排查机密扫描问题”。

支持的机密

下表列出了 secret scanning 支持的机密。 可以查看为每个令牌生成的警报类型,以及是否对令牌执行验证检查。

  • 提供商 - 令牌提供商的名称。

  • 合作伙伴 - 将泄漏报告给相关令牌合作伙伴的令牌。 仅适用于公共存储库。

  • 用户 - 向 GitHub 上的用户报告泄漏的令牌。

    • 适用于公共存储库,以及 GitHub Advanced Security、secret scanning 的专用存储库。
    • 包括与支持的模式和指定的自定义模式相关的高置信度令牌,以及非提供商令牌(例如私钥),这些令牌通常具有较高的误报率。
    • 要使 secret scanning 扫描非提供商模式,必须为存储库或组织启用非提供商模式检测。 有关详细信息,请参阅“为存储库配置机密扫描”。

    注意: 非提供商模式检测目前处于 beta 版本阶段,可能会发生变化。

  • 推送保护 - 向 GitHub 上的用户报告泄漏的令牌。 适用于启用了 secret scanning 和推送保护的存储库。

    **注意:**推送保护可能不支持某些旧版令牌,因为这些令牌生成的误报数可能高于其最新版本。 推送保护也可能不适用于旧令牌。 对于 Azure 存储密钥等令牌,GitHub 仅支持“最近创建”令牌,不支持与旧模式匹配的令牌。 有关推送保护限制的详细信息,请参阅“排查机密扫描问题”。

  • 验证检查 - 实现其验证检查的令牌。 对于合作伙伴令牌,GitHub 会将令牌发送给相关合作伙伴。 请注意,并非所有合作伙伴都位于美国。 有关详细信息,请参阅站点策略文档中的“Advanced Security”。

非提供商模式

注意: 非提供商模式检测目前处于 beta 版本阶段,可能会发生变化。

提供程序令牌
常规http_basic_authentication_header
常规http_bearer_authentication_header
常规mongodb_connection_string
常规mysql_connection_string
常规openssh_private_key
常规pgp_private_key
常规postgres_connection_string
常规rsa_private_key

非提供商模式不支持推送保护和验证检查。

高置信度模式

提供程序标记Partner用户推送保护验证检查
Adafruit IOadafruit_io_key
Adobeadobe_client_secret
Adobeadobe_device_token
Adobeadobe_pac_token
Adobeadobe_refresh_token
Adobeadobe_service_token
Adobeadobe_short_lived_access_token
Aivenaiven_auth_token
Aivenaiven_service_password
Alibaba Cloudalibaba_cloud_access_key_id
alibaba_cloud_access_key_secret
Login with Amazonamazon_oauth_client_id
amazon_oauth_client_secret
Amazon Web Services (AWS)aws_access_key_id
aws_secret_access_key
Amazon Web Services (AWS)aws_session_token
aws_temporary_access_key_id
aws_secret_access_key
Anthropicanthropic_api_key
Asanaasana_personal_access_token
Atlassianatlassian_api_token
Atlassianatlassian_jwt
Atlassianbitbucket_server_personal_access_token
Authressauthress_service_client_access_key
Azureazure_active_directory_application_secret
Azureazure_batch_key_identifiable
Azureazure_cache_for_redis_access_key
Azureazure_container_registry_key_identifiable
Azureazure_cosmosdb_key_identifiable
Azureazure_devops_personal_access_token
Azureazure_function_key
Azureazure_ml_web_service_classic_identifiable_key
Azureazure_sas_token
Azureazure_search_admin_key
Azureazure_search_query_key
Azureazure_management_certificate
Azureazure_sql_connection_string
Azureazure_sql_password
Azureazure_storage_account_key
Baidubaiducloud_api_accesskey
Beamerbeamer_api_key
Beijing Volcano Engine Technologyvolcengine_access_key_id
Canadian Digital Servicecds_canada_notify_api_key
Canvacanva_connect_api_secret
CashfreeCashfree API Key
Checkout.comcheckout_production_secret_key
Checkout.comcheckout_test_secret_key
Chief Toolschief_tools_token
CircleCIcircleci-pat
CircleCIcircleci-prj
Clojarsclojars_deploy_token
CloudBees CodeShipcodeship_credential
Contentfulcontentful_personal_access_token
Contributed SystemsCONTRIBUTED_SYSTEMS_CREDENTIALS
crates.io (Rust Foundation)cratesio_api_token
Databricksdatabricks_access_token
DatadogDATADOG_API_KEY
Defineddefined_networking_nebula_api_key
DevCycledevcycle_client_api_key
DevCycledevcycle_mobile_api_key
DevCycledevcycle_server_api_key
DigitalOceandigitalocean_oauth_token
DigitalOceandigitalocean_personal_access_token
DigitalOceandigitalocean_refresh_token
DigitalOceandigitalocean_system_token
Discorddiscord_api_token_v2
Discorddiscord_bot_token
Dockerdocker_personal_access_token
Dopplerdoppler_audit_token
Dopplerdoppler_cli_token
Dopplerdoppler_personal_token
Dopplerdoppler_scim_token
Dopplerdoppler_service_token
Dopplerdoppler_service_account_token
Dropboxdropbox_access_token
Dropboxdropbox_short_lived_access_token
Duffelduffel_live_access_token
Duffelduffel_test_access_token
Dynatracedynatrace_access_token
Dynatracedynatrace_internal_token
EasyPosteasypost_production_api_key
EasyPosteasypost_test_api_key
eBayebay_production_client_id
ebay_production_client_secret
eBayebay_sandbox_client_id
ebay_sandbox_client_secret
Fastlyfastly_api_token
Figmafigma_pat
Finicityfinicity_app_key
Flutterwaveflutterwave_live_api_secret_key
Flutterwaveflutterwave_test_api_secret_key
Frame.ioframeio_developer_token
Frame.ioframeio_jwt
FullStoryfullstory_api_key
GitHubgithub_app_installation_access_token
GitHubgithub_oauth_access_token
GitHubgithub_personal_access_token
GitHubgithub_refresh_token
GitHubgithub_ssh_private_key
GitLabgitlab_access_token
GoCardlessgocardless_live_access_token
GoCardlessgocardless_sandbox_access_token
Googlefirebase_cloud_messaging_server_key
Googlegoogle_cloud_storage_service_account_access_key_id
google_cloud_storage_access_key_secret
Googlegoogle_cloud_storage_user_access_key_id
google_cloud_storage_access_key_secret
Googlegoogle_oauth_access_token
Googlegoogle_oauth_client_id
google_oauth_client_secret
Googlegoogle_oauth_refresh_token
Google Cloudgoogle_api_key
Google Cloudgoogle_cloud_private_key_id
Grafanagrafana_cloud_api_key
Grafanagrafana_cloud_api_token
Grafanagrafana_project_api_key
Grafanagrafana_project_service_account_token
HashiCorphashicorp_vault_batch_token
HashiCorphashicorp_vault_root_service_token
HashiCorphashicorp_vault_service_token
Hashicorp Terraformterraform_api_token
Highnotehighnote_rk_live_key
Highnotehighnote_rk_test_key
Highnotehighnote_sk_live_key
Highnotehighnote_sk_test_key
Hophop_bearer
Hophop_pat
Hophop_ptk
Hubspothubspot_api_key
Hubspothubspot_api_personal_access_key
Intercomintercom_access_token
Ionicionic_personal_access_token
Ionicionic_refresh_token
JD Cloudjd_cloud_access_key
JFrogjfrog_platform_access_token
JFrogjfrog_platform_api_key
JFrogjfrog_platform_reference_token
Lightspeedlightspeed-xs-pat
Linearlinear_api_key
Linearlinear_oauth_access_token
Loblob_live_api_key
Loblob_test_api_key
LocalStacklocalstack_api_key
LogicMonitorlogicmonitor_bearer_token
LogicMonitorlogicmonitor_lmv1_access_key
Mailchimpmailchimp_api_key
MailchimpMANDRILL_API
Mailgunmailgun_api_key
Mapboxmapbox_secret_access_token
Maxmindmaxmind_license_key
Mercurymercury_non_production_api_token
Mercurymercury_production_api_token
Mergifymergify_application_key
MessageBirdmessagebird_api_key
Metafacebook_access_token
Midtransmidtrans_production_server_key
Midtransmidtrans_sandbox_server_key
New Relicnew_relic_insights_query_key
New Relicnew_relic_license_key
New Relicnew_relic_personal_api_key
New Relicnew_relic_rest_api_key
Notionnotion_integration_token
Notionnotion_oauth_client_secret
npmnpm_access_token
NuGetnuget_api_key
Octopus Deployoctopus_deploy_api_key
Oculusoculus_very_tiny_encrypted_session
OneChronosonechronos_api_key
OneChronosonechronos_eb_api_key
OneChronosonechronos_eb_encryption_key
OneChronosonechronos_oauth_token
OneChronosonechronos_refresh_token
Onfidoonfido_live_api_token
Onfidoonfido_sandbox_api_token
OpenAIopenai_api_key
OpenAIopenai_api_key_v2
Palantirpalantir_jwt
Personapersona_production_api_key
Personapersona_sandbox_api_key
Pinterestpinterest_access_token
Pinterestpinterest_refresh_token
PlanetScaleplanetscale_database_password
PlanetScaleplanetscale_oauth_token
PlanetScaleplanetscale_service_token
Plivoplivo_auth_id
plivo_auth_token
Postmanpostman_api_key
Postmanpostman_collection_key
Prefectprefect_server_api_key
Prefectprefect_user_api_key
PrefectPREFECT_USER_API_TOKEN
Proctorioproctorio_consumer_key
Proctorioproctorio_linkage_key
Proctorioproctorio_registration_key
Proctorioproctorio_secret_key
Pulumipulumi_access_token
PyPIpypi_api_token
ReadMereadmeio_api_access_token
redirect.pizzaredirect_pizza_api_token
Rootlyrootly_api_key
RubyGemsrubygems_api_key
Samsarasamsara_api_token
Samsarasamsara_oauth_access_token
Segmentsegment_public_api_token
SendGridsendgrid_api_key
Sendinbluesendinblue_api_key
Sendinbluesendinblue_smtp_key
Shipposhippo_live_api_token
Shipposhippo_test_api_token
Shopifyshopify_access_token
Shopifyshopify_app_client_credentials
Shopifyshopify_app_client_secret
Shopifyshopify_app_shared_secret
Shopifyshopify_custom_app_access_token
Shopifyshopify_marketplace_token
Shopifyshopify_merchant_token
Shopifyshopify_partner_api_token
Shopifyshopify_private_app_password
Siemenscode_siemens_com_token
Slackslack_api_token
Slackslack_incoming_webhook_url
Slackslack_workflow_webhook_url
Squaresquare_access_token
Squaresquare_production_application_secret
Squaresquare_sandbox_application_secret
SSLMatesslmate_api_key
SSLMatesslmate_cluster_secret
Stripestripe_live_restricted_key
Stripestripe_api_key
Stripestripe_legacy_api_key
Stripestripe_test_restricted_key
Stripestripe_test_secret_key
Stripestripe_webhook_signing_secret
Supabasesupabase_service_key
Tableautableau_personal_access_token
Telegramtelegram_bot_token
Telnyxtelnyx_api_v2_key
Tencent Cloudtencent_cloud_secret_id
Tencent WeChattencent_wechat_api_app_id
Twiliotwilio_access_token
Twiliotwilio_account_sid
Twiliotwilio_api_key
Typeformtypeform_personal_access_token
Uniwisewiseflow_api_key
WakaTimewakatime_pp_secret
WakaTimewakatime_oauth_access_token
WakaTimewakatime_oauth_refresh_token
Workatoworkato_developer_api_token
WorkOSworkos_production_api_key
WorkOSworkos_staging_api_key
Yandexyandex_iam_access_secret
Yandexyandex_cloud_api_key
Yandexyandex_cloud_iam_cookie
Yandexyandex_cloud_iam_token
Yandexyandex_cloud_smartcaptcha_server_key
Yandexyandex_dictionary_api_key
YandexYANDEX_PASSPORT_OAUTH_TOKEN
Yandexyandex_predictor_api_key
Yandexyandex_translate_api_key
Zuplozuplo_consumer_api_key

延伸阅读