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:
parent
17a859d26d
commit
7a6e1dbc1b
@ -25,21 +25,6 @@ export const SecurityAudit = ({ serverId }: Props) => {
|
||||
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 (
|
||||
<CardContent className="p-0">
|
||||
@ -162,15 +147,6 @@ export const SecurityAudit = ({ serverId }: Props) => {
|
||||
: "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
|
||||
label="Use PAM"
|
||||
isEnabled={data?.ssh?.usePam === "no"}
|
||||
|
Loading…
Reference in New Issue
Block a user