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 1700511 - certmonger local not honoring validity_period in '/etc/certmonger/certmonger.conf
Summary: certmonger local not honoring validity_period in '/etc/certmonger/certmonger....
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: certmonger
Version: 7.6
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1595876 1700520
TreeView+ depends on / blocked
 
Reported: 2019-04-16 18:48 UTC by Pavan
Modified: 2019-05-03 17:09 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-03 17:09:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pavan 2019-04-16 18:48:30 UTC
Description of problem:

On an undercloud SSL enabled Red Hat OpenStack platform, both certmonger local CA cert and undercloud SSL cert managed by certmonger expires in 1 year. Hence, on undercloud SSL cert renewal, the local CA cert also expires at the same time causing openstack services to become unavailable. 

The local CA does not honor changing the validity_period = 1y beyond its default value seen.

undercloud file location - '/etc/certmonger/certmonger.conf'

# This is the certmonger configuration file.  The format is a rather basic
# INI-style file.  See certmonger.conf(5) for notes about individual settings.
# · initial whitespace is ignored
# · whitespace between the key name and "=" is ignored
# · whitespace after "=" is ignored
# · trailing whitespace after values is ignored
# · comments begin with "#"
# · keys and section names are case-sensitive
# · there is no end-of-line continuation
#
# [defaults]
# notification_method = syslog
# notification_destination = daemon.notice
#
# [selfsign]
# validity_period = 1y
#
# [local]
# validity_period = 1y
#


Version-Release number of selected component (if applicable):
Red Hat OpenStack PLatform OSP-13



How reproducible:


Steps to Reproduce:
1. Change [local] validity_period = 3y in /etc/certmonger/certmonger.conf on undercloud node.
2. Deploy undercloud stack
3. Use below command to verify local ca cert expiry date set to 3 years
openssl x509 -in /etc/pki/ca-trust/source/anchors/cm-local-ca.pem -noout -text

Actual results:
local ca cert has expiry period 1 year


Expected results:
local ca cert has expiry period 3 years



Additional info:
Previously verified in RHOSP-13 with core_puddle_version 2019-04-10.1

Comment 3 Rob Crittenden 2019-05-01 19:39:31 UTC
The local CA doesn't use /etc for configuration. It uses configuration on a "per-session" basis and is really intended as a per-user CA for development AFAICT, by the user running certmonger directly. The docs refer to it multiple times as a "toy". The local CA is very much still a work in process though I should point out that upstream is not currently working, and has not worked on this in years.

When running as root certmonger looks for the configuration in /run/certmonger/.config/certmonger/certmonger.conf. So one workaround would be to drop a file in there before starting certmonger for the first time, or removing the local CA, create the file and restart certmonger.

# cat /run/certmonger/.config/certmonger/certmonger.conf
[local]
validity_period = 2y
# systemctl stop certmonger
# rm -f /var/lib/certmonger/local/*
# systemctl start certmonger

To confirm that the cert was issued two years from now:

# openssl pkcs12 -info -in  /var/lib/certmonger/local/creds -nokeys -password pass:'' | openssl x509 -text | grep 'Not After :'
MAC: sha1, Iteration 1
MAC length: 20, salt length: 8
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
Certificate bag
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
            Not After : May  1 19:18:19 2021 GMT


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