Skip to content

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

refactor: simplify SSH connection configuration in HP iLO rotation functions

Victor Hugo dos Santos25e08559611c
diff --git a/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.ts
index e814cac76d..dc9377965e 100644
--- a/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.ts
+++ b/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.ts
@@ -108,17 +108,7 @@ const executeIloShell = (conn: Client, command: string): Promise<string> => {
};
const createIloConnection = (config: TSshConnectionConfig, targetHost: string, targetPort: number): Promise<Client> => {
- return getSshConnectionClient(
- {
- ...config,
- algorithms: {
- serverHostKey: ["ssh-rsa"],
- kex: ["diffie-hellman-group14-sha1", "diffie-hellman-group1-sha1"]
- }
- },
- targetHost,
- targetPort
- );
+ return getSshConnectionClient(config, targetHost, targetPort);
};
const rotateIloPasswordAsTarget = async (
diff --git a/backend/src/services/app-connection/ssh/ssh-connection-fns.ts b/backend/src/services/app-connection/ssh/ssh-connection-fns.ts
index 2b6cc1c1c5..f670621ee6 100644
--- a/backend/src/services/app-connection/ssh/ssh-connection-fns.ts
+++ b/backend/src/services/app-connection/ssh/ssh-connection-fns.ts
@@ -1,4 +1,4 @@
-import { Algorithms, Client, ConnectConfig } from "ssh2";
+import { Client, ConnectConfig } from "ssh2";
import { TGatewayServiceFactory } from "@app/ee/services/gateway/gateway-service";
import { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";
@@ -33,10 +33,7 @@ export const getSshConnectionClient = async (
host: targetHost,
port: targetPort,
readyTimeout: SSH_TIMEOUT,
- tryKeyboard: false,
- algorithms: (credentials.algorithms as Algorithms) || {
- serverHostKey: ["rsa-sha2-512", "rsa-sha2-256", "ssh-rsa", "ecdsa-sha2-nistp256", "ecdsa-sha2-nistp521"]
- }
+ tryKeyboard: false
};
client.on("error", (err: Error) => {
diff --git a/backend/src/services/app-connection/ssh/ssh-connection-types.ts b/backend/src/services/app-connection/ssh/ssh-connection-types.ts
index a4ed538906..ef06d7a310 100644
--- a/backend/src/services/app-connection/ssh/ssh-connection-types.ts
+++ b/backend/src/services/app-connection/ssh/ssh-connection-types.ts
@@ -22,8 +22,4 @@ export type TSshConnectionConfig = DiscriminativePick<
"method" | "app" | "credentials" | "gatewayId"
> & {
orgId: string;
- algorithms?: {
- serverHostKey?: string[];
- kex?: string[];
- };
};