Skip to content

Commit 6917970

Browse files
authored
repo sync
2 parents d9167f1 + 2dd51a6 commit 6917970

File tree

1 file changed

+57
-16
lines changed

1 file changed

+57
-16
lines changed

content/developers/overview/secret-scanning.md

Lines changed: 57 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,60 @@
11
---
22
title: Secret scanning
33
intro: 'As a service provider, you can partner with {% data variables.product.prodname_dotcom %} to have your secret token formats secured through secret scanning, which searches for accidental commits of your secret format and can be sent to a service provider''s verify endpoint.'
4+
miniTocMaxHeadingLevel: 4
45
redirect_from:
56
- /partnerships/token-scanning/
67
- /partnerships/secret-scanning
78
versions:
89
free-pro-team: '*'
910
---
1011

11-
12-
{% data variables.product.prodname_dotcom %} scans repositories for known secret formats to prevent fraudulent use of credentials that were committed accidentally. Secret scanning happens by default on public repositories, and can be enabled on private repositories by repository administrators or organization owners. As a service provider, you can partner with {% data variables.product.prodname_dotcom %} so that your secret formats are included in our secret scanning.
12+
{% data variables.product.prodname_dotcom %} scans repositories for known secret formats to prevent fraudulent use of credentials that were committed accidentally. {% data variables.product.prodname_secret_scanning_caps %} happens by default on public repositories, and can be enabled on private repositories by repository administrators or organization owners. As a service provider, you can partner with {% data variables.product.prodname_dotcom %} so that your secret formats are included in our {% data variables.product.prodname_secret_scanning %}.
1313

1414
When a match of your secret format is found in a public repository, a payload is sent to an HTTP endpoint of your choice.
1515

16-
When a match of your secret format is found in a private repository configured for secret scanning, then repository admins are alerted and can view and manage the secret scanning results on {% data variables.product.prodname_dotcom %}. For more information, see "[Managing alerts from secret scanning](/github/administering-a-repository/managing-alerts-from-secret-scanning)".
16+
When a match of your secret format is found in a private repository configured for {% data variables.product.prodname_secret_scanning %}, then repository admins are alerted and can view and manage the {% data variables.product.prodname_secret_scanning %} results on {% data variables.product.prodname_dotcom %}. For more information, see "[Managing alerts from {% data variables.product.prodname_secret_scanning %}](/github/administering-a-repository/managing-alerts-from-secret-scanning)."
1717

1818
{% note %}
1919

20-
**Note:** Secret scanning for private repositories is currently in beta.
20+
**Note:** {% data variables.product.prodname_secret_scanning_caps %} for private repositories is currently in beta.
2121

2222
{% endnote %}
2323

24-
This article describes how you can partner with {% data variables.product.prodname_dotcom %} as a service provider and join the secret scanning program.
24+
This article describes how you can partner with {% data variables.product.prodname_dotcom %} as a service provider and join the {% data variables.product.prodname_secret_scanning %} program.
2525

26-
### The secret scanning process
26+
### The {% data variables.product.prodname_secret_scanning %} process
2727

28-
##### How secret scanning works in a public repository
28+
##### How {% data variables.product.prodname_secret_scanning %} works in a public repository
2929

30-
The following diagram summarizes the secret scanning process for public repositories, with any matches sent to a service provider's verify endpoint.
30+
The following diagram summarizes the {% data variables.product.prodname_secret_scanning %} process for public repositories, with any matches sent to a service provider's verify endpoint.
3131

