Skip to content

feat(kmip): kmip auto cert renewal - #7542

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

feat(kmip): kmip auto cert renewal#7542
bernie-g wants to merge 9 commits into
mainfrom
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

Context

KMIP servers now auto-renew their TLS certificates (Infisical/infisical-kmip#14, Infisical/cli#354): this adds an isRenewal flag to the register-kmip-server audit log, makes Certificate TTL optional in the UI, and updates the docs accordingly. Tested E2E locally.

Type

  • Feature

KMIP servers now auto-renew their TLS certificates (see
infisical-kmip). /kmip/servers/connect accepts an isRenewal query flag
recorded in the register-kmip-server audit metadata so renewals are
distinguishable from first-time connects. Certificate TTL becomes
optional in the deploy and edit modals (server default 1y), and the
stale restart-to-apply copy and docs now describe renewal semantics.
@mintlify

mintlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
infisical 🟢 Ready View Preview Aug 5, 2026, 6:34 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@linear

linear Bot commented Aug 5, 2026

Copy link
Copy Markdown

KMS-24

@infisical-review-police

Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-infisical-7542-feat-kmip-renewal-audit-flag-optional-certificate-ttl-d

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3fb98017c0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread backend/src/ee/routes/v1/kmip-server-router.ts Outdated
@veria-ai

veria-ai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 2 · PR risk: 0/10

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds renewal context to KMIP connect audit events, allows certificate TTL to be omitted in the UI, and documents automatic certificate renewal.

  • Adds the isRenewal query flag and corresponding audit metadata.
  • Makes TTL blankable in KMIP create and certificate-edit forms.
  • Updates UI and documentation with renewal timing, retry, and recovery behavior.

Confidence Score: 4/5

The edit-modal TTL reset behavior should be fixed before merging because clearing a custom TTL reports success without applying the documented default.

Server creation correctly defaults an omitted TTL to one year, but the edit path omits a cleared TTL from its PATCH request and therefore leaves the previous stored value and renewal behavior unchanged.

Files Needing Attention: frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx

Important Files Changed

Filename Overview
backend/src/ee/routes/v1/kmip-server-router.ts Adds validated renewal audit metadata and retains the existing one-year fallback for certificate issuance.
backend/src/ee/services/audit-log/audit-log-types.ts Extends KMIP registration audit metadata with an optional renewal marker.
frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx Makes TTL blankable, but clearing an existing custom value silently preserves it instead of resetting to the default.
frontend/src/pages/organization/KmipServersPage/components/components/KmipServerDeployModal.tsx Omits blank TTL values during creation, allowing the backend create schema to apply its one-year default.
docs/documentation/platform/kms/kmip.mdx Documents optional TTLs, automatic renewal scheduling, retries, and revoked-access recovery.
docs/cli/commands/kmip.mdx Updates CLI guidance to describe automatic renewal and when configuration changes take effect.

Reviews (1): Last reviewed commit: "feat(kmip): audit flag for certificate r..." | Re-trigger Greptile

PATCH /kmip/servers/:id now accepts ttl: null to clear a stored custom
TTL, and the edit modal sends null when the field is blanked, so
renewals fall back to the 1y default instead of silently keeping the
old value.
Comment thread docs/documentation/platform/kms/kmip.mdx Outdated
Comment thread backend/src/ee/routes/v1/kmip-server-router.ts Outdated
Comment thread backend/src/ee/routes/v1/kmip-server-router.ts Outdated
@bernie-g bernie-g changed the title feat(kmip): renewal audit flag, optional certificate TTL, docs feat(kmip): kmip auto cert renewal Aug 7, 2026
With auto-renewal the TTL is an internal detail, matching how gateway
certificates work (hardcoded lifetime, no UI knob). Servers get the 1y
default; a custom ttl can still be set via the API. Also guard the ttl
validator against ms() throwing on unparseable input like an empty
string, which previously surfaced a broken 400.
/connect now logs its own kmip-server-connect event instead of reusing
register-kmip-server with a client-reported isRenewal flag; the flag,
its query param, and the metadata field are removed. Docs trimmed to a
Renewal Failures troubleshooting section since the happy path needs no
explanation.
ms() reads "1m" as one minute, the natural typo for one month, which
would leave the server reissuing its certificate every minute forever.
Reject sub-hour TTLs with a message naming the floor.
The 1 hour floor was only enforced on input, so a server configured before
it existed keeps its old value. The daemon would then be handed a
certificate it spends the rest of its life reissuing, which is exactly the
"1m" case the floor was added for.

Check the resolved TTL in the connect handler too, and name the offending
value so the operator knows what to change.
The floor was checked per route, which missed the legacy registration path:
it validated only ms(val) > 0, so "1m" reached certificate issuance there
even after the enrollment path was fixed.

Move the check into registerServer, which both callers go through, and
raise the legacy route's own validation to the same floor.

Reject rather than clamp. Silently raising the value leaves the stored
config wrong and the operator never learns the certificate they get is not
the one they asked for.

Also handle unparseable input: ms() returns undefined rather than throwing,
and NaN comparisons are always false, so garbage previously slipped past the
floor and failed later as a 500.
Keeps why the TTL check throws instead of clamping, that ms() returns
undefined rather than throwing, and why the floor sits at issuance. Drops the
surrounding restatement of the code.
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.

3 participants