Bug 2174489

Summary: katello-certs-check will pass, even if the bundle is expired
Product: Red Hat Satellite Reporter: Waldirio M Pinheiro <wpinheir>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.12.1CC: aganbat, ahumbe, ehelms
Target Milestone: UnspecifiedKeywords: MigratedToJIRA, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-06 16:09:34 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:

Description Waldirio M Pinheiro 2023-03-01 19:07:26 UTC
Description of problem:
We got a situation where the customer has the new bundle, but some certs are still expired. However, the katello-certs-check passed

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

How reproducible:
100%

Steps to Reproduce:
1. Get a bundle with expired cert
2. Run the katello-certs-check against them
3. Run "openssl verify -CAfile ./satellite_cert_bundle.pem sat_cert.pem "

Actual results:
---
$ openssl verify -CAfile ./satellite_cert_bundle.pem sat_cert.pem 
sat_cert.pem: DC = com, DC = emigrant, CN = EmigrantCertAuth
error 10 at 2 depth lookup:certificate has expired
OK
---

---
Executing: katello-certs-check -c "/root/sat_cert/sat_cert.pem" -k "/root/sat_cert/satellite_cert_key.pem" -b "/root/sat_cert/satellite_cert_bundle.pem"
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Checking server certificate encoding: [OK]

Checking expiration of certificate: [OK]

Checking expiration of CA bundle: [OK]

Checking if server certificate has CA:TRUE flag [OK]

Checking for private key passphrase: [OK]

Checking to see if the private key matches the certificate: [OK]

Checking CA bundle against the certificate file: [OK]

Checking CA bundle size: 2
[OK]

Checking Subject Alt Name on certificate [OK]

Checking if any Subject Alt Name on certificate matches the Subject CN
[OK]

Checking Key Usage extension on certificate for Key Encipherment [OK]

Checking for use of shortname as CN
[OK]

Validation succeeded


To install the Red Hat Satellite server with the custom certificates, run:

    satellite-installer --scenario satellite \
                      --certs-server-cert "/root/sat_cert/sat_cert.pem" \
                      --certs-server-key "/root/sat_cert/satellite_cert_key.pem" \
                      --certs-server-ca-cert "/root/sat_cert/satellite_cert_bundle.pem"

To update the certificates on a currently running Red Hat Satellite installation, run:

    satellite-installer --scenario satellite \
                      --certs-server-cert "/root/sat_cert/sat_cert.pem" \
                      --certs-server-key "/root/sat_cert/satellite_cert_key.pem" \
                      --certs-server-ca-cert "/root/sat_cert/satellite_cert_bundle.pem" \
                      --certs-update-server --certs-update-server-ca
---

Expected results:
Once some cert is expired, the katello-certs-check should fail as well.

Additional info:

Comment 1 Eric Helms 2023-03-02 18:16:19 UTC
Openssl does not natively support reporting the expiration date of all found certificates in a bundle. We'd have to read in the file and split it based on the headers and then pass each split out certificate file to openssl to collect all expiration dates present.

Comment 2 Eric Helms 2024-05-30 12:42:01 UTC
*** Bug 2280065 has been marked as a duplicate of this bug. ***

Comment 3 Eric Helms 2024-06-06 16:09:34 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.