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 1363608 - Kra-selftest behavior is not as expected
Summary: Kra-selftest behavior is not as expected
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pki-core
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 7.3
Assignee: Endi Sukma Dewata
QA Contact: Asha Akkiangady
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-03 07:47 UTC by Geetika Kapoor
Modified: 2020-10-04 21:13 UTC (History)
2 users (show)

Fixed In Version: pki-core-10.3.3-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 05:26:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github dogtagpki pki issues 2552 0 None None None 2020-10-04 21:13:47 UTC
Red Hat Product Errata RHBA-2016:2396 0 normal SHIPPED_LIVE pki-core bug fix and enhancement update 2016-11-03 13:55:03 UTC

Description Geetika Kapoor 2016-08-03 07:47:19 UTC
Description of problem:
To test if we try to do find with KRA's CS.cfg  it shows " selftests.container.instance" as KRAPresence and SystemCertsVerification but this is not shown when we do a kra-selftest-find.
Also, in KRA selftest.log it says selftests.container.instance.KRAPresence does not exist which is actually there in CS.cfg .Please refer below cli output's.

[root@pki1 alias]# pki  -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 21080 -n "PKI KRA Administrator for Example.Org" kra-selftest-find
-----------------
1 entries matched
-----------------
  SelfTest ID: KRAPresence
  Enabled at startup: false
  Enabled on demand: true
  Critical on demand: true
----------------------------
Number of entries returned 1
----------------------------
[root@pki1 alias]# pki  -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 21080 -n "PKI KRA Administrator for Example.Org" kra-selftest-run
  Selftest ID: KRAPresence
  Status: PASSED
-------------------
Selftests completed
------------------

Version-Release number of selected component (if applicable):


Build: 10.3.3-3.1.el7

How reproducible:
always

Steps to Reproduce:
Setup:
-----

1. stop the KRA services using systemctl stop pki-tomcatd
2. Make changes in CS.cfg

auths.revocationChecking.enabled=true 
auths.revocationChecking.kra=kra
auths.revocationChecking.bufferSize=50
auths.revocationChecking.unknownStateInterval=0
auths.revocationChecking.validityInterval=120
auths.revocationChecking.url=http://pki1.example.com:20080/ca/ocsp

3. Make changes in server.xml @ /etc/pki/topology-02-KRA/server.xml

4. Import cert to KRA alias dir using:

[root@pki1 ~]# certutil -L -d /var/lib/pki/topology-02-CA/alias -n "ocspSigningCert cert-topology-02-CA CA" -a > ocsp_signing.crt
[root@pki1 ~]# certutil -A -d /var/lib/pki/topology-02-KRA/alias/ -n "ocspSigningCert cert-topology-02-CA CA" -t "C,," -i ocsp_signing.crt

5. Restart the KRA services using systemctl start pki-tomcatd.
==============================================================================
Actual results:

selftest.log:

0.http-bio-21443-exec-17 - [22/Jul/2016:05:02:49 EDT] [20] [1] SelfTestSubsystem:  the self test property name selftests.container.instance.KRAPresence does not exist
0.http-bio-21443-exec-14 - [22/Jul/2016:05:03:00 EDT] [20] [1] KRAPresence:  KRA is present


CS.cfg :

[root@pki1 alias]# grep "selftests.container.instance" /etc/pki/topology-02-KRA/kra/CS.cfg
selftests.container.instance.KRAPresence=com.netscape.cms.selftests.kra.KRAPresence
selftests.container.instance.SystemCertsVerification=com.netscape.cms.selftests.common.SystemCertsVerification

[root@pki1 alias]# grep "selftests.container.instance.KRAPresence" /etc/pki/topology-02-KRA/kra/CS.cfg
selftests.container.instance.KRAPresence=com.netscape.cms.selftests.kra.KRAPresence

Expected results:
 with KRA's CS.cfg  it shows " selftests.container.instance" as KRAPresence and SystemCertsVerification but this is not shown when we do a kra-selftest-find.
