Skip to content

feat(pki): subordinate CA, agent trust updates and CA rotation - #217

Merged
eniac111 merged 2 commits into
masterfrom
feat/subordinate-ca
Nov 12, 2026
Merged

eniac111 merged 2 commits into
masterfrom
feat/subordinate-ca

Conversation

@eniac111

Copy link
Copy Markdown
Member

Run the Bor CA as a subordinate of an external certificate authority:

  • The CA certificate file may hold a chain: the signing certificate first, then its issuers up to a self-signed root. The chain is validated at startup (key match, CA flag, key usage, extended key usage, key strength, path length, name constraints).
  • Agent certificates are verified against the Bor signing certificate only. Before, every certificate in the CA file was trusted for client authentication, so a chain in the file let any CA under the same root issue agent certificates.
  • The auto-generated server certificate is served with the signing certificate and the intermediates.
  • New commands: bor-server ca csr | import | status. The CA key is created on the server (or the PKCS#11 token) and never leaves it. A certificate for the same key and subject replaces the CA certificate in place without re-enrolling agents.
  • New setting ca.agent_trust (BOR_CA_AGENT_TRUST): signing (default) or chain.

Keep the CA certificates of enrolled agents current: an agent reports the fingerprint of its CA file with every heartbeat and the server answers with the certificates to trust when they differ. The agent reads its CA file and its own certificate again for every connection.

Add the mechanism for replacing the CA with one that has a new key (stage, activate, retire), exposed to extension modules through pkg/ext together with CA status, signing request and install. The server asks agents holding a certificate of a replaced CA to renew. Migration 000047 records per node which CA certificates it trusts and which CA issued its certificate.

Settings panels of extension modules can return a document to copy or download.

An operator-supplied CA with a key below RSA 3072 or ECDSA P-256 now stops the server at startup.

Closes #215

Run the Bor CA as a subordinate of an external certificate authority:

- The CA certificate file may hold a chain: the signing certificate
  first, then its issuers up to a self-signed root. The chain is
  validated at startup (key match, CA flag, key usage, extended key
  usage, key strength, path length, name constraints).
- Agent certificates are verified against the Bor signing certificate
  only. Before, every certificate in the CA file was trusted for client
  authentication, so a chain in the file let any CA under the same root
  issue agent certificates.
- The auto-generated server certificate is served with the signing
  certificate and the intermediates.
- New commands: bor-server ca csr | import | status. The CA key is
  created on the server (or the PKCS#11 token) and never leaves it. A
  certificate for the same key and subject replaces the CA certificate
  in place without re-enrolling agents.
- New setting ca.agent_trust (BOR_CA_AGENT_TRUST): signing (default) or
  chain.

Keep the CA certificates of enrolled agents current: an agent reports
the fingerprint of its CA file with every heartbeat and the server
answers with the certificates to trust when they differ. The agent
reads its CA file and its own certificate again for every connection.

Add the mechanism for replacing the CA with one that has a new key
(stage, activate, retire), exposed to extension modules through
pkg/ext together with CA status, signing request and install. The
server asks agents holding a certificate of a replaced CA to renew.
Migration 000047 records per node which CA certificates it trusts and
which CA issued its certificate.

Settings panels of extension modules can return a document to copy or
download.

An operator-supplied CA with a key below RSA 3072 or ECDSA P-256 now
stops the server at startup.

Closes #215
…tificates

The agent reads its CA certificate file again for every connection, so
it follows a replacement of the server's CA. This was done by switching
the built-in verification off and verifying in a VerifyConnection
callback, which code scanning reports as a disabled certificate check.

Use transport credentials that load the root CAs from the file for each
handshake and run the regular crypto/tls handshake with them instead.
The certificate chain and server name are verified by crypto/tls again;
no hand-written verification remains.
@eniac111
eniac111 merged commit e5ac327 into master Nov 12, 2026
35 checks passed
@eniac111
eniac111 deleted the feat/subordinate-ca branch November 12, 2026 00:21
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support running the Bor CA as a subordinate of an external certificate authority

2 participants