Bug 1497920
| Summary: | CMC: Missing CN causing NPE in CMCAuth | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Geetika Kapoor <gkapoor> | ||||
| Component: | pki-core | Assignee: | Christina Fu <cfu> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Asha Akkiangady <aakkiang> | ||||
| Severity: | unspecified | Docs Contact: | Marc Muehlfeld <mmuehlfe> | ||||
| Priority: | unspecified | ||||||
| Version: | 7.4 | CC: | cfu, mharmsen | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | pki-core-10.5.1-1.el7 | Doc Type: | No Doc Update | ||||
| Doc Text: |
See BZ#1474658
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2018-04-10 17:01:25 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: |
|
||||||
Test Case 2: I tried to add this certificate as part of CA's Agent group using: pki -d . -c SECret.123 -n "PKI CA Administrator" ca-user-cert-add test108 --serial 0x1f6fd129 pki -d . -c SECret.123 -n "PKI CA Administrator" ca-group-member-add "Certificate Manager Agents" test108 pki -d . -c SECret.123 -n "PKI CA Administrator" ca-group-member-find "Certificate Manager Agents" ----------------- 3 entries matched ----------------- User: caadmin User: pkidbuser User: test108 ---------------------------- Number of entries returned 3 ---------------------------- Later I execute the same test for SubCA i got a NUllPointerException: <Debug logs> [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: authenticated uid=test108,ou=people,o=rhcs-0day-CA [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: CMCAuth: java.lang.NullPointerException [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: SignedAuditEventFactory: create() message created for eventType=CMC_SIGNED_REQUEST_SIG_VERIFY [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: SignedAuditEventFactory: create() message created for eventType=CMC_SIGNED_REQUEST_SIG_VERIFY [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: ProfileSubmitCMCServlet: authenticate: Invalid Credential. [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: SignedAuditEventFactory: create() message created for eventType=AUTH_FAIL [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: CMCOutputTemplate: getContentInfo: begins [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: CMCOutputTemplate: getContentInfo: - done [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: ProfileSubmitCMCServlet: authentication error Invalid Credential. [03/Oct/2017:02:56:53][http-bio-8443-exec-10]: CMSServlet: curDate=Tue Oct 03 02:56:53 EDT 2017 id=caProfileSubmitCMCFull time=25 </debug logs> Created attachment 1333512 [details]
config_files
The following are results of my investigation. for the initially reported issue, there is adequate info in the debug log: [11/Oct/2017:14:04:31][http-bio-8443-exec-22]: CertUserDBAuthentication: cannot map certificate to any userUser not found [11/Oct/2017:14:04:31][http-bio-8443-exec-22]: CMCAuth: Invalid Credential. [11/Oct/2017:14:04:31][http-bio-8443-exec-22]: SignedAuditLogger: event CMC_SIGNED_REQUEST_SIG_VERIFY [11/Oct/2017:14:04:31][http-bio-8443-exec-22]: SignedAuditLogger: event CMC_SIGNED_REQUEST_SIG_VERIFY For the issue reported in comment #2 on NPE for once a user cert is added to agent group, I was able to reproduce the issue, so this needs to be fixed. I think it has the same issue as the one reported earlier on user signed CMC auth for "missing CN". pushed to master https://pagure.io/dogtagpki/issue/2834#comment-473814 This works as expected.Moving this bugzilla to verified. 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-2018:0925 |
Description of problem: Looking for better logging for detecting issue faster.Audit and debug doesn't have much information to troubleshoot the issue. As a user they mind need it. 1. If we are trying to sign a SubCA certificate using a non Agent certificate it fails with <debug logs> [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: ProfileSubmitCMCServlet: authenticate: Invalid Credential. [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: SignedAuditEventFactory: create() message created for eventType=AUTH_FAIL </debug logs> 2. Audit logs doesn't provide exact failure reason: <audit logs> 0.http-bio-8443-exec-19 - [03/Oct/2017:02:24:22 EDT] [14] [6] [AuditEvent=ACCESS_SESSION_ESTABLISH_SUCCESS][ClientIP=10.12.28.208][ServerIP=10.12.28.208][SubjectID=UID=testing,E=Geetikakk,OU=Test2,C=IN][Outcome=Success] access session establish success 0.http-bio-8443-exec-19 - [03/Oct/2017:02:24:22 EDT] [14] [6] [AuditEvent=CMC_SIGNED_REQUEST_SIG_VERIFY][SubjectID=$NonRoleUser$][Outcome=Failure][ReqType=$Unidentified$][CertSubject=$Unidentified$][SignerInfo=$Unidentified$] agent pre-approved CMC request signature verification 0.http-bio-8443-exec-19 - [03/Oct/2017:02:24:22 EDT] [14] [6] [AuditEvent=CMC_SIGNED_REQUEST_SIG_VERIFY][SubjectID=$NonRoleUser$][Outcome=Failure][ReqType=$Unidentified$][CertSubject=$Unidentified$][SignerInfo=$Unidentified$] agent pre-approved CMC request signature verification 0.http-bio-8443-exec-19 - [03/Oct/2017:02:24:22 EDT] [14] [6] [AuditEvent=AUTH_FAIL][SubjectID=null][Outcome=Failure][AuthMgr=CMCAuth][AttemptedCred=null] authentication failure </audit logs> Version-Release number of selected component (if applicable): rpm -qa pki-ca pki-ca-10.4.1-15.el7_4.noarch How reproducible: always Steps to Reproduce: 1.Try to sign a SubCA certificate with a user certificate 2. 3. Actual results: Reason of failure is never listed in logs. Expected results: Reason should be visible in logs . example: user certificate not have permissions to sign a subCA certificate Additional info: Debug logs with user certificate: ================================= [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: CertUserDBAuthentication: cannot map certificate to any userUser not found [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: CMCAuth: Invalid Credential. [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: SignedAuditEventFactory: create() message created for eventType=CMC_SIGNED_REQUEST_SIG_VERIFY [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: SignedAuditEventFactory: create() message created for eventType=CMC_SIGNED_REQUEST_SIG_VERIFY [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: ProfileSubmitCMCServlet: authenticate: Invalid Credential. [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: SignedAuditEventFactory: create() message created for eventType=AUTH_FAIL [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: CMCOutputTemplate: getContentInfo: begins [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: CMCOutputTemplate: getContentInfo: - done [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: ProfileSubmitCMCServlet: authentication error Invalid Credential. [03/Oct/2017:02:29:50][http-bio-8443-exec-23]: CMSServlet: curDate=Tue Oct 03 02:29:50 EDT 2017 id=caProfileSubmitCMCFull time=26 Debug logs with CA certificate: =============================== [03/Oct/2017:02:34:54][http-bio-8443-exec-18]: SignedAuditEventFactory: create() message created for eventType=CMC_SIGNED_REQUEST_SIG_VERIFY [03/Oct/2017:02:34:54][http-bio-8443-exec-18]: ProfileSubmitCMCServlet: authenticate: setting auditSubjectID in SessionContext:caadmin [03/Oct/2017:02:34:54][http-bio-8443-exec-18]: SignedAuditEventFactory: create() message created for eventType=AUTH_SUCCESS [03/Oct/2017:02:34:54][http-bio-8443-exec-18]: ProfileSubmitCMCServlet authToken not null [03/Oct/2017:02:34:54][http-bio-8443-exec-18]: CMSServlet: in auditSubjectID [03/Oct/2017:02:34:54][http-bio-8443-exec-18]: CMSServlet: auditSubjectID auditContext {sslClientCertProvider=com.netscape.cms.servlet.profile.SSLClientCertProvider@328ac2ac, userid=caadmin,