Skip to content

Commit 78c1e60

Browse files
for openziti/ziti#2324 adds external JWT enrollment doc (#1238)
* for openziti/ziti#2324 adds external JWT enrollment doc - adds documentation for ext-jwt-signer enrollment
1 parent 06abe61 commit 78c1e60

File tree

13 files changed

+176
-29
lines changed

13 files changed

+176
-29
lines changed

docusaurus/docs/guides/external-auth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _click here to see a list of guides to help you configure your selected [Identit
1313
OpenZiti utilizes and implements the [Authorization Code Flow with PKCE or PKCE flow](https://oauth.net/2/pkce/)
1414
for authentication. This flow is well-known and numerous excellent resources on the internet explain what PKCE is
1515
and what it entails. The guides here focuses on correctly configuring an OpenZiti
16-
[external JWT signer](../../learn/core-concepts/security/authentication/50-external-jwt-signers.md) for use with an OIDC
16+
[external JWT signer](../../learn/core-concepts/security/authentication/50-external-jwt-signers.mdx) for use with an OIDC
1717
provider.
1818

1919
Correctly configuring an external jwt signer requires the careful attention. The fields below all correspond to fields
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- `enrollToCertEnabled` - Allows clients with valid JWTs to request a certificate from the controller by providing a
2+
[Certificate Signing Request (CSR)](https://en.wikipedia.org/wiki/Certificate_signing_request). The resulting certificate will be used for authentication. The target `enrollAuthPolicyId` must be set
3+
to a policy that allows certificate authentication. If `enrollAuthPolicyId` is not set, the default policy
4+
will be used and must allow certificate authentication.
5+
- `enrollToTokenEnabled`- Allows clients with valid JWTs to continue to use JWTs for authentication. The target
6+
policy must be set to a policy that allows External JWT Signer authentication. If `enrollAuthPolicyId` is not
7+
set, the default policy will be used and must allow External JWT Signer authentication.
8+
9+
10+
Additionally, there are optional values that can be used to control which claims within the JWT are significant:
11+
12+
- `enrollAttributeClaimsSelector` - a root level property name (e.g. `claims`) or a JSON pointer (e.g. `/claims`) that
13+
points to a string or array of strings that will be used to populate the `attributes` field of the enrolling
14+
identity. Defaults to no value set and identities will enroll without attributes.
15+
- `enrollAuthPolicyId` - the id of the authentication policy to use for the enrolling identity. Defaults to no value set
16+
and the identity will enroll with the default authentication policy.
17+
- `enrollNameClaimsSelector` - the root level property name (e.g. `claims`) or a JSON pointer (e.g. `/claims`) that
18+
points to a string that will be used to populate the `name` field of the enrolling identity.
19+
Defaults to the subject property of the JWT (e.g. `/sub`)

docusaurus/docs/learn/core-concepts/security/authentication/10-third-party-cas.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ index zero and any required intermediate certificates afterwards.
1414
## Usage
1515

1616
3rd Party CAs can be used in the following manners:
17-
- allows clients to enroll and authenticate automatically for at-scale network boarding - [Auto CA Enrollment](../enrollment.md#auto-ca-enrollment)
18-
- allows clients to enroll pre-created identities - [OTT CA Enrollment](../enrollment.md#ott-ca-enrollment)
17+
- allows clients to enroll and authenticate automatically for at-scale network boarding - [Auto CA Enrollment](../enrollment.mdx#auto-ca-enrollment)
18+
- allows clients to enroll pre-created identities - [OTT CA Enrollment](../enrollment.mdx#ott-ca-enrollment)
1919
- allows clients to map to pre-created identities using `externalId` and [X509 Claims](#external-id--x509-claims)
2020

2121
## Create
@@ -28,11 +28,11 @@ certificates will be validated. The following fields configure client authentica
2828
- `isAuthEnabled` - allows client certificates of the CA to attempt to enroll
2929
- `externalIdClaim` - configuration used to pull values out of the x509 client certificate used to match identity `externalId`, see [External Id & x509 Claims](#external-id--x509-claims)
3030

31-
For [Auto CA Enrollment](../enrollment.md#auto-ca-enrollment) an identity is created on first authentication.
31+
For [Auto CA Enrollment](../enrollment.mdx#auto-ca-enrollment) an identity is created on first authentication.
3232
The following fields allow configuration of newly created identities:
3333

3434
- `identityRoles` - the identity roles to give to automatically enrolling identities
35-
- `identityNameFormat` - the identity name format used to name [automatically enrolling identities](../enrollment.md#auto-ca-enrollment)
35+
- `identityNameFormat` - the identity name format used to name [automatically enrolling identities](../enrollment.mdx#auto-ca-enrollment)
3636

3737
On initial creation of a 3rd Party CA it will be in an unverified stated and must undergo [verification](#verification).
3838
The following fields relate to [verification](#verification):

docusaurus/docs/learn/core-concepts/security/authentication/30-authentication-policies.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ process to maintain client certificate validity if `allowExpiredCerts` is false.
7676
Fields:
7777

7878
- `allowed` - whether external JWTs may be used for authentication
79-
- `allowedSigners` - the ids of valid [External JWT Signers](./50-external-jwt-signers.md)
79+
- `allowedSigners` - the ids of valid [External JWT Signers](50-external-jwt-signers.mdx)
8080

81-
If `allowed` is true the [External JWT Signers](./50-external-jwt-signers.md) specified in the `allowedSigners` field
81+
If `allowed` is true the [External JWT Signers](50-external-jwt-signers.mdx) specified in the `allowedSigners` field
8282
may be used for authentication.
8383

8484
#### Username Password (updb)
@@ -92,4 +92,4 @@ may be used for authentication.
9292
The secondary section contain only two top-level configuration values:
9393

9494
- `requireTotp` - if true authenticating clients must have [MFA TOTP](./70-totp.md) enabled
95-
- `requireExtJwt` - if set to an id of an [External JWT Signer](./50-external-jwt-signers.md) every request must have a valid JWT in the HTTP `Authentication` header
95+
- `requireExtJwt` - if set to an id of an [External JWT Signer](50-external-jwt-signers.mdx) every request must have a valid JWT in the HTTP `Authentication` header

docusaurus/docs/learn/core-concepts/security/authentication/40-certificate-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PKIs via [3rd Party CAs](./10-third-party-cas.md). Ziti can trust certificates f
1212
Routers will attempt to extend their current client and server certificates one week prior to expiration. No
1313
intervention is necessary on behalf of the network administrator. The request must be sent to the controller via a
1414
pre-authenticated connection. If a router has been disconnected from the Ziti network and their client certificates
15-
have expired, the router must be [re-enrolled](../enrollment.md#router-enrollment-extension).
15+
have expired, the router must be [re-enrolled](../enrollment.mdx#router-enrollment-extension).
1616

1717
## Client Certificate Extension
1818

docusaurus/docs/learn/core-concepts/security/authentication/50-external-jwt-signers.md renamed to docusaurus/docs/learn/core-concepts/security/authentication/50-external-jwt-signers.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import ExtJwtDocEnrollDetails from '../_ext_jwt_enroll_details.md'
2+
13
# External JWT Signers
24

35
External JWT Signers allow external identity providers to facilitate authentication with a Ziti network. External
@@ -21,6 +23,14 @@ _Note: `externalId` values on identities are enforced to be unique._
2123
`claimsProperty` can contain JWT standard claims or private claims. An example usage would be an `email` JWT private
2224
claim and Ziti identities with `externalId` set to email addresses.
2325

26+
### Enrollment
27+
28+
External JWT Signers can be used to enroll identities that are not pre-created by administrators. Enrollment is
29+
controlled by the `enrollToCertEnabled` and `enrollToTokenEnabled` fields on `enabled` External JWT Signers. See the
30+
[Enrollment - Auto External JWT Signer Enrollment](../enrollment.mdx#auto-external-jwt-signer-enrollment)
31+
documentation for more information.
32+
33+
<ExtJwtDocEnrollDetails />
2434

2535
### x509 Certificate
2636

docusaurus/docs/learn/core-concepts/security/authentication/60-identities.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ itself, a single account on a multi-user device, an application, or a set of app
66
Identity is only limited by the intent of its use, its security configuration, and where/how it stores its credentials.
77

88
If an Identity represents a human that is using an SSO provider that ties into Ziti Edge's
9-
[External JWT Signers](./50-external-jwt-signers.md) the human operator can move from device to device using whichever Ziti
9+
[External JWT Signers](50-external-jwt-signers.mdx) the human operator can move from device to device using whichever Ziti
1010
enabled applications that allow them to authenticate. If the Identity can only authenticate via a x509 Client
1111
Certificate where the private key is stored in a hardware back keystore on a device, such that the key can not be moved,
1212
the identity is tied to that hardware. Further if the Identity's credentials are stored in an OS-backed user specific
@@ -36,7 +36,7 @@ erDiagram
3636
## Creating
3737

3838
Creating an identity alone may not be enough to make it usable. An identity will also need a valid primary
39-
authentication mechanism. Depending on that mechanism it may also need to complete [enrollment](../enrollment.md#clients).
39+
authentication mechanism. Depending on that mechanism it may also need to complete [enrollment](../enrollment.mdx#clients).
4040

4141
Please note that all authentication mechanisms also require a properly configured [authentication policy](./auth.md)
4242

@@ -46,7 +46,7 @@ The following [primary authentication](./auth.md#primary-authentication) mechani
4646
- 3rd Party x509 Client Certificate
4747
- Username Password (UPDB)
4848

49-
The following do not require enrollment, but must have a properly configured [External JWT Signer](./50-external-jwt-signers.md)
49+
The following do not require enrollment, but must have a properly configured [External JWT Signer](50-external-jwt-signers.mdx)
5050

5151
- JWT
5252

@@ -137,7 +137,7 @@ Note: This identity will be using the default [authentication policy](./auth.md)
137137
```
138138

139139
### Creating w/ JWT Authenticator
140-
Note: A valid [External JWT Signer](./50-external-jwt-signers.md) must be created and an [authentication policy](./auth.md)
140+
Note: A valid [External JWT Signer](50-external-jwt-signers.mdx) must be created and an [authentication policy](./auth.md)
141141
must be defined that allows the identity to authenticate with that signer.
142142

143143
#### Ziti CLI:
@@ -165,7 +165,7 @@ Deleting an Identity removes all directly associated data. This includes:
165165
- [Session Certificates](./20-api-session-certificates.md)
166166
- Identity Role Attributes
167167
- [Authenticators](./auth.md#authenticators)
168-
- [Enrollments](../enrollment.md)
168+
- [Enrollments](../enrollment.mdx)
169169
- [MFA TOTP Configuration](./70-totp.md)
170170

171171
It does not remove entities are that re-usable between Identities:

docusaurus/docs/learn/core-concepts/security/authentication/auth.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ intermediate CA, and root CA functionality supports RSA and EC keys.
9191
Please note that intermediate CA certificates may be provided during authentication if necessary. The client certificate
9292
should be in index zero and intermediate CA certificates in subsequent indexes in any order.
9393

94-
To associate a client certificate with an Identity and Authenticator see the [Enrollment](../enrollment.md)
94+
To associate a client certificate with an Identity and Authenticator see the [Enrollment](../enrollment.mdx)
9595
section.
9696

9797
Expired client certificates may be allowed via [Authentication Policies](30-authentication-policies.md) if desired.
9898

9999
### JWT Primary Authentication
100100

101-
JWT authentication requires that an [External JWT Signer](50-external-jwt-signers.md) be added via the Ziti edge management
102-
API. The definition of [External JWT Signer](50-external-jwt-signers.md) allows configuration of which JWT claim should be
101+
JWT authentication requires that an [External JWT Signer](50-external-jwt-signers.mdx) be added via the Ziti edge management
102+
API. The definition of [External JWT Signer](50-external-jwt-signers.mdx) allows configuration of which JWT claim should be
103103
used as a value to map against the unique `externalId` or `id` property on Identities. This mapping of JWT claim to
104104
`externalId`/`id` is used to determine which Identity is authenticating.
105105

106106
The JWT must be provided in the HTTP request in the `Authorization` header with a value in the format of
107107
`Bearer <jwt>`. The JWT provided must pass signature, expiration, issuer, and audience validation as configured
108-
on the [External JWT Signer](50-external-jwt-signers.md).
108+
on the [External JWT Signer](50-external-jwt-signers.mdx).
109109

110110
### Username/password
111111

docusaurus/docs/learn/core-concepts/security/enrollment.md renamed to docusaurus/docs/learn/core-concepts/security/enrollment.mdx

Lines changed: 121 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import ExtJwtDocEnrollDetails from './_ext_jwt_enroll_details.md'
2+
13
# Enrollment
24

35
Enrollment is the process of some Edge client or edge router associating itself with a Ziti network. Client enrollment
@@ -46,7 +48,7 @@ Routers will automatically maintain their enrollment by refreshing their certifi
4648

4749
## Clients
4850

49-
Client enroll in one of two major categories:
51+
Clients enroll in one of two major categories:
5052

5153
- pre-provisioned - identities are created before the client attempts to run and are provided with one-time-tokens to enroll
5254
- OTT, OTT CA
@@ -147,7 +149,7 @@ Ziti network without first creating an identity or distributing a JWT enrollment
147149
[3rd Party CA](./authentication/10-third-party-cas.md) and ensure that `isAutoCaEnrollmentEnabled` is set to `true`.
148150

149151
The name of enrolling clients is controlled by the `identityNameFormat` of the [3rd Party CA](./authentication/10-third-party-cas.md).
150-
The format support a number of replacement strings:
152+
The /format supports a number of replacement strings:
151153

152154
- `[caName]` - the Ziti `name` of the [3rd Party CA](./authentication/10-third-party-cas.md) that validates the enrolling certificate
153155
- `[caId]` - the Ziti `id` of the [3rd Party CA](./authentication/10-third-party-cas.md) that validates the enrolling certificate
@@ -157,7 +159,123 @@ The format support a number of replacement strings:
157159

158160
The default format is `[caName] - [commonName]`.
159161

160-
Identity names are unique and if a collision occurs, incrementing numbers are appended.
162+
Identity names are unique, and if a collision occurs, incrementing numbers are appended.
163+
164+
### Auto External JWT Signer Enrollment
165+
166+
[External JWT Signers](./authentication/50-external-jwt-signers.mdx) represent an external IdP that can sign JWTs
167+
as proof of identity (including OAuth/OIDC servers). Auto Ext-JWT-Signer enrollment allows a client with a JWT from a
168+
configured [External JWT Signers](./authentication/50-external-jwt-signers.mdx) to enroll without an administrator
169+
preconfiguring an identity for them.
170+
171+
For this to function, the following must be true:
172+
- the External JWT Signer is configured to validate incoming JWTs
173+
- the External JWT Signer is enabled
174+
- the External JWT Signer has a `claimsProperty` set that maps to an id value to use as `externalId` of enrolling
175+
identities.
176+
- either the `enrollToCertEnable` or `enrollToTokenEnabled` are set to `true`
177+
178+
179+
The [External JWT Signers](./authentication/50-external-jwt-signers.mdx) options `enrollToCertEnable` and
180+
`enrollToTokenEnabled` are defined as follows:
181+
182+
<ExtJwtDocEnrollDetails />
183+
184+
These values are included on the OpenZiti CLI command `ziti edge create ext-jwt-signer`.
185+
186+
#### Identity Uniqueness
187+
188+
The `claimsProperty` that selects the external id of the enrolling identity must be unique. Attempting to enroll
189+
with further duplicate external ids will result in an error. If desired, remove the previously enrolled identity
190+
to allow re-enrollment.
191+
192+
#### Enrollment Process
193+
194+
In order for Auto External JWT Signer Enrollment to happen, a client must be used that implements the enrollment flow.
195+
This process is similar to External JWT Signer authentication (e.g. OIDC or OAuth).
196+
197+
1. The client queries the public External JWT Signers list on the Client API
198+
```text
199+
GET /edge/client/v1/external-jwt-signers
200+
```
201+
202+
```text
203+
200 OK
204+
Content-Type: application/json
205+
206+
{
207+
meta: {...},
208+
data: [
209+
{
210+
id: "20jgir0ji02",
211+
"name": "Example 1",
212+
"externalAuthUrl": "https://auth.example.com/login",
213+
"clientId": "native",
214+
"scopes": "openid profile email",
215+
"openIdConfigurationUrl": "https://auth.example.com/.well-known/openid-configuration",
216+
"audience": "myAudience",
217+
"targetToken": "ACCESS",
218+
"enrollToCertEnabled": true,
219+
"enrollToTokenEnabled": false,
220+
},
221+
...
222+
]
223+
}
224+
```
225+
2. The client presents a list to be selected from or selects a specific one.
226+
3. The client follows the authentication flow, enabling user input where necessary.
227+
4. The client receives a JWT from the external IdP.
228+
5. The client uses the JWT for enrollment. (see below)
229+
230+
#### Enrollment Token Submission
231+
232+
The client can submit the JWT to the controller for enrollment that results in either certificate-based authentication
233+
(`enrollToCert` is true) or token-based authentication (`enrollToToken` is true).
234+
235+
236+
##### Certificate Enrollment
237+
238+
Certificate enrollment requires the creation of a [Certificate Signing Request (CSR)](https://en.wikipedia.org/wiki/Certificate_signing_request). The CSR can contain any values desired. However, they will
239+
be ignored by the controller. The only requirement is that a properly configured key set was used to create and sign
240+
the CSR.
241+
242+
```text
243+
POST /edge/client/v1/enroll/token
244+
Authorization: Bearer <jwt from IdP>
245+
246+
<CSR>
247+
```
248+
249+
```text
250+
200 OK
251+
Content-Type: application/json
252+
253+
{
254+
"meta":{},
255+
"data":{}
256+
}
257+
```
258+
259+
```text
260+
200 OK
261+
Content-Type: application/json
262+
263+
{
264+
"meta": {...},
265+
"data": {
266+
"cert": "<PEM encoded certificate chain>",
267+
"ca": "<PEM encoded CA certificate bundle>"
268+
}
269+
}
270+
```
271+
272+
##### Token Enrollment
273+
274+
Token enrollment is a simple request to the controller with the JWT.
275+
```text
276+
POST /edge/client/v1/enroll/token
277+
Authorization: Bearer <jwt from IdP>
278+
```
161279

162280
### Client Re-Enrollment
163281

docusaurus/docs/learn/core-concepts/security/overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ are related to identity authentication and service access:
77

88
- [Identities](#identity) - describe a human, device, or service within the edge
99
- [Authenticators](./authentication/auth.md#authenticators) - describes the credentials of an authentication method associated with an Identity
10-
- [Enrollments](./enrollment.md) - describes a set of criteria necessary to create a new Identity and associated Authenticator
10+
- [Enrollments](enrollment.mdx) - describes a set of criteria necessary to create a new Identity and associated Authenticator
1111
- [Authentication Policy](./authentication/30-authentication-policies.md) - describes the methods available for Identity authentication
1212
- [3rd Party CAs](./authentication/10-third-party-cas.md) - allows external x509 PKIs to be used for authentication
13-
- [External JWT Signers](./authentication/50-external-jwt-signers.md) - allows external JWT signers to be used for authentication
13+
- [External JWT Signers](authentication/50-external-jwt-signers.mdx) - allows external JWT signers to be used for authentication
1414
- [API Session](./sessions.md) - a security context represented by a security token (JWT, secret, etc) that represents
1515
Identity authentication
1616
- [Session](./sessions.md) - a security context represented by a security token (JWT, secret, etc) that represents access
@@ -78,14 +78,14 @@ dial (connect) to services over a network. Read more in the [Identity](/learn/co
7878

7979
Enrollment is a client initiated process where the result is the creation of an Identity that has some manner
8080
of authenticating. Enrollments may be automated through [3rd Party Cas](./authentication/10-third-party-cas.md) and
81-
[External JWT Signers](./authentication/50-external-jwt-signers.md) or may be completed through pre-provisioning. Read more in the
82-
[Enrollment](./enrollment.md) section.
81+
[External JWT Signers](authentication/50-external-jwt-signers.mdx) or may be completed through pre-provisioning. Read more in the
82+
[Enrollment](enrollment.mdx) section.
8383

8484
### Authentication
8585

8686
[Authentication](./authentication/auth.md) is the process of a client proving their identity through the submission of one primary credential
8787
and zero or more secondary credentials that are prompted by Authentication Queries. Authentication methods can be
88-
configured through [3rd Party Cas](./authentication/10-third-party-cas.md), [External JWT Signers](./authentication/50-external-jwt-signers.md),
88+
configured through [3rd Party Cas](./authentication/10-third-party-cas.md), [External JWT Signers](authentication/50-external-jwt-signers.mdx),
8989
and [Authentication Policies](./authentication/30-authentication-policies.md). Read more in the
9090
[Authentication](./authentication/auth.md) section.
9191

0 commit comments

Comments
 (0)