Skip to content

Commit 2363950

Browse files
am-steadmchammer01courtneycl
authored
Copilot secret scanning - generic secret detection [GA] github#15175 (#52605)
Co-authored-by: mc <[email protected]> Co-authored-by: Courtney Claessens <[email protected]>
1 parent 5fbcec4 commit 2363950

27 files changed

+229
-199
lines changed

content/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-security-and-analysis-for-your-enterprise.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ Across all of your enterprise's organizations, you can allow or disallow people
118118

119119
{% ifversion secret-scanning-ai-generic-secret-detection %}
120120

121-
## Enforcing a policy to manage the use of generic secret detection for {% data variables.product.prodname_secret_scanning %} in your enterprise's repositories
121+
## Enforcing a policy to manage the use of {% data variables.secret-scanning.generic-secret-detection %} for {% data variables.product.prodname_secret_scanning %} in your enterprise's repositories
122122

123-
Across all of your enterprise's organizations, you can allow or disallow people with admin access to repositories to manage and configure generic secret detection for {% data variables.product.prodname_secret_scanning %} for the repositories. {% data reusables.advanced-security.ghas-must-be-enabled %}
123+
Across all of your enterprise's organizations, you can allow or disallow people with admin access to repositories to manage and configure AI detection in {% data variables.product.prodname_secret_scanning %} for the repositories. {% data reusables.advanced-security.ghas-must-be-enabled %}
124124

