Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Merge remote-tracking branch 'origin/main' into PKI-373
Carlos Monastyrskifcc470cb7902
diff --cc backend/src/services/pki-sync/pki-sync-service.tsindex c48b5315a5,4f1cda96fc..9a13f3320b--- a/backend/src/services/pki-sync/pki-sync-service.ts+++ b/backend/src/services/pki-sync/pki-sync-service.ts@@@ -596,42 -561,22 +597,56 @@@ export const pkiSyncServiceFactory = (}}++ // main's per-destination merge hook; a passthrough for every destination except GCP+ const resolvedDestinationConfig = destinationConfig+ ? resolvePkiSyncDestinationConfigUpdate(+ pkiSync.destination as PkiSync,+ pkiSync.destinationConfig ?? {},+ destinationConfig+ )+ : undefined;+- let effectiveConnection: { gatewayId?: string | null; gatewayPoolId?: string | null } | undefined;- if (connectionId && connectionId !== pkiSync.connectionId) {- const destinationApp = getDestinationAppType(pkiSync.destination);- effectiveConnection = await appConnectionService.connectAppConnectionById(destinationApp, connectionId, actor);- }++ // Swapping the connection re-runs the App Connection Connect check, as it always has. Editing the++ // sync's own fields must not: the delivery target is gated by SetTargetHost below, and the sync row++ // already carries enough of its current connection to validate against.+ let resolvedConnection: Awaited<ReturnType<typeof appConnectionService.connectAppConnectionById>> | undefined;+ const resolveConnection = async () => {+ resolvedConnection ??= await appConnectionService.connectAppConnectionById(+ getPkiSyncConnectionApps(pkiSync.destination),+ connectionId ?? pkiSync.connectionId,+ actor+ );+ return resolvedConnection;+ };++ const isConnectionChanging = Boolean(connectionId && connectionId !== pkiSync.connectionId);++ // Compared structurally, not by JSON text: the stored value comes back from a jsonb column with its++ // keys reordered, so stringify never matches once the config has more than one key.const isDestinationConfigChanging =- Boolean(destinationConfig) && !deepEqual(destinationConfig, pkiSync.destinationConfig);- Boolean(destinationConfig) && JSON.stringify(destinationConfig) !== JSON.stringify(pkiSync.destinationConfig);++ Boolean(destinationConfig) && !deepEqual(resolvedDestinationConfig, pkiSync.destinationConfig);+- const nextDestinationConfig = (destinationConfig ?? pkiSync.destinationConfig) as++ const effectiveDestinationConfig = (resolvedDestinationConfig ?? pkiSync.destinationConfig) as+ | (Record<string, unknown> & { host?: string })+ | undefined;++ if (isConnectionChanging || destinationConfig !== undefined) {+ assertTargetHostMatchesConnection({+ destination: pkiSync.destination,+ connection: isConnectionChanging+ ? await resolveConnection()+ : { ...pkiSync.connection, app: pkiSync.connection.app as AppConnection },- destinationConfig: nextDestinationConfig++ destinationConfig: effectiveDestinationConfig+ });+ }++ await $assertMaySetTargetHost({- nextConfig: nextDestinationConfig,++ nextConfig: effectiveDestinationConfig,+ currentConfig: pkiSync.destinationConfig as Record<string, unknown> | undefined,+ pkiSync,+ subscriberName: currentSubscriber?.name,+ actor+ });const storedSyncOptions = pkiSync.syncOptions as Record<string, unknown> | undefined;let resolvedSyncOptions = syncOptions;@@@ -665,27 -613,24 +680,18 @@@pkiSync,subscriberName: currentSubscriber?.name,actor,- isExecutionTargetChanging: Boolean(effectiveConnection) || isDestinationConfigChanging,- resolveConnection: async () =>- effectiveConnection ??- appConnectionService.connectAppConnectionById(- getDestinationAppType(pkiSync.destination),- pkiSync.connectionId,- actor- )+ isExecutionTargetChanging: isConnectionChanging || isDestinationConfigChanging,+ resolveConnection});- if (certificateIds !== undefined) {- if (certificateIds.length > 0) {- assertWithinCertificateLimit(pkiSync.destination, certificateIds.length);- await validateCertificatesForSync(certificateIds, pkiSync.projectId, pkiSync.applicationId);- assertSyncOptionsAllowCertificateCount(effectiveSyncOptions, certificateIds.length);- }-- await certificateSyncDAL.removeAllCertificatesFromSync(id);- if (certificateIds.length > 0) {- await certificateSyncDAL.addCertificates(- id,- certificateIds.map((certId) => ({ certificateId: certId }))- );- }- } else if (syncOptions) {+ if (syncOptions || destinationConfig) {const existingCount = (await certificateSyncDAL.findByPkiSyncId(id)).length;assertSyncOptionsAllowCertificateCount(effectiveSyncOptions, existingCount);+ assertPkiSyncDestinationConfigAllowsCertificateCount(+ pkiSync.destination,+ effectiveDestinationConfig,+ existingCount+ );}if (diff --cc docs/documentation/platform/pki/applications/certificate-syncs/linux-server.mdxindex d86ae3897b,395400bd0c..32e3fb651a--- a/docs/documentation/platform/pki/applications/certificate-syncs/linux-server.mdx+++ b/docs/documentation/platform/pki/applications/certificate-syncs/linux-server.mdx@@@ -17,11 -16,10 +16,11 @@@ Deploy certificates from Infisical to## Prerequisites-- An [SSH Connection](/integrations/app-connections/ssh) with access to the target server+- An [SSH Connection](/integrations/app-connections/ssh) with access to the target server, or an [LDAP Connection](/integrations/app-connections/ldap) to the domain the server is joined to. See [using an LDAP connection for many servers](#using-an-ldap-connection-for-many-servers).+- For an LDAP Connection: the connection URL must use LDAPS on port 636, because a hardened domain controller rejects a plaintext simple bind on port 389 with `strongerAuthRequired`. The domain controller must be reachable as well as the target server, since every run reads the directory to derive the login.- The destination directory must already exist on the server and the connection user must be able to write to it- The server must be reachable from Infisical, either directly or through an [Infisical Gateway](/documentation/platform/gateways/overview)- - A Gateway is required to use a [health check](#health-checks) or a [post-sync command](#post-sync-commands), because the Gateway is what executes them. It must be running Infisical CLI v0.43.120 or later+ - A Gateway is required to use a [health check](#health-check) or a [post-sync command](#post-sync-command), because the Gateway is what executes them. It must be running Infisical CLI v0.43.120 or later## Create a Linux Server sync@@@ -52,11 -46,11 +51,11 @@@- **Certificate Name Schema**: The base file name, using placeholders such as `{{commonName}}`, `{{certificateId}}`, or `{{shortCertificateId}}`. The export format adds the extension. A schema with no placeholder can be linked to only one certificate.- **Auto-Sync Enabled**: Automatically sync certificates when changes occur.- 5. Configure the **Commands**, or leave them empty:+ 6. Configure the **Commands**, or leave them empty:- - **Health check**: A command run on the server before any certificate is written, to confirm the host is ready, for example `test -w /etc/ssl/certs`. A non-zero exit stops the sync, so nothing is delivered. See [health checks](#health-checks).- - **Post-sync command**: A command run on the server after the sync delivers a certificate, so the service that uses it picks up the new file, for example `sudo systemctl reload nginx`. See [Post-Sync Commands](#post-sync-commands).+ - **Health check**: A command run on the server before any certificate is written, to confirm the host is ready, for example `test -w /etc/ssl/certs`. A non-zero exit stops the sync, so nothing is delivered. See [health check](#health-check).+ - **Post-sync command**: A command run on the server after the sync delivers a certificate, so the service that uses it picks up the new file, for example `sudo systemctl reload nginx`. See [post-sync command](#post-sync-command).- 6. Configure the **Details**:+ 7. Configure the **Details**:- **Name**: The name of your sync.- **Description**: Optional description.@@@ -152,7 -114,44 +151,44 @@@ PKCS#1When syncing certificates, Infisical opens an SSH session to the server and, for each certificate, packages it in the chosen export format and writes the resulting files to the destination directory. Files are written atomically over SFTP so a reader never sees a partially written certificate or key.- ## Health checks+ ## Commands++ A sync can run two optional commands on the target server, in that server's own shell:++ - A **health check** runs before any certificate is written and gates the delivery, for example `test -w /etc/ssl/certs`.+ - A **post-sync command** runs after the delivery has finished, so the service that uses the certificate picks up the new file, for example `sudo systemctl reload nginx`.++ Set each on the sync's **Commands** step. Leaving a field empty means nothing runs, so neither has a separate toggle. Both accept a whole script, so several steps can run in one go: put each on its own line, or chain them with `&&`.++ <Note>- Your [Infisical Gateway](/documentation/platform/gateways/overview) runs both commands, never Infisical. The sync's SSH Connection must therefore use a gateway, otherwise the command is rejected when you save the sync.++ Your [Infisical Gateway](/documentation/platform/gateways/overview) runs both commands, never Infisical. The sync's App Connection must therefore use a gateway, otherwise the command is rejected when you save the sync.++ The Gateway must be running Infisical CLI **v0.43.120 or later**. Earlier Gateways either cannot run the command at all or cannot unlock an SSH Connection's passphrase-protected private key, so the command fails. Run `infisical --version` on the Gateway host to check, and see [Gateway deployment](/documentation/platform/gateways/gateway-deployment) for how to upgrade.+ </Note>++ ### Available variables++ <CommandVariables />++ ### Length limit++ Each command is limited to 8192 characters, counted as you write it, before variables are substituted. For anything longer, put the logic in a script on the server and have the command call that script.++ ### Least privilege++ Both commands run as the account the SSH Connection authenticates with, so constraining that account bounds what either can do. A service reload does not need root. Grant the connection user a `sudoers` rule for that one command instead:++ ```text+ svc-infisical ALL=(root) NOPASSWD: /usr/bin/systemctl reload nginx+ ```++ Only Application Admins can set either command, so treat that role as access to the target server.++ <Warning>+ The rendered command is visible in the target server's process table while it runs. This only matters if you reference `{{pkcs12Password}}`, and only to accounts that already have a shell on the server the sync writes private keys to.+ </Warning>++ ### Health checkA sync can only tell you the host was not ready once it has already tried. If the destination directory was renamed or the service that owns it is stopped, you find out from a failed sync, and on a renewal that is the day the certificate was going to expire anyway.diff --cc docs/documentation/platform/pki/applications/certificate-syncs/windows-server.mdxindex 13dfb877a6,01ad235901..61f7b9347c--- a/docs/documentation/platform/pki/applications/certificate-syncs/windows-server.mdx+++ b/docs/documentation/platform/pki/applications/certificate-syncs/windows-server.mdx@@@ -17,9 -16,8 +16,9 @@@ Deploy certificates from Infisical to## Prerequisites-- A [Windows (WinRM) Connection](/integrations/app-connections/winrm) with access to the target server+- A [Windows (WinRM) Connection](/integrations/app-connections/winrm) with access to the target server, or an [LDAP Connection](/integrations/app-connections/ldap) to the domain the server belongs to. See [using an LDAP connection for many servers](#using-an-ldap-connection-for-many-servers).+- For an LDAP Connection: the connection URL must use LDAPS on port 636, because a hardened domain controller rejects a plaintext simple bind on port 389 with `strongerAuthRequired`. A Gateway must be assigned to the LDAP Connection itself, and that Gateway must reach both the domain controller and the target server.- - An [Infisical Gateway](/documentation/platform/gateways/overview) that can reach the server. Windows delivery always runs through the Gateway. A [post-sync command](#post-sync-commands) additionally needs the Gateway to be running Infisical CLI v0.43.120 or later.+ - An [Infisical Gateway](/documentation/platform/gateways/overview) that can reach the server. Windows delivery always runs through the Gateway. A [post-sync command](#post-sync-command) additionally needs the Gateway to be running Infisical CLI v0.43.120 or later.- The connection user must be able to write to the destination directory<Note>@@@ -61,11 -48,11 +60,11 @@@- **Certificate Name Schema**: The base file name, using placeholders such as `{{commonName}}`, `{{certificateId}}`, or `{{shortCertificateId}}`. The export format adds the extension. A schema with no placeholder can be linked to only one certificate.- **Auto-Sync Enabled**: Automatically sync certificates when changes occur.- 5. Configure the **Commands**, or leave them empty:+ 6. Configure the **Commands**, or leave them empty:- - **Health check**: A PowerShell command run on the server before any certificate is written, to confirm the host is ready, for example `Get-Service W3SVC | Where-Object Status -ne 'Running' | ForEach-Object { throw "W3SVC is not running" }`. A failure stops the sync, so nothing is delivered. See [health checks](#health-checks).- - **Post-sync command**: A PowerShell command run on the server after the sync delivers a certificate, so the service that uses it picks up the new file, for example `Restart-Service -Name "W3SVC"`. See [Post-Sync Commands](#post-sync-commands).+ - **Health check**: A PowerShell command run on the server before any certificate is written, to confirm the host is ready, for example `Get-Service W3SVC | Where-Object Status -ne 'Running' | ForEach-Object { throw "W3SVC is not running" }`. A failure stops the sync, so nothing is delivered. See [health check](#health-check).+ - **Post-sync command**: A PowerShell command run on the server after the sync delivers a certificate, so the service that uses it picks up the new file, for example `Restart-Service -Name "W3SVC"`. See [post-sync command](#post-sync-command).- 6. Configure the **Details**:+ 7. Configure the **Details**:- **Name**: The name of your sync.- **Description**: Optional description.diff --cc frontend/package-lock.jsonindex 083e43529f,083e43529f..bd6e1cfbd1--- a/frontend/package-lock.json+++ b/frontend/package-lock.json@@@ -210,7 -210,7 +210,6 @@@"integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"@babel/code-frame": "^7.27.1","@babel/generator": "^7.28.3",@@@ -587,7 -587,7 +586,6 @@@"resolved": "https://registry.npmjs.org/@casl/ability/-/ability-6.8.0.tgz","integrity": "sha512-Ipt4mzI4gSgnomFdaPjaLgY2MWuXqAEZLrU6qqWBB7khGiBBuuEp6ytYDnq09bRXqcjaeeHiaCvCGFbBA2SpvA==","license": "MIT",-- "peer": true,"dependencies": {"@ucast/mongo2js": "^1.3.0"},@@@ -751,7 -751,7 +749,6 @@@"resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz","integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==","license": "MIT",-- "peer": true,"dependencies": {"@dnd-kit/accessibility": "^3.1.1","@dnd-kit/utilities": "^3.2.2",@@@ -1611,7 -1611,7 +1608,6 @@@"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.7.1.tgz","integrity": "sha512-8dBIHbfsKlCk2jHQ9PoRBg2Z+4TwyE3vZICSnoDlnsHA6SiMlTwfmW6yX0lHsRmWJugkeb92sA0hZdkXJhuz+g==","license": "MIT",-- "peer": true,"dependencies": {"@fortawesome/fontawesome-common-types": "6.7.1"},@@@ -2346,7 -2346,7 +2342,6 @@@"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz","integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==","license": "Apache-2.0",-- "peer": true,"engines": {"node": ">=8.0.0"}@@@ -5170,7 -5170,7 +5165,6 @@@"integrity": "sha512-RnO1SaiCFHn666wNz2QfZEFxvmiNRqhzaMXHXxXXKt+MEP7aajlPxUSMIQpKAaJfverpovEYqjBOXDq6dDcaOQ==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"@typescript-eslint/utils": "^8.13.0","eslint-visitor-keys": "^4.2.0",@@@ -5826,7 -5826,7 +5820,6 @@@"resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.95.1.tgz","integrity": "sha512-P5x4yNhcdkYsCEoYeGZP8Q9Jlxf0WXJa4G/xvbmM905seZc9FqJqvCSRvX3dWTPOXRABhl4g+8DHqfft0c/AvQ==","license": "MIT",-- "peer": true,"dependencies": {"@tanstack/history": "1.95.0","@tanstack/react-store": "^0.7.0",@@@ -6048,6 -6048,6 +6041,7 @@@"integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"@babel/code-frame": "^7.10.4","@babel/runtime": "^7.12.5",@@@ -6068,6 -6068,6 +6062,7 @@@"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==","dev": true,"license": "Apache-2.0",++ "peer": true,"dependencies": {"dequal": "^2.0.3"}@@@ -6118,7 -6118,7 +6113,8 @@@"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz","integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==","dev": true,-- "license": "MIT"++ "license": "MIT",++ "peer": true},"node_modules/@types/babel__core": {"version": "7.20.5",@@@ -6416,7 -6416,7 +6412,6 @@@"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.16.tgz","integrity": "sha512-oh8AMIC4Y2ciKufU8hnKgs+ufgbA/dhPTACaZPM86AbwX9QwnFtSoPWEeRUj8fge+v6kFt78BXcDhAU1SrrAsw==","license": "MIT",-- "peer": true,"dependencies": {"@types/prop-types": "*","csstype": "^3.0.2"@@@ -6428,7 -6428,7 +6423,6 @@@"integrity": "sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==","devOptional": true,"license": "MIT",-- "peer": true,"peerDependencies": {"@types/react": "^18.0.0"}@@@ -6482,7 -6482,7 +6476,6 @@@"integrity": "sha512-QXwAlHlbcAwNlEEMKQS2RCgJsgXrTJdjXT08xEgbPFa2yYQgVjBymxP5DrfrE7X7iodSzd9qBUHUycdyVJTW1w==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"@eslint-community/regexpp": "^4.10.0","@typescript-eslint/scope-manager": "8.34.0",@@@ -6523,7 -6523,7 +6516,6 @@@"integrity": "sha512-vxXJV1hVFx3IXz/oy2sICsJukaBrtDEQSBiV48/YIV5KWjX1dO+bcIr/kCPrW6weKXvsaGKFNlwH0v2eYdRRbA==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"@typescript-eslint/scope-manager": "8.34.0","@typescript-eslint/types": "8.34.0",@@@ -6877,8 -6877,8 +6869,7 @@@"version": "5.5.0","resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz","integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==",-- "license": "MIT",-- "peer": true++ "license": "MIT"},"node_modules/@xyflow/react": {"version": "12.4.4",@@@ -6944,7 -6944,7 +6935,6 @@@"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==","dev": true,"license": "MIT",-- "peer": true,"bin": {"acorn": "bin/acorn"},@@@ -7115,6 -7115,6 +7105,7 @@@"integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"call-bind": "^1.0.7","define-properties": "^1.2.1",@@@ -7195,6 -7195,6 +7186,7 @@@"integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"call-bind": "^1.0.7","define-properties": "^1.2.1",@@@ -7304,7 -7304,7 +7296,8 @@@"resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz","integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==","dev": true,-- "license": "MIT"++ "license": "MIT",++ "peer": true},"node_modules/asynckit": {"version": "0.4.0",@@@ -7356,6 -7356,6 +7349,7 @@@"integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==","dev": true,"license": "Apache-2.0",++ "peer": true,"engines": {"node": ">= 0.4"}@@@ -7661,7 -7661,7 +7655,6 @@@}],"license": "MIT",-- "peer": true,"dependencies": {"baseline-browser-mapping": "^2.8.9","caniuse-lite": "^1.0.30001746",@@@ -8036,21 -8036,21 +8029,6 @@@"react-dom": "^18 || ^19 || ^19.0.0-rc"}},-- "node_modules/cmdk/node_modules/@radix-ui/react-compose-refs": {-- "version": "1.1.2",-- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz",-- "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==",-- "license": "MIT",-- "peerDependencies": {-- "@types/react": "*",-- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"-- },-- "peerDependenciesMeta": {-- "@types/react": {-- "optional": true-- }-- }-- },"node_modules/color-convert": {"version": "2.0.1","resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",@@@ -8420,7 -8420,7 +8398,6 @@@"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz","integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==","license": "ISC",-- "peer": true,"engines": {"node": ">=12"}@@@ -8510,7 -8510,7 +8487,8 @@@"resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz","integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==","dev": true,-- "license": "BSD-2-Clause"++ "license": "BSD-2-Clause",++ "peer": true},"node_modules/data-view-buffer": {"version": "1.0.1",@@@ -8797,7 -8797,7 +8775,8 @@@"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz","integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==","dev": true,-- "license": "MIT"++ "license": "MIT",++ "peer": true},"node_modules/dom-helpers": {"version": "5.2.1",@@@ -9017,6 -9017,6 +8996,7 @@@"integrity": "sha512-tpxqxncxnpw3c93u8n3VOzACmRFoVmWJqbWXvX/JfKbkhBw1oslgPrUfeSt2psuqyEJFD6N/9lg5i7bsKpoq+Q==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"call-bind": "^1.0.7","define-properties": "^1.2.1",@@@ -9110,7 -9110,7 +9090,6 @@@"dev": true,"hasInstallScript": true,"license": "MIT",-- "peer": true,"bin": {"esbuild": "bin/esbuild"},@@@ -9188,7 -9188,7 +9167,6 @@@"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"@eslint-community/eslint-utils": "^4.2.0","@eslint-community/regexpp": "^4.6.1",@@@ -9245,7 -9245,7 +9223,6 @@@"integrity": "sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"eslint-config-airbnb-base": "^15.0.0","object.assign": "^4.1.2",@@@ -9268,7 -9268,7 +9245,6 @@@"integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"confusing-browser-globals": "^1.0.10","object.assign": "^4.1.2",@@@ -9299,7 -9299,7 +9275,6 @@@"integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==","dev": true,"license": "MIT",-- "peer": true,"bin": {"eslint-config-prettier": "bin/cli.js"},@@@ -9399,7 -9399,7 +9374,6 @@@"integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"@rtsao/scc": "^1.1.0","array-includes": "^3.1.8",@@@ -9491,6 -9491,6 +9465,7 @@@"integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"aria-query": "^5.3.2","array-includes": "^3.1.8",@@@ -9521,6 -9521,6 +9496,7 @@@"integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"balanced-match": "^1.0.0","concat-map": "0.0.1"@@@ -9532,6 -9532,6 +9508,7 @@@"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==","dev": true,"license": "ISC",++ "peer": true,"dependencies": {"brace-expansion": "^1.1.7"},@@@ -9576,6 -9576,6 +9553,7 @@@"integrity": "sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"array-includes": "^3.1.8","array.prototype.findlast": "^1.2.5",@@@ -9609,7 -9609,7 +9587,6 @@@"integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==","dev": true,"license": "MIT",-- "peer": true,"engines": {"node": ">=10"},@@@ -9633,6 -9633,6 +9610,7 @@@"integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"balanced-match": "^1.0.0","concat-map": "0.0.1"@@@ -9644,6 -9644,6 +9622,7 @@@"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==","dev": true,"license": "Apache-2.0",++ "peer": true,"dependencies": {"esutils": "^2.0.2"},@@@ -9657,6 -9657,6 +9636,7 @@@"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==","dev": true,"license": "ISC",++ "peer": true,"dependencies": {"brace-expansion": "^1.1.7"},@@@ -9670,6 -9670,6 +9650,7 @@@"integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"is-core-module": "^2.13.0","path-parse": "^1.0.7",@@@ -9688,6 -9688,6 +9669,7 @@@"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==","dev": true,"license": "ISC",++ "peer": true,"bin": {"semver": "bin/semver.js"}@@@ -10845,7 -10845,7 +10827,6 @@@}],"license": "MIT",-- "peer": true,"dependencies": {"@babel/runtime": "^7.23.2"},@@@ -10903,7 -10903,7 +10884,6 @@@"resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz","integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==","license": "MIT",-- "peer": true,"funding": {"type": "opencollective","url": "https://opencollective.com/immer"@@@ -11570,6 -11570,6 +11550,7 @@@"resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.2.5.tgz","integrity": "sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==","license": "MIT",++ "peer": true,"funding": {"type": "GitHub Sponsors ❤","url": "https://github.com/sponsors/dmonad"@@@ -11581,6 -11581,6 +11562,7 @@@"integrity": "sha512-x4WH0BWmrMmg4oHHl+duwubhrvczGlyuGAZu3nvrf0UXOfPu8IhZObFEr7DE/iv01YgVZrsOiRcqw2srkKEDIA==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"define-data-property": "^1.1.4","es-object-atoms": "^1.0.0",@@@ -11696,6 -11696,6 +11678,7 @@@"integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"array-includes": "^3.1.6","array.prototype.flat": "^1.3.1",@@@ -11730,7 -11730,7 +11713,8 @@@"resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz","integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==","dev": true,-- "license": "CC0-1.0"++ "license": "CC0-1.0",++ "peer": true},"node_modules/language-tags": {"version": "1.0.9",@@@ -11738,6 -11738,6 +11722,7 @@@"integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"language-subtag-registry": "^0.3.20"},@@@ -11770,6 -11770,6 +11755,7 @@@"resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.102.tgz","integrity": "sha512-g70kydI0I1sZU0ChO8mBbhw0oUW/8U0GHzygpvEIx8k+jgOpqnTSb/E+70toYVqHxBhrERD21TwD5QcZJQ40ZQ==","license": "MIT",++ "peer": true,"dependencies": {"isomorphic.js": "^0.2.4"},@@@ -12113,6 -12113,6 +12099,7 @@@"integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==","dev": true,"license": "MIT",++ "peer": true,"bin": {"lz-string": "bin/bin.js"}@@@ -13549,7 -13549,7 +13536,6 @@@"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==","dev": true,"license": "MIT",-- "peer": true,"bin": {"prettier": "bin/prettier.cjs"},@@@ -13666,6 -13666,6 +13652,7 @@@"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"ansi-regex": "^5.0.1","ansi-styles": "^5.0.0",@@@ -13681,6 -13681,6 +13668,7 @@@"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==","dev": true,"license": "MIT",++ "peer": true,"engines": {"node": ">=10"},@@@ -13693,7 -13693,7 +13681,8 @@@"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz","integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==","dev": true,-- "license": "MIT"++ "license": "MIT",++ "peer": true},"node_modules/prismjs": {"version": "1.30.0",@@@ -14009,7 -14009,7 +13998,6 @@@"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz","integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==","license": "MIT",-- "peer": true,"dependencies": {"loose-envify": "^1.1.0"},@@@ -14097,7 -14097,7 +14085,6 @@@"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz","integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==","license": "MIT",-- "peer": true,"dependencies": {"loose-envify": "^1.1.0","scheduler": "^0.23.2"@@@ -14148,7 -14148,7 +14135,6 @@@"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.56.3.tgz","integrity": "sha512-IK18V6GVbab4TAo1/cz3kqajxbDPGofdF0w7VHdCo0Nt8PrPlOZcuuDq9YYIV1BtjcX78x0XsldbQRQnQXWXmw==","license": "MIT",-- "peer": true,"engines": {"node": ">=18.0.0"},@@@ -14195,8 -14195,8 +14181,7 @@@"version": "16.13.1","resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz","integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",-- "license": "MIT",-- "peer": true++ "license": "MIT"},"node_modules/react-markdown": {"version": "10.0.1",@@@ -14229,7 -14229,7 +14214,6 @@@"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz","integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==","license": "MIT",-- "peer": true,"dependencies": {"@types/use-sync-external-store": "^0.0.6","use-sync-external-store": "^1.4.0"@@@ -14492,8 -14492,8 +14476,7 @@@"version": "5.0.1","resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz","integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",-- "license": "MIT",-- "peer": true++ "license": "MIT"},"node_modules/redux-thunk": {"version": "3.1.0",@@@ -14763,7 -14763,7 +14746,6 @@@"integrity": "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"@types/estree": "1.0.8"},@@@ -15277,6 -15277,6 +15259,7 @@@"integrity": "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"call-bind": "^1.0.7","define-properties": "^1.2.1",@@@ -15292,6 -15292,6 +15275,7 @@@"integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"call-bind": "^1.0.7","define-properties": "^1.2.1",@@@ -15319,6 -15319,6 +15303,7 @@@"integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==","dev": true,"license": "MIT",++ "peer": true,"dependencies": {"define-properties": "^1.1.3","es-abstract": "^1.17.5"@@@ -15923,7 -15923,7 +15908,6 @@@"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==","devOptional": true,"license": "Apache-2.0",-- "peer": true,"bin": {"tsc": "bin/tsc","tsserver": "bin/tsserver"@@@ -16315,7 -16315,7 +16299,6 @@@"integrity": "sha512-2N/55r4JDJ4gdrCvGgINMy+HH3iRpNIz8K6SFwVsA+JbQScLiC+clmAxBgwiSPgcG9U15QmvqCGWzMbqda5zGQ==","dev": true,"license": "MIT",-- "peer": true,"dependencies": {"esbuild": "^0.25.0","fdir": "^6.4.4",@@@ -16815,7 -16815,7 +16798,6 @@@"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz","integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==","license": "ISC",-- "peer": true,"bin": {"yaml": "bin.mjs"},@@@ -16969,7 -16969,7 +16951,6 @@@"resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz","integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==","license": "MIT",-- "peer": true,"funding": {"url": "https://github.com/sponsors/colinhacks"}diff --cc frontend/src/components/pki-syncs/forms/CreatePkiSyncForm.tsxindex bdf2ccefdd,4177a07baf..ac5df8f223--- a/frontend/src/components/pki-syncs/forms/CreatePkiSyncForm.tsx+++ b/frontend/src/components/pki-syncs/forms/CreatePkiSyncForm.tsx@@@ -26,8 -26,11 +26,12 @@@ importSwitch} from "@app/components/v3";import { useProject } from "@app/context";- import { PKI_SYNC_MAP } from "@app/helpers/pkiSyncs";+ import {+ PKI_SYNC_MAP,+ PRESERVE_ARN_DESTINATIONS,+ PRESERVE_ITEM_ON_RENEWAL_DESTINATIONS+ } from "@app/helpers/pkiSyncs";+import { AppConnection } from "@app/hooks/api/appConnections/enums";import {PkiSync,PkiSyncExportFormat,diff --cc frontend/src/components/pki-syncs/forms/EditPkiSyncForm.tsxindex 1b09ae9f5e,7452dacbf7..d18ede44ab--- a/frontend/src/components/pki-syncs/forms/EditPkiSyncForm.tsx+++ b/frontend/src/components/pki-syncs/forms/EditPkiSyncForm.tsx@@@ -212,9 -179,7 +212,9 @@@ export const EditPkiSyncForm = ({ pkiSyconst renderStep = () => {switch (currentStep.key) {case "destination":- return <PkiSyncDestinationFields />;+ return <PkiSyncDestinationFields isUpdate />;+ case "targetHost":+ return <PkiSyncTargetHostField applicationId={pkiSync.applicationId} />;case "options":return (<>diff --cc frontend/src/components/pki-syncs/forms/schemas/pki-sync-schema.tsindex 5dc810bab6,ae530fd299..325d7bd44b--- a/frontend/src/components/pki-syncs/forms/schemas/pki-sync-schema.ts+++ b/frontend/src/components/pki-syncs/forms/schemas/pki-sync-schema.ts@@@ -1,7 -1,7 +1,8 @@@import { z } from "zod";+import { AppConnection } from "@app/hooks/api/appConnections/enums";import { PkiSync, PkiSyncExportFormat } from "@app/hooks/api/pkiSyncs";+ import { GCP_MAX_CERTIFICATES_PER_MAP_ENTRY } from "@app/hooks/api/pkiSyncs/types/gcp-certificate-manager-sync";import {AwsCertificateManagerPkiSyncDestinationSchema,@@@ -82,33 -88,19 +89,45 @@@ const UpdatePkiSyncUnionSchema = z.discUpdateNutanixPrismCentralPkiSyncDestinationSchema]);+const refineTargetHost = (data: unknown, ctx: z.RefinementCtx) => {+ const { connection, destinationConfig } = data as {+ connection?: { app?: AppConnection };+ destinationConfig?: { host?: string };+ };++ if (!connection?.app) return;++ if (connection.app === AppConnection.LDAP && !destinationConfig?.host) {+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ path: ["destinationConfig", "host"],+ message: "A target host is required when using an LDAP connection"+ });+ return;+ }++ if (connection.app !== AppConnection.LDAP && destinationConfig?.host) {+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ path: ["destinationConfig", "host"],+ message: "A target host cannot be set when the connection already targets a single host"+ });+ }+};+export const PkiSyncFormSchema = PkiSyncUnionSchema.superRefine((data, ctx) => {+ if (+ data.destination === PkiSync.GcpCertificateManager &&+ data.destinationConfig?.certificateMapBinding &&+ (data.certificateIds?.length ?? 0) > GCP_MAX_CERTIFICATES_PER_MAP_ENTRY+ ) {+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ path: ["destinationConfig", "certificateMapBinding"],+ message: `Certificate map binding supports up to ${GCP_MAX_CERTIFICATES_PER_MAP_ENTRY} certificates, which is the GCP limit for one certificate map entry.`+ });+ }+if ((data.destination === PkiSync.WindowsServer || data.destination === PkiSync.LinuxServer) &&data.syncOptions?.exportFormat === PkiSyncExportFormat.Pkcs12 &&