Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 982619

Summary: realm permit --groups does not work
Product: Red Hat Enterprise Linux 7 Reporter: David Spurek <dspurek>
Component: sssdAssignee: Jakub Hrozek <jhrozek>
Status: CLOSED CURRENTRELEASE QA Contact: Kaushik Banerjee <kbanerje>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: d_katariya, dpal, dspurek, ebenes, grajaiya, jgalipea, jhrozek, pbrezina, pkis, stefw
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sssd-1.11.0-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:35:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 917637    

Description David Spurek 2013-07-09 12:20:47 UTC
Description of problem:
realm permit --groups not work, group is added to sssd.conf, realm list show the group in permitted-groups. ssh login with a member of this group doesn't work.

Version-Release number of selected component (if applicable):
realmd-0.14.2-3.el7
sssd-1.10.0-12.el7.beta2

How reproducible:
always

Steps to Reproduce:
1.realm permit --realm=security.baseos.qe --groups 'test permit group.qe'
2.
3.

Actual results:
ssh login with a member of this group doesn't work.

Expected results:
ssh login with a member of this group work.

Additional info:
realm list
security.baseos.qe
  type: kerberos
  realm-name: SECURITY.BASEOS.QE
  domain-name: security.baseos.qe
  configured: kerberos-member
  server-software: active-directory
  client-software: sssd
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd
  required-package: adcli
  required-package: samba-common
  login-formats: %U.qe
  login-policy: allow-permitted-logins
  permitted-logins: 
  permitted-groups: test permit group.qe


getent group 'test permit group.qe'
test permit group.qe:*:89801530:amy.qe

cat /etc/sssd/sssd.conf
[sssd]
config_file_version = 2
domains = LDAP, security.baseos.qe
services            = nss, pam, sudo

[nss]
filter_groups       = root
filter_users        = root
default_shell = /bin/bash

[pam]

[sudo]
debug_level         = 0xFFFF

[domain/LDAP]
id_provider         = ldap
auth_provider       = ldap
sudo_provider       = ldap
debug_level         = 0xFFFF
ldap_uri            = ldap://example.com
ldap_tls_cacert     = /etc/openldap/certs/cacert.asc
ldap_search_base    = dc=example,dc=com
entry_cache_nowait_percentage       = 0
entry_cache_timeout                 = 0
ldap_sudo_smart_refresh_interval    = 1
ldap_sudo_full_refresh_interval     = 10

[domain/security.baseos.qe]
ad_domain = security.baseos.qe
krb5_realm = SECURITY.BASEOS.QE
realmd_tags = manages-system
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
ldap_id_mapping = True
use_fully_qualified_names = True
fallback_homedir = /home/%d/%u
access_provider = simple
krb5_use_enterprise_principal=False
simple_allow_groups = test permit group.qe

ssh amy.qe@localhost
amy.qe@localhost's password: 
Connection closed by ::1

Comment 1 Stef Walter 2013-07-09 12:35:21 UTC
Can you try changing sssd.conf to:

simple_allow_groups = test permit group

Could you try this command:

$ realm permit --realm=security.baseos.qe --groups 'test permit group'

Comment 2 David Spurek 2013-07-09 12:39:49 UTC
Result is the same.

[test]realm permit --realm=security.baseos.qe --groups 'test permit group'

[test]realm list
security.baseos.qe
  type: kerberos
  realm-name: SECURITY.BASEOS.QE
  domain-name: security.baseos.qe
  configured: kerberos-member
  server-software: active-directory
  client-software: sssd
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd
  required-package: adcli
  required-package: samba-common
  login-formats: %U.qe
  login-policy: allow-permitted-logins
  permitted-logins: 
  permitted-groups: test permit group


[test]cat /etc/sssd/sssd.conf 
[sssd]
config_file_version = 2
domains = LDAP, security.baseos.qe
services            = nss, pam, sudo

[nss]
filter_groups       = root
filter_users        = root
default_shell = /bin/bash

[pam]

[sudo]
debug_level         = 0xFFFF

[domain/LDAP]
id_provider         = ldap
auth_provider       = ldap
sudo_provider       = ldap
debug_level         = 0xFFFF
ldap_uri            = ldap://example.com
ldap_tls_cacert     = /etc/openldap/certs/cacert.asc
ldap_search_base    = dc=example,dc=com
entry_cache_nowait_percentage       = 0
entry_cache_timeout                 = 0
ldap_sudo_smart_refresh_interval    = 1
ldap_sudo_full_refresh_interval     = 10

[domain/security.baseos.qe]
ad_domain = security.baseos.qe
krb5_realm = SECURITY.BASEOS.QE
realmd_tags = manages-system
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
ldap_id_mapping = True
use_fully_qualified_names = True
fallback_homedir = /home/%d/%u
access_provider = simple
krb5_use_enterprise_principal=False
simple_allow_groups = test permit groupf 


[test]ssh amy.qe@localhost
amy.qe@localhost's password: 
Connection closed by ::1

