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
test(secret-rotation): cover HP iLO prompt detection for iLO 5/6 and 7
Claude5c0bda3c63e1
diff --git a/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.test.ts b/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.test.tsnew file mode 100644index 0000000000..bc1fa005fa--- /dev/null+++ b/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.test.ts@@ -0,0 +1,16 @@+import { isIloPrompt } from "./hp-ilo-rotation-fns";++describe("isIloPrompt", () => {+ test("matches the iLO 5/6 prompt", () => {+ expect(isIloPrompt("</>hpiLO-> ")).toBe(true);+ });++ test("matches the iLO 7 prompt", () => {+ expect(isIloPrompt("</>hpeiLO-> ")).toBe(true);+ });++ test("does not match banner or password prompt output", () => {+ expect(isIloPrompt("Integrated Lights-Out 7\n")).toBe(false);+ expect(isIloPrompt("Password: ")).toBe(false);+ });+});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.tsindex a9acc677f3..9efe98125d 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@@ -40,6 +40,9 @@ const HP_ILO_DEFAULT_PASSWORD_REQUIREMENTS = {// iLO 5/6 present the prompt as "hpiLO->", iLO 7 as "hpeiLO->"; match the common suffixconst ILO_PROMPT = "iLO->";++export const isIloPrompt = (output: string) => output.includes(ILO_PROMPT);+const COMMAND_COMPLETED = "status_tag=COMMAND COMPLETED";const COMMAND_FAILED = "COMMAND PROCESSING FAILED";const CONNECTION_TIMEOUT = 45000;@@ -78,7 +81,7 @@ const executeIloShell = (conn: Client, command: string): Promise<string> => {return;}- if (buffer.includes(ILO_PROMPT) && !commandSent) {+ if (isIloPrompt(buffer) && !commandSent) {commandSent = true;stream.write(`${command}\n`);}