Also, in KRA selftest.log it says selftests.container.instance.KRAPresence does not exist which is actually there in CS.cfg 


Additional info:

Comment 3 Matthew Harmsen 2016-08-05 22:23:25 UTC
Upstream ticket:
https://fedorahosted.org/pki/ticket/2432

Comment 4 Endi Sukma Dewata 2016-08-16 00:00:01 UTC
Fixed in master (10.4):
* 6bfee0e46aee93e1255ecb5652d46348557664d5
* 4001335ed5105112c64c433a26272286ecf66196

Just a note, the problem can be reproduced by executing pki kra-selftest-find against a basic KRA installation. It's not necessary to modify the CS.cfg/server.xml or import the OCSP certificate.

Comment 5 Matthew Harmsen 2016-08-23 21:49:41 UTC
The following were checked in to DOGTAG_10_3_RHEL_BRANCH:

commit 561191eacd168ed3b75de0c502ee82a6517f4348
Author: Endi S. Dewata <edewata>
Date:   Tue Aug 16 01:43:36 2016 +0200

    Fixed SelfTestService.findSelfTests().
    
    The SelfTestService.findSelfTests() has been modified to return
    all selftests defined in the CS.cfg.
    
    https://fedorahosted.org/pki/ticket/2432
    (cherry picked from commit 4001335ed5105112c64c433a26272286ecf66196)
    (cherry picked from commit e860276fc5889aae40beda33ea523358fbe76911)

commit 90c6537038caa9a241d1c4123e1a642860a0aa5a
Author: Endi S. Dewata <edewata>
Date:   Tue Aug 16 00:15:15 2016 +0200

    Removed misleading log in SelfTestSubsystem.
    
    To avoid confusion, the isSelfTestCriticalAtStartup() and
    isSelfTestCriticalOnDemand() in SelfTestSubsystem have been
    modified to no longer log an error message if the selftest
    being checked does not exist in the corresponding property
    in CS.cfg.
    
    https://fedorahosted.org/pki/ticket/2432
    (cherry picked from commit 6bfee0e46aee93e1255ecb5652d46348557664d5)
    (cherry picked from commit 422fc92597d80aa115efa59a592fbaf8851b243e)

Comment 7 Geetika Kapoor 2016-09-19 09:21:56 UTC
build: pki-kra-10.3.3-10.el7.noarch

Test case 1: Check the output of kra-selftest-find.

Expected Result : It should return 2 entries based on what is mentioned in CS.cfg. -- PASS


pki -d /tmp/abc -c Secret123 -h `hostname` -p 8080  -n "PKI Administrator for idm.lab.eng.rdu2.redhat.com" kra-selftest-find
WARNING: UNTRUSTED ISSUER encountered on 'CN=nocp30.idm.lab.eng.rdu2.redhat.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,O=EXAMPLE'
Import CA certificate (Y/n)? n
-----------------
2 entries matched
-----------------
  SelfTest ID: KRAPresence
  Enabled at startup: false
  Enabled on demand: true
  Critical on demand: true

  SelfTest ID: SystemCertsVerification
  Enabled at startup: true
  Critical at startup: true
  Enabled on demand: false
----------------------------
Number of entries returned 2
----------------------------

Test Case 2 : Disable on of the "SystemCertsVerification" from CS.cfg.

Expected Result: Works as expected --PASS

pki -d /tmp/abc -c Secret123 -h `hostname` -p 8080  -n "PKI Administrator for idm.lab.eng.rdu2.redhat.com" kra-selftest-show SystemCertsVerification
WARNING: UNTRUSTED ISSUER encountered on 'CN=nocp30.idm.lab.eng.rdu2.redhat.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,O=EXAMPLE'
Import CA certificate (Y/n)? n
----------------------------------
SelfTest "SystemCertsVerification"
----------------------------------
  SelfTest ID: SystemCertsVerification
  Enabled at startup: false
  Enabled on demand: false

