@@ -186,15 +186,23 @@ Detailed [documentation](https://docs.trustauthority.intel.com).
186186
187187### Admin API Configuration
188188
189- Multiple Admin backends are available. These control access to admin endpoints such as ` set_policy ` .
190- Today, the available backends are ` DenyAll ` (disables admin endpoints), ` InsecureAllowAll ` (for debugging)
191- and ` Simple ` .
189+ The admin configuration has two parts.
190+ The admin backend is used for validating the admin token and extracting a role.
191+ The admin configuration can also specify which endpoints the role has access to.
192+
193+
194+ Multiple Admin backends are available.
195+ Today, the available backends are ` DenyAll ` (rejects all admin tokens, thereby blocking all admin interfaces),
196+ ` InsecureAllowAll ` (treats every request as if there is a valid admin token and return the role ` Anonymous ` )
197+ and ` Simple ` (checks the admin token based on a set of public keys).
198+
192199By default, the simple backend will be used, but no personas will be enabled.
193200Use the ` type ` field to set the admin backend.
194201
195202| Property | Type | Description | Required | Default |
196203| -------------------| ---------| -------------------------------------------------------------------| ----------| ---------|
197- | ` type ` | String | The backend used to validate admiin requests. | No | Simple |
204+ | ` type ` | String | The backend used to validate admin requests. | No | Simple |
205+ | ` roles ` | | Rules for accessing admin endpoints | No | Empty |
198206
199207If the ` Simple ` backend is used, a list of admin personas can be provided, each with the following properties:
200208
@@ -203,6 +211,23 @@ If the `Simple` backend is used, a list of admin personas can be provided, each
203211| ` id ` | String | A string used to identify the admin. | Yes | Simple |
204212| ` public_key_path ` | String | The path to the public key corresponding to the admin token. | Yes | Simple |
205213
214+ The role field can specify rules that govern which endpoints an admin is allowed to visit.
215+ If no roles are specified, all admin can access all admin endpoints.
216+ Otherwise, the roles field should be a list of role entries.
217+ One role entry looks like this.
218+
219+ | Property | Type | Description | Required |
220+ | -------------------| --------| ----------------------------------------------------------| ----------|
221+ | id | String | The role that this rule applies to | Yes |
222+ | allowed_endpoints | String | A regular expression matching endpoints that are allowed | Yes |
223+
224+ After the admin token is validated, the role extracted from the token will be checked against
225+ the roles specified in the config file.
226+ If a matching role is found, the ` allowed_endpoints ` regular expression is used to determine
227+ which endpoints the admin can access.
228+ If no matching role is found (and at least one role is specified), the admin will not be able
229+ to access any endpoints.
230+ Roles and role ids are case insensitive.
206231
207232### Policy Engine Configuration
208233
0 commit comments