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 1446176

Summary: hbactest does not work with trusted users
Product: Red Hat Enterprise Linux 7 Reporter: Varun Mylaraiah <mvarun>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED WORKSFORME QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.4CC: atolani, dpal, frenaud, jgalipea, jhrozek, mbabinsk, mkosek, mvarun, pvoborni, rcritten, seceng-idm-qe-list, sgoveas, spoore, tscherf
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 848531 Environment:
Last Closed: 2017-05-11 11:05:26 UTC Type: ---
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: 848531, 1049533    
Bug Blocks:    

Comment 2 Varun Mylaraiah 2017-04-27 12:03:33 UTC
This issue appears in latest version:
ipa-server-4.5.0-8.el7.x86_64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: hbactest works with trusted users, bz848531
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Running 'kdestroy -A'
:: [   PASS   ] :: Command 'kdestroy -A' (Expected 0, got 0)
:: [ 06:59:05 ] :: Create group for testing bug
:: [  BEGIN   ] :: Running 'ipa group-add --desc=0 bz848531_external --external'
-------------------------------
Added group "bz848531_external"
-------------------------------
  Group name: bz848531_external
  Description: 0
:: [   PASS   ] :: Command 'ipa group-add --desc=0 bz848531_external --external' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa group-add --desc=0 bz848531'
----------------------
Added group "bz848531"
----------------------
  Group name: bz848531
  Description: 0
  GID: 1744200006