125125
{% data reusables.enterprise-accounts.access-enterprise %}
126126
{% data reusables.enterprise-accounts.policies-tab %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Enabling Copilot secret scanning's generic secret detection
3+
shortTitle: Enable generic secret detection
4+
intro: 'You can enable {% data variables.secret-scanning.generic-secret-detection %} for your repository or organization. Alerts for generic secrets, such as passwords, are displayed in a separate list on the {% data variables.product.prodname_secret_scanning %} alerts page.'
5+
allowTitleToDifferFromFilename: true
6+
versions:
7+
feature: secret-scanning-ai-generic-secret-detection
8+
product: '{% data reusables.gated-features.secret-scanning %}'
9+
type: how_to
10+
topics:
11+
- Secret scanning
12+
- Advanced Security
13+
- AI
14+
- Copilot
15+
redirect_from:
16+
- /code-security/secret-scanning/enabling-ai-powered-generic-secret-detection
17+
- /code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/enabling-ai-powered-generic-secret-detection
18+
---
19+
20+
## Enabling {% data variables.secret-scanning.generic-secret-detection %}
21+
22+
{% data reusables.secret-scanning.generic-secret-detection-policy-note %}
23+
24+
You can then enable {% data variables.secret-scanning.generic-secret-detection %} in the security settings page of your repository or organization.
25+
26+
{% data reusables.secret-scanning.copilot-secret-scanning-generic-secrets-subscription-note %}
27+
28+
### Enabling {% data variables.secret-scanning.generic-secret-detection %} for your repository
29+
30+
{% data reusables.repositories.navigate-to-repo %}
31+
{% data reusables.repositories.sidebar-settings %}
32+
{% data reusables.repositories.navigate-to-code-security-and-analysis %}
33+
{% data reusables.repositories.navigate-to-ghas-settings %}
34+
1. Under "Secret scanning", select the checkbox next to "Scan for generic secrets".
35+
36+
### Enabling {% data variables.secret-scanning.generic-secret-detection %} for your organization
37+
38+
{% data reusables.profile.access_org %}
39+
{% data reusables.profile.org_settings %}
40+
1. In the "Security" section of the sidebar, click **{% octicon "codescan" aria-hidden="true" %} Code security** then **Global settings**.
41+
1. Under "Secret scanning", select the checkbox next to "Scan for generic secrets".
42+
43+
For information on how to view alerts for generic secrets that have been detected using AI, see "[AUTOTITLE](/code-security/secret-scanning/managing-alerts-from-secret-scanning/viewing-alerts)."
44+
45+
## Further reading
46+
47+
* [AUTOTITLE](/code-security/secret-scanning/copilot-secret-scanning/responsible-ai-generic-secrets)
48+
* [AUTOTITLE](/code-security/secret-scanning/introduction/about-secret-scanning)
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ topics:
1010
- Advanced Security
1111
- Secret scanning
1212
- AI
13+
- Copilot
1314
redirect_from:
1415
- /code-security/secret-scanning/generating-regular-expressions-for-custom-patterns-with-ai
16+
- /code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/generating-regular-expressions-for-custom-patterns-with-ai
1517
---
1618

1719
## Generating a regular expression for a repository with AI
1820

21+
{% data reusables.secret-scanning.copilot-secret-scanning-expression-generator-subscription-note %}
22+
1923
{% data reusables.repositories.navigate-to-repo %}
2024
{% data reusables.repositories.sidebar-settings %}
2125
{% data reusables.repositories.navigate-to-code-security-and-analysis %}
@@ -44,4 +48,4 @@ redirect_from:
4448

4549
## Further reading
4650

47-
* "[AUTOTITLE](/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/responsible-use-ai-regex-generator)"
51+
* "[AUTOTITLE](/code-security/secret-scanning/copilot-secret-scanning/responsible-use-ai-regex-generator)"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Enhance your secret detection capabilities with Copilot secret scanning
3+
shortTitle: Copilot secret scanning
4+
allowTitleToDifferFromFilename: true
5+
intro: 'Learn how {% data variables.product.prodname_secret_scanning %} uses AI to detect generic secrets in your code, and generate regular expressions for your custom patterns.'
6+
product: '{% data reusables.gated-features.secret-scanning %}'
7+
versions:
8+
ghec: '*'
9+
topics:
10+
- Secret scanning
11+
- Advanced Security
12+
- Repositories
13+
- Copilot
14+
children:
15+
- /responsible-ai-generic-secrets
16+
- /enabling-ai-powered-generic-secret-detection
17+
- /responsible-use-ai-regex-generator
18+
- /generating-regular-expressions-for-custom-patterns-with-ai
19+
redirect_from:
20+
- /code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection
21+
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Responsible detection of generic secrets with Copilot secret scanning
3+
shortTitle: Generic secret detection
4+
intro: 'Learn how {% data variables.secret-scanning.copilot-secret-scanning %} uses AI responsibly to scan and create alerts for unstructured secrets, such as passwords.'
5+
allowTitleToDifferFromFilename: true
6+
versions:
7+
feature: secret-scanning-ai-generic-secret-detection
8+
fpt: '*'
9+
type: rai
10+
topics:
11+
- Secret scanning
12+
- Advanced Security
13+
- AI
14+
- Copilot
15+
redirect_from:
16+
- /code-security/secret-scanning/about-the-detection-of-generic-secrets-with-secret-scanning
17+
- /code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/about-the-detection-of-generic-secrets-with-secret-scanning
18+
- /code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/responsible-ai-generic-secrets
19+
---
20+
21+
<!--Note on the versioning above ^. This article is visible to free, pro, team users for transparency. They cannot use the feature so `fpt` is not included in the feature definition.-->
22+
23+
## About {% data variables.secret-scanning.generic-secret-detection %} with {% data variables.secret-scanning.copilot-secret-scanning %}
24+
25+
{% data variables.secret-scanning.copilot-secret-scanning %}'s {% data variables.secret-scanning.generic-secret-detection %} is an AI-powered expansion of {% data variables.product.prodname_secret_scanning %} that identifies unstructured secrets (passwords) in your source code and then generates an alert.
26+
27+
{% data reusables.rai.secret-scanning.copilot-secret-scanning-generic-secrets-subscription-note %}
28+
29+
{% data variables.product.prodname_GH_advanced_security %} users can already receive {% data variables.secret-scanning.alerts %} for partner or custom patterns found in their source code, but unstructured secrets are not easily discoverable. {% data variables.secret-scanning.copilot-secret-scanning %} uses large language models (LLMs) to identify this type of secret.
30+
31+
When a password is detected, an alert is displayed in the "Experimental" list of {% data variables.product.prodname_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.
32+
33+
{% data reusables.rai.secret-scanning.generic-secret-detection-policy-note %} The feature must then be enabled for repositories and organizations.
34+
35+
### Input processing
36+
37+
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.
38+
39+
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 {% data variables.product.prodname_secret_scanning %} feature.
40+
41+
### Output and display
42+
43+
The LLM scans for strings that resemble passwords and verifies that the identified strings included in the response actually exist in the input.
44+
45+
These detected strings are surfaced as alerts on the {% data variables.product.prodname_secret_scanning %} alerts page, but they are displayed in an additional list that is separate from regular {% data variables.secret-scanning.alerts %}. 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. {% ifversion secret-scanning-ai-generic-secret-detection %}For information on how to view alerts for generic secrets, see "[AUTOTITLE](/code-security/secret-scanning/managing-alerts-from-secret-scanning/viewing-alerts)."{% endif %}
46+
47+
## Improving the performance of {% data variables.secret-scanning.generic-secret-detection %}
48+
49+
To improve the performance of {% data variables.secret-scanning.generic-secret-detection %}, we recommend closing false positive alerts appropriately.
50+
51+
### Verify the accuracy of alerts and close as appropriate
52+
53+
Since {% data variables.secret-scanning.copilot-secret-scanning %}'s {% data variables.secret-scanning.generic-secret-detection %} may generate more false positives than the existing {% data variables.product.prodname_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 {% data variables.product.prodname_dotcom %} UI. The {% data variables.product.prodname_dotcom %} development team will use information on false positive volume and detection locations to improve the model. {% data variables.product.prodname_dotcom %} does not have access to the secret literals themselves.
54+
55+
## Limitations of {% data variables.secret-scanning.generic-secret-detection %}
56+
57+
When using {% data variables.secret-scanning.copilot-secret-scanning %}'s {% data variables.secret-scanning.generic-secret-detection %}, you should consider the following limitations.
58+
59+
### Limited scope
60+
61+
{% data variables.secret-scanning.generic-secret-detection-caps %} 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 {% data variables.product.prodname_github_issues %}.
62+
63+
### Potential for false positive alerts
64+
65+
{% data variables.secret-scanning.generic-secret-detection-caps %} may generate more false positive alerts when compared to the existing {% data variables.product.prodname_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.
66+
67+
### Potential for incomplete reporting
68+
69+
{% data variables.secret-scanning.generic-secret-detection-caps %} 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.
70+
71+
### Limitations by design
72+
73+
{% data variables.secret-scanning.generic-secret-detection-caps %} has the following limitations by design:
74+
75+
* {% data variables.secret-scanning.copilot-secret-scanning %} will not detect secrets that are obviously fake or test passwords, or passwords with low entropy.
76+
* {% data variables.secret-scanning.copilot-secret-scanning %} will only detect a maximum of 100 passwords per push.
77+
* If five or more detected secrets within a single file are marked as false positive, {% data variables.secret-scanning.copilot-secret-scanning %} will stop generating new alerts for that file.
78+
* {% data variables.secret-scanning.copilot-secret-scanning %} does not detect secrets in generated or vendored files.
79+
* {% data variables.secret-scanning.copilot-secret-scanning %} does not detect secrets in encrypted files.
80+
* {% data variables.secret-scanning.copilot-secret-scanning %} does not detect secrets in file types: SVG, PNG, JPEG, CSV, TXT, SQL, or ITEM.
81+
* {% data variables.secret-scanning.copilot-secret-scanning %} does not detect secrets in test code. {% data variables.secret-scanning.copilot-secret-scanning %} skips detections where:
82+
* The file path contains "test", "mock", or "spec".
83+
* The file extension is `.cs`, `.go`, `.java`, `.js`, `.kt`, `.php`, `.py`, `.rb`, `.scala`, `.swift`, or `.ts`.
84+
85+
## Evaluation of {% data variables.secret-scanning.generic-secret-detection %}
86+
87+
{% data variables.secret-scanning.generic-secret-detection-caps %} has been subject to Responsible AI Red Teaming and {% data variables.product.prodname_dotcom %} will continue to monitor the efficacy and safety of the feature over time.
88+
89+
{% ifversion secret-scanning-ai-generic-secret-detection %}
90+
91+
## Next steps
92+
93+
* [AUTOTITLE](/code-security/secret-scanning/copilot-secret-scanning/enabling-ai-powered-generic-secret-detection)
94+
* [AUTOTITLE](/code-security/secret-scanning/managing-alerts-from-secret-scanning)
95+
96+
{% endif %}
97+
98+
## Further reading
99+
100+
* [AUTOTITLE](/code-security/secret-scanning/introduction/about-secret-scanning){% ifversion ghec %}
101+
* [AUTOTITLE](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-security-and-analysis-for-your-enterprise#enforcing-a-policy-to-manage-the-use-of-generic-secret-detection-for-secret-scanning-in-your-enterprises-repositories){% endif %}
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ topics:
1212
- Advanced Security
1313
- Secret scanning
1414
- AI
15+
- Copilot
1516
redirect_from:
1617
- /code-security/secret-scanning/about-the-regular-expression-generator-for-custom-patterns
1718
- /code-security/secret-scanning/about-generating-regular-expressions-with-ai
1819
- /code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/about-generating-regular-expressions-with-ai
20+
- /code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/responsible-use-ai-regex-generator
1921
---
2022

2123
<!--Note on the versioning above ^. This article is visible to free, pro, team users for transparency. They cannot use the feature so `fpt` is not included in the feature definition.-->
@@ -24,6 +26,8 @@ redirect_from:
2426

2527
{% data variables.product.prodname_secret_scanning_caps %} scans repositories for a predefined set of secrets from our partner program, as well as custom patterns that are user-defined. Custom patterns are formatted as regular expressions.
2628

29+
{% data reusables.rai.secret-scanning.copilot-secret-scanning-expression-generator-subscription-note %}
30+
2731
Regular expressions can be challenging for people to write. The {% data variables.secret-scanning.custom-pattern-regular-expression-generator %} makes it possible for you to define your custom patterns without knowledge of regular expressions. Within the existing custom pattern page, you can launch a generative AI experience where you input a text description of what pattern you would like to detect, include optional example strings that should be detected, and get matching regular expressions in return.
2832

2933
### Input processing
@@ -60,7 +64,7 @@ Note that the {% data variables.secret-scanning.custom-pattern-regular-expressio
6064

6165
## Next steps
6266

63-
* [AUTOTITLE](/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/generating-regular-expressions-for-custom-patterns-with-ai)
67+
* [AUTOTITLE](/code-security/secret-scanning/copilot-secret-scanning/generating-regular-expressions-for-custom-patterns-with-ai)
6468
* [AUTOTITLE](/code-security/secret-scanning/managing-alerts-from-secret-scanning)
6569
{% endif %}
6670

content/code-security/secret-scanning/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ children:
2020
- /managing-alerts-from-secret-scanning
2121
- /working-with-secret-scanning-and-push-protection
2222
- /using-advanced-secret-scanning-and-push-protection-features
23+
- /copilot-secret-scanning
2324
- /troubleshooting-secret-scanning-and-push-protection
2425
- /secret-scanning-partnership-program
2526
---

content/code-security/secret-scanning/introduction/about-secret-scanning.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ Scan for and detect secrets that are not specific to a service provider, such as
104104

105105
{% endif %}
106106

107-
{% ifversion secret-scanning-ai-generic-secret-detection %}
108-
109-
### Generic secret detection
110-
111-
Leverage {% data variables.product.prodname_secret_scanning %}'s AI capabilities to detect unstructured secrets, such as passwords, in your repository. For more information, see "[AUTOTITLE](/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/generic-secret-detection/responsible-ai-generic-secrets)."
112-
113-
{% endif %}
114-
115107
### Performing validity checks
116108

117109
Validity checks help you prioritize alerts by telling you which secrets are `active` or `inactive`. For more information, see{% ifversion secret-scanning-validity-check-partner-patterns %} "[AUTOTITLE](/code-security/secret-scanning/enabling-secret-scanning-features/enabling-validity-checks-for-your-repository)" and{% endif %} "[AUTOTITLE](/code-security/secret-scanning/managing-alerts-from-secret-scanning/evaluating-alerts#checking-a-secrets-validity)."
@@ -122,11 +114,14 @@ Validity checks help you prioritize alerts by telling you which secrets are `act
122114

123115
Define your own patterns for secrets used by your organization that {% data variables.product.prodname_secret_scanning %} can scan for and detect. For more information, see "[AUTOTITLE](/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning)."
124116

125-
{% ifversion secret-scanning-custom-pattern-ai-generated %}
117+
{% endif %}
126118

127-
You can also leverage AI to generate regular expressions that will capture all your custom patterns. For more information, see "[AUTOTITLE](/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/responsible-use-ai-regex-generator)."
119+
{% ifversion secret-scanning-ai-generic-secret-detection %}
128120

129-
{% endif %}
121+
### {% data variables.secret-scanning.copilot-secret-scanning %}
122+
123+
* **{% data variables.secret-scanning.generic-secret-detection-caps %}**: Leverage {% data variables.product.prodname_secret_scanning %}'s AI capabilities to detect unstructured secrets, such as passwords, in your repository. For more information, see "[AUTOTITLE](/code-security/secret-scanning/copilot-secret-scanning/responsible-ai-generic-secrets)."{% ifversion secret-scanning-custom-pattern-ai-generated %}
124+
* **{% data variables.secret-scanning.custom-pattern-regular-expression-generator-caps %}**: Leverage {% data variables.product.prodname_secret_scanning %}'s AI capabilities to generate regular expressions that will capture all your custom patterns. For more information, see "[AUTOTITLE](/code-security/secret-scanning/copilot-secret-scanning/responsible-use-ai-regex-generator).{% endif %}
130125

131126
{% endif %}
132127

0 commit comments

Comments
 (0)