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
secret rotation
Matheus Nogueira01ecde91bb43
diff --git a/backend/src/ee/routes/v2/secret-rotation-v2-routers/convex-access-key-rotation-router.ts b/backend/src/ee/routes/v2/secret-rotation-v2-routers/convex-access-key-rotation-router.tsnew file mode 100644index 0000000000..71f9cf6543--- /dev/null+++ b/backend/src/ee/routes/v2/secret-rotation-v2-routers/convex-access-key-rotation-router.ts@@ -0,0 +1,19 @@+import {+ ConvexAccessKeyRotationGeneratedCredentialsSchema,+ ConvexAccessKeyRotationSchema,+ CreateConvexAccessKeyRotationSchema,+ UpdateConvexAccessKeyRotationSchema+} from "@app/ee/services/secret-rotation-v2/convex-access-key";+import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";++import { registerSecretRotationEndpoints } from "./secret-rotation-v2-endpoints";++export const registerConvexAccessKeyRotationRouter = async (server: FastifyZodProvider) =>+ registerSecretRotationEndpoints({+ type: SecretRotation.ConvexAccessKey,+ server,+ responseSchema: ConvexAccessKeyRotationSchema,+ createSchema: CreateConvexAccessKeyRotationSchema,+ updateSchema: UpdateConvexAccessKeyRotationSchema,+ generatedCredentialsSchema: ConvexAccessKeyRotationGeneratedCredentialsSchema+ });diff --git a/backend/src/ee/routes/v2/secret-rotation-v2-routers/index.ts b/backend/src/ee/routes/v2/secret-rotation-v2-routers/index.tsindex 0d543cfefb..29e9bf02ba 100644--- a/backend/src/ee/routes/v2/secret-rotation-v2-routers/index.ts+++ b/backend/src/ee/routes/v2/secret-rotation-v2-routers/index.ts@@ -1,6 +1,7 @@import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";import { registerAuth0ClientSecretRotationRouter } from "./auth0-client-secret-rotation-router";+import { registerConvexAccessKeyRotationRouter } from "./convex-access-key-rotation-router";import { registerAwsIamUserSecretRotationRouter } from "./aws-iam-user-secret-rotation-router";import { registerAzureClientSecretRotationRouter } from "./azure-client-secret-rotation-router";import { registerDatabricksServicePrincipalSecretRotationRouter } from "./databricks-service-principal-secret-rotation-router";@@ -46,5 +47,6 @@ export const SECRET_ROTATION_REGISTER_ROUTER_MAP: Record<[SecretRotation.HpIloLocalAccount]: registerHpIloRotationRouter,[SecretRotation.SupabaseApiKey]: registerSupabaseApiKeyRotationRouter,[SecretRotation.SalesforceOauthCredentials]: registerSalesforceOauthCredentialsRotationRouter,- [SecretRotation.DatadogApplicationKeySecret]: registerDatadogApplicationKeySecretRotationRouter+ [SecretRotation.DatadogApplicationKeySecret]: registerDatadogApplicationKeySecretRotationRouter,+ [SecretRotation.ConvexAccessKey]: registerConvexAccessKeyRotationRouter};diff --git a/backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-router.ts b/backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-router.tsindex ac683cb74e..fd9ebd77db 100644--- a/backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-router.ts+++ b/backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-router.ts@@ -2,6 +2,7 @@ import { z } from "zod";import { EventType } from "@app/ee/services/audit-log/audit-log-types";import { Auth0ClientSecretRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/auth0-client-secret";+import { ConvexAccessKeyRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/convex-access-key";import { AwsIamUserSecretRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/aws-iam-user-secret";import { AzureClientSecretRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/azure-client-secret";import { DatabricksServicePrincipalSecretRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/databricks-service-principal-secret";@@ -47,7 +48,8 @@ const SecretRotationV2OptionsSchema = z.discriminatedUnion("type", [HpIloRotationListItemSchema,SupabaseApiKeyRotationListItemSchema,SalesforceOauthCredentialsRotationListItemSchema,- DatadogApplicationKeySecretRotationListItemSchema+ DatadogApplicationKeySecretRotationListItemSchema,+ ConvexAccessKeyRotationListItemSchema]);export const registerSecretRotationV2Router = async (server: FastifyZodProvider) => {diff --git a/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-constants.ts b/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-constants.tsnew file mode 100644index 0000000000..fccc30a9da--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-constants.ts@@ -0,0 +1,14 @@+import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";+import { TSecretRotationV2ListItem } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-types";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";++export const CONVEX_ACCESS_KEY_ROTATION_LIST_OPTION: TSecretRotationV2ListItem = {+ name: "Convex Access Key",+ type: SecretRotation.ConvexAccessKey,+ connection: AppConnection.Convex,+ template: {+ secretsMapping: {+ accessKey: "CONVEX_ACCESS_KEY"+ }+ }+};diff --git a/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-fns.tsnew file mode 100644index 0000000000..9ec89de58b--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-fns.ts@@ -0,0 +1,164 @@+import { AxiosError } from "axios";++import {+ TRotationFactory,+ TRotationFactoryGetSecretsPayload,+ TRotationFactoryIssueCredentials,+ TRotationFactoryRevokeCredentials,+ TRotationFactoryRotateCredentials+} from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-types";+import { request } from "@app/lib/config/request";+import { BadRequestError } from "@app/lib/errors";+import { logger } from "@app/lib/logger";+import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";+import { TConvexConnection } from "@app/services/app-connection/convex";++import {+ TConvexAccessKeyRotationGeneratedCredentials,+ TConvexAccessKeyRotationWithConnection+} from "./convex-access-key-rotation-types";++const getConvexApiBaseUrl = async (connection: TConvexConnection) => {+ const baseUrl = connection.credentials.instanceUrl || "https://api.convex.dev";+ await blockLocalAndPrivateIpAddresses(baseUrl);+ return baseUrl;+};++const $createAccessKey = async (+ connection: TConvexConnection,+ namePrefix: string+): Promise<{ accessKeyId: string; accessKey: string }> => {+ const baseUrl = await getConvexApiBaseUrl(connection);+ const name = `${namePrefix}-${Date.now()}`;++ const { data } = await request.post<{ accessToken: string }>(+ `${baseUrl}/v1/create_personal_access_token`,+ { name },+ {+ headers: {+ Authorization: `Bearer ${connection.credentials.accessToken}`,+ "Content-Type": "application/json"+ }+ }+ );++ if (!data?.accessToken) {+ throw new BadRequestError({ message: "Convex access key response missing 'accessToken'" });+ }++ return { accessKeyId: name, accessKey: data.accessToken };+};++const $deleteAccessKey = async (connection: TConvexConnection, accessKeyId: string): Promise<void> => {+ const baseUrl = await getConvexApiBaseUrl(connection);++ try {+ await request.post(+ `${baseUrl}/v1/delete_personal_access_token`,+ { id: accessKeyId },+ {+ headers: {+ Authorization: `Bearer ${connection.credentials.accessToken}`,+ "Content-Type": "application/json"+ }+ }+ );+ } catch (error: unknown) {+ if (error instanceof AxiosError && error.response?.status === 404) return;+ throw new BadRequestError({+ message: `Failed to delete Convex access key ${accessKeyId}: ${error instanceof AxiosError ? error.message : "Unknown error"}`+ });+ }+};++const $checkAccessKey = async (connection: TConvexConnection, accessKey: string): Promise<void> => {+ const baseUrl = await getConvexApiBaseUrl(connection);++ try {+ await request.get(`${baseUrl}/v1/list_personal_access_tokens`, {+ headers: {+ Authorization: `Bearer ${accessKey}`,+ "Content-Type": "application/json"+ }+ });+ } catch (error: unknown) {+ throw new BadRequestError({+ message: `Convex access key verification failed: ${error instanceof AxiosError ? error.message : "Unknown error"}`+ });+ }+};++export const convexAccessKeyRotationFactory: TRotationFactory<+ TConvexAccessKeyRotationWithConnection,+ TConvexAccessKeyRotationGeneratedCredentials+> = (secretRotation) => {+ const {+ id: rotationId,+ connection,+ parameters: { namePrefix },+ secretsMapping+ } = secretRotation;++ const issueCredentials: TRotationFactoryIssueCredentials<TConvexAccessKeyRotationGeneratedCredentials> = async (+ callback+ ) => {+ const credentials = await $createAccessKey(connection, namePrefix);+ return callback(credentials);+ };++ const revokeCredentials: TRotationFactoryRevokeCredentials<TConvexAccessKeyRotationGeneratedCredentials> = async (+ generatedCredentials,+ callback+ ) => {+ if (!generatedCredentials?.length) return callback();++ const results = await Promise.allSettled(+ generatedCredentials.map((credential) => $deleteAccessKey(connection, credential.accessKeyId))+ );++ results.forEach((result, index) => {+ if (result.status === "rejected") {+ logger.error(+ result.reason,+ `convexAccessKeyRotation: failed to revoke key during cleanup [rotationId=${rotationId}] [keyId=${generatedCredentials[index].accessKeyId}]`+ );+ }+ });++ return callback();+ };++ const rotateCredentials: TRotationFactoryRotateCredentials<TConvexAccessKeyRotationGeneratedCredentials> = async (+ credentialsToRevoke,+ callback+ ) => {+ const credentials = await $createAccessKey(connection, namePrefix);++ if (credentialsToRevoke?.accessKeyId) {+ try {+ await $deleteAccessKey(connection, credentialsToRevoke.accessKeyId);+ } catch (revokeError) {+ logger.error(+ revokeError,+ `convexAccessKeyRotation: failed to revoke previous key after rotation [rotationId=${rotationId}] [keyId=${credentialsToRevoke.accessKeyId}]`+ );+ }+ }++ return callback(credentials);+ };++ const getSecretsPayload: TRotationFactoryGetSecretsPayload<TConvexAccessKeyRotationGeneratedCredentials> = (+ generatedCredentials+ ) => [{ key: secretsMapping.accessKey, value: generatedCredentials.accessKey }];++ return {+ issueCredentials,+ revokeCredentials,+ rotateCredentials,+ getSecretsPayload,+ checkActiveCredentials: async ({ accessKey }) => {+ await $checkAccessKey(connection, accessKey);+ }+ };+};diff --git a/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-schemas.ts b/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-schemas.tsnew file mode 100644index 0000000000..c533a91e21--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-schemas.ts@@ -0,0 +1,65 @@+import { z } from "zod";++import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";+import {+ BaseCreateSecretRotationSchema,+ BaseSecretRotationSchema,+ BaseUpdateSecretRotationSchema+} from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-schemas";+import { SecretRotations } from "@app/lib/api-docs";+import { SecretNameSchema } from "@app/server/lib/schemas";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";++export const ConvexAccessKeyRotationGeneratedCredentialsSchema = z+ .object({+ accessKeyId: z.string(),+ accessKey: z.string()+ })+ .array()+ .min(1)+ .max(2);++const ConvexAccessKeyRotationParametersSchema = z.object({+ namePrefix: z+ .string()+ .trim()+ .min(1, "Name Prefix required")+ .describe(SecretRotations.PARAMETERS.CONVEX_ACCESS_KEY.namePrefix)+});++const ConvexAccessKeyRotationSecretsMappingSchema = z.object({+ accessKey: SecretNameSchema.describe(SecretRotations.SECRETS_MAPPING.CONVEX_ACCESS_KEY.accessKey)+});++export const ConvexAccessKeyRotationTemplateSchema = z.object({+ secretsMapping: z.object({+ accessKey: z.string()+ })+});++export const ConvexAccessKeyRotationSchema = BaseSecretRotationSchema(SecretRotation.ConvexAccessKey).extend({+ type: z.literal(SecretRotation.ConvexAccessKey),+ parameters: ConvexAccessKeyRotationParametersSchema,+ secretsMapping: ConvexAccessKeyRotationSecretsMappingSchema+});++export const CreateConvexAccessKeyRotationSchema = BaseCreateSecretRotationSchema(+ SecretRotation.ConvexAccessKey+).extend({+ parameters: ConvexAccessKeyRotationParametersSchema,+ secretsMapping: ConvexAccessKeyRotationSecretsMappingSchema+});++export const UpdateConvexAccessKeyRotationSchema = BaseUpdateSecretRotationSchema(+ SecretRotation.ConvexAccessKey+).extend({+ parameters: ConvexAccessKeyRotationParametersSchema.optional(),+ secretsMapping: ConvexAccessKeyRotationSecretsMappingSchema.optional()+});++export const ConvexAccessKeyRotationListItemSchema = z.object({+ name: z.literal("Convex Access Key"),+ connection: z.literal(AppConnection.Convex),+ type: z.literal(SecretRotation.ConvexAccessKey),+ template: ConvexAccessKeyRotationTemplateSchema+});diff --git a/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-types.ts b/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-types.tsnew file mode 100644index 0000000000..238f91fa38--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-types.ts@@ -0,0 +1,24 @@+import { z } from "zod";++import { TConvexConnection } from "@app/services/app-connection/convex";++import {+ ConvexAccessKeyRotationGeneratedCredentialsSchema,+ ConvexAccessKeyRotationListItemSchema,+ ConvexAccessKeyRotationSchema,+ CreateConvexAccessKeyRotationSchema+} from "./convex-access-key-rotation-schemas";++export type TConvexAccessKeyRotation = z.infer<typeof ConvexAccessKeyRotationSchema>;++export type TConvexAccessKeyRotationInput = z.infer<typeof CreateConvexAccessKeyRotationSchema>;++export type TConvexAccessKeyRotationListItem = z.infer<typeof ConvexAccessKeyRotationListItemSchema>;++export type TConvexAccessKeyRotationWithConnection = TConvexAccessKeyRotation & {+ connection: TConvexConnection;+};++export type TConvexAccessKeyRotationGeneratedCredentials = z.infer<+ typeof ConvexAccessKeyRotationGeneratedCredentialsSchema+>;diff --git a/backend/src/ee/services/secret-rotation-v2/convex-access-key/index.ts b/backend/src/ee/services/secret-rotation-v2/convex-access-key/index.tsnew file mode 100644index 0000000000..cb1b9ef244--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/convex-access-key/index.ts@@ -0,0 +1,3 @@+export * from "./convex-access-key-rotation-constants";+export * from "./convex-access-key-rotation-schemas";+export * from "./convex-access-key-rotation-types";diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-enums.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-enums.tsindex 84280a44b1..cc89c95193 100644--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-enums.ts+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-enums.ts@@ -18,7 +18,8 @@ export enum SecretRotation {HpIloLocalAccount = "hp-ilo-local-account",SupabaseApiKey = "supabase-api-key",SalesforceOauthCredentials = "salesforce-oauth-credentials",- DatadogApplicationKeySecret = "datadog-application-key-secret"+ DatadogApplicationKeySecret = "datadog-application-key-secret",+ ConvexAccessKey = "convex-access-key"}export enum SecretRotationStatus {diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-fns.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-fns.tsindex 6d039e2d0d..ddd92aa531 100644--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-fns.ts@@ -7,6 +7,7 @@ import { TQueueOptions } from "@app/queue/queue-service";import { KmsDataKey } from "@app/services/kms/kms-types";import { AUTH0_CLIENT_SECRET_ROTATION_LIST_OPTION } from "./auth0-client-secret";+import { CONVEX_ACCESS_KEY_ROTATION_LIST_OPTION } from "./convex-access-key";import { AWS_IAM_USER_SECRET_ROTATION_LIST_OPTION } from "./aws-iam-user-secret";import { AZURE_CLIENT_SECRET_ROTATION_LIST_OPTION } from "./azure-client-secret";import { DATABRICKS_SERVICE_PRINCIPAL_SECRET_ROTATION_LIST_OPTION } from "./databricks-service-principal-secret";@@ -67,7 +68,8 @@ const SECRET_ROTATION_LIST_OPTIONS: Record<SecretRotation, TSecretRotationV2List[SecretRotation.HpIloLocalAccount]: HP_ILO_ROTATION_LIST_OPTION,[SecretRotation.SupabaseApiKey]: SUPABASE_API_KEY_ROTATION_LIST_OPTION,[SecretRotation.SalesforceOauthCredentials]: SALESFORCE_OAUTH_CREDENTIALS_ROTATION_LIST_OPTION,- [SecretRotation.DatadogApplicationKeySecret]: DATADOG_APPLICATION_KEY_SECRET_ROTATION_LIST_OPTION+ [SecretRotation.DatadogApplicationKeySecret]: DATADOG_APPLICATION_KEY_SECRET_ROTATION_LIST_OPTION,+ [SecretRotation.ConvexAccessKey]: CONVEX_ACCESS_KEY_ROTATION_LIST_OPTION};export const listSecretRotationOptions = () => {diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.tsindex 4384cc0722..ccc913fc69 100644--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts@@ -21,7 +21,8 @@ export const SECRET_ROTATION_NAME_MAP: Record<SecretRotation, string> = {[SecretRotation.HpIloLocalAccount]: "HP iLO Local Account",[SecretRotation.SupabaseApiKey]: "Supabase API Key",[SecretRotation.SalesforceOauthCredentials]: "Salesforce OAuth Credentials",- [SecretRotation.DatadogApplicationKeySecret]: "Datadog Application Key"+ [SecretRotation.DatadogApplicationKeySecret]: "Datadog Application Key",+ [SecretRotation.ConvexAccessKey]: "Convex Access Key"};export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnection> = {@@ -44,5 +45,6 @@ export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnectio[SecretRotation.HpIloLocalAccount]: AppConnection.SSH,[SecretRotation.SupabaseApiKey]: AppConnection.Supabase,[SecretRotation.SalesforceOauthCredentials]: AppConnection.Salesforce,- [SecretRotation.DatadogApplicationKeySecret]: AppConnection.Datadog+ [SecretRotation.DatadogApplicationKeySecret]: AppConnection.Datadog,+ [SecretRotation.ConvexAccessKey]: AppConnection.Convex};diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.tsindex 4917ae1dca..399455c507 100644--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts@@ -15,6 +15,7 @@ import {} from "@app/ee/services/permission/project-permission";import { auth0ClientSecretRotationFactory } from "@app/ee/services/secret-rotation-v2/auth0-client-secret/auth0-client-secret-rotation-fns";import { azureClientSecretRotationFactory } from "@app/ee/services/secret-rotation-v2/azure-client-secret/azure-client-secret-rotation-fns";+import { convexAccessKeyRotationFactory } from "@app/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-fns";import { databricksServicePrincipalSecretRotationFactory } from "@app/ee/services/secret-rotation-v2/databricks-service-principal-secret/databricks-service-principal-secret-rotation-fns";import { datadogApplicationKeySecretRotationFactory } from "@app/ee/services/secret-rotation-v2/datadog-application-key-secret/datadog-application-key-secret-rotation-fns";import { ldapPasswordRotationFactory } from "@app/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-fns";@@ -198,7 +199,8 @@ const SECRET_ROTATION_FACTORY_MAP: Record<SecretRotation, TRotationFactoryImplem[SecretRotation.SalesforceOauthCredentials]:salesforceOauthCredentialsRotationFactory as TRotationFactoryImplementation,[SecretRotation.DatadogApplicationKeySecret]:- datadogApplicationKeySecretRotationFactory as TRotationFactoryImplementation+ datadogApplicationKeySecretRotationFactory as TRotationFactoryImplementation,+ [SecretRotation.ConvexAccessKey]: convexAccessKeyRotationFactory as TRotationFactoryImplementation};export const secretRotationV2ServiceFactory = ({diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.tsindex e7a2ad0f6f..cf77a46739 100644--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts@@ -138,6 +138,13 @@ import {TUnixLinuxLocalAccountRotationListItem,TUnixLinuxLocalAccountRotationWithConnection} from "./unix-linux-local-account-rotation";+import {+ TConvexAccessKeyRotation,+ TConvexAccessKeyRotationGeneratedCredentials,+ TConvexAccessKeyRotationInput,+ TConvexAccessKeyRotationListItem,+ TConvexAccessKeyRotationWithConnection+} from "./convex-access-key";import {TWindowsLocalAccountRotation,TWindowsLocalAccountRotationGeneratedCredentials,@@ -166,7 +173,8 @@ export type TSecretRotationV2 =| THpIloRotation| TSupabaseApiKeyRotation| TSalesforceOauthCredentialsRotation- | TDatadogApplicationKeySecretRotation;+ | TDatadogApplicationKeySecretRotation+ | TConvexAccessKeyRotation;export type TSecretRotationV2WithConnection =| TPostgresCredentialsRotationWithConnection@@ -188,7 +196,8 @@ export type TSecretRotationV2WithConnection =| THpIloRotationWithConnection| TSupabaseApiKeyRotationWithConnection| TSalesforceOauthCredentialsRotationWithConnection- | TDatadogApplicationKeySecretRotationWithConnection;+ | TDatadogApplicationKeySecretRotationWithConnection+ | TConvexAccessKeyRotationWithConnection;export type TSecretRotationV2GeneratedCredentials =| TSqlCredentialsRotationGeneratedCredentials@@ -206,7 +215,8 @@ export type TSecretRotationV2GeneratedCredentials =| THpIloRotationGeneratedCredentials| TSupabaseApiKeyRotationGeneratedCredentials| TSalesforceOauthCredentialsRotationGeneratedCredentials- | TDatadogApplicationKeySecretRotationGeneratedCredentials;+ | TDatadogApplicationKeySecretRotationGeneratedCredentials+ | TConvexAccessKeyRotationGeneratedCredentials;export type TSecretRotationV2Input =| TPostgresCredentialsRotationInput@@ -228,7 +238,8 @@ export type TSecretRotationV2Input =| THpIloRotationInput| TSupabaseApiKeyRotationInput| TSalesforceOauthCredentialsRotationInput- | TDatadogApplicationKeySecretRotationInput;+ | TDatadogApplicationKeySecretRotationInput+ | TConvexAccessKeyRotationInput;export type TSecretRotationV2ListItem =| TPostgresCredentialsRotationListItem@@ -250,7 +261,8 @@ export type TSecretRotationV2ListItem =| THpIloRotationListItem| TSupabaseApiKeyRotationListItem| TSalesforceOauthCredentialsRotationListItem- | TDatadogApplicationKeySecretRotationListItem;+ | TDatadogApplicationKeySecretRotationListItem+ | TConvexAccessKeyRotationListItem;export type TSecretRotationV2TemporaryParameters =| TLdapPasswordRotationInput["temporaryParameters"]diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema.tsindex c7446a58c1..d1cfa6cfc2 100644--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema.ts+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema.ts@@ -18,6 +18,7 @@ import { SalesforceOauthCredentialsRotationSchema } from "@app/ee/services/secreimport { UnixLinuxLocalAccountRotationSchema } from "@app/ee/services/secret-rotation-v2/unix-linux-local-account-rotation";import { WindowsLocalAccountRotationSchema } from "@app/ee/services/secret-rotation-v2/windows-local-account-rotation";+import { ConvexAccessKeyRotationSchema } from "./convex-access-key";import { DbtServiceTokenRotationSchema } from "./dbt-service-token";import { HpIloRotationSchema } from "./hp-ilo-rotation";import { SupabaseApiKeyRotationSchema } from "./supabase-api-key";@@ -42,5 +43,6 @@ export const SecretRotationV2Schema = z.discriminatedUnion("type", [HpIloRotationSchema,SupabaseApiKeyRotationSchema,SalesforceOauthCredentialsRotationSchema,- DatadogApplicationKeySecretRotationSchema+ DatadogApplicationKeySecretRotationSchema,+ ConvexAccessKeyRotationSchema]);diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex 6e93ebdbc1..d0e5496145 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -3393,6 +3393,9 @@ export const SecretRotations = {},DATADOG_APPLICATION_KEY_SECRET: {serviceAccountId: "The ID of the Datadog service account to rotate the application key for."+ },+ CONVEX_ACCESS_KEY: {+ namePrefix: "A prefix to use when naming the generated Convex access key."}},SECRETS_MAPPING: {@@ -3464,6 +3467,9 @@ export const SecretRotations = {DATADOG_APPLICATION_KEY_SECRET: {applicationKeyId: "The name of the secret that the rotated Datadog application key ID will be mapped to.",applicationKey: "The name of the secret that the rotated Datadog application key value will be mapped to."+ },+ CONVEX_ACCESS_KEY: {+ accessKey: "The name of the secret that the rotated Convex access key will be mapped to."}}};diff --git a/backend/src/services/app-connection/convex/convex-connection-fns.ts b/backend/src/services/app-connection/convex/convex-connection-fns.tsindex 920c29d4b8..e020e224fa 100644--- a/backend/src/services/app-connection/convex/convex-connection-fns.ts+++ b/backend/src/services/app-connection/convex/convex-connection-fns.ts@@ -1,10 +1,11 @@import { request } from "@app/lib/config/request";import { UnauthorizedError } from "@app/lib/errors";+import { logger } from "@app/lib/logger";+import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";import { AppConnection } from "@app/services/app-connection/app-connection-enums";import { ConvexConnectionMethod } from "./convex-connection-enums";import { TConvexConnectionConfig } from "./convex-connection-types";-import { logger } from "@app/lib/logger";export const CONVEX_API_BASE_URL = "https://api.convex.dev";@@ -20,6 +21,8 @@ export const validateConvexConnectionCredentials = async (config: TConvexConnectconst { accessToken, instanceUrl } = config.credentials;const baseUrl = instanceUrl || CONVEX_API_BASE_URL;+ await blockLocalAndPrivateIpAddresses(baseUrl);+try {await request.get(`${baseUrl}/v1/list_personal_access_tokens`, {headers: {diff --git a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewConvexAccessKeyRotationGeneratedCredentials.tsx b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewConvexAccessKeyRotationGeneratedCredentials.tsxnew file mode 100644index 0000000000..2cf640330d--- /dev/null+++ b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewConvexAccessKeyRotationGeneratedCredentials.tsx@@ -0,0 +1,31 @@+import { TConvexAccessKeyRotationGeneratedCredentialsResponse } from "@app/hooks/api/secretRotationsV2/types/convex-access-key-rotation";++import { CredentialDisplay, ViewRotationGeneratedCredentialsDisplay } from "./shared";++type Props = {+ generatedCredentialsResponse: TConvexAccessKeyRotationGeneratedCredentialsResponse;+};++export const ViewConvexAccessKeyRotationGeneratedCredentials = ({+ generatedCredentialsResponse: { generatedCredentials, activeIndex }+}: Props) => {+ const inactiveIndex = activeIndex === 0 ? 1 : 0;++ const activeCredentials = generatedCredentials[activeIndex];+ const inactiveCredentials = generatedCredentials[inactiveIndex];++ return (+ <ViewRotationGeneratedCredentialsDisplay+ activeCredentials={+ <CredentialDisplay isSensitive label="Access Key">+ {activeCredentials?.accessKey}+ </CredentialDisplay>+ }+ inactiveCredentials={+ <CredentialDisplay isSensitive label="Access Key">+ {inactiveCredentials?.accessKey}+ </CredentialDisplay>+ }+ />+ );+};diff --git a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsxindex 7115ec5685..c40b1d65c9 100644--- a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx+++ b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx@@ -4,6 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { format } from "date-fns";import { ViewAuth0ClientSecretRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewAuth0ClientSecretRotationGeneratedCredentials";+import { ViewConvexAccessKeyRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewConvexAccessKeyRotationGeneratedCredentials";import { ViewAzureClientSecretRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewAzureClientSecretRotationGeneratedCredentials";import { ViewDatabricksServicePrincipalSecretRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewDatabricksServicePrincipalSecretRotationGeneratedCredentials";import { ViewLdapPasswordRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewLdapPasswordRotationGeneratedCredentials";@@ -188,6 +189,13 @@ const Content = ({ secretRotation }: ContentProps) => {/>);break;+ case SecretRotation.ConvexAccessKey:+ Component = (+ <ViewConvexAccessKeyRotationGeneratedCredentials+ generatedCredentialsResponse={generatedCredentialsResponse}+ />+ );+ break;default:throw new Error("Unhandled View Generated Credential Rotation Type");}diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/ConvexAccessKeyRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/ConvexAccessKeyRotationParametersFields.tsxnew file mode 100644index 0000000000..faa239ae5d--- /dev/null+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/ConvexAccessKeyRotationParametersFields.tsx@@ -0,0 +1,29 @@+import { Controller, useFormContext } from "react-hook-form";++import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";+import { FormControl, Input } from "@app/components/v2";+import { SecretRotation } from "@app/hooks/api/secretRotationsV2";++export const ConvexAccessKeyRotationParametersFields = () => {+ const { control } = useFormContext<+ TSecretRotationV2Form & {+ type: SecretRotation.ConvexAccessKey;+ }+ >();++ return (+ <Controller+ name="parameters.namePrefix"+ control={control}+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <FormControl isError={Boolean(error)} errorText={error?.message} label="Name Prefix">+ <Input+ value={value}+ onChange={onChange}+ placeholder="e.g. infisical-rotation"+ />+ </FormControl>+ )}+ />+ );+};diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SecretRotationV2ParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SecretRotationV2ParametersFields.tsxindex b43f5eed35..6a719e83a0 100644--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SecretRotationV2ParametersFields.tsx+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SecretRotationV2ParametersFields.tsx@@ -4,6 +4,7 @@ import { SecretRotation } from "@app/hooks/api/secretRotationsV2";import { TSecretRotationV2Form } from "../schemas";import { Auth0ClientSecretRotationParametersFields } from "./Auth0ClientSecretRotationParametersFields";+import { ConvexAccessKeyRotationParametersFields } from "./ConvexAccessKeyRotationParametersFields";import { AwsIamUserSecretRotationParametersFields } from "./AwsIamUserSecretRotationParametersFields";import { AzureClientSecretRotationParametersFields } from "./AzureClientSecretRotationParametersFields";import { DatabricksServicePrincipalSecretRotationParametersFields } from "./DatabricksServicePrincipalSecretRotationParametersFields";@@ -42,7 +43,8 @@ const COMPONENT_MAP: Record<SecretRotation, React.FC> = {[SecretRotation.HpIloLocalAccount]: HpIloRotationParametersFields,[SecretRotation.SupabaseApiKey]: SupabaseApiKeyRotationParametersFields,[SecretRotation.SalesforceOauthCredentials]: SalesforceOauthCredentialsRotationParametersFields,- [SecretRotation.DatadogApplicationKeySecret]: DatadogApplicationKeySecretRotationParametersFields+ [SecretRotation.DatadogApplicationKeySecret]: DatadogApplicationKeySecretRotationParametersFields,+ [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationParametersFields};export const SecretRotationV2ParametersFields = () => {diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/ConvexAccessKeyRotationReviewFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/ConvexAccessKeyRotationReviewFields.tsxnew file mode 100644index 0000000000..8b51d5c9d8--- /dev/null+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/ConvexAccessKeyRotationReviewFields.tsx@@ -0,0 +1,30 @@+import { useFormContext } from "react-hook-form";++import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";+import { GenericFieldLabel } from "@app/components/v2";+import { SecretRotation } from "@app/hooks/api/secretRotationsV2";++import { SecretRotationReviewSection } from "./shared";++export const ConvexAccessKeyRotationReviewFields = () => {+ const { watch } = useFormContext<+ TSecretRotationV2Form & {+ type: SecretRotation.ConvexAccessKey;+ }+ >();++ const [parameters, { accessKey }] = watch(["parameters", "secretsMapping"]);++ return (+ <>+ <SecretRotationReviewSection label="Parameters">+ <GenericFieldLabel label="Name Prefix">+ {parameters.namePrefix}+ </GenericFieldLabel>+ </SecretRotationReviewSection>+ <SecretRotationReviewSection label="Secrets Mapping">+ <GenericFieldLabel label="Access Key">{accessKey}</GenericFieldLabel>+ </SecretRotationReviewSection>+ </>+ );+};diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/SecretRotationReviewFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/SecretRotationReviewFields.tsxindex e8926b0caa..6ba9d1ac01 100644--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/SecretRotationReviewFields.tsx+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/SecretRotationReviewFields.tsx@@ -7,6 +7,7 @@ import { getRotateAtLocal } from "@app/helpers/secretRotationsV2";import { SecretRotation } from "@app/hooks/api/secretRotationsV2";import { Auth0ClientSecretRotationReviewFields } from "./Auth0ClientSecretRotationReviewFields";+import { ConvexAccessKeyRotationReviewFields } from "./ConvexAccessKeyRotationReviewFields";import { AwsIamUserSecretRotationReviewFields } from "./AwsIamUserSecretRotationReviewFields";import { AzureClientSecretRotationReviewFields } from "./AzureClientSecretRotationReviewFields";import { DatabricksServicePrincipalSecretRotationReviewFields } from "./DatabricksServicePrincipalSecretRotationReviewFields";@@ -44,7 +45,8 @@ const COMPONENT_MAP: Record<SecretRotation, React.FC> = {[SecretRotation.HpIloLocalAccount]: HpIloRotationReviewFields,[SecretRotation.SupabaseApiKey]: SupabaseApiKeyRotationReviewFields,[SecretRotation.SalesforceOauthCredentials]: SalesforceOauthCredentialsRotationReviewFields,- [SecretRotation.DatadogApplicationKeySecret]: DatadogApplicationKeySecretRotationReviewFields+ [SecretRotation.DatadogApplicationKeySecret]: DatadogApplicationKeySecretRotationReviewFields,+ [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationReviewFields};export const SecretRotationV2ReviewFields = () => {diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/ConvexAccessKeyRotationSecretsMappingFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/ConvexAccessKeyRotationSecretsMappingFields.tsxnew file mode 100644index 0000000000..a249d6a444--- /dev/null+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/ConvexAccessKeyRotationSecretsMappingFields.tsx@@ -0,0 +1,40 @@+import { Controller, useFormContext } from "react-hook-form";++import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";+import { FormControl, Input } from "@app/components/v2";+import { SecretRotation, useSecretRotationV2Option } from "@app/hooks/api/secretRotationsV2";++import { SecretsMappingTable } from "./shared";++export const ConvexAccessKeyRotationSecretsMappingFields = () => {+ const { control } = useFormContext<+ TSecretRotationV2Form & {+ type: SecretRotation.ConvexAccessKey;+ }+ >();++ const { rotationOption } = useSecretRotationV2Option(SecretRotation.ConvexAccessKey);++ const items = [+ {+ name: "Access Key",+ input: (+ <Controller+ render={({ field: { value, onChange }, fieldState: { error } }) => (+ <FormControl isError={Boolean(error)} errorText={error?.message}>+ <Input+ value={value}+ onChange={onChange}+ placeholder={rotationOption?.template.secretsMapping.accessKey}+ />+ </FormControl>+ )}+ control={control}+ name="secretsMapping.accessKey"+ />+ )+ }+ ];++ return <SecretsMappingTable items={items} />;+};diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/SecretRotationV2SecretsMappingFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/SecretRotationV2SecretsMappingFields.tsxindex 1b83ccf175..4c79c3c424 100644--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/SecretRotationV2SecretsMappingFields.tsx+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/SecretRotationV2SecretsMappingFields.tsx@@ -4,6 +4,7 @@ import { SecretRotation } from "@app/hooks/api/secretRotationsV2";import { TSecretRotationV2Form } from "../schemas";import { Auth0ClientSecretRotationSecretsMappingFields } from "./Auth0ClientSecretRotationSecretsMappingFields";+import { ConvexAccessKeyRotationSecretsMappingFields } from "./ConvexAccessKeyRotationSecretsMappingFields";import { AwsIamUserSecretRotationSecretsMappingFields } from "./AwsIamUserSecretRotationSecretsMappingFields";import { AzureClientSecretRotationSecretsMappingFields } from "./AzureClientSecretRotationSecretsMappingFields";import { DatabricksServicePrincipalSecretRotationSecretsMappingFields } from "./DatabricksServicePrincipalSecretRotationSecretsMappingFields";@@ -43,7 +44,8 @@ const COMPONENT_MAP: Record<SecretRotation, React.FC> = {[SecretRotation.SalesforceOauthCredentials]:SalesforceOauthCredentialsRotationSecretsMappingFields,[SecretRotation.DatadogApplicationKeySecret]:- DatadogApplicationKeySecretRotationSecretsMappingFields+ DatadogApplicationKeySecretRotationSecretsMappingFields,+ [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationSecretsMappingFields};export const SecretRotationV2SecretsMappingFields = () => {diff --git a/frontend/src/components/secret-rotations-v2/forms/schemas/convex-access-key-rotation-schema.ts b/frontend/src/components/secret-rotations-v2/forms/schemas/convex-access-key-rotation-schema.tsnew file mode 100644index 0000000000..0f5e9c788c--- /dev/null+++ b/frontend/src/components/secret-rotations-v2/forms/schemas/convex-access-key-rotation-schema.ts@@ -0,0 +1,16 @@+import { z } from "zod";++import { BaseSecretRotationSchema } from "@app/components/secret-rotations-v2/forms/schemas/base-secret-rotation-v2-schema";+import { SecretRotation } from "@app/hooks/api/secretRotationsV2";++export const ConvexAccessKeyRotationSchema = z+ .object({+ type: z.literal(SecretRotation.ConvexAccessKey),+ parameters: z.object({+ namePrefix: z.string().trim().min(1, "Name Prefix required")+ }),+ secretsMapping: z.object({+ accessKey: z.string().trim().min(1, "Access Key secret name required")+ })+ })+ .merge(BaseSecretRotationSchema);diff --git a/frontend/src/components/secret-rotations-v2/forms/schemas/index.ts b/frontend/src/components/secret-rotations-v2/forms/schemas/index.tsindex 6051cafc84..499d876872 100644--- a/frontend/src/components/secret-rotations-v2/forms/schemas/index.ts+++ b/frontend/src/components/secret-rotations-v2/forms/schemas/index.ts@@ -15,6 +15,7 @@ import { LdapPasswordRotationMethod } from "@app/hooks/api/secretRotationsV2/typimport { UnixLinuxLocalAccountRotationMethod } from "@app/hooks/api/secretRotationsV2/types/unix-linux-local-account-rotation";import { WindowsLocalAccountRotationMethod } from "@app/hooks/api/secretRotationsV2/types/windows-local-account-rotation";+import { ConvexAccessKeyRotationSchema } from "./convex-access-key-rotation-schema";import { DatadogApplicationKeySecretRotationSchema } from "./datadog-application-key-secret-rotation-schema";import { DbtServiceTokenRotationSchema } from "./dbt-service-token-rotation-schema";import { HpIloRotationSchema } from "./hp-ilo-rotation-schema";@@ -50,7 +51,8 @@ export const SecretRotationV2FormSchema = (isUpdate: boolean) =>HpIloRotationSchema,SupabaseApiKeyRotationSchema,SalesforceOauthCredentialsRotationSchema,- DatadogApplicationKeySecretRotationSchema+ DatadogApplicationKeySecretRotationSchema,+ ConvexAccessKeyRotationSchema]),z.object({ id: z.string().optional() }))diff --git a/frontend/src/helpers/secretRotationsV2.ts b/frontend/src/helpers/secretRotationsV2.tsindex 86969542a5..f768f4dc25 100644--- a/frontend/src/helpers/secretRotationsV2.ts+++ b/frontend/src/helpers/secretRotationsV2.ts@@ -104,6 +104,11 @@ export const SECRET_ROTATION_MAP: Record<name: "Datadog Application Key",image: "DatadogWhite.png",size: 50+ },+ [SecretRotation.ConvexAccessKey]: {+ name: "Convex Access Key",+ image: "Convex.png",+ size: 50}};@@ -127,7 +132,8 @@ export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnectio[SecretRotation.HpIloLocalAccount]: AppConnection.SSH,[SecretRotation.SupabaseApiKey]: AppConnection.Supabase,[SecretRotation.SalesforceOauthCredentials]: AppConnection.Salesforce,- [SecretRotation.DatadogApplicationKeySecret]: AppConnection.Datadog+ [SecretRotation.DatadogApplicationKeySecret]: AppConnection.Datadog,+ [SecretRotation.ConvexAccessKey]: AppConnection.Convex};// if a rotation can potentially have downtime due to rotating a single credential set this to false@@ -151,7 +157,8 @@ export const IS_ROTATION_DUAL_CREDENTIALS: Record<SecretRotation, boolean> = {[SecretRotation.HpIloLocalAccount]: false,[SecretRotation.SupabaseApiKey]: true,[SecretRotation.SalesforceOauthCredentials]: true,- [SecretRotation.DatadogApplicationKeySecret]: true+ [SecretRotation.DatadogApplicationKeySecret]: true,+ [SecretRotation.ConvexAccessKey]: true};export const getRotateAtLocal = ({ hours, minutes }: TSecretRotationV2["rotateAtUtc"]) => {diff --git a/frontend/src/hooks/api/secretRotationsV2/enums.ts b/frontend/src/hooks/api/secretRotationsV2/enums.tsindex e674d33eb5..ce3c11c8e5 100644--- a/frontend/src/hooks/api/secretRotationsV2/enums.ts+++ b/frontend/src/hooks/api/secretRotationsV2/enums.ts@@ -18,7 +18,8 @@ export enum SecretRotation {HpIloLocalAccount = "hp-ilo-local-account",SupabaseApiKey = "supabase-api-key",SalesforceOauthCredentials = "salesforce-oauth-credentials",- DatadogApplicationKeySecret = "datadog-application-key-secret"+ DatadogApplicationKeySecret = "datadog-application-key-secret",+ ConvexAccessKey = "convex-access-key"}export enum SecretRotationStatus {diff --git a/frontend/src/hooks/api/secretRotationsV2/types/convex-access-key-rotation.ts b/frontend/src/hooks/api/secretRotationsV2/types/convex-access-key-rotation.tsnew file mode 100644index 0000000000..c5363b0c40--- /dev/null+++ b/frontend/src/hooks/api/secretRotationsV2/types/convex-access-key-rotation.ts@@ -0,0 +1,36 @@+import { AppConnection } from "@app/hooks/api/appConnections/enums";+import { SecretRotation } from "@app/hooks/api/secretRotationsV2";+import {+ TSecretRotationV2Base,+ TSecretRotationV2GeneratedCredentialsResponseBase+} from "@app/hooks/api/secretRotationsV2/types/shared";++export type TConvexAccessKeyRotation = TSecretRotationV2Base & {+ type: SecretRotation.ConvexAccessKey;+ parameters: {+ namePrefix: string;+ };+ secretsMapping: {+ accessKey: string;+ };+};++export type TConvexAccessKeyRotationGeneratedCredentials = {+ accessKeyId: string;+ accessKey: string;+};++export type TConvexAccessKeyRotationGeneratedCredentialsResponse =+ TSecretRotationV2GeneratedCredentialsResponseBase<+ SecretRotation.ConvexAccessKey,+ TConvexAccessKeyRotationGeneratedCredentials+ >;++export type TConvexAccessKeyRotationOption = {+ name: string;+ type: SecretRotation.ConvexAccessKey;+ connection: AppConnection.Convex;+ template: {+ secretsMapping: TConvexAccessKeyRotation["secretsMapping"];+ };+};diff --git a/frontend/src/hooks/api/secretRotationsV2/types/index.ts b/frontend/src/hooks/api/secretRotationsV2/types/index.tsindex ae0caa929c..3f0370531f 100644--- a/frontend/src/hooks/api/secretRotationsV2/types/index.ts+++ b/frontend/src/hooks/api/secretRotationsV2/types/index.ts@@ -36,6 +36,11 @@ import { TSqlCredentialsRotationOption } from "@app/hooks/api/secretRotationsV2/import { SecretV3RawSanitized } from "@app/hooks/api/secrets/types";import { DiscriminativePick } from "@app/types";+import {+ TConvexAccessKeyRotation,+ TConvexAccessKeyRotationGeneratedCredentialsResponse,+ TConvexAccessKeyRotationOption+} from "./convex-access-key-rotation";import {TDatadogApplicationKeySecretRotation,TDatadogApplicationKeySecretRotationGeneratedCredentialsResponse,@@ -121,6 +126,7 @@ export type TSecretRotationV2 = (| TSupabaseApiKeyRotation| TSalesforceOauthCredentialsRotation| TDatadogApplicationKeySecretRotation+ | TConvexAccessKeyRotation) & {secrets: (SecretV3RawSanitized | null)[];};@@ -142,7 +148,8 @@ export type TSecretRotationV2Option =| THpIloRotationOption| TSupabaseApiKeyRotationOption| TSalesforceOauthCredentialsRotationOption- | TDatadogApplicationKeySecretRotationOption;+ | TDatadogApplicationKeySecretRotationOption+ | TConvexAccessKeyRotationOption;export type TListSecretRotationV2Options = { secretRotationOptions: TSecretRotationV2Option[] };@@ -168,7 +175,8 @@ export type TViewSecretRotationGeneratedCredentialsResponse =| THpIloRotationGeneratedCredentialsResponse| TSupabaseApiKeyRotationGeneratedCredentialsResponse| TSalesforceOauthCredentialsRotationGeneratedCredentialsResponse- | TDatadogApplicationKeySecretRotationGeneratedCredentialsResponse;+ | TDatadogApplicationKeySecretRotationGeneratedCredentialsResponse+ | TConvexAccessKeyRotationGeneratedCredentialsResponse;export type TCreateSecretRotationV2DTO = DiscriminativePick<TSecretRotationV2,@@ -243,6 +251,7 @@ export type TSecretRotationOptionMap = {[SecretRotation.SupabaseApiKey]: TSupabaseApiKeyRotationOption;[SecretRotation.SalesforceOauthCredentials]: TSalesforceOauthCredentialsRotationOption;[SecretRotation.DatadogApplicationKeySecret]: TDatadogApplicationKeySecretRotationOption;+ [SecretRotation.ConvexAccessKey]: TConvexAccessKeyRotationOption;};export type TSecretRotationGeneratedCredentialsResponseMap = {@@ -266,6 +275,7 @@ export type TSecretRotationGeneratedCredentialsResponseMap = {[SecretRotation.SupabaseApiKey]: TSupabaseApiKeyRotationGeneratedCredentialsResponse;[SecretRotation.SalesforceOauthCredentials]: TSalesforceOauthCredentialsRotationGeneratedCredentialsResponse;[SecretRotation.DatadogApplicationKeySecret]: TDatadogApplicationKeySecretRotationGeneratedCredentialsResponse;+ [SecretRotation.ConvexAccessKey]: TConvexAccessKeyRotationGeneratedCredentialsResponse;};// Unified type for local account reconciliation (Unix/Linux, Windows, and HP iLO)