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
feat: switched ssh-password to unix linux account rotation naming
=4c0d34a6b393
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 3f2a1e2644..f32a3d4b4c 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@@ -12,7 +12,7 @@ import { registerOktaClientSecretRotationRouter } from "./okta-client-secret-rotimport { registerOracleDBCredentialsRotationRouter } from "./oracledb-credentials-rotation-router";import { registerPostgresCredentialsRotationRouter } from "./postgres-credentials-rotation-router";import { registerRedisCredentialsRotationRouter } from "./redis-credentials-rotation-router";-import { registerSshPasswordRotationRouter } from "./ssh-password-rotation-router";+import { registerUnixLinuxLocalAccountRotationRouter } from "./unix-linux-local-account-rotation-router";export * from "./secret-rotation-v2-router";@@ -32,5 +32,5 @@ export const SECRET_ROTATION_REGISTER_ROUTER_MAP: Record<[SecretRotation.RedisCredentials]: registerRedisCredentialsRotationRouter,[SecretRotation.MongoDBCredentials]: registerMongoDBCredentialsRotationRouter,[SecretRotation.DatabricksServicePrincipalSecret]: registerDatabricksServicePrincipalSecretRotationRouter,- [SecretRotation.SshPassword]: registerSshPasswordRotationRouter+ [SecretRotation.UnixLinuxLocalAccount]: registerUnixLinuxLocalAccountRotationRouter};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 0fa0dab6a9..864697409c 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@@ -14,7 +14,7 @@ import { OracleDBCredentialsRotationListItemSchema } from "@app/ee/services/secrimport { PostgresCredentialsRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/postgres-credentials";import { RedisCredentialsRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/redis-credentials";import { SecretRotationV2Schema } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema";-import { SshPasswordRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/ssh-password";+import { UnixLinuxLocalAccountRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/unix-linux-local-account-rotation";import { ApiDocsTags, SecretRotations } from "@app/lib/api-docs";import { readLimit } from "@app/server/config/rateLimiter";import { verifyAuth } from "@app/server/plugins/auth/verify-auth";@@ -33,7 +33,7 @@ const SecretRotationV2OptionsSchema = z.discriminatedUnion("type", [RedisCredentialsRotationListItemSchema,MongoDBCredentialsRotationListItemSchema,DatabricksServicePrincipalSecretRotationListItemSchema,- SshPasswordRotationListItemSchema+ UnixLinuxLocalAccountRotationListItemSchema]);export const registerSecretRotationV2Router = async (server: FastifyZodProvider) => {diff --git a/backend/src/ee/routes/v2/secret-rotation-v2-routers/ssh-password-rotation-router.ts b/backend/src/ee/routes/v2/secret-rotation-v2-routers/unix-linux-local-account-rotation-router.tssimilarity index 60%rename from backend/src/ee/routes/v2/secret-rotation-v2-routers/ssh-password-rotation-router.tsrename to backend/src/ee/routes/v2/secret-rotation-v2-routers/unix-linux-local-account-rotation-router.tsindex ade2e23c73..1e13011d56 100644--- a/backend/src/ee/routes/v2/secret-rotation-v2-routers/ssh-password-rotation-router.ts+++ b/backend/src/ee/routes/v2/secret-rotation-v2-routers/unix-linux-local-account-rotation-router.ts@@ -3,12 +3,12 @@ import { z } from "zod";import { EventType } from "@app/ee/services/audit-log/audit-log-types";import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";import {- CreateSshPasswordRotationSchema,- SshPasswordRotationGeneratedCredentialsSchema,- SshPasswordRotationSchema,- TSshPasswordRotation,- UpdateSshPasswordRotationSchema-} from "@app/ee/services/secret-rotation-v2/ssh-password";+ CreateUnixLinuxLocalAccountRotationSchema,+ UnixLinuxLocalAccountRotationGeneratedCredentialsSchema,+ UnixLinuxLocalAccountRotationSchema,+ TUnixLinuxLocalAccountRotation,+ UpdateUnixLinuxLocalAccountRotationSchema+} from "@app/ee/services/secret-rotation-v2/unix-linux-local-account-rotation";import { ApiDocsTags, SecretRotations } from "@app/lib/api-docs";import { writeLimit } from "@app/server/config/rateLimiter";import { verifyAuth } from "@app/server/plugins/auth/verify-auth";@@ -16,18 +16,18 @@ import { AuthMode } from "@app/services/auth/auth-type";import { registerSecretRotationEndpoints } from "./secret-rotation-v2-endpoints";-export const registerSshPasswordRotationRouter = async (server: FastifyZodProvider) => {+export const registerUnixLinuxLocalAccountRotationRouter = async (server: FastifyZodProvider) => {// Register standard CRUD endpointsregisterSecretRotationEndpoints({- type: SecretRotation.SshPassword,+ type: SecretRotation.UnixLinuxLocalAccount,server,- responseSchema: SshPasswordRotationSchema,- createSchema: CreateSshPasswordRotationSchema,- updateSchema: UpdateSshPasswordRotationSchema,- generatedCredentialsSchema: SshPasswordRotationGeneratedCredentialsSchema+ responseSchema: UnixLinuxLocalAccountRotationSchema,+ createSchema: CreateUnixLinuxLocalAccountRotationSchema,+ updateSchema: UpdateUnixLinuxLocalAccountRotationSchema,+ generatedCredentialsSchema: UnixLinuxLocalAccountRotationGeneratedCredentialsSchema});- // Add reconcile endpoint for SSH password rotation+ // Add reconcile endpoint for Unix/Linux Local Account rotationserver.route({method: "POST",url: "/:rotationId/reconcile",@@ -38,7 +38,7 @@ export const registerSshPasswordRotationRouter = async (server: FastifyZodProvidhide: false,tags: [ApiDocsTags.SecretRotations],description:- "Reconcile SSH password rotation credentials. This operation uses the SSH app connection credentials to reset the password when credentials are out of sync.",+ "Reconcile Unix/Linux Local Account rotation credentials. This operation uses the SSH app connection credentials to reset the password when credentials are out of sync.",params: z.object({rotationId: z.string().uuid().describe(SecretRotations.RECONCILE.rotationId)}),@@ -46,7 +46,7 @@ export const registerSshPasswordRotationRouter = async (server: FastifyZodProvid200: z.object({message: z.string(),reconciled: z.boolean(),- secretRotation: SshPasswordRotationSchema+ secretRotation: UnixLinuxLocalAccountRotationSchema})}},@@ -54,7 +54,7 @@ export const registerSshPasswordRotationRouter = async (server: FastifyZodProvidhandler: async (req) => {const { rotationId } = req.params;- const result = await server.services.secretRotationV2.reconcileSshPasswordRotation(+ const result = await server.services.secretRotationV2.reconcileUnixLinuxLocalAccountRotation({ rotationId },req.permission);@@ -65,7 +65,7 @@ export const registerSshPasswordRotationRouter = async (server: FastifyZodProvidevent: {type: EventType.RECONCILE_SECRET_ROTATION,metadata: {- type: SecretRotation.SshPassword,+ type: SecretRotation.UnixLinuxLocalAccount,rotationId,reconciled: result.reconciled}@@ -75,7 +75,7 @@ export const registerSshPasswordRotationRouter = async (server: FastifyZodProvidreturn {message: result.message,reconciled: result.reconciled,- secretRotation: result.secretRotation as TSshPasswordRotation+ secretRotation: result.secretRotation as TUnixLinuxLocalAccountRotation};}});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 16f7a4d5fd..f848876cf1 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@@ -11,7 +11,7 @@ export enum SecretRotation {RedisCredentials = "redis-credentials",MongoDBCredentials = "mongodb-credentials",DatabricksServicePrincipalSecret = "databricks-service-principal-secret",- SshPassword = "ssh-password"+ UnixLinuxLocalAccount = "unix-linux-local-account"}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 da8d54babb..8a43296892 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@@ -28,7 +28,7 @@ import {TSecretRotationV2Raw,TUpdateSecretRotationV2DTO} from "./secret-rotation-v2-types";-import { SSH_PASSWORD_ROTATION_LIST_OPTION, TSshPasswordRotation } from "./ssh-password";+import { UNIX_LINUX_LOCAL_ACCOUNT_ROTATION_LIST_OPTION, TUnixLinuxLocalAccountRotation } from "./unix-linux-local-account-rotation";const SECRET_ROTATION_LIST_OPTIONS: Record<SecretRotation, TSecretRotationV2ListItem> = {[SecretRotation.PostgresCredentials]: POSTGRES_CREDENTIALS_ROTATION_LIST_OPTION,@@ -43,7 +43,7 @@ const SECRET_ROTATION_LIST_OPTIONS: Record<SecretRotation, TSecretRotationV2List[SecretRotation.RedisCredentials]: REDIS_CREDENTIALS_ROTATION_LIST_OPTION,[SecretRotation.MongoDBCredentials]: MONGODB_CREDENTIALS_ROTATION_LIST_OPTION,[SecretRotation.DatabricksServicePrincipalSecret]: DATABRICKS_SERVICE_PRINCIPAL_SECRET_ROTATION_LIST_OPTION,- [SecretRotation.SshPassword]: SSH_PASSWORD_ROTATION_LIST_OPTION+ [SecretRotation.UnixLinuxLocalAccount]: UNIX_LINUX_LOCAL_ACCOUNT_ROTATION_LIST_OPTION};export const listSecretRotationOptions = () => {@@ -274,11 +274,11 @@ export const throwOnImmutableParameterUpdate = (throw new BadRequestError({ message: "Cannot update rotation method or DN" });}break;- case SecretRotation.SshPassword:+ case SecretRotation.UnixLinuxLocalAccount:if (haveUnequalProperties(- updatePayload.parameters as TSshPasswordRotation["parameters"],- secretRotation.parameters as TSshPasswordRotation["parameters"],+ updatePayload.parameters as TUnixLinuxLocalAccountRotation["parameters"],+ secretRotation.parameters as TUnixLinuxLocalAccountRotation["parameters"],["rotationMethod", "username"])) {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 aa926e725b..bfc39f39ec 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@@ -14,7 +14,7 @@ export const SECRET_ROTATION_NAME_MAP: Record<SecretRotation, string> = {[SecretRotation.RedisCredentials]: "Redis Credentials",[SecretRotation.MongoDBCredentials]: "MongoDB Credentials",[SecretRotation.DatabricksServicePrincipalSecret]: "Databricks Service Principal Secret",- [SecretRotation.SshPassword]: "SSH Password"+ [SecretRotation.UnixLinuxLocalAccount]: "Unix/Linux Local Account"};export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnection> = {@@ -30,5 +30,5 @@ export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnectio[SecretRotation.RedisCredentials]: AppConnection.Redis,[SecretRotation.MongoDBCredentials]: AppConnection.MongoDB,[SecretRotation.DatabricksServicePrincipalSecret]: AppConnection.Databricks,- [SecretRotation.SshPassword]: AppConnection.SSH+ [SecretRotation.UnixLinuxLocalAccount]: AppConnection.SSH};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 06710fc265..454c7e1b64 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@@ -89,12 +89,12 @@ import { mongodbCredentialsRotationFactory } from "./mongodb-credentials/mongodbimport { oktaClientSecretRotationFactory } from "./okta-client-secret/okta-client-secret-rotation-fns";import { redisCredentialsRotationFactory } from "./redis-credentials/redis-credentials-rotation-fns";import { TSecretRotationV2DALFactory } from "./secret-rotation-v2-dal";-import { sshPasswordRotationFactory } from "./ssh-password/ssh-password-rotation-fns";-import { SshPasswordRotationMethod } from "./ssh-password/ssh-password-rotation-schemas";+import { unixLinuxLocalAccountRotationFactory } from "./unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns";+import { UnixLinuxLocalAccountRotationMethod } from "./unix-linux-local-account-rotation/unix-linux-local-account-rotation-schemas";import {- TSshPasswordRotation,- TSshPasswordRotationGeneratedCredentials-} from "./ssh-password/ssh-password-rotation-types";+ TUnixLinuxLocalAccountRotation,+ TUnixLinuxLocalAccountRotationGeneratedCredentials+} from "./unix-linux-local-account-rotation/unix-linux-local-account-rotation-types";export type TSecretRotationV2ServiceFactoryDep = {secretRotationV2DAL: TSecretRotationV2DALFactory;@@ -146,7 +146,7 @@ const SECRET_ROTATION_FACTORY_MAP: Record<SecretRotation, TRotationFactoryImplem[SecretRotation.MongoDBCredentials]: mongodbCredentialsRotationFactory as TRotationFactoryImplementation,[SecretRotation.DatabricksServicePrincipalSecret]:databricksServicePrincipalSecretRotationFactory as TRotationFactoryImplementation,- [SecretRotation.SshPassword]: sshPasswordRotationFactory as TRotationFactoryImplementation+ [SecretRotation.UnixLinuxLocalAccount]: unixLinuxLocalAccountRotationFactory as TRotationFactoryImplementation};export const secretRotationV2ServiceFactory = ({@@ -1381,7 +1381,7 @@ export const secretRotationV2ServiceFactory = ({return secretRotations as TSecretRotationV2[];};- const reconcileSshPasswordRotation = async ({ rotationId }: { rotationId: string }, actor: OrgServiceActor) => {+ const reconcileUnixLinuxLocalAccountRotation = async ({ rotationId }: { rotationId: string }, actor: OrgServiceActor) => {const plan = await licenseService.getPlan(actor.orgId);if (!plan.secretRotation)@@ -1397,9 +1397,9 @@ export const secretRotationV2ServiceFactory = ({message: `Could not find Secret Rotation with ID "${rotationId}"`});- if (secretRotation.type !== SecretRotation.SshPassword)+ if (secretRotation.type !== SecretRotation.UnixLinuxLocalAccount)throw new BadRequestError({- message: "Reconcile operation is only supported for SSH Password rotations"+ message: "Reconcile operation is only supported for Unix/Linux Local Account rotations"});const { projectId, environment, folder, connection, encryptedGeneratedCredentials, parameters, folderId } =@@ -1422,12 +1422,12 @@ export const secretRotationV2ServiceFactory = ({}));- const sshParams = parameters as TSshPasswordRotation["parameters"];+ const unixLinuxParams = parameters as TUnixLinuxLocalAccountRotation["parameters"];// Only allow reconcile for self-rotation mode- if (sshParams.rotationMethod !== SshPasswordRotationMethod.LoginAsTarget) {+ if (unixLinuxParams.rotationMethod !== UnixLinuxLocalAccountRotationMethod.LoginAsTarget) {throw new BadRequestError({- message: "Reconcile operation is only supported for self-rotation mode SSH Password rotations"+ message: "Reconcile operation is only supported for self-rotation mode Unix/Linux Local Account rotations"});}@@ -1440,17 +1440,17 @@ export const secretRotationV2ServiceFactory = ({const activeCredentials = generatedCredentials[secretRotation.activeIndex- ] as TSshPasswordRotationGeneratedCredentials[number];+ ] as TUnixLinuxLocalAccountRotationGeneratedCredentials[number];const appConnection = await decryptAppConnection(connection, kmsService);// Use the rotation factory to perform a rotation using the app connection credentials- const rotationFactory = SECRET_ROTATION_FACTORY_MAP[SecretRotation.SshPassword](+ const rotationFactory = SECRET_ROTATION_FACTORY_MAP[SecretRotation.UnixLinuxLocalAccount]({...secretRotation,// Override rotation method to managed so it uses the app connection credentialsparameters: {- ...sshParams,- rotationMethod: SshPasswordRotationMethod.LoginAsRoot+ ...unixLinuxParams,+ rotationMethod: UnixLinuxLocalAccountRotationMethod.LoginAsRoot},connection: appConnection} as TSecretRotationV2WithConnection,@@ -1463,9 +1463,9 @@ export const secretRotationV2ServiceFactory = ({// Issue new credentials using managed mode (app connection credentials)const updatedRotation = await rotationFactory.issueCredentials(async (newCredentials) => {- const sshCredentials = newCredentials as TSshPasswordRotationGeneratedCredentials[number];+ const unixLinuxCredentials = newCredentials as TUnixLinuxLocalAccountRotationGeneratedCredentials[number];const updatedCredentials = [...generatedCredentials];- updatedCredentials[secretRotation.activeIndex] = sshCredentials;+ updatedCredentials[secretRotation.activeIndex] = unixLinuxCredentials;const encryptedUpdatedCredentials = await encryptSecretRotationCredentials({projectId,@@ -1480,7 +1480,7 @@ export const secretRotationV2ServiceFactory = ({});// Update the password secret with the new value- const secretsMapping = secretRotation.secretsMapping as TSshPasswordRotation["secretsMapping"];+ const secretsMapping = secretRotation.secretsMapping as TUnixLinuxLocalAccountRotation["secretsMapping"];await fnSecretBulkUpdate({folderId,@@ -1495,7 +1495,7 @@ export const secretRotationV2ServiceFactory = ({},data: {encryptedValue: encryptor({- plainText: Buffer.from(sshCredentials.password)+ plainText: Buffer.from(unixLinuxCredentials.password)}).cipherTextBlob,references: []}@@ -1535,7 +1535,7 @@ export const secretRotationV2ServiceFactory = ({});return {- message: "SSH password credentials reconciled successfully",+ message: "Unix/Linux Local Account credentials reconciled successfully",reconciled: true,secretRotation: await expandSecretRotation(updatedRotation, kmsService)};@@ -1555,6 +1555,6 @@ export const secretRotationV2ServiceFactory = ({getDashboardSecretRotationCount,getDashboardSecretRotations,getQuickSearchSecretRotations,- reconcileSshPasswordRotation+ reconcileUnixLinuxLocalAccountRotation};};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 1cec901e85..9b6c89ad10 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@@ -89,12 +89,12 @@ import {import { TSecretRotationV2DALFactory } from "./secret-rotation-v2-dal";import { SecretRotation } from "./secret-rotation-v2-enums";import {- TSshPasswordRotation,- TSshPasswordRotationGeneratedCredentials,- TSshPasswordRotationInput,- TSshPasswordRotationListItem,- TSshPasswordRotationWithConnection-} from "./ssh-password";+ TUnixLinuxLocalAccountRotation,+ TUnixLinuxLocalAccountRotationGeneratedCredentials,+ TUnixLinuxLocalAccountRotationInput,+ TUnixLinuxLocalAccountRotationListItem,+ TUnixLinuxLocalAccountRotationWithConnection+} from "./unix-linux-local-account-rotation";export type TSecretRotationV2 =| TPostgresCredentialsRotation@@ -109,7 +109,7 @@ export type TSecretRotationV2 =| TRedisCredentialsRotation| TMongoDBCredentialsRotation| TDatabricksServicePrincipalSecretRotation- | TSshPasswordRotation;+ | TUnixLinuxLocalAccountRotation;export type TSecretRotationV2WithConnection =| TPostgresCredentialsRotationWithConnection@@ -124,7 +124,7 @@ export type TSecretRotationV2WithConnection =| TRedisCredentialsRotationWithConnection| TMongoDBCredentialsRotationWithConnection| TDatabricksServicePrincipalSecretRotationWithConnection- | TSshPasswordRotationWithConnection;+ | TUnixLinuxLocalAccountRotationWithConnection;export type TSecretRotationV2GeneratedCredentials =| TSqlCredentialsRotationGeneratedCredentials@@ -135,7 +135,7 @@ export type TSecretRotationV2GeneratedCredentials =| TOktaClientSecretRotationGeneratedCredentials| TRedisCredentialsRotationGeneratedCredentials| TDatabricksServicePrincipalSecretRotationGeneratedCredentials- | TSshPasswordRotationGeneratedCredentials;+ | TUnixLinuxLocalAccountRotationGeneratedCredentials;export type TSecretRotationV2Input =| TPostgresCredentialsRotationInput@@ -150,7 +150,7 @@ export type TSecretRotationV2Input =| TRedisCredentialsRotationInput| TMongoDBCredentialsRotationInput| TDatabricksServicePrincipalSecretRotationInput- | TSshPasswordRotationInput;+ | TUnixLinuxLocalAccountRotationInput;export type TSecretRotationV2ListItem =| TPostgresCredentialsRotationListItem@@ -165,11 +165,11 @@ export type TSecretRotationV2ListItem =| TRedisCredentialsRotationListItem| TMongoDBCredentialsRotationListItem| TDatabricksServicePrincipalSecretRotationListItem- | TSshPasswordRotationListItem;+ | TUnixLinuxLocalAccountRotationListItem;export type TSecretRotationV2TemporaryParameters =| TLdapPasswordRotationInput["temporaryParameters"]- | TSshPasswordRotationInput["temporaryParameters"]+ | TUnixLinuxLocalAccountRotationInput["temporaryParameters"]| undefined;export type TSecretRotationV2Raw = NonNullable<Awaited<ReturnType<TSecretRotationV2DALFactory["findById"]>>>;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 10c614a9a6..ef30328102 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@@ -12,7 +12,7 @@ import { OktaClientSecretRotationSchema } from "@app/ee/services/secret-rotationimport { OracleDBCredentialsRotationSchema } from "@app/ee/services/secret-rotation-v2/oracledb-credentials";import { PostgresCredentialsRotationSchema } from "@app/ee/services/secret-rotation-v2/postgres-credentials";import { RedisCredentialsRotationSchema } from "@app/ee/services/secret-rotation-v2/redis-credentials";-import { SshPasswordRotationSchema } from "@app/ee/services/secret-rotation-v2/ssh-password";+import { UnixLinuxLocalAccountRotationSchema } from "@app/ee/services/secret-rotation-v2/unix-linux-local-account-rotation";export const SecretRotationV2Schema = z.discriminatedUnion("type", [PostgresCredentialsRotationSchema,@@ -27,5 +27,5 @@ export const SecretRotationV2Schema = z.discriminatedUnion("type", [RedisCredentialsRotationSchema,MongoDBCredentialsRotationSchema,DatabricksServicePrincipalSecretRotationSchema,- SshPasswordRotationSchema+ UnixLinuxLocalAccountRotationSchema]);diff --git a/backend/src/ee/services/secret-rotation-v2/ssh-password/index.ts b/backend/src/ee/services/secret-rotation-v2/ssh-password/index.tsdeleted file mode 100644index 0a86f81272..0000000000--- a/backend/src/ee/services/secret-rotation-v2/ssh-password/index.ts+++ /dev/null@@ -1,4 +0,0 @@-export * from "./ssh-password-rotation-constants";-export * from "./ssh-password-rotation-fns";-export * from "./ssh-password-rotation-schemas";-export * from "./ssh-password-rotation-types";diff --git a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-constants.ts b/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-constants.tsdeleted file mode 100644index 6e846bf1b7..0000000000--- a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-constants.ts+++ /dev/null@@ -1,16 +0,0 @@-import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";-import { AppConnection } from "@app/services/app-connection/app-connection-enums";--import { TSshPasswordRotationListItem } from "./ssh-password-rotation-types";--export const SSH_PASSWORD_ROTATION_LIST_OPTION: TSshPasswordRotationListItem = {- name: "SSH Password",- type: SecretRotation.SshPassword,- connection: AppConnection.SSH,- template: {- secretsMapping: {- username: "SSH_USERNAME",- password: "SSH_PASSWORD"- }- }-};diff --git a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-types.ts b/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-types.tsdeleted file mode 100644index b15d8b9633..0000000000--- a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-types.ts+++ /dev/null@@ -1,22 +0,0 @@-import { z } from "zod";--import { TSshConnection } from "@app/services/app-connection/ssh";--import {- CreateSshPasswordRotationSchema,- SshPasswordRotationGeneratedCredentialsSchema,- SshPasswordRotationListItemSchema,- SshPasswordRotationSchema-} from "./ssh-password-rotation-schemas";--export type TSshPasswordRotation = z.infer<typeof SshPasswordRotationSchema>;--export type TSshPasswordRotationInput = z.infer<typeof CreateSshPasswordRotationSchema>;--export type TSshPasswordRotationListItem = z.infer<typeof SshPasswordRotationListItemSchema>;--export type TSshPasswordRotationWithConnection = TSshPasswordRotation & {- connection: TSshConnection;-};--export type TSshPasswordRotationGeneratedCredentials = z.infer<typeof SshPasswordRotationGeneratedCredentialsSchema>;diff --git a/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/index.ts b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/index.tsnew file mode 100644index 0000000000..0fa34a74f6--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/index.ts@@ -0,0 +1,4 @@+export * from "./unix-linux-local-account-rotation-constants";+export * from "./unix-linux-local-account-rotation-fns";+export * from "./unix-linux-local-account-rotation-schemas";+export * from "./unix-linux-local-account-rotation-types";diff --git a/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-constants.ts b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-constants.tsnew file mode 100644index 0000000000..82d67d7e77--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-constants.ts@@ -0,0 +1,16 @@+import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";+import { AppConnection } from "@app/services/app-connection/app-connection-enums";++import { TUnixLinuxLocalAccountRotationListItem } from "./unix-linux-local-account-rotation-types";++export const UNIX_LINUX_LOCAL_ACCOUNT_ROTATION_LIST_OPTION: TUnixLinuxLocalAccountRotationListItem = {+ name: "Unix/Linux Local Account",+ type: SecretRotation.UnixLinuxLocalAccount,+ connection: AppConnection.SSH,+ template: {+ secretsMapping: {+ username: "UNIX_USERNAME",+ password: "UNIX_PASSWORD"+ }+ }+};diff --git a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.tssimilarity index 87%rename from backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-fns.tsrename to backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.tsindex d5817cf29a..28d247b0e1 100644--- a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts@@ -17,12 +17,12 @@ import {} from "@app/services/app-connection/ssh";import { generatePassword } from "../shared/utils";-import { SshPasswordRotationMethod } from "./ssh-password-rotation-schemas";+import { UnixLinuxLocalAccountRotationMethod } from "./unix-linux-local-account-rotation-schemas";import {- TSshPasswordRotationGeneratedCredentials,- TSshPasswordRotationInput,- TSshPasswordRotationWithConnection-} from "./ssh-password-rotation-types";+ TUnixLinuxLocalAccountRotationGeneratedCredentials,+ TUnixLinuxLocalAccountRotationInput,+ TUnixLinuxLocalAccountRotationWithConnection+} from "./unix-linux-local-account-rotation-types";// Execute command over SSH and return stdoutconst executeCommand = (client: Client, command: string): Promise<string> => {@@ -64,7 +64,7 @@ const changeManagedPassword = async (client: Client, username: string, newPasswotry {await executeCommand(client, command);} catch (error) {- logger.error(error, "SSH Password Rotation: Failed to change password (managed)");+ logger.error(error, "Unix/Linux Local Account Rotation: Failed to change password (managed)");throw new Error(`Failed to change password: ${(error as Error).message}`);}};@@ -152,13 +152,13 @@ const changeSelfPassword = async (client: Client, oldPassword: string, newPasswo});};-export const sshPasswordRotationFactory: TRotationFactory<- TSshPasswordRotationWithConnection,- TSshPasswordRotationGeneratedCredentials,- TSshPasswordRotationInput["temporaryParameters"]+export const unixLinuxLocalAccountRotationFactory: TRotationFactory<+ TUnixLinuxLocalAccountRotationWithConnection,+ TUnixLinuxLocalAccountRotationGeneratedCredentials,+ TUnixLinuxLocalAccountRotationInput["temporaryParameters"]> = (secretRotation, appConnectionDAL, kmsService, _gatewayService, gatewayV2Service) => {const { connection, parameters, secretsMapping, activeIndex } = secretRotation;- const { username, passwordRequirements, rotationMethod = SshPasswordRotationMethod.LoginAsRoot } = parameters;+ const { username, passwordRequirements, rotationMethod = UnixLinuxLocalAccountRotationMethod.LoginAsRoot } = parameters;// Helper to verify SSH credentials workconst $verifyCredentials = async (targetUsername: string, targetPassword: string): Promise<void> => {@@ -190,7 +190,7 @@ export const sshPasswordRotationFactory: TRotationFactory<const { credentials } = connection;const newPassword = generatePassword(passwordRequirements);- const isSelfRotation = rotationMethod === SshPasswordRotationMethod.LoginAsTarget;+ const isSelfRotation = rotationMethod === UnixLinuxLocalAccountRotationMethod.LoginAsTarget;if (username === credentials.username)throw new BadRequestError({ message: "Provided username is used in Infisical app connections." });@@ -249,14 +249,14 @@ export const sshPasswordRotationFactory: TRotationFactory<};const issueCredentials: TRotationFactoryIssueCredentials<- TSshPasswordRotationGeneratedCredentials,- TSshPasswordRotationInput["temporaryParameters"]+ TUnixLinuxLocalAccountRotationGeneratedCredentials,+ TUnixLinuxLocalAccountRotationInput["temporaryParameters"]> = async (callback, temporaryParameters) => {const credentials = await $rotatePassword(temporaryParameters?.password);return callback(credentials);};- const revokeCredentials: TRotationFactoryRevokeCredentials<TSshPasswordRotationGeneratedCredentials> = async (+ const revokeCredentials: TRotationFactoryRevokeCredentials<TUnixLinuxLocalAccountRotationGeneratedCredentials> = async (credentialsToRevoke,callback) => {@@ -268,7 +268,7 @@ export const sshPasswordRotationFactory: TRotationFactory<return callback();};- const rotateCredentials: TRotationFactoryRotateCredentials<TSshPasswordRotationGeneratedCredentials> = async (+ const rotateCredentials: TRotationFactoryRotateCredentials<TUnixLinuxLocalAccountRotationGeneratedCredentials> = async (_,callback,activeCredentials@@ -280,7 +280,7 @@ export const sshPasswordRotationFactory: TRotationFactory<return callback(credentials);};- const getSecretsPayload: TRotationFactoryGetSecretsPayload<TSshPasswordRotationGeneratedCredentials> = (+ const getSecretsPayload: TRotationFactoryGetSecretsPayload<TUnixLinuxLocalAccountRotationGeneratedCredentials> = (generatedCredentials) => {return [diff --git a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-schemas.ts b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-schemas.tssimilarity index 52%rename from backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-schemas.tsrename to backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-schemas.tsindex 848d3d400d..f3801c9440 100644--- a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-schemas.ts+++ b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-schemas.ts@@ -12,12 +12,12 @@ import { CharacterType, characterValidator } from "@app/lib/validator/validate-simport { SecretNameSchema } from "@app/server/lib/schemas";import { AppConnection } from "@app/services/app-connection/app-connection-enums";-export enum SshPasswordRotationMethod {+export enum UnixLinuxLocalAccountRotationMethod {LoginAsTarget = "login-as-target",LoginAsRoot = "login-as-root"}-export const SshPasswordRotationGeneratedCredentialsSchema = z+export const UnixLinuxLocalAccountRotationGeneratedCredentialsSchema = z.object({username: z.string(),password: z.string()@@ -26,7 +26,7 @@ export const SshPasswordRotationGeneratedCredentialsSchema = z.min(1).max(2);-const SshPasswordRotationParametersSchema = z.object({+const UnixLinuxLocalAccountRotationParametersSchema = z.object({username: z.string().trim()@@ -35,45 +35,45 @@ const SshPasswordRotationParametersSchema = z.object({(val) => characterValidator([CharacterType.AlphaNumeric, CharacterType.Hyphen, CharacterType.Underscore])(val),"Name can only contain alphanumeric characters, dashes, underscores, and spaces")- .describe(SecretRotations.PARAMETERS.SSH_PASSWORD.username),+ .describe(SecretRotations.PARAMETERS.UNIX_LINUX_LOCAL_ACCOUNT.username),passwordRequirements: PasswordRequirementsSchema.optional(),rotationMethod: z- .nativeEnum(SshPasswordRotationMethod)+ .nativeEnum(UnixLinuxLocalAccountRotationMethod).optional()- .describe(SecretRotations.PARAMETERS.SSH_PASSWORD.rotationMethod)+ .describe(SecretRotations.PARAMETERS.UNIX_LINUX_LOCAL_ACCOUNT.rotationMethod)});-const SshPasswordRotationSecretsMappingSchema = z.object({- username: SecretNameSchema.describe(SecretRotations.SECRETS_MAPPING.SSH_PASSWORD.username),- password: SecretNameSchema.describe(SecretRotations.SECRETS_MAPPING.SSH_PASSWORD.password)+const UnixLinuxLocalAccountRotationSecretsMappingSchema = z.object({+ username: SecretNameSchema.describe(SecretRotations.SECRETS_MAPPING.UNIX_LINUX_LOCAL_ACCOUNT.username),+ password: SecretNameSchema.describe(SecretRotations.SECRETS_MAPPING.UNIX_LINUX_LOCAL_ACCOUNT.password)});-export const SshPasswordRotationTemplateSchema = z.object({+export const UnixLinuxLocalAccountRotationTemplateSchema = z.object({secretsMapping: z.object({username: z.string(),password: z.string()})});-export const SshPasswordRotationSchema = BaseSecretRotationSchema(SecretRotation.SshPassword).extend({- type: z.literal(SecretRotation.SshPassword),- parameters: SshPasswordRotationParametersSchema,- secretsMapping: SshPasswordRotationSecretsMappingSchema+export const UnixLinuxLocalAccountRotationSchema = BaseSecretRotationSchema(SecretRotation.UnixLinuxLocalAccount).extend({+ type: z.literal(SecretRotation.UnixLinuxLocalAccount),+ parameters: UnixLinuxLocalAccountRotationParametersSchema,+ secretsMapping: UnixLinuxLocalAccountRotationSecretsMappingSchema});-export const CreateSshPasswordRotationSchema = BaseCreateSecretRotationSchema(SecretRotation.SshPassword)+export const CreateUnixLinuxLocalAccountRotationSchema = BaseCreateSecretRotationSchema(SecretRotation.UnixLinuxLocalAccount).extend({- parameters: SshPasswordRotationParametersSchema,- secretsMapping: SshPasswordRotationSecretsMappingSchema,+ parameters: UnixLinuxLocalAccountRotationParametersSchema,+ secretsMapping: UnixLinuxLocalAccountRotationSecretsMappingSchema,temporaryParameters: z.object({- password: z.string().optional().describe(SecretRotations.PARAMETERS.SSH_PASSWORD.password)+ password: z.string().optional().describe(SecretRotations.PARAMETERS.UNIX_LINUX_LOCAL_ACCOUNT.password)}).optional()}).superRefine((val, ctx) => {if (- val.parameters.rotationMethod === SshPasswordRotationMethod.LoginAsTarget &&+ val.parameters.rotationMethod === UnixLinuxLocalAccountRotationMethod.LoginAsTarget &&!val.temporaryParameters?.password) {ctx.addIssue({@@ -84,14 +84,14 @@ export const CreateSshPasswordRotationSchema = BaseCreateSecretRotationSchema(Se}});-export const UpdateSshPasswordRotationSchema = BaseUpdateSecretRotationSchema(SecretRotation.SshPassword).extend({- parameters: SshPasswordRotationParametersSchema.optional(),- secretsMapping: SshPasswordRotationSecretsMappingSchema.optional()+export const UpdateUnixLinuxLocalAccountRotationSchema = BaseUpdateSecretRotationSchema(SecretRotation.UnixLinuxLocalAccount).extend({+ parameters: UnixLinuxLocalAccountRotationParametersSchema.optional(),+ secretsMapping: UnixLinuxLocalAccountRotationSecretsMappingSchema.optional()});-export const SshPasswordRotationListItemSchema = z.object({- name: z.literal("SSH Password"),+export const UnixLinuxLocalAccountRotationListItemSchema = z.object({+ name: z.literal("Unix/Linux Local Account"),connection: z.literal(AppConnection.SSH),- type: z.literal(SecretRotation.SshPassword),- template: SshPasswordRotationTemplateSchema+ type: z.literal(SecretRotation.UnixLinuxLocalAccount),+ template: UnixLinuxLocalAccountRotationTemplateSchema});diff --git a/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-types.ts b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-types.tsnew file mode 100644index 0000000000..3f00a5555c--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-types.ts@@ -0,0 +1,22 @@+import { z } from "zod";++import { TSshConnection } from "@app/services/app-connection/ssh";++import {+ CreateUnixLinuxLocalAccountRotationSchema,+ UnixLinuxLocalAccountRotationGeneratedCredentialsSchema,+ UnixLinuxLocalAccountRotationListItemSchema,+ UnixLinuxLocalAccountRotationSchema+} from "./unix-linux-local-account-rotation-schemas";++export type TUnixLinuxLocalAccountRotation = z.infer<typeof UnixLinuxLocalAccountRotationSchema>;++export type TUnixLinuxLocalAccountRotationInput = z.infer<typeof CreateUnixLinuxLocalAccountRotationSchema>;++export type TUnixLinuxLocalAccountRotationListItem = z.infer<typeof UnixLinuxLocalAccountRotationListItemSchema>;++export type TUnixLinuxLocalAccountRotationWithConnection = TUnixLinuxLocalAccountRotation & {+ connection: TSshConnection;+};++export type TUnixLinuxLocalAccountRotationGeneratedCredentials = z.infer<typeof UnixLinuxLocalAccountRotationGeneratedCredentialsSchema>;diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex 4056df2aae..7a0adf883c 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -2909,7 +2909,7 @@ export const SecretRotations = {'Whether the rotation should be performed by the LDAP "connection-principal" or the "target-principal" (defaults to \'connection-principal\').',password: 'The password of the provided principal if "parameters.rotationMethod" is set to "target-principal".'},- SSH_PASSWORD: {+ UNIX_LINUX_LOCAL_ACCOUNT: {username: "The username of the Unix/Linux user account to rotate the password for.",rotationMethod:'Whether the rotation should be performed using "self" (the target user\'s own credentials) or "managed" (the SSH connection\'s admin credentials). Defaults to "managed".',@@ -2976,7 +2976,7 @@ export const SecretRotations = {dn: "The name of the secret that the Distinguished Name (DN) or User Principal Name (UPN) of the principal will be mapped to.",password: "The name of the secret that the rotated password will be mapped to."},- SSH_PASSWORD: {+ UNIX_LINUX_LOCAL_ACCOUNT: {username: "The name of the secret that the username will be mapped to.",password: "The name of the secret that the rotated password will be mapped to."},