32-
![Flow diagram showing the process of scanning for a secret and sending matches to a service provider's verify endpoint](/assets/images/secret-scanning-flow.png "Secret scanning flow")
32+
![Flow diagram showing the process of scanning for a secret and sending matches to a service provider's verify endpoint](/assets/images/secret-scanning-flow.png "{% data variables.product.prodname_secret_scanning_caps %} flow")
3333

34-
### Joining the secret scanning program on {% data variables.product.prodname_dotcom %}
34+
### Joining the {% data variables.product.prodname_secret_scanning %} program on {% data variables.product.prodname_dotcom %}
3535

3636
1. Contact {% data variables.product.prodname_dotcom %} to get the process started.
3737
1. Identify the relevant secrets you want to scan for and create regular expressions to capture them.
38-
1. For secret matches found in public repositories, create a secret alert service which accepts webhooks from {% data variables.product.prodname_dotcom %} that contain the secret scanning message payload.
38+
1. For secret matches found in public repositories, create a secret alert service which accepts webhooks from {% data variables.product.prodname_dotcom %} that contain the {% data variables.product.prodname_secret_scanning %} message payload.
3939
1. Implement signature verification in your secret alert service.
4040
1. Implement secret revocation and user notification in your secret alert service.
41+
1. Provide feedback for false positives (optional).
4142

4243
#### Contact {% data variables.product.prodname_dotcom %} to get the process started
4344

44-
To get the enrollment process started, email secret-scanning@github.com.
45+
To get the enrollment process started, email <a href="mailto:secret-scanning@github.com">secret-scanning@github.com</a>.
4546

46-
You will receive details on the secret scanning program, and you will need to agree to {% data variables.product.prodname_dotcom %}'s terms of participation before proceeding.
47+
You will receive details on the {% data variables.product.prodname_secret_scanning %} program, and you will need to agree to {% data variables.product.prodname_dotcom %}'s terms of participation before proceeding.
4748

4849
#### Identify your secrets and create regular expressions
4950

50-
To scan for your secrets, {% data variables.product.prodname_dotcom %} needs the following pieces of information for each secret that you want included in the secret scanning program:
51+
To scan for your secrets, {% data variables.product.prodname_dotcom %} needs the following pieces of information for each secret that you want included in the {% data variables.product.prodname_secret_scanning %} program:
5152

5253
* A unique, human readable name for the secret type. We'll use this to generate the `Type` value in the message payload later.
5354
* A regular expression which finds the secret type. Be as precise as possible, because this will reduce the number of false positives.
5455
* The URL of the endpoint that receives messages from {% data variables.product.prodname_dotcom %}. This does not have to be unique for each secret type.
5556

56-
Send this information to secret-scanning@github.com.
57+
Send this information to <a href="mailto:secret-scanning@github.com">secret-scanning@github.com</a>.
5758

5859
#### Create a secret alert service
5960

@@ -279,4 +280,44 @@ puts openssl_key.verify(OpenSSL::Digest::SHA256.new, Base64.decode64(signature),
279280

280281
#### Implement secret revocation and user notification in your secret alert service
281282

282-
For secret scanning in public repositories, you can enhance your secret alert service to revoke the exposed secrets and notify the affected users. How you implement this in your secret alert service is up to you, but we recommend considering any secrets that {% data variables.product.prodname_dotcom %} sends you messages about as public and compromised.
283+
For {% data variables.product.prodname_secret_scanning %} in public repositories, you can enhance your secret alert service to revoke the exposed secrets and notify the affected users. How you implement this in your secret alert service is up to you, but we recommend considering any secrets that {% data variables.product.prodname_dotcom %} sends you messages about as public and compromised.
284+
285+
#### Provide feedback for false positives
286+
287+
We collect feedback on the validity of the detected individual secrets in partner responses. If you wish to take part, email us at <a href="mailto:secret-scanning@github.com">secret-scanning@github.com</a>.
288+
289+
When we report secrets to you, we send a JSON array with each element containing the token, type identifier, and commit URL. When you send us feedback, you send us information about whether the detected token was a real or false credential. We accept feedback in the following formats.
290+
291+
You can send us the raw token:
292+
293+
```
294+
[
295+
{
296+
"token_raw": "The raw token",
297+
"token_type": "ACompany_API_token",
298+
"label": "true_positive"
299+
}
300+
]
301+
```
302+
You may also provide the token in hashed form after performing a one way cryptographic hash of the raw token using SHA-256:
303+
304+
```
305+
[
306+
{
307+
"token_hash": "The SHA-256 hashed form of the raw token",
308+
"token_type": "ACompany_API_token",
309+
"label": "false_positive"
310+
}
311+
]
312+
```
313+
A few important points:
314+
- You should only send us either the raw form of the token ("token_raw"), or the hashed form ("token_hash"), but not both.
315+
- For the hashed form of the raw token, you can only use SHA-256 to hash the token, not any other hashing algorithm.
316+
- The label indicates whether the token is a true ("true_positive") or a false positive ("false_positive"). Only these two lowercased literal strings are allowed.
317+
318+
{% note %}
319+
320+
**Note:** Our request timeout is set to be higher (that is, 30 seconds) for partners who provide data about false positives. If you require a timeout higher than 30 seconds, email us at <a href="mailto:secret-scanning@github.com">secret-scanning@github.com</a>.
321+
322+
{% endnote %}
323+

0 commit comments

Comments
 (0)