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 1940261 - [RFE] Include certificate NotBefore date in output of the 'getcert list' command
Summary: [RFE] Include certificate NotBefore date in output of the 'getcert list' command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: certmonger
Version: 8.3
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks: 1978383
TreeView+ depends on / blocked
 
Reported: 2021-03-18 00:21 UTC by Marco Rhodes
Modified: 2022-05-10 14:01 UTC (History)
10 users (show)

Fixed In Version: certmonger-0.79.13-4.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1978383 (view as bug list)
Environment:
Last Closed: 2022-05-10 13:38:10 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-7044 0 None None None 2021-10-06 14:37:18 UTC
Red Hat Product Errata RHBA-2022:1789 0 None None None 2022-05-10 13:38:20 UTC

Description Marco Rhodes 2021-03-18 00:21:00 UTC
Description of problem:
The 'getcert list' command displays the 'NotAfter' date of tracked certificates, but omits the 'NotBefore' date that indicates when the certificates became valid for use. 
Including the NotBefore date in the command output will be beneficial for administrative and troubleshooting purposes. 

How reproducible:
Always

Steps to Reproduce:
1. Root user runs the 'getcert list' command.

Actual results (example):

Request ID '20200930052944':
	status: MONITORING
	stuck: no
	key pair storage: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='ocspSigningCert cert-pki-ca',token='NSS Certificate DB',pin set
	certificate: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='ocspSigningCert cert-pki-ca',token='NSS Certificate DB'
	CA: dogtag-ipa-ca-renew-agent
	issuer: CN=Certificate Authority,O=IPA.CORP.EXAMPLE.COM
	subject: CN=OCSP Subsystem,O=IPA.CORP.EXAMPLE.COM
	expires: 2021-11-23 18:19:33 UTC
	eku: id-kp-OCSPSigning
	pre-save command: /usr/libexec/ipa/certmonger/stop_pkicad
	post-save command: /usr/libexec/ipa/certmonger/renew_ca_cert "ocspSigningCert cert-pki-ca"
	track: yes
	auto-renew: yes


Proposed output (example):

Request ID '20200930052944':
	status: MONITORING
	stuck: no
	key pair storage: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='ocspSigningCert cert-pki-ca',token='NSS Certificate DB',pin set
	certificate: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='ocspSigningCert cert-pki-ca',token='NSS Certificate DB'
	CA: dogtag-ipa-ca-renew-agent
	issuer: CN=Certificate Authority,O=IPA.CORP.EXAMPLE.COM
	subject: CN=OCSP Subsystem,O=IPA.CORP.EXAMPLE.COM
        valid from: 2019-11-21 18:19:33 UTC
	expires: 2021-11-23 18:19:33 UTC
	eku: id-kp-OCSPSigning
	pre-save command: /usr/libexec/ipa/certmonger/stop_pkicad
	post-save command: /usr/libexec/ipa/certmonger/renew_ca_cert "ocspSigningCert cert-pki-ca"
	track: yes
	auto-renew: yes


Additional info:

Comment 2 Marc Sauton 2021-03-18 18:41:03 UTC
to set the system clock back to when the certificates were valid, 1 day before expiration

for nickname in "auditSigningCert cert-pki-ca" "ocspSigningCert cert-pki-ca" "subsystemCert cert-pki-ca" "Server-Cert cert-pki-ca"; do
  certdate=$(date -d "`certutil -L -d /etc/pki/pki-tomcat/alias -n "${nickname}" | grep -i after | cut -d: -f2-`" +%s )
  echo "$nickname - $certdate"
  [[ ${newdate:-99999999999} -gt "${certdate}" ]] && newdate=$certdate
done
date --set="`date --date=@$[newdate - 86400]`"

Comment 7 Rob Crittenden 2021-08-03 15:12:25 UTC
Test automation in ipa
master:
https://pagure.io/freeipa/c/3272780439a579f5bfa6a609aa3c5094764c4109

Comment 8 Florence Blanc-Renaud 2021-08-04 06:45:31 UTC
Test automation in ipa
ipa-4-9:
https://pagure.io/freeipa/c/826b5825bd644fc69a9bee17626d71fe03cc0190

Comment 9 Rob Crittenden 2021-08-04 12:37:28 UTC
Kaleem, how do we want to coordinate the automated test changes that will be in ipa? Do we need a separate BZ for those?

