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
Update backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-fns.ts
Akhil Mohan52d54eff82cd
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/ssh-password/ssh-password-rotation-fns.tsindex e256308b42..5b92d80ac6 100644--- a/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/ssh-password/ssh-password-rotation-fns.ts@@ -193,6 +193,10 @@ export const sshPasswordRotationFactory: TRotationFactory<const isSelfRotation = rotationMethod === SshPasswordRotationMethod.LoginAsTarget;if (username === credentials.username)throw new BadRequestError({ message: "Provided username is used in Infisical app connections." });++ const privilegedAccounts = ['root', 'admin', 'administrator', 'sudo'];+ if (privilegedAccounts.includes(username.toLowerCase()))+ throw new BadRequestError({ message: "Cannot rotate passwords for privileged system accounts." });// Determine which credentials to use for the SSH connectionlet connectConfig: TSshConnectionConfig;