Skip to content

Commit 6ed6b53

Browse files
committed
Merge branch 'main' into carl/enrollment-guide
2 parents 44bfb3b + 7da8e2a commit 6ed6b53

File tree

15 files changed

+383
-367
lines changed

15 files changed

+383
-367
lines changed

.github/PULL_REQUEST_TEMPLATE

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
1-
<!---
2-
Please provide answers in the spaces below each prompt, where applicable.
3-
Not every PR requires responses for each prompt.
4-
Use your discretion.
5-
-->
6-
#### Name of feature:
1+
#### Describe your changes:
72

8-
#### Pain or issue this feature alleviates:
93

10-
#### Why is this important to the project (if not answered above):
4+
#### Related links/other PRs/issues:
115

12-
#### Is there documentation on how to use this feature? If so, where?
136

14-
#### In what environments or workflows is this feature supported?
15-
16-
#### In what environments or workflows is this feature explicitly NOT supported (if any)?
17-
18-
#### Supporting links/other PRs/issues:
19-
20-
💔Thank you!
7+
Thank you!

manifest.json

Lines changed: 237 additions & 237 deletions
Large diffs are not rendered by default.

platform/smallstep-agent.mdx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,30 +187,35 @@ curl -sL https://packages.smallstep.com/scripts/smallstep-agent-install.sh | sud
187187
```
188188
189189
190-
## Configure the agent
190+
## Register the endpoint
191+
192+
### Auto-registration
191193
192194
To configure the agent and register your Linux device with your Smallstep team, run:
193195
194196
```jsx
195197
sudo step-agent-plugin register [team name]
196198
```
197199
198-
Alternatively, you can configure the agent manually.
199-
Simply update `/etc/step-agent/agent.yaml` config file, with your Smallstep team name and Smallstep Agent CA fingerprint.
200+
### Manual registration
200201
201-
```jsx
202-
team: "myteamname"
203-
fingerprint: "40523785c1d1d11EXAMPLE017b660d52a5fa5f2cb94cf0e1a9e9209dbea0826"
204-
```
202+
Alternatively, you can configure the agent manually:
203+
1. First, [register and approve your devices via API](./enrollment-guide.mdx#add-devices-via-api).
204+
2. On your endpoints, update the `/etc/step-agent/agent.yaml` config file with your Smallstep team name and Smallstep Agent CA fingerprint.
205+
206+
```jsx
207+
team: "myteamname"
208+
fingerprint: "40523785c1d1d11EXAMPLE017b660d52a5fa5f2cb94cf0e1a9e9209dbea0826"
209+
```
205210
206-
- Your `team` ID (team slug). This is the value after `/app/` in your Smallstep dashboard URL.
207-
- Your agent CA `fingerprint`. Find this value in your dashboard:
208-
- In the Smallstep dashboard, select Authorities
209-
- Select the Smallstep Agents authority
210-
- Use the sha256 Root fingerprint displayed on this page
211+
- Your `team` ID (team slug). This is the value after `/app/` in your Smallstep dashboard URL.
212+
- Your agent CA `fingerprint`. Find this value in your dashboard:
213+
- In the Smallstep dashboard, select Authorities
214+
- Select the Smallstep Agents authority
215+
- Use the sha256 Root fingerprint displayed on this page
211216
212217
213-
## Start the Smallstep agent
218+
## Start the agent
214219
215220
Finally, enable and start the agent:
216221

platform/smallstep-api.mdx

Lines changed: 39 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ description: The Smallstep platform is used across security, IT, and DevOps team
66

77
With the Smallstep API, you can:
88

9-
- Register VMs with Smallstep as you spin them up, for instant trust bootstrapping
10-
- Integrate certificate lifecycle management into your Terraform and Ansible definitions
11-
- Programmatically manage CAs, SSH grants and tags, and more!
9+
- Register new devices in your Smallstep inventory
10+
- Manage your high-level protected resources, such as Wi-Fi or VPN configurations
11+
- Manage low-level resources like X.509 CAs, Attestation authorities, and provisioners
12+
- Manage hosts, host grants, and tags for [Smallstep SSH](../ssh/README.mdx)
13+
- And more!
1214

1315
The Smallstep API is [OpenAPI conformant](https://www.openapis.org/), with JSON requests and responses.
1416

@@ -17,97 +19,53 @@ The Smallstep API is [OpenAPI conformant](https://www.openapis.org/), with JSON
1719
👉 [Smallstep API Specification and Playground](https://gateway.smallstep.com)
1820

1921
You can get an API token in two ways:
20-
- In your [Smallstep settings](https://smallstep.com/app?next=/settings). Under **API Tokens**, choose **+ Add Token.**
21-
- On the command line, using the [`step` CLI](https://smallstep.com/docs/step-cli/). The [`step api token create`](https://smallstep.com/docs/step-cli/reference/api/token/create/index.html) command accepts a client certificate and private key to authenticate with Smallstep and issue a temporary API token. To use this option, you must first configure a trusted root CA in your [Smallstep settings](https://smallstep.com/app?next=/settings). The trusted root can be a Smallstep CA or an external CA. Only one trusted root CA may be configured.
22+
- **Long-term token**: In your [Smallstep settings](https://smallstep.com/app?next=/settings). Under **API Tokens**, choose **+ Add Token.** This token has a 10 year validity period and will only be displayed once. Please store it in a safe place!
23+
- **Short-term token**: On the command line, using the [`step` CLI](../step-cli/README.mdx). The [`step api token create`](../step-cli/reference/api/token/create/README.mdx) command accepts a client certificate and private key to authenticate with Smallstep and issue a temporary API token with a 1 hour validity period.
24+
To use this option, you must configure a trusted root CA in your [Smallstep settings](https://smallstep.com/app?next=/settings). The trusted root can be a Smallstep CA or an external CA. Only one trusted root CA may be configured.
2225

2326
### API Clients
2427

25-
- [Smallstep Terraform Provider](https://github.com/smallstep/terraform-provider-smallstep) ([Documentation](https://registry.terraform.io/providers/smallstep/smallstep/latest/docs))
2628
- [Smallstep API Python Client](https://github.com/smallstep/smallstep-python)
29+
- [Smallstep Terraform Provider](https://github.com/smallstep/terraform-provider-smallstep) ([Documentation](https://registry.terraform.io/providers/smallstep/smallstep/latest/docs))
30+
31+
### Example: Add devices via the API
32+
33+
You can import devices from any source into Smallstep using our API.
2734

28-
### Getting Started
35+
Devices added via API are automatically approved.
36+
but they will not be marked as high-assurance
37+
until Smallstep receives an attestation from the device.
2938

30-
You’ll need an API token to get started. You can create one by [signing into the Smallstep dashboard](https://smallstep.com/app/). In the bottom-left **** menu, go to **Settings**. Under **API Tokens**, choose **+ Add Token.**
39+
For each device, use the [Save Collection Instance](https://gateway.smallstep.com/v2023-11-01/operations/PutCollectionInstance) endpoint to create a device.
40+
- For the `collectionSlug`, use `default`
41+
- For Apple devices, the `instanceID` must be the device's serial number.
42+
- For TPM 2.0 devices, the `instanceID` must be the TPM Endorsement Key URI, in the format `urn:ek:sha256:ul3sYf6uQ6jVEXAMPLEXoAuHI10U8gTvEJ6bMj95LXI=`. (You can retrieve the EK URI by running `step agent tpm --fingerprint` on the device.)
3143

32-
Your API token has a 10 year validity period and will only be displayed once. Please store it in a safe place!
44+
For the body of the request,
45+
create a user using the following value
46+
(replacing `[email protected]` with the device owner's email address):
3347

34-
Once you have a token, try your first API call:
48+
```
49+
{
50+
"data": {
51+
"name": "Carl's MacBook Pro",
52+
"smallstep:identity": "[email protected]"
53+
}
54+
}
55+
```
56+
57+
Once added,
58+
the devices will be automatically approved.
59+
60+
You can see the device using the [ListCollectionInstances](https://gateway.smallstep.com/v2023-11-01/operations/ListCollectionInstances) endpoint:
3561

3662
```bash
3763
set +o history
3864
echo "Authorization: Bearer [your token]" > api_headers
3965
set -o history
40-
curl -sH @api_headers https://gateway.smallstep.com/api/users | jq
66+
curl -sH @api_headers https://gateway.smallstep.com/api/collections/default/items | jq
4167
```
4268

43-
Output:
44-
45-
```bash
46-
[
47-
{
48-
"active": true,
49-
"displayName": "Alice T",
50-
"emails": [
51-
{
52-
"email": "[email protected]",
53-
"primary": true
54-
}
55-
],
56-
"familyName": "T",
57-
"givenName": "Alice",
58-
"groups": [
59-
{
60-
"id": "a1028765-3d67-44b0-b51b-f7d76727f181",
61-
"name": "admin"
62-
},
63-
{
64-
"id": "eb4b75f0-a341-4dac-a52a-12d90d91b97d",
65-
"name": "super-admin"
66-
}
67-
],
68-
"id": "4510f372-f4ba-4dc7-b6c2-ad22fdaaadb1",
69-
"posixUsers": []
70-
}
71-
]
72-
```
69+
Or, in your Smallstep dashboard,
70+
you'll see the device listed under Recent Devices.
7371

74-
### Configure Devices and Workloads via the API
75-
76-
Here’s the most common workflow for using the Smallstepi API, either directly or via the Terraform or Ansible integrations:
77-
78-
#### 1. [Create a device collection](https://gateway.smallstep.com/operations/PutDeviceCollection).
79-
80-
Set the device type according to your deployment. Note that each device type is going to have its own `deviceTypeConfiguration` as well. For example, an Azure VM device will require you to set your Azure tenant ID, for access control.
81-
82-
You’ll register your individual devices in step 3.
83-
84-
#### 2. [Add workloads](https://gateway.smallstep.com/operations/PutWorkload).
85-
86-
This is where you set up your workload configuration. You can specify things like certificate SANs and duration, certificate and key file ownership and permissions, reload options for the workload, and so on.
87-
88-
A single workload can be associated with multiple devices.
89-
90-
Have three HAProxy hosts in front of a fleet of `internal.example.com` web servers? That’s one workload.
91-
92-
Have a PostgreSQL server with several hot standby servers? That’s one workload.
93-
94-
Have an etcd cluster comprised of three hosts? That’s one workload.
95-
96-
On this endpoint, you can use the `deviceMetadataKeySANs` property to dynamically map certificate SANs for each device that’s running a workload. Or, statically assign SANs for every certificate in the workload, using `staticSANs`.
97-
98-
#### 3. [Add devices to collection](https://gateway.smallstep.com/operations/PutCollectionInstance).
99-
100-
Each device’s `instanceID` should be set according to the device type:
101-
102-
- For AWS EC2 instances, use the EC2 instance ID (eg. [`i-0d460b88a96dfdd08`](https://us-east-2.console.aws.amazon.com/ec2/home?region=us-east-2#InstanceDetails:instanceId=i-0d460b88a96dfdd08))
103-
- For Azure VMs, use the managed identity principal object ID
104-
- For Compute Engine VMs, use the instance ID (eg. `16979701088048819`)
105-
106-
Use the `data` field to store any relevant instance metadata, such as:
107-
108-
- an instance’s region, name, or role(s)
109-
- DNS names (these can be mapped to a SANs using `deviceMetadataKeySANs`, above)
110-
111-
#### 4. Install the Smallstep app on each device.
112-
113-
See [Smallstep App](./smallstep-app.mdx) for details.

step-ca/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Teams use `step-ca` to:
3131
<div>
3232
To get up and running quickly, or as an alternative to running your own
3333
<Code>step-ca</Code> server, consider creating a
34-
<a href="https://smallstep.com/signup?product=cm">free hosted smallstep Certificate Manager authority</a>.
34+
<a href="https://smallstep.com/signup?product=cm">hosted Smallstep authority</a>.
3535
</div>
3636
</Alert>
3737

step-ca/basic-certificate-authority-operations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ $ step ca certificate localhost localhost.crt localhost.key --not-after=5m
193193
$ step ca certificate localhost localhost.crt localhost.key --not-before=5m --not-after=240h
194194
```
195195

