Skip to content

Commit 8d619c2

Browse files
committed
NBE SAML SSO Group Mappings
1 parent 27a5e80 commit 8d619c2

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Configuring SAML Group Mapping in NetBox Enterprise
2+
3+
Setting up Group Mapping for SAML requires the [base SAML SSO Setup](./nbe-saml.md) to be configured and working first.
4+
5+
## Configure the IdP
6+
7+
NetBox Enterprise expects a SAML group attribute statement to be named `groups`, which contains a list of group names the user belongs to. If your IdP sends group information under a different attribute name, such as `MemberOf`, you must update its configuration to use `groups` to ensure proper mapping.
8+
9+
Example:
10+
11+
![SAML Settings](../images/netbox-enterprise/SAML/netbox-enterprise-saml-idp-groups.png)
12+
13+
## Configuring Group Mappings
14+
15+
1. Desired groups must first be configured within NetBox
16+
2. In the Admin Console for NetBox Enterprise, navigate to the **Config** tab and scroll to the bottom to check **Advanced Settings**
17+
3. Apply the following into **NetBox Python Configuration Overrides**, replacing the relevant information.
18+
19+
``` python
20+
SOCIAL_AUTH_PIPELINE = (
21+
'social_core.pipeline.social_auth.social_details',
22+
'social_core.pipeline.social_auth.social_uid',
23+
'social_core.pipeline.social_auth.social_user',
24+
'social_core.pipeline.user.get_username',
25+
'social_core.pipeline.social_auth.associate_by_email',
26+
'social_core.pipeline.user.create_user',
27+
'social_core.pipeline.social_auth.associate_user',
28+
'netbox.authentication.user_default_groups_handler',
29+
'social_core.pipeline.social_auth.load_extra_data',
30+
'social_core.pipeline.user.user_details',
31+
'nbc_auth_extensions.saml_authentication.saml_map_groups',
32+
)
33+
34+
SOCIAL_AUTH_PIPELINE_CONFIG = {
35+
'SAML_USER_FLAGS_BY_GROUP': {
36+
"is_staff": {
37+
"idp-staff-group-name" # remove this line if no group should be granted 'Staff'
38+
},
39+
"is_superuser": {
40+
"idp-superuser-group-name" # remove this line if no group should be granted 'Superuser'
41+
}
42+
},
43+
'SAML_GROUP_MAP': {
44+
"idp-group-name-1": "netbox-group-name-1",
45+
"idp-group-name-2": "netbox-group-name-2"
46+
}
47+
}
48+
```
49+

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ nav:
115115
- Entra ID Group Mapping: "netbox-enterprise/nbe-azure-group-mapping.md"
116116
- SAML:
117117
- SAML SSO Setup: "netbox-enterprise/nbe-saml.md"
118+
- SAML Group Mapping: "netbox-enterprise/nbe-saml-group-map.md"
118119
- LDAP: "netbox-enterprise/nbe-ldap.md"
119120
- "Administration":
120121
- "TLS and Ingress": "netbox-enterprise/nbe-tls-ingress.md"

0 commit comments

Comments
 (0)