Skip to main content

支持的密钥列表以及 GitHub 合作的合作伙伴,用于防止意外提交的密钥被恶意使用。

谁可以使用此功能?

Secret scanning 可用于以下存储库类型:

  • 公共存储库:Secret scanning 自动且免费地运行。
  •           **组织拥有的私有和内部存储库**:在 GitHub Secret Protection 或 GitHub Team 上启用 [GitHub Enterprise Cloud](/get-started/learning-about-github/about-github-advanced-security) 后可用。
    
  • 用户拥有的存储库:在 GitHub Enterprise Cloud 上可用,配合 Enterprise Managed Users。 当企业启用了 GitHub Enterprise Server 时,可在 GitHub Secret Protection 上使用。

关于 secret scanning 模式

有三种类型的机密扫描警报:

  • 用户警报: 在存储库中 Security and quality 检测到支持的机密时,在存储库选项卡中向用户报告。
  • 推送保护警报: 当贡献者绕过推送保护时,会在存储库的** Security and quality** 选项卡中向用户报告。
  • 合作伙伴警报: 直接向属于secret scanning合作伙伴计划的保密供应商报告。 这些警报不会在存储库的** Security and quality** 选项卡中报告。

有关每种警报类型的深入信息,请参阅 关于机密扫描警报

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

模式类别

类别Description检测方法示例
常规未绑定到特定提供程序的机密,例如私钥和数据库连接字符串基于正则表达式rsa_private_key
AI检测到的
Copilot 机密扫描 使用 AI 模型检测到的通用型密码基于人工智能password
供应商绑定到特定服务提供商的机密(如 AWS、Azure、Stripe)基于正则表达式aws_access_key_id

按类别划分的功能

能力泛型模式AI检测到提供者设计模式
用户警报
合作伙伴通知
(如果合作伙伴)
推送保护(默认值)
(最多)
推送保护(可配置)Some
有效性检查Some
扩展元数据Some
Base64 格式支持Some

注意

有效性和扩展元数据检查仅适用于拥有 GitHub Team 或 GitHub Enterprise,并在 GitHub Secret Protection 中启用该功能的用户。

支持的泛型模式

根据模式类型的典型误报率估计精度级别。

Provider标记Description精准率
常规ec_private_key用于加密操作的椭圆曲线(EC)私钥High
常规通用私钥带标头的 -----BEGIN PRIVATE KEY----- 加密私钥High
常规http_basic_authentication_header请求标头中的 HTTP 基本身份验证凭据中等
常规http_bearer_authentication_header用于 API 身份验证的 HTTP 持有者令牌中等
常规mongodb_connection_string包含凭据的 MongoDB 数据库的连接字符串High
常规mysql_connection_url包含凭据的 MySQL 数据库的连接字符串High
常规openssh_private_key用于 SSH 身份验证的 OpenSSH 格式私钥High
常规pgp_private_key用于加密和签名的 PGP (相当良好的隐私) 私钥High
常规postgres_connection_string包含凭据的 PostgreSQL 数据库的连接字符串High
常规rsa_private_key用于加密作的 RSA 私钥High

注意

有效性检查对泛型/非提供程序模式不支持

支持的 AI 检测模式

Secret scanning 用于 Copilot 检测泛型密码。 请参阅“使用 Copilot 机密扫描负责任地检测通用机密”。

Provider标记
常规密码

注意

密码不支持推送保护和有效性检查。

支持的提供程序模式

使用下表搜索、筛选和浏览所有受支持的模式。 可以按提供程序名称、推送保护支持、有效性检查等进行筛选。

注意

服务提供商会更新用于定期生成令牌的模式,并且可能支持多个版本的令牌。 推送保护仅支持 secret scanning 能确信识别的最新令牌版本。 这样可以避免在结果可能是误报时,不必要地阻止提交推送保护,这种情况在使用旧令牌时更有可能发生。

显示 514 个模式共计 514 个模式

支持的模式

机密合作伙伴用户警报推送保护有效性检查元数据检查Base64
1Password
1Password Service Account Token

1password_service_account_token

Adafruit
Adafruit IO Key

adafruit_io_key

Adobe
Adobe Client Secret

adobe_client_secret

Adobe
Adobe Device Token

adobe_device_token

Adobe
Adobe PAC Token

adobe_pac_token

Adobe
Adobe Refresh Token

adobe_refresh_token

Adobe
Adobe Service Token

adobe_service_token

Adobe
Adobe Short-Lived Access Token

adobe_short_lived_access_token

Aikido
Aikido API Client Secret

aikido_api_client_secret

Aikido
Aikido CI Scanning Token

aikido_ci_scanning_token

Airtable
Airtable API Key

airtable_api_key

Airtable
Airtable Personal Access Token

airtable_personal_access_token

Aiven
Aiven Auth Token

aiven_auth_token

Aiven
Aiven Service Password

aiven_service_password

Alibaba
Alibaba Cloud AccessKey ID

alibaba_cloud_access_key_id, alibaba_cloud_access_key_secret

Amazon AWS
Amazon AWS Access Key ID

aws_access_key_id, aws_secret_access_key, 令牌版本

Amazon AWS
Amazon AWS API Key ID

aws_api_key

Amazon AWS
Amazon AWS Session Token

aws_secret_access_key, aws_session_token, aws_temporary_access_key_id

Anthropic
Anthropic Admin API Key

anthropic_admin_api_key

Anthropic
Anthropic API Key

anthropic_api_key, 令牌版本

Anthropic
Anthropic Session ID

anthropic_session_id

Apify
Apify Actor Run API Token

apify_actor_run_api_token

Apify
Apify Actor Run Proxy Password

apify_actor_run_proxy_password

Apify
Apify API Token

apify_api_token

Apify
Apify Integration API Token

apify_integration_api_token