diff --git a/tutorials/protect-github-ssh.mdx b/tutorials/protect-github-ssh.mdx index abc39a3e..b6f3fe07 100644 --- a/tutorials/protect-github-ssh.mdx +++ b/tutorials/protect-github-ssh.mdx @@ -1,5 +1,5 @@ --- -updated_at: October 13, 2026 +updated_at: December 2, 2026 title: Protect GitHub with SSH Certificates html_title: Protect GitHub Repositories with Hardware-Bound SSH Certificates description: Authenticate to GitHub with short-lived SSH certificates backed by your device's TPM or Secure Enclave, issued and managed by the Smallstep Agent. @@ -40,8 +40,12 @@ sequenceDiagram You will need: - A GitHub Enterprise Cloud organization where you are an owner. -- Devices enrolled in Smallstep with the [Smallstep Agent](../platform/smallstep-agent.mdx) installed, +- Devices enrolled in your Smallstep team with the [Smallstep Agent](../platform/smallstep-agent.mdx) installed, each with a user assigned. + A device enrolled in a different team won't receive the certificate. +- SSH enabled for your Smallstep team. + If it isn't enabled yet, + [contact Smallstep Support](https://support.smallstep.com/en/contact-us) to turn it on before you continue. - Users synced from your identity provider, with a GitHub username attribute (next section). ## Sync users and their GitHub usernames @@ -107,8 +111,19 @@ Create a **credential** that tells the Smallstep Agent to issue a hardware-bound to each of your devices. You will need [an API token](https://smallstep.com/app/?next=/settings/api/tokens/add). +In the dashboard, tokens are under **Team Settings → API Clients**. +Give the token the `post-endpoint-configurations` scope, found in the **Protect** group of scopes +(add `get-endpoint-configuration` and `list-endpoint-configurations` to look it up afterward). See [Smallstep API](../platform/smallstep-api.mdx) for details. + +
+ SSH credentials are created as endpoint configurations in API version 2025-01-01, + which is why the request below sets x-smallstep-api-version: 2025-01-01. + Later API versions don't include the endpoint configurations API. +
+
+ Store your API token in a headers file for `curl`: ```bash @@ -175,6 +190,11 @@ from the `githubUsername` attribute you configured above. Once this credential is created, the Smallstep Agent on matching devices automatically requests and renews hardware-bound SSH certificates that carry each user's GitHub username. +A successful request returns the new configuration with its `id`. +SSH credentials don't appear on the **Credentials** page in the dashboard. +To confirm it worked, wait a few minutes and run `ssh-add -l` on a matching device +(see [Verify SSH authentication](#verify-ssh-authentication)). + # Step 2: Configure the enforcement point The enforcement point is GitHub itself: