mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Refactor SecurityAudit component: remove unused root login security check and related UI elements to streamline the code and improve readability.
This commit is contained in:
@@ -25,21 +25,6 @@ export const SecurityAudit = ({ serverId }: Props) => {
|
|||||||
enabled: !!serverId,
|
enabled: !!serverId,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
const _utils = api.useUtils();
|
|
||||||
|
|
||||||
// Helper function to check if root login is securely configured
|
|
||||||
const isRootLoginSecure = () => {
|
|
||||||
if (!data?.ssh?.permitRootLogin) return false;
|
|
||||||
|
|
||||||
// These are secure options for PermitRootLogin
|
|
||||||
const secureOptions = [
|
|
||||||
"no",
|
|
||||||
"prohibit-password",
|
|
||||||
"without-password",
|
|
||||||
"forced-commands-only",
|
|
||||||
];
|
|
||||||
return secureOptions.includes(data.ssh.permitRootLogin);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CardContent className="p-0">
|
<CardContent className="p-0">
|
||||||
@@ -162,15 +147,6 @@ export const SecurityAudit = ({ serverId }: Props) => {
|
|||||||
: "Enabled (Password Authentication should be disabled)"
|
: "Enabled (Password Authentication should be disabled)"
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<StatusRow
|
|
||||||
label="Root Login"
|
|
||||||
isEnabled={isRootLoginSecure()}
|
|
||||||
description={
|
|
||||||
isRootLoginSecure()
|
|
||||||
? `${data?.ssh?.permitRootLogin} (Secure)`
|
|
||||||
: `${data?.ssh?.permitRootLogin || "yes"} (Should be set to 'prohibit-password' or 'no')`
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<StatusRow
|
<StatusRow
|
||||||
label="Use PAM"
|
label="Use PAM"
|
||||||
isEnabled={data?.ssh?.usePam === "no"}
|
isEnabled={data?.ssh?.usePam === "no"}
|
||||||
|
|||||||
Reference in New Issue
Block a user