pki -d /tmp/abc -c Secret123 -h `hostname` -p 8080  -n "PKI Administrator for idm.lab.eng.rdu2.redhat.com" kra-selftest-find
WARNING: UNTRUSTED ISSUER encountered on 'CN=nocp30.idm.lab.eng.rdu2.redhat.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,O=EXAMPLE'
Import CA certificate (Y/n)? n
-----------------
1 entries matched
-----------------
  SelfTest ID: KRAPresence
  Enabled at startup: false
  Enabled on demand: true
  Critical on demand: true
----------------------------
Number of entries returned 1
----------------------------

Test Case 3 : Disable on of the "KRAPresence" in CS.cfg

<CS.cfg>
CS.cfg :

root@nocp30 externalCA # grep -i "presence" /etc/pki/pki-tomcat/kra/CS.cfg
#selftests.container.instance.KRAPresence=com.netscape.cms.selftests.kra.KRAPresence
#selftests.container.order.onDemand=KRAPresence:critical
#selftests.plugin.KRAPresence.SubId=kra

</CS.cfg>


1. pki -d /tmp/abc -c Secret123 -h `hostname` -p 8080  -n "PKI Administrator for idm.lab.eng.rdu2.redhat.com" kra-selftest-find
WARNING: UNTRUSTED ISSUER encountered on 'CN=nocp30.idm.lab.eng.rdu2.redhat.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,O=EXAMPLE'
Import CA certificate (Y/n)? n
-----------------
1 entries matched
-----------------
  SelfTest ID: KRAPresence
  Enabled at startup: false
  Enabled on demand: true
  Critical on demand: true
----------------------------
Number of entries returned 1
---------------------------

2. pki -d /tmp/abc -c Secret123 -h `hostname` -p 8080  -n "PKI Administrator for idm.lab.eng.rdu2.redhat.com" kra-selftest-find
WARNING: UNTRUSTED ISSUER encountered on 'CN=nocp30.idm.lab.eng.rdu2.redhat.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,O=EXAMPLE'
Import CA certificate (Y/n)? n
-----------------
1 entries matched
-----------------
  SelfTest ID: KRAPresence
  Enabled at startup: false
  Enabled on demand: true
  Critical on demand: true
----------------------------
Number of entries returned 1
---------------------------

3. pki -d /tmp/abc -c Secret123 -h `hostname` -p 8080  -n "PKI Administrator for idm.lab.eng.rdu2.redhat.com" kra-selftest-run
WARNING: UNTRUSTED ISSUER encountered on 'CN=nocp30.idm.lab.eng.rdu2.redhat.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,O=EXAMPLE'
Import CA certificate (Y/n)? n
  Selftest ID: KRAPresence
  Status: PASSED
-------------------
Selftests completed
-------------------

Comment 8 Geetika Kapoor 2016-09-19 09:23:45 UTC
Hello ,

According to my test case 3, if i disable KRAPresence in kra's CS.cfg, how it should behave. Do you think output of the the commands as mentioned in Test case 3 returns the accurate data?

Thanks
Geetika

Comment 9 Endi Sukma Dewata 2016-09-19 15:17:02 UTC
Geetika,

Did you restart Tomcat after changing the CS.cfg? Tomcat should restart, but the PKI subsystem will fail to start if any of the following parameters is missing or blank:
* selftests.container.order.onDemand
* selftests.container.order.startup

So test case #2 & #3 in comment #7 is currently not supported. I'd suggest creating a separate bug to fix this limitation (i.e. PKI server should support running without any selftests).

Comment 10 Geetika Kapoor 2016-09-20 06:18:12 UTC
Sure I'll test test case 1 here and for test case 2 and 3 i'll raise a seperate bug.

Comment 12 errata-xmlrpc 2016-11-04 05:26:38 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://rhn.redhat.com/errata/RHBA-2016-2396.html


Note You need to log in before you can comment on or make changes to this bug.