プロジェクトを外部サービスと通信させる場合、認証にトークンまたは秘密鍵を使用できます。 トークンや秘密鍵は、サービスプロバイダが発行できるシークレットです。 リポジトリにシークレットをチェックインする場合、リポジトリへの読み取りアクセスを持つすべてのユーザがシークレットを使用して、自分の権限で外部サービスにアクセスできます。 シークレットは、プロジェクトのリポジトリの外の、安全な専用の場所に保存することをお勧めします。
Secret scanningは、GitHubリポジトリ内に存在するすべてのブランチのGit履歴全体をスキャンしてシークレットを探します。 サービスプロバイダはGitHub と提携してスキャンするシークレットのフォーマットを提供できます。詳しい情報については、「Secret scanningのパートナープログラム」を参照してください。
GitHub上のパブリックもしくはプライベートリポジトリに既知のパターンを持つシークレットを誰かがチェックインすると、secret scanningはチェックインの時点でそのシークレットを捕捉し、漏洩のインパクトを緩和する手助けをします。 リポジトリ管理者は、シークレットを含むコミットについて通知され、リポジトリのセキュリティタブですべての検出されたシークレットを素早く見ることができます。
パブリックリポジトリの secret scanning について
パブリックリポジトリでは、Secret scanningは自動的に有効になります。 パブリックリポジトリにプッシュすると、GitHub がコミットの内容をスキャンしてシークレットを探します。 プライベートリポジトリをパブリックに切り替えると、GitHub はリポジトリ全体をスキャンしてシークレットを探します。
secret scanning が認証情報一式を検出すると、弊社はそのシークレットを発行したサービスプロバイダに通知します。 サービスプロバイダは認証情報を検証し、シークレットを取り消すか、新しいシークレットを発行するか、または直接連絡する必要があるかを決定します。これは、ユーザまたはサービスプロバイダに関連するリスクに依存します。 トークン発行パートナーと弊社との連携の概要については、「Secret scanningのパートナープログラム」を参照してください。
現在 GitHub は、パブリックリポジトリをスキャンして、次のサービスプロバイダが発行したシークレットを探します。
| パートナー | サポートされているシークレット |
|---|---|
| Adafruit IO | Adafruit IO Key |
| Adobe | Adobe Device Token |
| Adobe | Adobe Service Token |
| Adobe | Adobe Short-Lived Access Token |
| Adobe | Adobe JSON Web Token |
| Alibaba Cloud | Alibaba Cloud Access Key ID及びAccess Key Secret pair |
| Amazon Web Services (AWS) | Amazon AWS Access Key ID及びSecret Access Key pair |
| Atlassian | Atlassian API Token |
| Atlassian | Atlassian JSON Web Token |
| Azure | Azure Active Directory Application Secret |
| Azure | Azure DevOps Personal Access Token |
| Azure | Azure SAS Token |
| Azure | Azure Service Management Certificate |
| Azure | Azure SQL Connection String |
| Azure | Azure Storage Account Key |
| Checkout.com | Checkout.com Production Secret Key |
| Checkout.com | Checkout.com Test Secret Key |
| Clojars | Clojars Deploy Token |
| CloudBees CodeShip | CloudBees CodeShip Credential |
| Contributed Systems | Contributed Systems Credentials |
| Databricks | Databricks Access Token |
| Datadog | Datadog API Key |
| Discord | Discord Bot Token |
| Doppler | Doppler Personal Token |
| Doppler | Doppler Service Token |
| Doppler | Doppler CLI Token |
| Doppler | Doppler SCIM Token |
| Doppler | Doppler Audit Token |
| Dropbox | Dropbox Access Token |
| Dropbox | Dropbox Short Lived Access Token |
| Dynatrace | Dynatrace Access Token |
| Dynatrace | Dynatrace Internal Token |
| Finicity | Finicity App Key |
| Frame.io | Frame.io JSON Web Token |
| Frame.io | Frame.io Developer Token |
| FullStory | FullStory API Key |
| GitHub | GitHub Personal Access Token |
| GitHub | GitHub OAuthアクセストークン |
| GitHub | GitHub Refreshトークン |
| GitHub | GitHub App Installation Access Token |
| GitHub | GitHub SSH Private Key |
| GoCardless | GoCardless Live Access Token |
| GoCardless | GoCardless Sandbox Access Token |
| Google Cloud | Google API Key |
| Google Cloud | Google Cloud Private Key ID |
| Hashicorp Terraform | Terraform Cloud / Enterprise API Token |
| Hubspot | Hubspot API Key |
| Ionic | Ionic Personal Access Token |
| Ionic | Ionic Refresh Token |
| Linear | Linear API Key |
| Linear | Linear OAuth Access Token |
| Mailchimp | Mailchimp API Key |
| Mailchimp | Mandrill API Key |
| Mailgun | Mailgun API Key |
| MessageBird | MessageBird API Key |
| npm | npm Access Token |
| NuGet | NuGet API Key |
| OpenAI | OpenAI API Key |
| Palantir | Palantir JSON Web Token |
| PlanetScale | PlanetScale Database Password |
| PlanetScale | PlanetScale OAuth Token |
| PlanetScale | PlanetScale Service Token |
| Plivo | Plivo Auth ID and Token |
| Postman | Postman API Key |
| Proctorio | Proctorio Consumer Key |
| Proctorio | Proctorio Linkage Key |
| Proctorio | Proctorio Registration Key |
| Proctorio | Proctorio Secret Key |
| Pulumi | Pulumi Access Token |
| PyPI | PyPI API Token |
| RubyGems | RubyGems API Key |
| Samsara | Samsara API Token |
| Samsara | Samsara OAuth Access Token |
| SendGrid | SendGrid API Key |
| Shopify | Shopify App Shared Secret |
| Shopify | Shopify Access Token |
| Shopify | Shopify Custom App Access Token |
| Shopify | Shopify Private App Password |
| Slack | Slack API Token |
| Slack | Slack Incoming Webhook URL |
| Slack | Slack Workflow Webhook URL |
| SSLMate | SSLMate API Key |
| SSLMate | SSLMate Cluster Secret |
| Stripe | Stripe Live API Secret Key |
| Stripe | Stripe Test API Secret Key |
| Stripe | Stripe Live API Restricted Key |
| Stripe | Stripe Test API Restricted Key |
| Tencent Cloud | Tencent Cloud Secret ID |
| Twilio | Twilio Account String Identifier |
| Twilio | Twilio API Key |
| Valour | Valour Access Token |
プライベートリポジトリの secret scanning について
リポジトリの管理者または Organization のオーナーは、Organization が所有するプライベートなリポジトリで secret scanning を有効化できます。 You can enable secret scanning for all your repositories, or for all new repositories within your organization. Secret scanning is not available for user-owned private repositories. For more information, see "Managing security and analysis settings for your repository" and "Managing security and analysis settings for your organization."
You can also define custom secret scanning patterns that only apply to your repository or organization. 詳しい情報については「secret scanningのカスタムパターンの定義」を参照してください。
When you push commits to a private repository with secret scanning enabled, GitHub scans the contents of the commits for secrets.
When secret scanning detects a secret in a private repository, GitHub generates an alert.
-
GitHub は、リポジトリ管理者と Organizationのオーナーにメールアラートを送信します。
-
GitHub は、シークレットをリポジトリにコミットしたコントリビューターに、関連する secret scanning アラートのリンクを記載したメールアラートを送信します。 コミット作者は、リポジトリでこのアラートを表示して、アラートを解決できます。
-
GitHub は、リポジトリのアラートを表示します。
secret scanningアラートの表示と解決に関する詳しい情報については「secret scanningからのアラートの管理」を参照してください。
リポジトリ管理者と Organization のオーナーは、ユーザおよび Team に secret scanning アラートへのアクセスを許可できます。 詳しい情報については「リポジトリのセキュリティ及び分析の設定の管理」を参照してください。
プライベートリポジトリあるいはOrganizationに渡るsecret scanningからの結果をモニターするには、secret scanning APIが利用できます。 API に関する詳しい情報については、「Secret scanning」を参照してください。
GitHub currently scans private repositories for secrets issued by the following service providers.
| Provider | サポートされているシークレット | APIスラッグ |
|---|---|---|
| Adafruit IO | Adafruit IO Key | adafruit_io_key |
| Adobe | Adobe Device Token | adobe_device_token |
| Adobe | Adobe Service Token | adobe_service_token |
| Adobe | Adobe Short-Lived Access Token | adobe_short_lived_access_token |
| Adobe | Adobe JSON Web Token | adobe_jwt Alibaba Cloud |
| Amazon Web Services (AWS) | Amazon AWS Session Token | aws_session_token |
| Amazon Web Services (AWS) | Amazon AWS Temporary Access Key ID | aws_temporary_access_key_id |
| Asana | Asana Personal Access Token | asana_personal_access_token Atlassian |
| Atlassian | Bitbucket Server Personal Access Token | bitbucket_server_personal_access_token Azure |
| Beamer | Beamer API Key | beamer_api_key |
| Checkout.com | Checkout.com Production Secret Key | checkout_production_secret_key |
| Checkout.com | Checkout.com Test Secret Key | checkout_test_secret_key Clojars |
| CloudBees CodeShip | CloudBees CodeShip Credential | codeship_credential |
| Contentful | Contentful Personal Access Token | contentful_personal_access_token Databricks |
| Doppler | Doppler Personal Token | doppler_personal_token |
| Doppler | Doppler Service Token | doppler_service_token |
| Doppler | Doppler CLI Token | doppler_cli_token |
| Doppler | Doppler SCIM Token | doppler_scim_token |
| Doppler | Doppler Audit Token | doppler_audit_token Dropbox |
| Duffel | Duffel Live Access Token | duffel_live_access_token |
| Duffel | Duffel Test Access Token | duffel_test_access_token |
| Dynatrace | Dynatrace Access Token | dynatrace_access_token Dynatrace |
| EasyPost | EasyPost Production API Key | easypost_production_api_key |
| EasyPost | EasyPost Test API Key | easypost_test_api_key |
| Facebook Access Token | facebook_access_token | |
| Fastly | Fastly API Token | fastly_api_token Finicity |
| Flutterwave | Flutterwave Live API Secret Key | flutterwave_live_api_secret_key |
| Flutterwave | Flutterwave Test API Secret Key | flutterwave_test_api_secret_key Frame.io |
| FullStory | FullStory API Key | fullstory_api_key |
| GitHub | GitHub個人アクセストークン | github_personal_access_token |
| GitHub | GitHub OAuthアクセストークン | github_oauth_access_token |
| GitHub | GitHubリフレッシュトークン | github_refresh_token |
| GitHub | GitHub App Installation Access Token | github_app_installation_access_token GitHub |
| Firebase Cloud Messaging Server Key | firebase_cloud_messaging_server_key Google | |
| Google Cloud Storage Access Key Secret | google_cloud_storage_access_key_secret | |
| Google Cloud Storage Service Account Access Key ID | google_cloud_storage_service_account_access_key_id | |
| Google Cloud Storage User Access Key ID | google_cloud_storage_user_access_key_id | |
| Google OAuth Client ID | google_oauth_client_id | |
| Google OAuth Client Secret | google_oauth_client_secret | |
| Grafana | Grafana API Key | grafana_api_key Hashicorp Terraform |
| Intercom | Intercom Access Token | intercom_access_token |
| Ionic | Ionic Personal Access Token | ionic_personal_access_token |
| Ionic | Ionic Refresh Token | ionic_refresh_token |
| JFrog | JFrog Platform Access Token | jfrog_platform_access_token |
| JFrog | JFrog Platform API Key | jfrog_platform_api_key |
| Linear | Linear API Key | linear_api_key |
| Linear | Linear OAuth Access Token | linear_oauth_access_token |
| Lob | Lob Live API Key | lob_live_api_key |
| Lob | Lob Test API Key | lob_test_api_key Mailchimp |
| MessageBird | MessageBird API Key | messagebird_api_key |
| New Relic | New Relic Personal API Key | new_relic_personal_api_key |
| New Relic | New Relic REST API Key | new_relic_rest_api_key |
| New Relic | New Relic Insights Query Key | new_relic_insights_query_key |
| New Relic | New Relic License Key | new_relic_license_key npm |
| Onfido | Onfido Live API Token | onfido_live_api_token |
| Onfido | Onfido Sandbox API Token | onfido_sandbox_api_token |
| OpenAI | OpenAI API Key | openai_api_key Palantir |
| PlanetScale | PlanetScale Database Password | planetscale_database_password |
| PlanetScale | PlanetScale OAuth Token | planetscale_oauth_token |
| PlanetScale | PlanetScale Service Token | planetscale_service_token |
| Plivo | Plivo Auth ID | plivo_auth_id |
| Plivo | Plivo Auth Token | plivo_auth_token Postman |
| PyPI | PyPI API Token | pypi_api_token |
| RubyGems | RubyGems API Key | rubygems_api_key Samsara |
| SendGrid | SendGrid API Key | sendgrid_api_key |
| Sendinblue | Sendinblue API Key | sendinblue_api_key |
| Sendinblue | Sendinblue SMTP Key | sendinblue_smtp_key |
| Shippo | Shippo Live API Token | shippo_live_api_token |
| Shippo | Shippo Test API Token | shippo_test_api_token Shopify |
| Stripe | Stripe Live API Secret Key | stripe_live_secret_key |
| Stripe | Stripe Test API Secret Key | stripe_test_secret_key |
| Stripe | Stripe Live API Restricted Key | stripe_live_restricted_key |
| Stripe | Stripe Test API Restricted Key | stripe_test_restricted_key |
| Stripe | Stripe Webhook Signing Secret | stripe_webhook_signing_secret |
| Tableau | Tableau Personal Access Token | tableau_personal_access_token |
| Telegram | Telegram Bot Token | telegram_bot_token Tencent Cloud |
| Twilio | Twilio Access Token | twilio_access_token Twilio |