Comment 10 Kaleem 2021-08-09 05:53:12 UTC
(In reply to Rob Crittenden from comment #9)
> Kaleem, how do we want to coordinate the automated test changes that will be
> in ipa? Do we need a separate BZ for those?

automated test will come as part of rebase in 8.6, so we do not need a separate bz for that.

Comment 13 Mohammad Rizwan 2021-11-25 06:47:29 UTC
version:
certmonger-0.79.13-5.el8.x86_64

[root@master ~]# getcert list 
Number of certificates and requests being tracked: 9.
Request ID '20211125062519':
	status: MONITORING
	stuck: no
	key pair storage: type=FILE,location='/var/lib/ipa/ra-agent.key'
	certificate: type=FILE,location='/var/lib/ipa/ra-agent.pem'
	CA: dogtag-ipa-ca-renew-agent
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=IPA RA,O=TESTRELM.TEST
	issued: 2021-11-25 01:25:19 EST
	expires: 2023-11-15 01:25:19 EST
	key usage: digitalSignature,keyEncipherment,dataEncipherment
	eku: id-kp-clientAuth
	profile: caSubsystemCert
	pre-save command: /usr/libexec/ipa/certmonger/renew_ra_cert_pre
	post-save command: /usr/libexec/ipa/certmonger/renew_ra_cert
	track: yes
	auto-renew: yes
Request ID '20211125062524':
	status: MONITORING
	stuck: no
	key pair storage: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='auditSigningCert cert-pki-ca',token='NSS Certificate DB',pin set
	certificate: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='auditSigningCert cert-pki-ca',token='NSS Certificate DB'
	CA: dogtag-ipa-ca-renew-agent
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=CA Audit,O=TESTRELM.TEST
	issued: 2021-11-25 01:24:04 EST
	expires: 2023-11-15 01:24:04 EST
	key usage: digitalSignature,nonRepudiation
	profile: caSignedLogCert
	pre-save command: /usr/libexec/ipa/certmonger/stop_pkicad
	post-save command: /usr/libexec/ipa/certmonger/renew_ca_cert "auditSigningCert cert-pki-ca"
	track: yes
	auto-renew: yes
Request ID '20211125062526':
	status: MONITORING
	stuck: no
	key pair storage: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='ocspSigningCert cert-pki-ca',token='NSS Certificate DB',pin set
	certificate: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='ocspSigningCert cert-pki-ca',token='NSS Certificate DB'
	CA: dogtag-ipa-ca-renew-agent
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=OCSP Subsystem,O=TESTRELM.TEST
	issued: 2021-11-25 01:24:01 EST
	expires: 2023-11-15 01:24:01 EST
	eku: id-kp-OCSPSigning
	profile: caOCSPCert
	pre-save command: /usr/libexec/ipa/certmonger/stop_pkicad
	post-save command: /usr/libexec/ipa/certmonger/renew_ca_cert "ocspSigningCert cert-pki-ca"
	track: yes
	auto-renew: yes
Request ID '20211125062527':
	status: MONITORING
	stuck: no
	key pair storage: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='subsystemCert cert-pki-ca',token='NSS Certificate DB',pin set
	certificate: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='subsystemCert cert-pki-ca',token='NSS Certificate DB'
	CA: dogtag-ipa-ca-renew-agent
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=CA Subsystem,O=TESTRELM.TEST
	issued: 2021-11-25 01:24:03 EST
	expires: 2023-11-15 01:24:03 EST
	key usage: digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment
	eku: id-kp-clientAuth
	profile: caSubsystemCert
	pre-save command: /usr/libexec/ipa/certmonger/stop_pkicad
	post-save command: /usr/libexec/ipa/certmonger/renew_ca_cert "subsystemCert cert-pki-ca"
	track: yes
	auto-renew: yes
Request ID '20211125062528':
	status: MONITORING
	stuck: no
	key pair storage: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='caSigningCert cert-pki-ca',token='NSS Certificate DB',pin set
	certificate: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='caSigningCert cert-pki-ca',token='NSS Certificate DB'
	CA: dogtag-ipa-ca-renew-agent
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=Certificate Authority,O=TESTRELM.TEST
	issued: 2021-11-25 01:23:58 EST
	expires: 2041-11-25 01:23:58 EST
	key usage: digitalSignature,nonRepudiation,keyCertSign,cRLSign
	profile: caCACert
	pre-save command: /usr/libexec/ipa/certmonger/stop_pkicad
	post-save command: /usr/libexec/ipa/certmonger/renew_ca_cert "caSigningCert cert-pki-ca"
	track: yes
	auto-renew: yes
Request ID '20211125062529':
	status: MONITORING
	stuck: no
	key pair storage: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='Server-Cert cert-pki-ca',token='NSS Certificate DB',pin set
	certificate: type=NSSDB,location='/etc/pki/pki-tomcat/alias',nickname='Server-Cert cert-pki-ca',token='NSS Certificate DB'
	CA: dogtag-ipa-ca-renew-agent
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=master.testrelm.test,O=TESTRELM.TEST
	issued: 2021-11-25 01:24:01 EST
	expires: 2023-11-15 01:24:01 EST
	dns: master.testrelm.test
	key usage: digitalSignature,keyEncipherment,dataEncipherment
	eku: id-kp-serverAuth
	profile: caServerCert
	pre-save command: /usr/libexec/ipa/certmonger/stop_pkicad
	post-save command: /usr/libexec/ipa/certmonger/renew_ca_cert "Server-Cert cert-pki-ca"
	track: yes
	auto-renew: yes
Request ID '20211125062533':
	status: MONITORING
	stuck: no
	key pair storage: type=NSSDB,location='/etc/dirsrv/slapd-TESTRELM-TEST',nickname='Server-Cert',token='NSS Certificate DB',pinfile='/etc/dirsrv/slapd-TESTRELM-TEST/pwdfile.txt'
	certificate: type=NSSDB,location='/etc/dirsrv/slapd-TESTRELM-TEST',nickname='Server-Cert',token='NSS Certificate DB'
	CA: IPA
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=master.testrelm.test,O=TESTRELM.TEST
	issued: 2021-11-25 01:25:42 EST                    <<<<<<<<<<<<<<<<
	expires: 2023-11-26 01:25:42 EST
	dns: master.testrelm.test
	principal name: ldap/master.testrelm.test
	key usage: digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment
	eku: id-kp-serverAuth,id-kp-clientAuth
	profile: caIPAserviceCert
	pre-save command: 
	post-save command: /usr/libexec/ipa/certmonger/restart_dirsrv TESTRELM-TEST
	track: yes
	auto-renew: yes
Request ID '20211125062616':
	status: MONITORING
	stuck: no
	key pair storage: type=FILE,location='/var/lib/ipa/private/httpd.key',pinfile='/var/lib/ipa/passwds/master.testrelm.test-443-RSA'
	certificate: type=FILE,location='/var/lib/ipa/certs/httpd.crt'
	CA: IPA
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=master.testrelm.test,O=TESTRELM.TEST
	issued: 2021-11-25 01:26:16 EST                       <<<<<<<<<<<<<<<<
	expires: 2023-11-26 01:26:16 EST
	dns: master.testrelm.test,ipa-ca.testrelm.test
	principal name: HTTP/master.testrelm.test
	key usage: digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment
	eku: id-kp-serverAuth,id-kp-clientAuth
	profile: caIPAserviceCert
	pre-save command: 
	post-save command: /usr/libexec/ipa/certmonger/restart_httpd
	track: yes
	auto-renew: yes
Request ID '20211125062623':
	status: MONITORING
	stuck: no
	key pair storage: type=FILE,location='/var/kerberos/krb5kdc/kdc.key'
	certificate: type=FILE,location='/var/kerberos/krb5kdc/kdc.crt'
	CA: IPA
	issuer: CN=Certificate Authority,O=TESTRELM.TEST
	subject: CN=master.testrelm.test,O=TESTRELM.TEST
	issued: 2021-11-25 01:26:23 EST                       <<<<<<<<<<<<<<<<
	expires: 2023-11-26 01:26:23 EST
	dns: master.testrelm.test
	principal name: krbtgt/TESTRELM.TEST
	key usage: digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment
	eku: id-kp-serverAuth,id-pkinit-KPKdc
	profile: KDCs_PKINIT_Certs
	pre-save command: 
	post-save command: /usr/libexec/ipa/certmonger/renew_kdc_cert
	track: yes
	auto-renew: yes


As we can see, issued is mentioned in getccert list output. Hence marking the bug as verified.

Comment 19 errata-xmlrpc 2022-05-10 13:38:10 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 (certmonger bug fix and enhancement update), 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-2022:1789


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