Score:0

Nested AD group is not respected with SSSD

be flag

I have a domain joined server, configured with sssd. In sssd.conf I use

ad_access_filter = (memberof=CN=CustomGroup,OU=Security Group,DC=company,DC=com)

This works well for users in CustomGroup but not for users in the Nested_CustomGroup group that is a member of CustomGroup

My sssd.conf looks as follows:

[sssd]
domains = company.com
config_file_version = 2
services = nss, pam

[domain/company.com]
ad_domain = company.com
krb5_realm = COMPANY.COM

cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
default_shell = /bin/bash
ldap_id_mapping = True
ignore_group_members = False
ldap_group_nesting_level = 2
use_fully_qualified_names = False
fallback_homedir = /home/%u
case_sensitive = false
access_provider = ad
auth_provider = ad
enumerate = false
ad_gpo_access_control = disabled
ad_access_filter = (memberof=CN=CustomGroup,OU=Security Group,DC=company,DC=com)

sshd journal log during user from nested group login:

server sshd[30781]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=x.x.x.x user=someuser
server sshd[30781]: pam_sss(sshd:auth): authentication success; logname= uid=0 euid=0 tty=ssh ruser= rhost=x.x.x.x user=someuser
server sshd[30781]: pam_sss(sshd:account): Access denied for user someuser: 6 (Permission denied)
server sshd[30781]: Failed password for someuser from x.x.x.x port 26241 ssh2
server sshd[30781]: fatal: Access denied for user someuser by PAM account configuration [preauth]

Any ideas? Thank you,

Score:0
jo flag

In order to query recursive or nested group memberships of an account against Active Directory in LDAP syntax, you need to make use of the OID 1.2.840.113556.1.4.1941, which is the OID for LDAP_MATCHING_RULE_IN_CHAIN or LDAP_MATCHING_RULE_TRANSITIVE_EVAL

In your case, you would need to adjust your access filter to

(memberOf:1.2.840.113556.1.4.1941:=CN=CustomGroup,OU=Security Group,DC=company,DC=com)
Norskyi avatar
be flag
Thank you for this great information. I tried your suggestion but sadly it did not work in my case. The journal shows the same errors
Norskyi avatar
be flag
I am clearly lacking something fundamental here. I did another experiment by creating another group that sits in the SAME parent OU as CustomGroup. `CN=Nested_CustomGroup2,OU=Security Group,DC=company,DC=com #member of below group` `CN=CustomGroup,OU=Security Group,DC=company,DC=com` and that works fine (with/without OID) My original example had this: `CN=Nested_CustomGroup,OU=SomeOU1,OU=SomeOU2,DC=company,DC=com # member of below group` `CN=CustomGroup,OU=Security Group,DC=company,DC=com` @Semicolon
Semicolon avatar
jo flag
Do you have a search base configured for sssd, and does it cover the other group’s OU?
Norskyi avatar
be flag
I do not (as per my original post). I'll give it a try, thank you! Reading on `ldap_search_base` states: `Default: If not set, the value of the defaultNamingContext or namingContexts attribute from the RootDSE of the LDAP server is used`. I am not sure if it'll help
Semicolon avatar
jo flag
What is the group scope of the first nested group?
Norskyi avatar
be flag
it is `Global` just like all of them
Norskyi avatar
be flag
My previous experiment was tainted because of sssd caching. I cleared sssd cache and tried again with my original settings (original post) minus `ldap_group_nesting_level = 2` and `ignore_group_members` set to `True`. As expected, the user from `Nested_CustomGroup` was denied. The moment I added `ldap_search_base`, that same user was able to login
Norskyi avatar
be flag
may I get you to either update your solution or create a new one so can I mark it as the solution? You've lead me down the right path and I do appreciate it! @Semicolon
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.