Repository navigation
Conversation
- Pin basicConstraints, keyUsage and extendedKeyUsage in a CA-controlled section so an issued certificate cannot be a signing certificate. - Request extensions were previously copied verbatim and could replace anything the CA set, so a signing request could choose its own constraints; requests can still supply a subject alternative name. - Show the certificate with its extensions before asking whether to sign it. OpenSSL reads name_opt and cert_opt, so the nameopt and certopt lines were ignored and the prompt showed no extensions. - Add CI tests that run the shipped openssl commands, and a changelog entry. Signed-off-by: Adam360x <Adam.pryor@amd.com>
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
There was a problem hiding this comment.
🟢 Approval recommended
The focused configuration fix prevents requester-controlled signing authority, with regression coverage and no identified blocking issues.
No open issues 🎉
What changed in this PR
Hardens RDC certificate issuance so requests cannot grant themselves certificate-signing authority.
Changes:
- Enforces CA-controlled certificate extensions while preserving requested alternative names.
- Makes signing prompts display extensions and adds regression tests.
- Documents recovery guidance for affected deployments.
| File | Description |
|---|---|
| projects/rdc/tests/ci/test_authentication.py | Tests certificate restrictions, alternative names, TLS usage, and prompts. |
| projects/rdc/CHANGELOG.md | Documents the security fix and recovery steps. |
| projects/rdc/authentication/openssl.cnf | Enforces leaf-certificate restrictions and enables extension display. |
Review effort: Balanced
Motivation
The certificate authority setup in
projects/rdc/authentication(01gen_root_cert.sh,02gen_ssl_artifacts.sh,openssl.cnf) copied every extension of a certificate request into theissued certificate (
copy_extensions = copyall), and the CA set none of its own. A request thatasks for
basicConstraints = CA:TRUEgot a certificate that can sign other certificates. Itsholder could then create client certificates that
rdcdaccepts and server certificates thatrdcitrusts, without the CA operator. RDC has no revocation, so the only remedy for an affecteddeployment is a new root certificate.
The operator could not notice it:
openssl careadsname_optandcert_opt, so thenameoptandcertoptlines were ignored, and the signing prompt showed only the subject and thevalidity dates.
The OpenSSL documentation warns about exactly this setup and gives this fix:
https://docs.openssl.org/3.0/man1/openssl-ca/#warnings
This only affects certificates signed from requests that someone else created. The readme flow,
where the operator creates every key with
02gen_ssl_artifacts.sh, issues normal certificates.Technical Details
copy_extensions = copyandx509_extensions = usr_cert. The new[ usr_cert ]section setsbasicConstraints = critical, CA:FALSE,keyUsage,extendedKeyUsage = serverAuth, clientAuthand the key identifiers.
copyonly adds request extensions the CA has not set, so a request canstill supply its subject alternative names (the shipped request asks for
localhostand*.amd.com).name_opt = ca_defaultandcert_opt = ca_default, so the signing prompt shows the certificatewith its extensions, including the subject alternative names the operator is about to approve.
tests/ci/test_authentication.pyruns the shippedopensslcommands in a temporary CAand answers the prompts like the readme says. It checks that:
CA:TRUEgetsCA:FALSE;It needs only the
opensslcommand, which the RDC CI image has (OpenSSL 3.0.2), and skipswithout it.
people created.
Certificates that are already installed keep working; only future signing changes.
Issue Tracking
No ticket. Found during a security review of RDC.
Test Plan
openssl.cnf(OpenSSL 3.0.2 and 3.6.3) and with develop's.openssl.cnf(shipped commands plus one requestasking for
CA:TRUE). Then run an ASan Debugrdcdin its default mTLS mode and runrdci discoveryagainst it with:Test Result
New tests with this
openssl.cnf: 4 passed on OpenSSL 3.0.2 and 3.6.3.New tests with develop's
openssl.cnf: 3 failed (CA, TLS usage, prompt); the alternative-nametest passes on both.
mTLS runs:
openssl.cnfCA:TRUErequestCA:TRUECA:FALSErdciNo ASan reports.
Pre-commit: all hooks pass.
Submission Checklist