Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

initial exploration

Matheus Nogueira0c948f538f14
diff --git a/backend/src/services/app-connection/azure-app-configuration/azure-app-configuration-connection-schemas.ts b/backend/src/services/app-connection/azure-app-configuration/azure-app-configuration-connection-schemas.ts
index 49a557582a..4594408434 100644
--- a/backend/src/services/app-connection/azure-app-configuration/azure-app-configuration-connection-schemas.ts
+++ b/backend/src/services/app-connection/azure-app-configuration/azure-app-configuration-connection-schemas.ts
@@ -35,7 +35,15 @@ export const AzureAppConfigurationConnectionClientSecretInputCredentialsSchema =
.trim()
.min(1, "Client Secret required")
.max(50, "Client Secret must be at most 50 characters long"),
- tenantId: z.string().uuid().trim().min(1, "Tenant ID required")
+ tenantId: z.string().uuid().trim().min(1, "Tenant ID required"),
+ clientSecretKeyId: z
+ .string()
+ .uuid()
+ .trim()
+ .optional()
+ .describe(
+ "The Key ID of the client secret in Azure AD. Required when enabling credential rotation so the original secret can be revoked."
+ )
});
export const AzureAppConfigurationConnectionClientSecretOutputCredentialsSchema = z.object({
@@ -66,7 +74,9 @@ export const ValidateAzureAppConfigurationConnectionCredentialsSchema = z.discri
]);
export const CreateAzureAppConfigurationConnectionSchema = ValidateAzureAppConfigurationConnectionCredentialsSchema.and(
- GenericCreateAppConnectionFieldsSchema(AppConnection.AzureAppConfiguration)
+ GenericCreateAppConnectionFieldsSchema(AppConnection.AzureAppConfiguration, {
+ supportsCredentialRotation: true
+ })
);
export const UpdateAzureAppConfigurationConnectionSchema = z
@@ -79,7 +89,11 @@ export const UpdateAzureAppConfigurationConnectionSchema = z
.optional()
.describe(AppConnections.UPDATE(AppConnection.AzureAppConfiguration).credentials)
})
- .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.AzureAppConfiguration));
+ .and(
+ GenericUpdateAppConnectionFieldsSchema(AppConnection.AzureAppConfiguration, {
+ supportsCredentialRotation: true
+ })
+ );
const BaseAzureAppConfigurationConnectionSchema = BaseAppConnectionSchema.extend({
app: z.literal(AppConnection.AzureAppConfiguration)
diff --git a/backend/src/services/app-connection/azure-devops/azure-devops-schemas.ts b/backend/src/services/app-connection/azure-devops/azure-devops-schemas.ts
index c574770bb7..f9a6ab9bdd 100644
--- a/backend/src/services/app-connection/azure-devops/azure-devops-schemas.ts
+++ b/backend/src/services/app-connection/azure-devops/azure-devops-schemas.ts
@@ -63,7 +63,15 @@ export const AzureDevOpsConnectionClientSecretInputCredentialsSchema = z.object(
.string()
.trim()
.min(1, "Organization name required")
- .describe(AppConnections.CREDENTIALS.AZURE_DEVOPS.orgName)
+ .describe(AppConnections.CREDENTIALS.AZURE_DEVOPS.orgName),
+ clientSecretKeyId: z
+ .string()
+ .uuid()
+ .trim()
+ .optional()
+ .describe(
+ "The Key ID of the client secret in Azure AD. Required when enabling credential rotation so the original secret can be revoked."
+ )
});
export const AzureDevOpsConnectionClientSecretOutputCredentialsSchema = z.object({
@@ -103,7 +111,9 @@ export const ValidateAzureDevOpsConnectionCredentialsSchema = z.discriminatedUni
]);
export const CreateAzureDevOpsConnectionSchema = ValidateAzureDevOpsConnectionCredentialsSchema.and(
- GenericCreateAppConnectionFieldsSchema(AppConnection.AzureDevOps)
+ GenericCreateAppConnectionFieldsSchema(AppConnection.AzureDevOps, {
+ supportsCredentialRotation: true
+ })
);
export const UpdateAzureDevOpsConnectionSchema = z
@@ -117,7 +127,11 @@ export const UpdateAzureDevOpsConnectionSchema = z
.optional()
.describe(AppConnections.UPDATE(AppConnection.AzureDevOps).credentials)
})
- .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.AzureDevOps));
+ .and(
+ GenericUpdateAppConnectionFieldsSchema(AppConnection.AzureDevOps, {
+ supportsCredentialRotation: true
+ })
+ );
const BaseAzureDevOpsConnectionSchema = BaseAppConnectionSchema.extend({
app: z.literal(AppConnection.AzureDevOps)
diff --git a/backend/src/services/app-connection/azure-dns/azure-dns-connection-schema.ts b/backend/src/services/app-connection/azure-dns/azure-dns-connection-schema.ts
index 76363ea267..540abaafcb 100644
--- a/backend/src/services/app-connection/azure-dns/azure-dns-connection-schema.ts
+++ b/backend/src/services/app-connection/azure-dns/azure-dns-connection-schema.ts
@@ -26,7 +26,15 @@ export const AzureDnsConnectionClientSecretCredentialsSchema = z.object({
.trim()
.min(1, "Client secret required")
.max(256, "Client secret cannot exceed 256 characters"),
- subscriptionId: azureGuidSchema.describe("Subscription ID must be a valid GUID")
+ subscriptionId: azureGuidSchema.describe("Subscription ID must be a valid GUID"),
+ clientSecretKeyId: z
+ .string()
+ .trim()
+ .refine((val) => AZURE_GUID_REGEX.test(val), { message: "Invalid GUID format" })
+ .optional()
+ .describe(
+ "The Key ID of the client secret in Azure AD. Required when enabling credential rotation so the original secret can be revoked."
+ )
});
const BaseAzureDnsConnectionSchema = BaseAppConnectionSchema.extend({
@@ -57,7 +65,9 @@ export const ValidateAzureDnsConnectionCredentialsSchema = z.discriminatedUnion(
]);
export const CreateAzureDnsConnectionSchema = ValidateAzureDnsConnectionCredentialsSchema.and(
- GenericCreateAppConnectionFieldsSchema(AppConnection.AzureDNS)
+ GenericCreateAppConnectionFieldsSchema(AppConnection.AzureDNS, {
+ supportsCredentialRotation: true
+ })
);
export const UpdateAzureDnsConnectionSchema = z
@@ -66,7 +76,11 @@ export const UpdateAzureDnsConnectionSchema = z
AppConnections.UPDATE(AppConnection.AzureDNS).credentials
)
})
- .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.AzureDNS));
+ .and(
+ GenericUpdateAppConnectionFieldsSchema(AppConnection.AzureDNS, {
+ supportsCredentialRotation: true
+ })
+ );
export const AzureDnsConnectionListItemSchema = z
.object({
diff --git a/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-schemas.ts b/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-schemas.ts
index ca28d2e5b8..192ce487fd 100644
--- a/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-schemas.ts
+++ b/backend/src/services/app-connection/azure-entra-id/azure-entra-id-connection-schemas.ts
@@ -19,7 +19,15 @@ export const AzureEntraIdConnectionClientSecretInputCredentialsSchema = z.object
.min(1, "Client ID required")
.max(50, "Client ID must be at most 50 characters long"),
clientSecret: z.string().trim().min(1, "Client Secret required"),
- tenantId: z.string().uuid().trim().min(1, "Tenant ID required")
+ tenantId: z.string().uuid().trim().min(1, "Tenant ID required"),
+ clientSecretKeyId: z
+ .string()
+ .uuid()
+ .trim()
+ .optional()
+ .describe(
+ "The Key ID of the client secret in Azure AD. Required when enabling credential rotation so the original secret can be revoked."
+ )
});
export const AzureEntraIdConnectionClientSecretOutputCredentialsSchema = z.object({
@@ -42,7 +50,9 @@ export const ValidateAzureEntraIdConnectionCredentialsSchema = z.discriminatedUn
]);
export const CreateAzureEntraIdConnectionSchema = ValidateAzureEntraIdConnectionCredentialsSchema.and(
- GenericCreateAppConnectionFieldsSchema(AppConnection.AzureEntraId)
+ GenericCreateAppConnectionFieldsSchema(AppConnection.AzureEntraId, {
+ supportsCredentialRotation: true
+ })
);
export const UpdateAzureEntraIdConnectionSchema = z
@@ -51,7 +61,11 @@ export const UpdateAzureEntraIdConnectionSchema = z
AppConnections.UPDATE(AppConnection.AzureEntraId).credentials
)
})
- .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.AzureEntraId));
+ .and(
+ GenericUpdateAppConnectionFieldsSchema(AppConnection.AzureEntraId, {
+ supportsCredentialRotation: true
+ })
+ );
const BaseAzureEntraIdConnectionSchema = BaseAppConnectionSchema.extend({
app: z.literal(AppConnection.AzureEntraId)
diff --git a/backend/src/services/app-connection/credential-rotation/app-connection-credential-rotation-service.ts b/backend/src/services/app-connection/credential-rotation/app-connection-credential-rotation-service.ts
index e297667167..da6a4e920e 100644
--- a/backend/src/services/app-connection/credential-rotation/app-connection-credential-rotation-service.ts
+++ b/backend/src/services/app-connection/credential-rotation/app-connection-credential-rotation-service.ts
@@ -15,8 +15,12 @@ import {
import { TKmsServiceFactory } from "@app/services/kms/kms-service";
import { TAppConnection, TAppConnectionRaw } from "../app-connection-types";
-import { AzureClientSecretsConnectionMethod } from "../azure-client-secrets";
-import { AzureKeyVaultConnectionMethod } from "../azure-key-vault";
+import { AzureAppConfigurationConnectionMethod } from "../azure-app-configuration/azure-app-configuration-connection-enums";
+import { AzureClientSecretsConnectionMethod } from "../azure-client-secrets/azure-client-secrets-connection-enums";
+import { AzureDevOpsConnectionMethod } from "../azure-devops/azure-devops-enums";
+import { AzureDnsConnectionMethod } from "../azure-dns/azure-dns-connection-enums";
+import { AzureEntraIdConnectionMethod } from "../azure-entra-id/azure-entra-id-connection-enums";
+import { AzureKeyVaultConnectionMethod } from "../azure-key-vault/azure-key-vault-connection-enums";
import { TAppConnectionCredentialRotationDALFactory } from "./app-connection-credential-rotation-dal";
import {
AppConnectionCredentialRotationStatus,
@@ -62,6 +66,22 @@ const STRATEGY_MAP: Record<
{
app: AppConnection.AzureClientSecrets,
method: AzureClientSecretsConnectionMethod.ClientSecret
+ },
+ {
+ app: AppConnection.AzureAppConfiguration,
+ method: AzureAppConfigurationConnectionMethod.ClientSecret
+ },
+ {
+ app: AppConnection.AzureDevOps,
+ method: AzureDevOpsConnectionMethod.ClientSecret
+ },
+ {
+ app: AppConnection.AzureDNS,
+ method: AzureDnsConnectionMethod.ClientSecret
+ },
+ {
+ app: AppConnection.AzureEntraId,
+ method: AzureEntraIdConnectionMethod.ClientSecret
}
]
};
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureAppConfigurationConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureAppConfigurationConnectionForm.tsx
index bf1eafa389..3cd6246bcd 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureAppConfigurationConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureAppConfigurationConnectionForm.tsx
@@ -37,6 +37,7 @@ import {
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { AzureAppConfigurationFormData } from "../../../OauthCallbackPage/OauthCallbackPage.types";
+import { CredentialRotationForm } from "./shared/CredentialRotationForm";
import { useAppConnectionForm } from "./AppConnectionFormContext";
import {
genericAppConnectionFieldsSchema,
@@ -66,7 +67,8 @@ const clientSecretSchema = baseSchema.extend({
credentials: z.object({
clientSecret: z.string().trim().min(1, "Client Secret is required"),
clientId: z.string().trim().min(1, "Client ID is required"),
- tenantId: z.string().trim().min(1, "Tenant ID is required")
+ tenantId: z.string().trim().min(1, "Tenant ID is required"),
+ clientSecretKeyId: z.string().trim().optional()
})
});
@@ -74,11 +76,21 @@ const formSchema = z.discriminatedUnion("method", [oauthSchema, clientSecretSche
type FormData = z.infer<typeof formSchema>;
+const defaultRotation = {
+ rotationInterval: 30,
+ rotateAtUtc: {
+ hours: 0,
+ minutes: 0
+ }
+};
+
const getDefaultValues = (appConnection?: TAzureAppConfigurationConnection): Partial<FormData> => {
if (!appConnection) {
return {
app: AppConnection.AzureAppConfiguration,
- method: AzureAppConfigurationConnectionMethod.OAuth
+ method: AzureAppConfigurationConnectionMethod.OAuth,
+ isAutoRotationEnabled: false,
+ rotation: defaultRotation
};
}
@@ -86,7 +98,9 @@ const getDefaultValues = (appConnection?: TAzureAppConfigurationConnection): Par
name: appConnection.name,
description: appConnection.description,
app: appConnection.app,
- method: appConnection.method
+ method: appConnection.method,
+ isAutoRotationEnabled: appConnection.isAutoRotationEnabled,
+ rotation: appConnection.rotation ?? defaultRotation
};
const { credentials } = appConnection;
@@ -318,6 +332,36 @@ export const AzureAppConfigurationConnectionForm = ({
</Field>
)}
/>
+ <CredentialRotationForm>
+ <Controller
+ name="credentials.clientSecretKeyId"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4">
+ <FieldLabel htmlFor="credentials.clientSecretKeyId">
+ Client Secret Key ID
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm">
+ The Key ID of the client secret provided above. Found in Azure Portal
+ under App Registrations &gt; Certificates &amp; Secrets. Required so
+ Infisical can revoke the original secret after rotation.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <Input
+ {...field}
+ id="credentials.clientSecretKeyId"
+ placeholder="00000000-0000-0000-0000-000000000000"
+ isError={Boolean(error)}
+ />
+ <FieldError errors={[error]} />
+ </Field>
+ )}
+ />
+ </CredentialRotationForm>
</>
)}
<SheetFooter className="sticky bottom-0 -mx-4 items-center border-t bg-popover">
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureDNSConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureDNSConnectionForm.tsx
index b7a16446b2..41f15d4b8a 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureDNSConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureDNSConnectionForm.tsx
@@ -23,6 +23,7 @@ import { TAzureDNSConnection } from "@app/hooks/api/appConnections";
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { AzureDNSConnectionMethod } from "@app/hooks/api/appConnections/types/azure-dns-connection";
+import { CredentialRotationForm } from "./shared/CredentialRotationForm";
import { AppConnectionFormFooter } from "./AppConnectionFormFooter";
import {
genericAppConnectionFieldsSchema,
@@ -45,28 +46,45 @@ const formSchema = z.discriminatedUnion("method", [
tenantId: z.string().trim().min(1, "Tenant ID required"),
clientId: z.string().trim().min(1, "Client ID required"),
clientSecret: z.string().trim().min(1, "Client Secret required"),
- subscriptionId: z.string().trim().min(1, "Subscription ID required")
+ subscriptionId: z.string().trim().min(1, "Subscription ID required"),
+ clientSecretKeyId: z.string().trim().optional()
})
})
]);
type FormData = z.infer<typeof formSchema>;
+const defaultRotation = {
+ rotationInterval: 30,
+ rotateAtUtc: {
+ hours: 0,
+ minutes: 0
+ }
+};
+
export const AzureDNSConnectionForm = ({ appConnection, onSubmit }: Props) => {
const isUpdate = Boolean(appConnection);
const form = useForm<FormData>({
resolver: zodResolver(formSchema),
- defaultValues: appConnection ?? {
- app: AppConnection.AzureDNS,
- method: AzureDNSConnectionMethod.ClientSecret,
- credentials: {
- tenantId: "",
- clientId: "",
- clientSecret: "",
- subscriptionId: ""
- }
- }
+ defaultValues: appConnection
+ ? {
+ ...appConnection,
+ isAutoRotationEnabled: appConnection.isAutoRotationEnabled,
+ rotation: appConnection.rotation ?? defaultRotation
+ }
+ : {
+ app: AppConnection.AzureDNS,
+ method: AzureDNSConnectionMethod.ClientSecret,
+ isAutoRotationEnabled: false,
+ rotation: defaultRotation,
+ credentials: {
+ tenantId: "",
+ clientId: "",
+ clientSecret: "",
+ subscriptionId: ""
+ }
+ }
});
const { handleSubmit, control } = form;
@@ -181,6 +199,37 @@ export const AzureDNSConnectionForm = ({ appConnection, onSubmit }: Props) => {
</Field>
)}
/>
+ <CredentialRotationForm>
+ <Controller
+ name="credentials.clientSecretKeyId"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field className="mb-4">
+ <FieldLabel htmlFor="credentials.clientSecretKeyId">
+ Client Secret Key ID
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm">
+ The Key ID of the client secret provided above. Found in Azure Portal under
+ App Registrations &gt; Certificates &amp; Secrets. Required so Infisical can
+ revoke the original secret after rotation.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <Input
+ id="credentials.clientSecretKeyId"
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ placeholder="00000000-0000-0000-0000-000000000000"
+ isError={Boolean(error)}
+ />
+ <FieldError errors={[error]} />
+ </Field>
+ )}
+ />
+ </CredentialRotationForm>
<AppConnectionFormFooter
submitLabel={isUpdate ? "Update Credentials" : "Connect to Azure DNS"}
/>
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureDevOpsConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureDevOpsConnectionForm.tsx
index 133de9bf33..42ae324921 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureDevOpsConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureDevOpsConnectionForm.tsx
@@ -38,6 +38,7 @@ import {
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { AzureDevOpsFormData } from "../../../OauthCallbackPage/OauthCallbackPage.types";
+import { CredentialRotationForm } from "./shared/CredentialRotationForm";
import { useAppConnectionForm } from "./AppConnectionFormContext";
import {
genericAppConnectionFieldsSchema,
@@ -71,7 +72,8 @@ const clientSecretSchema = baseSchema.extend({
clientSecret: z.string().trim().min(1, "Client Secret is required"),
tenantId: z.string().trim().min(1, "Tenant ID is required"),
clientId: z.string().trim().min(1, "Client ID is required"),
- orgName: z.string().trim().min(1, "Organization name is required")
+ orgName: z.string().trim().min(1, "Organization name is required"),
+ clientSecretKeyId: z.string().trim().optional()
})
});
@@ -91,11 +93,21 @@ type Props = {
projectId: string | undefined | null;
};
+const defaultRotation = {
+ rotationInterval: 30,
+ rotateAtUtc: {
+ hours: 0,
+ minutes: 0
+ }
+};
+
const getDefaultValues = (appConnection?: TAzureDevOpsConnection): Partial<FormData> => {
if (!appConnection) {
return {
app: AppConnection.AzureDevOps,
- method: AzureDevOpsConnectionMethod.OAuth
+ method: AzureDevOpsConnectionMethod.OAuth,
+ isAutoRotationEnabled: false,
+ rotation: defaultRotation
};
}
@@ -103,7 +115,9 @@ const getDefaultValues = (appConnection?: TAzureDevOpsConnection): Partial<FormD
name: appConnection.name,
description: appConnection.description,
app: appConnection.app,
- method: appConnection.method
+ method: appConnection.method,
+ isAutoRotationEnabled: appConnection.isAutoRotationEnabled,
+ rotation: appConnection.rotation ?? defaultRotation
};
const { credentials } = appConnection;
@@ -375,6 +389,36 @@ export const AzureDevOpsConnectionForm = ({ appConnection, onSubmit, projectId }
</Field>
)}
/>
+ <CredentialRotationForm>
+ <Controller
+ name="credentials.clientSecretKeyId"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4">
+ <FieldLabel htmlFor="credentials.clientSecretKeyId">
+ Client Secret Key ID
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm">
+ The Key ID of the client secret provided above. Found in Azure Portal
+ under App Registrations &gt; Certificates &amp; Secrets. Required so
+ Infisical can revoke the original secret after rotation.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <Input
+ {...field}
+ id="credentials.clientSecretKeyId"
+ placeholder="00000000-0000-0000-0000-000000000000"
+ isError={Boolean(error)}
+ />
+ <FieldError errors={[error]} />
+ </Field>
+ )}
+ />
+ </CredentialRotationForm>
</>
)}
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureEntraIdConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureEntraIdConnectionForm.tsx
index 770c81fb1f..bff1b3fa2e 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureEntraIdConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AzureEntraIdConnectionForm.tsx
@@ -27,6 +27,7 @@ import {
TAzureEntraIdConnection
} from "@app/hooks/api/appConnections/types/azure-entra-id-connection";
+import { CredentialRotationForm } from "./shared/CredentialRotationForm";
import { useAppConnectionForm } from "./AppConnectionFormContext";
import {
genericAppConnectionFieldsSchema,
@@ -39,7 +40,8 @@ const formSchema = genericAppConnectionFieldsSchema.extend({
credentials: z.object({
tenantId: z.string().trim().min(1, "Tenant ID is required"),
clientId: z.string().trim().min(1, "Client ID is required"),
- clientSecret: z.string().trim().min(1, "Client Secret is required")
+ clientSecret: z.string().trim().min(1, "Client Secret is required"),
+ clientSecretKeyId: z.string().trim().optional()
})
});
@@ -54,6 +56,14 @@ export const AzureEntraIdConnectionForm = ({ appConnection, onSubmit }: Props) =
const isUpdate = Boolean(appConnection);
const { onCancel } = useAppConnectionForm();
+ const defaultRotation = {
+ rotationInterval: 30,
+ rotateAtUtc: {
+ hours: 0,
+ minutes: 0
+ }
+ };
+
const form = useForm<FormData>({
resolver: zodResolver(formSchema),
defaultValues: appConnection
@@ -62,6 +72,8 @@ export const AzureEntraIdConnectionForm = ({ appConnection, onSubmit }: Props) =
description: appConnection.description,
app: AppConnection.AzureEntraId,
method: AzureEntraIdConnectionMethod.ClientSecret,
+ isAutoRotationEnabled: appConnection.isAutoRotationEnabled,
+ rotation: appConnection.rotation ?? defaultRotation,
credentials: {
tenantId: appConnection.credentials.tenantId,
clientId: appConnection.credentials.clientId,
@@ -71,6 +83,8 @@ export const AzureEntraIdConnectionForm = ({ appConnection, onSubmit }: Props) =
: {
app: AppConnection.AzureEntraId,
method: AzureEntraIdConnectionMethod.ClientSecret,
+ isAutoRotationEnabled: false,
+ rotation: defaultRotation,
credentials: {
tenantId: "",
clientId: "",
@@ -211,6 +225,37 @@ export const AzureEntraIdConnectionForm = ({ appConnection, onSubmit }: Props) =
)}
/>
+ <CredentialRotationForm>
+ <Controller
+ name="credentials.clientSecretKeyId"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field className="mb-4">
+ <FieldLabel htmlFor="credentials.clientSecretKeyId">
+ Client Secret Key ID
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm">
+ The Key ID of the client secret provided above. Found in Azure Portal under
+ App Registrations &gt; Certificates &amp; Secrets. Required so Infisical can
+ revoke the original secret after rotation.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <Input
+ {...field}
+ id="credentials.clientSecretKeyId"
+ placeholder="00000000-0000-0000-0000-000000000000"
+ isError={Boolean(error)}
+ />
+ <FieldError errors={[error]} />
+ </Field>
+ )}
+ />
+ </CredentialRotationForm>
+
<SheetFooter className="sticky bottom-0 -mx-4 items-center border-t bg-popover">
<Button
type="submit"