:: [   PASS   ] :: Command 'ipa group-add --desc=0 bz848531' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa group-add-member bz848531 --groups=bz848531_external'
  Group name: bz848531
  Description: 0
  GID: 1744200006
  Member groups: bz848531_external
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa group-add-member bz848531 --groups=bz848531_external' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa group-add-member bz848531_external             --external='PNE\adgroup1' --users='' --groups='''
  Group name: bz848531_external
  Description: 0
  External member: S-1-5-21-2202318585-426110948-4011710778-1559
  Member of groups: bz848531
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa group-add-member bz848531_external             --external='PNE\adgroup1' --users='' --groups=''' (Expected 0, got 0)
:: [ 06:59:14 ] :: Create HBAC rule
:: [  BEGIN   ] :: Running 'ipa hbacrule-add bz848531'
--------------------------
Added HBAC rule "bz848531"
--------------------------
  Rule name: bz848531
  Enabled: TRUE
:: [   PASS   ] :: Command 'ipa hbacrule-add bz848531' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa hbacrule-add-host bz848531 --hosts=auto-hv-02-guest06.httpexsm9.test'
  Rule name: bz848531
  Enabled: TRUE
  Hosts: auto-hv-02-guest06.httpexsm9.test
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa hbacrule-add-host bz848531 --hosts=auto-hv-02-guest06.httpexsm9.test' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa hbacrule-add-service bz848531 --hbacsvcs=sshd'
  Rule name: bz848531
  Enabled: TRUE
  Hosts: auto-hv-02-guest06.httpexsm9.test
  Services: sshd
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa hbacrule-add-service bz848531 --hbacsvcs=sshd' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa hbacrule-add-user bz848531 --groups=bz848531'
  Rule name: bz848531
  Enabled: TRUE
  User Groups: bz848531
  Hosts: auto-hv-02-guest06.httpexsm9.test
  Services: sshd
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa hbacrule-add-user bz848531 --groups=bz848531' (Expected 0, got 0)
:: [ 06:59:17 ] :: Test hbactest
:: [  BEGIN   ] :: Running 'ipa hbactest --host=auto-hv-02-guest06.httpexsm9.test --service=sshd --user='PNE\aduser1' > /tmp/tmpout.ipa_trust_func_bug_848531 2>&1'
:: [   PASS   ] :: Command 'ipa hbactest --host=auto-hv-02-guest06.httpexsm9.test --service=sshd --user='PNE\aduser1' > /tmp/tmpout.ipa_trust_func_bug_848531 2>&1' (Expected 0, got 0)
:: [   FAIL   ] :: File '/tmp/tmpout.ipa_trust_func_bug_848531' should contain 'Matched rules: bz848531' 
File starts: <<<<<------>>>>>
--------------------
Access granted: True
--------------------
  Matched rules: allow_all
  Not matched rules: bz848531
File ends: <<<<<------>>>>>

Comment 12 Varun Mylaraiah 2017-05-11 11:05:26 UTC
the issue is not reproducing now. I'm going to close this bug for now

# rpm -qa ipa-server sssd
sssd-1.15.2-25.el7.x86_64
ipa-server-4.5.0-10.el7.x86_64


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: hbactest works with trusted users, bz848531
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Running 'kdestroy -A'
:: [   PASS   ] :: Command 'kdestroy -A' (Expected 0, got 0)
:: [ 13:29:29 ] :: Create group for testing bug
:: [  BEGIN   ] :: Running 'ipa group-add --desc=0 bz848531_external --external'
-------------------------------
Added group "bz848531_external"
-------------------------------
  Group name: bz848531_external
  Description: 0
:: [   PASS   ] :: Command 'ipa group-add --desc=0 bz848531_external --external' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa group-add --desc=0 bz848531'
----------------------
Added group "bz848531"
----------------------
  Group name: bz848531
  Description: 0
  GID: 1747000006
:: [   PASS   ] :: Command 'ipa group-add --desc=0 bz848531' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa group-add-member bz848531 --groups=bz848531_external'
  Group name: bz848531
  Description: 0
  GID: 1747000006
  Member groups: bz848531_external
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa group-add-member bz848531 --groups=bz848531_external' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa group-add-member bz848531_external             --external='PNEdgroup1' --users='' --groups='''
  Group name: bz848531_external
  Description: 0
  External member: S-1-5-21-2202318585-426110948-4011710778-1559
  Member of groups: bz848531
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa group-add-member bz848531_external             --external='PNE\adgroup1' --users='' --groups=''' (Expected 0, got 0)
:: [ 13:29:32 ] :: Create HBAC rule
:: [  BEGIN   ] :: Running 'ipa hbacrule-add bz848531'
--------------------------
Added HBAC rule "bz848531"
--------------------------
  Rule name: bz848531
  Enabled: TRUE
:: [   PASS   ] :: Command 'ipa hbacrule-add bz848531' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa hbacrule-add-host bz848531 --hosts=auto-hv-01-guest03.userexsm23.test'
  Rule name: bz848531
  Enabled: TRUE
  Hosts: auto-hv-01-guest03.userexsm23.test
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa hbacrule-add-host bz848531 --hosts=auto-hv-01-guest03.userexsm23.test' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa hbacrule-add-service bz848531 --hbacsvcs=sshd'
  Rule name: bz848531
  Enabled: TRUE
  Hosts: auto-hv-01-guest03.userexsm23.test
  Services: sshd
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa hbacrule-add-service bz848531 --hbacsvcs=sshd' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa hbacrule-add-user bz848531 --groups=bz848531'
  Rule name: bz848531
  Enabled: TRUE
  User Groups: bz848531
  Hosts: auto-hv-01-guest03.userexsm23.test
  Services: sshd
-------------------------
Number of members added 1
-------------------------
:: [   PASS   ] :: Command 'ipa hbacrule-add-user bz848531 --groups=bz848531' (Expected 0, got 0)
:: [ 13:29:34 ] :: Test hbactest
:: [  BEGIN   ] :: Running 'ipa hbactest --host=auto-hv-01-guest03.userexsm23.test --service=sshd --user='PNEduser1' > /tmp/tmpout.ipa_trust_func_bug_848531 2>&1'
:: [   PASS   ] :: Command 'ipa hbactest --host=auto-hv-01-guest03.userexsm23.test --service=sshd --user='PNE\aduser1' > /tmp/tmpout.ipa_trust_func_bug_848531 2>&1' (Expected 0, got 0)
:: [   PASS   ] :: File '/tmp/tmpout.ipa_trust_func_bug_848531' should contain 'Matched rules: bz848531' 
:: [   PASS   ] :: BZ848531 not found 
:: [ 13:29:35 ] :: Cleanup groups and hbacrule
:: [  BEGIN   ] :: Running 'ipa hbacrule-del bz848531'
----------------------------
Deleted HBAC rule "bz848531"
----------------------------
:: [   PASS   ] :: Command 'ipa hbacrule-del bz848531' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa group-del bz848531'
------------------------
Deleted group "bz848531"
------------------------
:: [   PASS   ] :: Command 'ipa group-del bz848531' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'ipa group-del bz848531_external'
---------------------------------
Deleted group "bz848531_external"
---------------------------------
:: [   PASS   ] :: Command 'ipa group-del bz848531_external' (Expected 0, got 0)
:: [ 13:29:37 ] :: Running remotehost-sync-set -s '6.' -m auto-hv-01-guest03.idmqe.lab.eng.bos.redhat.com
:: [  BEGIN   ] :: Running 'remotehost-sync-set -s '6.' -m auto-hv-01-guest03.idmqe.lab.eng.bos.redhat.com'
remotehost-sync-set -s 6. -m auto-hv-01-guest03.idmqe.lab.eng.bos.redhat.com
root     22391 12660  0 13:18 ?        00:00:00 python -m SimpleHTTPServer 8907
:: [   PASS   ] :: Command 'remotehost-sync-set -s '6.' -m auto-hv-01-guest03.idmqe.lab.eng.bos.redhat.com' (Expected 0, got 0)
'fca14437-438b-4c94-980f-3524a8a05c98'
hbactest-works-with-trusted-users-bz848531 result: PASS