Skip to content

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

feat: enhance HP iLO rotation functionality and UI

Victor Hugo dos Santos96088f47521a
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 0ab63a933b..e814cac76d 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
@@ -1,3 +1,4 @@
+import RE2 from "re2";
import { Client, ClientChannel } from "ssh2";
import {
@@ -81,12 +82,18 @@ const executeIloShell = (conn: Client, command: string): Promise<string> => {
clearTimeout(timeout);
settled = true;
conn.end();
- reject(new Error(`iLO command failed: ${buffer}`));
+ const passwordPattern = new RE2("password=[^\\s]+", "gi");
+ const sanitizedBuffer = buffer.replace(passwordPattern, "password=***");
+ reject(new Error(`iLO command failed: ${sanitizedBuffer}`));
}
});
stream.on("close", () => {
clearTimeout(timeout);
+ if (!settled) {
+ settled = true;
+ reject(new Error("iLO shell closed unexpectedly"));
+ }
});
stream.stderr.on("data", (data: Buffer) => {
diff --git a/docs/images/secret-rotations-v2/hp-ilo-local-account/hp-ilo-local-account-reconcile.png b/docs/images/secret-rotations-v2/hp-ilo-local-account/hp-ilo-local-account-reconcile.png
new file mode 100644
index 0000000000..ab10c19312
Binary files /dev/null and b/docs/images/secret-rotations-v2/hp-ilo-local-account/hp-ilo-local-account-reconcile.png differ
diff --git a/frontend/src/components/secret-rotations-v2/ReconcileLocalAccountRotationModal.tsx b/frontend/src/components/secret-rotations-v2/ReconcileLocalAccountRotationModal.tsx
index c651eed6b7..6c4179411d 100644
--- a/frontend/src/components/secret-rotations-v2/ReconcileLocalAccountRotationModal.tsx
+++ b/frontend/src/components/secret-rotations-v2/ReconcileLocalAccountRotationModal.tsx
@@ -2,6 +2,7 @@ import { createNotification } from "@app/components/notifications";
import { Button, Modal, ModalClose, ModalContent } from "@app/components/v2";
import { SecretRotation, TSecretRotationV2 } from "@app/hooks/api/secretRotationsV2";
import { useReconcileLocalAccountRotation } from "@app/hooks/api/secretRotationsV2/mutations";
+import { THpIloRotation } from "@app/hooks/api/secretRotationsV2/types/hp-ilo-rotation";
import { TUnixLinuxLocalAccountRotation } from "@app/hooks/api/secretRotationsV2/types/unix-linux-local-account-rotation";
import { TWindowsLocalAccountRotation } from "@app/hooks/api/secretRotationsV2/types/windows-local-account-rotation";
@@ -12,14 +13,14 @@ type Props = {
};
type ContentProps = {
- secretRotation: TUnixLinuxLocalAccountRotation | TWindowsLocalAccountRotation;
+ secretRotation: TUnixLinuxLocalAccountRotation | TWindowsLocalAccountRotation | THpIloRotation;
onComplete: () => void;
};
const getRotationTypeName = (type: SecretRotation): string => {
- return type === SecretRotation.UnixLinuxLocalAccount
- ? "Unix/Linux Local Account"
- : "Windows Local Account";
+ if (type === SecretRotation.UnixLinuxLocalAccount) return "Unix/Linux Local Account";
+ if (type === SecretRotation.WindowsLocalAccount) return "Windows Local Account";
+ return "HP iLO Local Account";
};
const Content = ({ secretRotation, onComplete }: ContentProps) => {
@@ -31,7 +32,10 @@ const Content = ({ secretRotation, onComplete }: ContentProps) => {
const handleReconcile = async () => {
const result = await reconcileLocalAccount.mutateAsync({
rotationId,
- type: type as SecretRotation.UnixLinuxLocalAccount | SecretRotation.WindowsLocalAccount,
+ type: type as
+ | SecretRotation.UnixLinuxLocalAccount
+ | SecretRotation.WindowsLocalAccount
+ | SecretRotation.HpIloLocalAccount,
projectId,
secretPath: folder.path
});
@@ -83,7 +87,8 @@ export const ReconcileLocalAccountRotationModal = ({
if (
!secretRotation ||
(secretRotation.type !== SecretRotation.UnixLinuxLocalAccount &&
- secretRotation.type !== SecretRotation.WindowsLocalAccount)
+ secretRotation.type !== SecretRotation.WindowsLocalAccount &&
+ secretRotation.type !== SecretRotation.HpIloLocalAccount)
)
return null;
@@ -97,7 +102,10 @@ export const ReconcileLocalAccountRotationModal = ({
>
<Content
secretRotation={
- secretRotation as TUnixLinuxLocalAccountRotation | TWindowsLocalAccountRotation
+ secretRotation as
+ | TUnixLinuxLocalAccountRotation
+ | TWindowsLocalAccountRotation
+ | THpIloRotation
}
onComplete={() => onOpenChange(false)}
/>