Uh oh!
There was an error while loading. Please reload this page.
Add optional root CA signature verification for client, server and management certificates - #13787
Open
Damans227 wants to merge 1 commit into
Open
Add optional root CA signature verification for client, server and management certificates#13787Damans227 wants to merge 1 commit into
Damans227 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #13787 +/- ##
=========================================
Coverage 19.65% 19.65% - Complexity 19792 19808 +16
=========================================
Files 6368 6368 Lines 574881 574942 +61 Branches 70351 70368 +17 =========================================
+ Hits 112970 113029 +59 + Misses 449639 449635 -4 - Partials 12272 12278 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The root-ca plugin never checked that certificates were actually signed by the CloudStack root CA.
checkClientTrusted()checked revocation, validity and SAN, but not the signature.checkServerTrusted()did nothing at all, so any server certificate was trusted.isManagementCertificate()trusted any cert with the right SAN, signed or not.This adds the missing signature check to all three, checked against every CA in the configured chain (so CA rotation still works). It's controlled by a new config key,
ca.plugin.root.ca.signature.verification, off by default so upgrades are a no-op.For
checkClientTrusted/checkServerTrusted, this follows the same pattern as the plugin's other checks: it only actually rejects a bad cert whenca.plugin.root.auth.strictnessis alsotrue. Otherwise it just logs.isManagementCertificatealways enforces it once enabled, since it's not part of that strict/non-strict handshake logic.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
Added unit tests for valid certs, certs signed by a rogue CA, certs signed by a non-primary CA in a rotated chain, and the no-CA-available case, in both strict and non-strict mode, across all three checks.
How did you try to break this feature and the system with this change?
Checked the flag defaults to off so nothing changes for existing deployments. Checked a cert signed by a different CA gets rejected once both flags are on. Checked CA rotation still works. Checked the missing-CA case doesn't throw an unhandled exception mid-handshake.