Skip to content

Commit 066e2e4

Browse files
marzvroveram-stead
andauthored
Update secret-scanning-partner-program example payload (#48727)
Co-authored-by: Anne-Marie <[email protected]>
1 parent edc2fb1 commit 066e2e4

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

content/code-security/secret-scanning/secret-scanning-partner-program.md

+8-22
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ to validate the messages you receive are genuinely from {% data variables.produc
103103

104104
The two HTTP headers to look for are:
105105

106-
- `GITHUB-PUBLIC-KEY-IDENTIFIER`: Which `key_identifier` to use from our API
107-
- `GITHUB-PUBLIC-KEY-SIGNATURE`: Signature of the payload
106+
- `Github-Public-Key-Identifier`: Which `key_identifier` to use from our API
107+
- `Github-Public-Key-Signature`: Signature of the payload
108108

109109
You can retrieve the {% data variables.product.prodname_dotcom %} secret scanning public key from https://api.github.com/meta/public_keys/secret_scanning and validate the message using the `ECDSA-NIST-P256V1-SHA256` algorithm. The endpoint
110110
will provide several `key_identifier` and public keys. You can determine which public
111-
key to use based on the value of `GITHUB-PUBLIC-KEY-IDENTIFIER`.
111+
key to use based on the value of `Github-Public-Key-Identifier`.
112112

113113
{% note %}
114114

@@ -128,28 +128,14 @@ key to use based on the value of `GITHUB-PUBLIC-KEY-IDENTIFIER`.
128128
POST / HTTP/2
129129
Host: HOST
130130
Accept: */*
131-
content-type: application/json
132-
GITHUB-PUBLIC-KEY-IDENTIFIER: f9525bf080f75b3506ca1ead061add62b8633a346606dc5fe544e29231c6ee0d
133-
GITHUB-PUBLIC-KEY-SIGNATURE: MEUCIFLZzeK++IhS+y276SRk2Pe5LfDrfvTXu6iwKKcFGCrvAiEAhHN2kDOhy2I6eGkOFmxNkOJ+L2y8oQ9A2T9GGJo6WJY=
134-
Content-Length: 83
131+
Content-Length: 104
132+
Content-Type: application/json
133+
Github-Public-Key-Identifier: bcb53661c06b4728e59d897fb6165d5c9cda0fd9cdf9d09ead458168deb7518c
134+
Github-Public-Key-Signature: MEQCIQDaMKqrGnE27S0kgMrEK0eYBmyG0LeZismAEz/BgZyt7AIfXt9fErtRS4XaeSt/AO1RtBY66YcAdjxji410VQV4xg==
135135
136-
[{"token":"some_token","type":"some_type","url":"some_url","source":"some_source"}]
137-
```
138-
139-
{% note %}
140-
141-
**Note**: The key id and signature from the example payload is derived from a test key.
142-
The public key for them is:
143-
144-
```shell
145-
-----BEGIN PUBLIC KEY-----
146-
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsz9ugWDj5jK5ELBK42ynytbo38gP
147-
HzZFI03Exwz8Lh/tCfL3YxwMdLjB+bMznsanlhK0RwcGP3IDb34kQDIo3Q==
148-
-----END PUBLIC KEY-----
136+
[{"source":"commit","token":"some_token","type":"some_type","url":"https://example.com/base-repo-url/"}]
149137
```
150138

151-
{% endnote %}
152-
153139
The following code snippets demonstrate how you could perform signature validation.
154140
The code examples assume you've set an environment variable called `GITHUB_PRODUCTION_TOKEN` with a generated [{% data variables.product.pat_generic %}](https://github.com/settings/tokens) to avoid hitting rate limits. The {% data variables.product.pat_generic %} does not need any scopes/permissions.
155141

0 commit comments

Comments
 (0)