Comment 3 Stef Walter 2013-07-09 12:41:00 UTC
(In reply to David Spurek from comment #2)
> simple_allow_groups = test permit groupf 

This looks wrong. Could you correct this, restart sssd, and try again?

Comment 4 David Spurek 2013-07-09 12:44:07 UTC
Sorry, this was copy/paste typo.
Current line with this variable is 'simple_allow_groups = test permit group'

I try getent - getent group 'test permit group' and it shows me nothing, maybe this is a problem with this setup.

Comment 5 Stef Walter 2013-07-09 13:12:45 UTC
Very odd. This looks like an sssd bug in that case. If sssd is not respecting 'simple_allow_groups = test permit group' then that sounds like a bug.

Comment 6 David Spurek 2013-07-09 13:47:49 UTC
Tried with modified realmd.conf, getents without fqdn now works, but result is the same.

[test]cat /etc/realmd.conf 
[security.baseos.qe]
fully-qualified-names = no

[test]getent passwd amy
amy:*:89801125:89800513:Amy:/home/security.baseos.qe/amy:/bin/bash
[test]getent group 'test permit group'
test permit group:*:89801530:amy

[test]realm permit --realm=security.baseos.qe --groups 'test permit group'

[test]realm list
security.baseos.qe
  type: kerberos
  realm-name: SECURITY.BASEOS.QE
  domain-name: security.baseos.qe
  configured: kerberos-member
  server-software: active-directory
  client-software: sssd
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd
  required-package: adcli
  required-package: samba-common
  login-formats: %U.qe
  login-policy: allow-permitted-logins
  permitted-logins: 
  permitted-groups: test permit group

[test]cat /etc/sssd/sssd.conf 
[sssd]
config_file_version = 2
services            = nss, pam
domains = security.baseos.qe

[nss]
filter_groups       = root
filter_users        = root
default_shell = /bin/bash

[pam]

[sudo]

[domain/security.baseos.qe]
ad_domain = security.baseos.qe
krb5_realm = SECURITY.BASEOS.QE
realmd_tags = manages-system
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
ldap_id_mapping = True
use_fully_qualified_names = False
fallback_homedir = /home/%d/%u
access_provider = simple
simple_allow_groups = test permit group
krb5_use_enterprise_principal=False

[test]ssh amy@localhost
amy@localhost's password: 
Connection closed by ::1

Comment 7 Jakub Hrozek 2013-07-18 12:08:38 UTC
Hi, do you have this environment set up somewhere? I tried to reproduce but couldn't..

Comment 8 Jakub Hrozek 2013-07-23 12:58:06 UTC
Upstream ticket:
https://fedorahosted.org/sssd/ticket/2026

Comment 9 Pavel Březina 2013-07-23 13:11:06 UTC
Hi,
unfortunately, SSSD is not able to parse fqdn in simple_allow_groups and similar options. Only group name alone is accepted.

I've tried it, even vm provided by David with those results:

use_fully_qualified_names = True
simple_allow_groups = test permit group.qe
==> amy is not permitted to log in

use_fully_qualified_names = True
simple_allow_groups = test permit group
==> amy is allowed to log in

We should parse the name for domain name and accept both formats.

Comment 10 David Spurek 2013-07-23 13:20:55 UTC
Cleaning needinfo flag, environment was prepared.

Comment 11 Stef Walter 2013-07-30 12:41:15 UTC
Is this really a rhel-7.0.0 blocker? I think the upstream fix targets a later release.

Comment 12 Jakub Hrozek 2013-07-30 13:32:16 UTC
(In reply to Stef Walter from comment #11)
> Is this really a rhel-7.0.0 blocker? I think the upstream fix targets a
> later release.

There are two upstream issues. One is to be able to parse fully qualified names in the simple access provider at all. This one we have a patch for and is quite easy.

The other more involved fix is to be able to dynamically discover a trusted domain that might be part of the FQDN but not known during the startup. This requires more changes as the code as one provider (of type simple) might need to call another provider (of different type) to validate the domain:
https://fedorahosted.org/sssd/ticket/2034

Comment 13 Patrik Kis 2013-08-06 14:51:15 UTC
(In reply to Stef Walter from comment #11)
> Is this really a rhel-7.0.0 blocker? I think the upstream fix targets a
> later release.

It is a question. I don't think this is really important feature but on the other hand it is documented in man page so supposed to work.

@ Jakub, when is it planned to be fixed?

Comment 14 Jakub Hrozek 2013-08-06 16:32:26 UTC
(In reply to Patrik Kis from comment #13)
> (In reply to Stef Walter from comment #11)
> > Is this really a rhel-7.0.0 blocker? I think the upstream fix targets a
> > later release.
> 
> It is a question. I don't think this is really important feature but on the
> other hand it is documented in man page so supposed to work.
> 
> @ Jakub, when is it planned to be fixed?

We have a patch on the mailing list already, the fix is going to RHEL-7.0.

I think this is a pretty important feature actually given that realmd uses fully qualified names by default.

Comment 15 Jakub Hrozek 2013-10-04 13:23:19 UTC
Temporarily moving bugs to MODIFIED to work around errata tool bug

Comment 17 Kaushik Banerjee 2014-01-15 10:26:05 UTC
Verified in version

Output from beaker automation run:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: ad_forest_simple_007: bz 982619 simple_deny_groups=group1
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'su_success user1_dom1 Secret123' (Expected 0, got 0)
:: [   PASS   ] :: Running 'su_permission_denied user1_dom2 Secret123' (Expected 0, got 0)
:: [   PASS   ] :: Running 'su_permission_denied user1_dom3.com Secret123' (Expected 0, got 0)
:: [   LOG    ] :: Duration: 9s
:: [   LOG    ] :: Assertions: 3 good, 0 bad
:: [   PASS   ] :: RESULT: ad_forest_simple_007: bz 982619 simple_deny_groups=group1

Comment 18 Ludek Smid 2014-06-13 12:35:50 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 20 Dinesh Katariya 2016-02-19 22:41:18 UTC
Stef Walter, the following command did work for me.. thanks

I denied all a realm access and wanted to just open up for few Active Directory groups.

realm permit --realm=<FQDN Domain> --groups 'group name'

Thanks,
Dinesh