196-
Note that default maximum certificate duration is 24 hours. To adjust the global default, minimum, and maximum certificate durations for your CA, add a `claims` section to the `$(step path)/config/ca.json` configuration file, under `"authority"`, with the following keys:
196+
Note that default maximum certificate duration is 24 hours. To adjust the global default, minimum, and maximum certificate durations for your CA, add a `claims` section to the `$(step path)/config/ca.json` configuration file, nested under `"authority"`, with the following keys:
197197

198198
```json
199199
"claims": {

step-ca/cryptographic-protection.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Here are some notes on granting a custom IAM role that provides step-ca with acc
337337

338338
## Azure Key Vault
339339

340-
[Azure Key Vault](https://azure.microsoft.com/en-us/products/key-vault) is Microsoft's managed key management service.
340+
[Azure Key Vault](https://learn.microsoft.com/en-us/azure/key-vault/general/overview) is Microsoft's managed key management service.
341341

342342
### Authentication
343343

step-ca/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Here are some of the most popular options:
3737
<AlertTitle>Don&apos;t want to run your own CA?</AlertTitle>
3838
<div>
3939
To get up and running quickly, consider creating a{' '}
40-
<a href="https://smallstep.com/signup?product=cm">free hosted smallstep Certificate Manager authority</a>.
40+
<a href="https://smallstep.com/signup?product=cm">hosted Smallstep authority</a>.
4141
</div>
4242
</Alert>
4343

step-ca/provisioners.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ a Certificate Signing Request (CSR) is sent to the CA
324324
along with a short-lived JSON Web Token (JWT) which authenticates the request.
325325

326326
The JWK provisioner can be useful for custom integrations.
327-
JWTs are easy to [generate programmatically](https://jwt.io/#libraries-io),
327+
JWTs are easy to [generate programmatically](https://jwt.io/libraries),
328328
without using `step`.
329329
We have written a few [example clients](https://github.com/smallstep/clients/tree/main) for demonstration purposes.
330330

@@ -1285,7 +1285,7 @@ Here's an example of a SCEP provisioner in `$(step path)/config/ca.json`:
12851285
```json
12861286
{
12871287
"type": "SCEP",
1288-
"name": "scepca",
1288+
"name": "my_scep_provisioner",
12891289
"forceCN": true,
12901290
"challenge": "secret1234",
12911291
"minimumPublicKeyLength": 2048,
@@ -1323,7 +1323,7 @@ Enable this by filling in the `"insecureAddress"` property to your top-level CA
13231323
```
13241324

13251325
Finally, restart `step-ca`.
1326-
Your SCEP provisioner is now available at the endpoint `http://ca.example.com:8080/scep/scepca`.
1326+
Your SCEP provisioner is now available at the endpoint `http://ca.example.com:8080/scep/my_scep_provisioner`.
13271327

13281328
<Alert severity="info">
13291329
<div>

step-ca/registration-authority-ra-mode.mdx

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -559,27 +559,45 @@ Here are the `config` options for `vaultcas` authorities:
559559

560560
- **pkiRoleEd25519**: the pki role used to issue Ed25519 certificates, defaults to *pkiRoleDefault*
561561

562-
- **authType**: required. the authentication method used to login to the vault, one of `approle` or `kubernetes`
562+
- **authType**: required. the authentication method used to login to the vault, one of `approle`, `kubernetes` or `aws`
563563

564564
- **authMountPath**: the vault mount path for the auth method you want to use, if not set the default mount path for that auth type is used (usually the same name as the auth method)
565565

566566
- **namespace**: optional. if using Vault Enterprise, the [namespace](https://developer.hashicorp.com/vault/docs/enterprise/namespaces) to which requests should be scoped. Note: this value will apply to both the `pkiMountPath` and the `authMountPath`, effectively prefixing them
567567

568568
- **authOptions**: required. a set of options specific to the selected auth method type
569569

570-
- **roleID**: [authType=`approle`] required. the approle role-id to use
570+
- For [authType=`approle`]:
571571

572-
- **secretID**: [authType=`approle`] the approle secret-id to use
572+
- **roleID**: required. the approle role-id to use
573573

574-
- **secretIDFile**: [authType=`approle`] the path to a file containing a secret-id (recommended method in production environments)
574+
- **secretID**: the approle secret-id to use
575575

576-
- **secretIDEnv**: [authType=`approle`] the name of an environment variable that contains the secret-id
576+
- **secretIDFile**: the path to a file containing a secret-id (recommended method in production environments)
577577

578-
- **isWrappingToken**: [authType=`approle`] set true if the secret-id is wrapped
578+
- **secretIDEnv**: the name of an environment variable that contains the secret-id
579579

580-
- **role**: [authType=`kubernetes`] required. the kubernetes role to use
580+
- **isWrappingToken**: set true if the secret-id is wrapped
581+
582+
- For [authType=`kubernetes`]:
581583

582-
- **tokenPath**: [authType=`kubernetes`] the path to a token used to authenticate (default to the service account token path in a k8s pod)
584+
- **role**: required. the kubernetes role to use
585+
586+
- **tokenPath**: the path to a token used to authenticate (default to the service account token path in a k8s pod)
587+
588+
- For [authType=`aws`]:
589+
590+
- **role**: required. the AWS role to use
591+
592+
- **awsAuthType**: required. the AWS authentication type to use, one of `iam` or `ec2`
593+
594+
- **region**: optional. the AWS region to use
595+
596+
- **iamServerIdHeader**: [awsAuthType=`iam`] optional. the additional header sent to Vault to mitigate replay attack
597+
598+
- **signatureType**: [awsAuthType=`ec2`] optional. the type of signature used to verify EC2 auth logins, one of `pkcs7`, `identity`, or `rsa2048`
599+
600+
- **nonce**: [awsAuthType=`ec2`] optional. the nonce sent to Vault to mitigate replay attack, a randomly generated nonce will be used if not provided
583601

584602
Finally, remove the `"root"`, `"key"`, and `"crt"` values from your `$(step path)/config/ca.json`, and the associated files. These are generated by `step ca init` but are not used by RA servers.
585603

0 commit comments

Comments
 (0)