Skip to content

feat: auto-renew KMIP server TLS certificates - #14

Open
bernie-g wants to merge 4 commits into
masterfrom
bernie/kms-24-add-auto-renewal-of-kmip-server-certificates
Open

feat: auto-renew KMIP server TLS certificates#14
bernie-g wants to merge 4 commits into
masterfrom
bernie/kms-24-add-auto-renewal-of-kmip-server-certificates

Conversation

@bernie-g

@bernie-g bernie-g commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

KMIP servers now renew their TLS certificates automatically in the background, so new certificates are picked up without a restart or dropped connections. On auth failure the new RefreshAccessToken callback lets the CLI re-authenticate (companions: Infisical/cli#354, Infisical/infisical#7542).

Certificate material now lives in an atomically-swapped snapshot served
per handshake via GetConfigForClient. A background loop renews the
certificate at 2/3 of its lifetime, keeps serving the old certificate
and retries with backoff on failure (capped at 1m once expired), and on
401/403 invokes the new RefreshAccessToken callback so AWS-enrolled
servers can re-authenticate.
@infisical-review-police

Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-infisical-kmip-14-feat-auto-renew-kmip-server-tls-certificates

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

@linear

linear Bot commented Aug 5, 2026

Copy link
Copy Markdown

KMS-24

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds automatic KMIP TLS certificate renewal using atomically swapped certificate snapshots, per-handshake TLS configuration, retry backoff, and optional access-token refresh.

  • Moves certificate, private-key, client-CA, and serial material into certState.
  • Adds background renewal scheduling and failure retry behavior.
  • Makes request handlers obtain the current certificate serial and access token safely.
  • Adds renewal-specific API signaling and authentication-error handling.

Confidence Score: 4/5

The invalid-renewal snapshot issue must be fixed before merging because a malformed certificate/key pair can replace the working TLS state and prevent new connections.

Certificate and key material are parsed independently and atomically published without proving they form a valid pair, allowing a renewal response that should be rejected to disable future TLS handshakes.

Files Needing Attention: kmip.go

Important Files Changed

Filename Overview
kmip.go Implements certificate fetching, atomic renewal, dynamic TLS configuration, and token-refresh retries; renewal can replace a working snapshot with a mismatched certificate/key pair.
server.go Adds synchronized token access, atomic certificate-state storage, and dynamic serial-number headers without a separate identified defect.

Reviews (1): Last reviewed commit: "feat: auto-renew server TLS certificates..." | Re-trigger Greptile

Comment thread kmip.go
Comment thread kmip.go Outdated
Comment thread kmip.go Outdated
Comment thread kmip.go Outdated
Comment thread kmip.go Outdated
The platform now logs a dedicated kmip-server-connect audit event, so
the daemon no longer reports renewal status.
Floor the wait between renewals at one minute so an already-past
renewal point cannot trigger back-to-back issuance, bound the
certificate fetch with a 60s timeout so a hung API call fails into the
retry cycle instead of stalling renewal, round the expires-in log to
seconds, and restore a truncated comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants