Skip to content

Commit 5a3b700

Browse files
Adam Lockeywangd
andauthored
[DOCS] SAML groups can use wildcards (#86770) (#86848)
* [DOCS] SAML groups can use wildcards * Expand note on matching groups * Change regexp to regular expression Co-authored-by: Yang Wang <[email protected]> Co-authored-by: Yang Wang <[email protected]> Co-authored-by: Yang Wang <[email protected]>
1 parent f68c7d4 commit 5a3b700

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

x-pack/docs/en/security/authentication/saml-guide.asciidoc

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,29 @@ groups:: _(Recommended)_
322322
If you wish to use your IdP's concept of groups or roles as the basis for a
323323
user's {es} privileges, you should map them with this attribute.
324324
The `groups` are passed directly to your
325-
<<saml-role-mapping, role mapping rules>>
325+
<<saml-role-mapping, role mapping rules>>.
326+
+
327+
[NOTE]
328+
====
329+
Some IdPs are configured to send the `groups` list as a comma-separated string,
330+
but {es} can't parse this string into an array of groups. To map this SAML
331+
attribute to the `attributes.groups` setting in the {es} realm, a cluster
332+
security administrator can use a wildcard when
333+
<<saml-role-mapping,configuring role mappings>>. While flexible, wildcards are
334+
less accurate and can match on unwanted patterns. Instead, a cluster security
335+
administrator can use a regular expression to create a role mapping rule that
336+
matches only a single group. For example, the following regular expression
337+
matches only on the `elasticsearch-admins` group:
338+
339+
[source,sh]
340+
----
341+
/^(.*,)?elasticsearch-admins(,.*)?$/
342+
----
343+
344+
These regular expressions are based on Lucene’s
345+
{ref}/regexp-syntax.html[regular expression syntax], and can match more complex
346+
patterns. All regular expressions must start and end with a forward slash.
347+
====
326348

327349
name:: _(Optional)_ The user's full name.
328350
mail:: _(Optional)_ The user's email address.
@@ -705,10 +727,13 @@ PUT /_security/role_mapping/saml-finance
705727
"enabled": true,
706728
"rules": { "all": [
707729
{ "field": { "realm.name": "saml1" } },
708-
{ "field": { "groups": "finance-team" } }
730+
{ "field": { "groups": "finance-team" } } <1>
709731
] }
710732
}
711733
--------------------------------------------------
734+
<1> The `groups` attribute supports using wildcards (`*`). Refer to the
735+
<<security-api-put-role-mapping-example,create or update role mappings API>> for
736+
more information.
712737

713738
If your users also exist in a repository that can be directly accessed by {es}
714739
(such as an LDAP directory) then you can use

0 commit comments

Comments
 (0)