Skip to content

Commit ac0d403

Browse files
authored
document JWT Groups Filter setting (#1770)
Add two reference pages, one for the global setting and one for the per-route setting. Add the new 'removed-groups-count' field to the Authorize Log Fields reference page.
1 parent 60941c8 commit ac0d403

File tree

5 files changed

+98
-3
lines changed

5 files changed

+98
-3
lines changed

content/docs/reference/authorize-log-fields.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ The table below lists all available authorize log fields:
114114
| `method` | The HTTP request method, such as `GET`, `POST`, or `PUT` | Yes |
115115
| `path` | The HTTP request path (for example, `/some/path`) | Yes |
116116
| `query` | The HTTP request query (for example, `?test=one&other=13`) | No |
117+
| `removed-groups-count` | The number of groups removed during [JWT groups filtering](/docs/reference/jwt-groups-filter) | Yes |
117118
| `request-id` | The request's unique identifier as assigned by Pomerium | Yes |
118119
| `service-account-id` | if using a service account, the service account ID | Yes |
119120
| `session-id` | the session ID | Yes |
47.1 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
id: jwt-groups-filter
3+
title: JWT Groups Filter
4+
description: |
5+
The JWT Groups Filter setting allows you to reduce the size of the groups claim in the Pomerium JWT.
6+
keywords:
7+
- reference
8+
- JWT Groups Filter
9+
pagination_prev: null
10+
pagination_next: null
11+
toc_max_heading_level: 2
12+
---
13+
14+
:::enterprise
15+
16+
This setting is available only in [Pomerium Enterprise](/docs/deploy/enterprise).
17+
18+
:::
19+
20+
## Summary
21+
22+
The **JWT Groups Filter** setting allows you to reduce the size of the groups claim in the [Pomerium JWT](/docs/capabilities/getting-users-identity) when used in combination with [directory sync]. This may be useful for organizations with large numbers of directory groups.
23+
24+
When directory sync is enabled, Pomerium will include directory groups membership information in a `groups` claim in the Pomerium JWT. By default, all of a user's groups are included in this claim. However, if the average number of groups is very large, this may grow unwieldy and potentially lead to HTTP header size issues with some upstream services.
25+
26+
This feature allows you to limit the size of the `groups` claim by specifying a subset of groups that are relevant for your deployment. Only groups belonging to this subset will be included in the `groups` claim in the Pomerium JWT.
27+
28+
The groups eligible for inclusion may be specified explicitly, or inferred automatically from the policies that apply to a given route.
29+
30+
The setting also applies to the `Impersonate-Group` header, for Kubernetes API server authentication.
31+
32+
This setting can also be customized for a particular route, see [**JWT Groups Filter (per route)**](/docs/reference/routes/jwt-groups-filter).
33+
34+
## How to configure
35+
36+
The **JWT Groups Filter** setting is available in the Enterprise Console on the "Settings" page, under the "Proxy" tab.
37+
38+
![screenshot of JWT Groups Filter setting](./img/jwt-groups-filter.png)
39+
40+
Select the "Filter to groups referenced in policies" option if you want to automatically filter based on any group IDs referenced in any policies associated with a specific route. Or you can enter specific groups using the "Filter to specific groups" input field.
41+
42+
If both are specified, a group will be eligible for inclusion in the Pomerium JWT if it is _either_ referenced in an associated policy, or present in the list of specific groups.
43+
44+
:::info
45+
46+
This setting has no effect if [directory sync] is not enabled.
47+
48+
:::
49+
50+
## Logging
51+
52+
When this feature is enabled, a new field `removed-groups-count` will be present in the [authorize logs](/docs/reference/authorize-log-fields). This field will indicate the number of groups that were removed by groups filtering for a specific request.
53+
54+
To verify that groups filtering is working as expected, you can also set the [log level](/docs/reference/log-level) to "debug." At this level, Pomerium will log an additional entry with the message `JWT group filtering removed groups` along with the IDs of all removed and included groups.
55+
56+
[directory sync]: /docs/integrations/user-standing/directory-sync

content/docs/reference/reference.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -711,9 +711,16 @@
711711
"jwt-groups-filter": {
712712
"id": "jwt-groups-filter",
713713
"title": "JWT Groups Filter",
714-
"description": "If set, filters the set of group memberships in the Pomerium JWT and Impersonate-Group headers to this subset of groups (based on an exact string match).",
715-
"services": [],
716-
"type": "array of string"
714+
"path": "/jwt-groups-filter",
715+
"description": "Restricts the set of groups allowed in the Pomerium JWT and Impersonate-Group headers, either based on applied policies or using a specific list of groups.",
716+
"services": []
717+
},
718+
"jwt-groups-filter-route": {
719+
"id": "jwt-groups-filter-route",
720+
"title": "JWT Groups Filter (per route)",
721+
"path": "/routes/jwt-groups-filter",
722+
"description": "Restricts the set of groups allowed in the Pomerium JWT and Impersonate-Group headers, either based on applied policies or using a specific list of groups.",
723+
"services": []
717724
},
718725
"override-certificate-name": {
719726
"id": "override-certificate-name",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: JWT Groups Filter (per route)
3+
description: |
4+
The JWT Groups Filter setting allows you to reduce the size of the groups claim in the Pomerium JWT.
5+
keywords:
6+
- reference
7+
- JWT Groups Filter
8+
pagination_prev: null
9+
pagination_next: null
10+
toc_max_heading_level: 2
11+
---
12+
13+
:::enterprise
14+
15+
This setting is available only in [Pomerium Enterprise](/docs/deploy/enterprise).
16+
17+
:::
18+
19+
## Summary
20+
21+
The **JWT Groups Filter (per route)** setting allows you to reduce the size of the groups claim in the [Pomerium JWT](/docs/capabilities/getting-users-identity). See the global [**JWT Groups Filter**](/docs/reference/jwt-groups-filter) reference page for more information about this feature.
22+
23+
When the global setting is enabled, the per-route option will _expand_ the set of allowed groups. A group will be eligible for inclusion in the groups claim if is allowed by either the global setting or the per-route setting.
24+
25+
When the global setting is not enabled, the per-route option will enable groups filtering for a specific route.
26+
27+
## How to configure
28+
29+
The **JWT Groups Filter** setting is available in the Enterprise Console on the route settings page, under the "Headers" tab.
30+
31+
![screenshot of JWT Groups Filter setting](../img/jwt-groups-filter.png)

0 commit comments

Comments
 (0)