You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: website/content/api-docs/system/secrets-sync.mdx
+134-1
Original file line number
Diff line number
Diff line change
@@ -424,7 +424,16 @@ This endpoint creates a destination to synchronize action secrets with a GitHub
424
424
425
425
-`name``(string: <required>)` - Specifies the name for this destination. This is specified as part of the URL.
426
426
427
-
-`access_token``(string: <required>)` - Fine-grained or personal access token.
427
+
-`access_token``(string: <optional>)` - Fine-grained or personal access token.
428
+
Use `access_token` as an alternative to authenticating with a GitHub app.
429
+
430
+
-`app_name``(string: <optional>)` - The name of a GitHub App configured in Vault to use for
431
+
authentication. Use `app_name` and `installation_id` as an alternative to
432
+
authenticating with an access token.
433
+
434
+
-`installation_id``(string: <optional>)` - The installation ID of the GitHub
435
+
app to use for authentication. Required when using `app_name` for
436
+
authentication.
428
437
429
438
-`repository_owner``(string: <required>)` - GitHub organization or username that owns the repository. For example, if a repository is located at https://github.com/hashicorp/vault.git the owner is hashicorp.
430
439
@@ -826,3 +835,127 @@ $ curl \
826
835
"auth": null
827
836
}
828
837
```
838
+
839
+
## Configure a custom GitHub app
840
+
841
+
Use the `POST` operation with `sys/sync/github-apps` endpoint to configure a
842
+
custom GitHub application for syncing secrets with GitHub repositories.
843
+
844
+
845
+
| Method | Path |
846
+
|:-------|:-----------------------------|
847
+
|`POST`|`sys/sync/github-apps/:name`|
848
+
849
+
850
+
### Parameters
851
+
852
+
-`name``(string: <required>)` - Specifies a custom name for the GitHub
853
+
application that is used when configuring the destination. Although this can be any name, we recommend using the same app name configured in GitHub.
854
+
855
+
-`app_id``(string: <required>)` - Specifies the GitHub application ID, provided by GitHub.
856
+
857
+
-`private_key``(string: <required>)` - Specifies the private key used to authenticate with the GitHub application.
Then add your GitHub application to your Vault instance.
177
+
178
+
To use your GitHub application with Vault:
179
+
180
+
- the application must have permission to read and write secrets.
181
+
- you must generate a private key for the application on GitHub.
182
+
- the application must be installed on the repository you want to sync secrets with.
183
+
- you must know the application ID assigned by GitHub.
184
+
- you must know the installation ID assigned by GitHub.
185
+
186
+
Callback, redirect URLs, and webhooks are not required at this time.
187
+
188
+
To configure the application in Vault, use `vault write` with the
189
+
`sys/sync/github-apps`endpoint to assign a unique name and set the relevant
190
+
information:
191
+
192
+
<CodeBlockConfig hideClipboard>
193
+
194
+
```shell-session
195
+
$ vault write sys/sync/github-apps/<APP_NAME> \
196
+
app_id=<APP_ID> \
197
+
private_key=<PATH_TO_PRIVATE_KEY>
198
+
199
+
Key Value
200
+
--- -----
201
+
app_id <app-id>
202
+
fingerprint <fingerprint>
203
+
name <app-name>
204
+
private_key *****
205
+
```
206
+
</CodeBlockConfig>
207
+
208
+
<Tip title="Fingerprint verification">
209
+
210
+
Vault returns the fingerprint of the private_key provided to ensure that the
211
+
correct private key was configured and that it was not tampered with along the way.
212
+
You can compare the fingerprint to the one provided by GitHub.
213
+
For more information, see [Verifying private keys](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps#verifying-private-keys).
214
+
215
+
</Tip>
216
+
217
+
218
+
Next, use `vault write` with the `sys/sync/destinations/gh` endpoint to
219
+
configure a GitHub destination that references your new GitHub application:
0 commit comments