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 1285012

Summary: Fix multiple keys in keytab
Product: Red Hat Enterprise Linux 7 Reporter: Ondrej <ondrej.valousek.xm>
Component: gssproxyAssignee: Robbie Harwood <rharwood>
Status: CLOSED ERRATA QA Contact: Abhijeet Kasurde <akasurde>
Severity: medium Docs Contact:
Priority: low    
Version: 7.2CC: dpal, eguan, ksiddiqu, mmuehlfe, nsoman, ondrej.valousek.xm, rharwood, yoyang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://fedorahosted.org/gss-proxy/ticket/155
Whiteboard:
Fixed In Version: gssproxy-0.6.2-4.el7 Doc Type: Bug Fix
Doc Text:
Cause: krb5_principal option is not implemented. Consequence: When multiple keys are present in a keytab, gssproxy will use the first which breaks some applications. Fix: krb5_principal has been implemented to match existing documentation. Result: Multiple keys in keytab works as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 20:55:26 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:
Attachments:
Description Flags
console.log none

Description Ondrej 2015-11-24 16:33:14 UTC
Description of problem:
Unable to use ldapsearch -Y GSSAPI to obtain TGT based on machine credentials via gssproxy

How reproducible:
always

Steps to Reproduce:
1. join machine to AD domain using "net ads join" command, storing machine credentials in /etc/krb5.keytab

2. Configure GSSPROXY to impersonate user trying to run ldapsearch:

[service/myimpersonator]
   mechs = krb5
   debug = yes
   krb5_principal = MYHOST$@EXAMPLE.COM
   cred_store = ccache:FILE:/var/lib/gssproxy/clients/krb5cc_%U
   cred_store = keytab:/etc/krb5.test.keytab
   cred_usage = initiate
   euid = 1000

3. Use ldapsearch:
bash$ export GSS_USE_PROXY=yes
bash$ ldapsearch -h dcduba.dublin.ad.s3group.com
SASL/GSSAPI authentication started
ldap_sasl_interactive_bind_s: Local error (-2)
	additional info: SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure.  Minor code may provide more information (No Kerberos credentials available)


Actual results:
ldapsearch fails

Expected results:
ldapsearch should succeed

Additional info:
running 'gssproxy -i -d' does not provide enough debug information to troubleshoot the problem

Comment 1 Ondrej 2015-11-25 11:05:57 UTC
Update: it starts to work if I replace:

   cred_store = keytab:/etc/krb5.test.keytab
with
   cred_store = client_keytab:/etc/krb5.test.keytab


Also note that krb5_principal parameter is still being ignored, i.e. if keytab also contains SPNs, it is quite a big chance it won't work.

Can we fix it?

Comment 2 Robbie Harwood 2016-04-22 16:24:39 UTC
Fixed merged upstream.

Comment 3 Ondrej 2016-05-06 13:23:31 UTC
Ok, will the fix be available in RHEL7 at some stage, too?

Comment 4 Robbie Harwood 2016-05-06 18:03:23 UTC
(In reply to Ondrej from comment #3)
> Ok, will the fix be available in RHEL7 at some stage, too?

Hopefully.  We're not sure when yet.

Comment 8 Kaleem 2016-09-21 05:30:33 UTC
krb5_principal option still not working, hence marking as FailedQA.

[root@dhcp207-130 ~]# rpm -q gssproxy
gssproxy-0.4.1-13.el7.x86_64
[root@dhcp207-130 ~]# 

Please find the attached file for verification steps with console output for reference.

Comment 12 Abhijeet Kasurde 2017-06-01 10:23:25 UTC
Verified using gssproxy :: gssproxy-0.7.0-3.el7.x86_64

Marking BZ as verified. See attachment for console.log.

Comment 13 Abhijeet Kasurde 2017-06-01 10:24:01 UTC
Created attachment 1284111 [details]
console.log

Comment 14 errata-xmlrpc 2017-08-01 20:55:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2033