Skip to main content

Responsible detection of generic secrets with Copilot secret scanning

Learn how Copilot シークレット スキャン uses AI responsibly to scan and create alerts for unstructured secrets, such as passwords.

この機能を使用できるユーザーについて

Copilot シークレット スキャン は、次のリポジトリの種類で使用できます。

  • GitHub Secret Protection が有効になっている GitHub Team または GitHub Enterprise Cloud 上の organization 所有リポジトリ

About ジェネリックシークレットの検出 with Copilot シークレット スキャン

Copilot シークレット スキャン's ジェネリックシークレットの検出 is an AI-powered expansion of secret scanning that identifies unstructured secrets (passwords) in your source code and then generates an alert.

メモ

Copilot シークレット スキャン の ジェネリックシークレットの検出 を使用するには、GitHub Copilot のサブスクリプションは必要ありません。 Copilot シークレット スキャン 機能は、GitHub Secret Protection のライセンスを持つ organization と Enterprise が所有するリポジトリで使用できます。

GitHub Secret Protection users can already receive シークレット スキャンニング アラート for partner or custom patterns found in their source code, but unstructured secrets are not easily discoverable. Copilot シークレット スキャン uses large language models (LLMs) to identify this type of secret.

When a password is detected, an alert is displayed in the "Generic" list of secret scanning alerts (under the Security tab of the repository, organization, or enterprise), so that maintainers and security managers can review the alert and, where necessary, remove the credential or implement a fix.

GitHub Enterprise Cloud を使うユーザーの場合、Enterprise 所有者は、まず organization 内のリポジトリに対して ジェネリックシークレットの検出 を有効または無効にできるかどうかを制御するポリシーを Enterprise レベルで設定する必要があります。 既定では、このポリシーは "許可" に設定されています。 The feature must then be enabled for repositories and organizations.

Input processing

Input is limited to text (typically code) that a user has checked into a repository. The system provides this text to the LLM along with a meta prompt asking the LLM to find passwords within the scope of the input. The user does not interact with the LLM directly.

The system scans for passwords using the LLM. No additional data is collected by the system, other than what is already collected by the existing secret scanning feature.

Output and display

The LLM scans for strings that resemble passwords and verifies that the identified strings included in the response actually exist in the input.

These detected strings are surfaced as alerts on the secret scanning alerts page, but they are displayed in an additional list that is separate from regular シークレット スキャンニング アラート. The intent is that this separate list is triaged with more scrutiny to verify the validity of the findings. Each alert notes that it was detected using AI. For information on how to view alerts for generic secrets, see シークレット スキャンからのアラートの表示とフィルター処理.

Improving the performance of ジェネリックシークレットの検出

To improve the performance of ジェネリックシークレットの検出, we recommend closing false positive alerts appropriately.

Verify the accuracy of alerts and close as appropriate

Since Copilot シークレット スキャン's ジェネリックシークレットの検出 may generate more false positives than the existing secret scanning feature for partner patterns, it's important that you review the accuracy of these alerts. When you verify an alert to be a false positive, be sure to close the alert and mark the reason as "False positive" in the GitHub UI. The GitHub development team will use information on false positive volume and detection locations to improve the model. GitHub does not have access to the secret literals themselves.

Limitations of ジェネリックシークレットの検出

When using Copilot シークレット スキャン's ジェネリックシークレットの検出, you should consider the following limitations.

Limited scope

ジェネリックシークレットの検出 currently only looks for instances of passwords in git content. The feature does not look for other types of generic secrets, and it does not look for secrets in non-git content, such as GitHub Issues.

Potential for false positive alerts

ジェネリックシークレットの検出 may generate more false positive alerts when compared to the existing secret scanning feature (which detects partner patterns, and which has a very low false positive rate). To mitigate this excess noise, alerts are grouped in a separate list from partner pattern alerts, and security managers and maintainers should triage each alert to verify its accuracy.

Potential for incomplete reporting

ジェネリックシークレットの検出 may miss instances of credentials checked into a repository. The LLM will improve over time. You retain ultimate responsibility for ensuring the security of your code.

Limitations by design

ジェネリックシークレットの検出 has the following limitations by design:

  • Copilot シークレット スキャン will not detect secrets that are obviously fake or test passwords, or passwords with low entropy.
  • Copilot シークレット スキャン will only detect a maximum of 100 passwords per push.
  • If five or more detected secrets within a single file are marked as false positive, Copilot シークレット スキャン will stop generating new alerts for that file.
  • Copilot シークレット スキャン does not detect secrets in generated or vendored files.
  • Copilot シークレット スキャン does not detect secrets in encrypted files.
  • Copilot シークレット スキャン does not detect secrets in file types: SVG, PNG, JPEG, CSV, TXT, SQL, or ITEM.
  • Copilot シークレット スキャン does not detect secrets in test code. Copilot シークレット スキャン skips detections when both conditions are met:
    • The file path contains "test", "mock", or "spec", AND
    • The file extension is .cs, .go, .java, .js, .kt, .php, .py, .rb, .scala, .swift, or .ts.

Evaluation of ジェネリックシークレットの検出

ジェネリックシークレットの検出 has been subject to Responsible AI Red Teaming and GitHub will continue to monitor the efficacy and safety of the feature over time.

Next steps

Further reading