From fc7eff94b643fd2bf57133bd0335330432d75371 Mon Sep 17 00:00:00 2001 From: Jason Parks Date: Sat, 22 Mar 2025 14:26:40 -0600 Subject: [PATCH] fix: Security Audit SSH Errors #1377 - Fixed SSH key authentication detection in server-audit.ts - Added proper handling for prohibit-password and other secure root login options - Fixed typos in security audit UI labels - Improved error handling with optional chaining --- .../settings/servers/security-audit.tsx | 65 ++++++++++++------- packages/server/src/setup/server-audit.ts | 51 +++++++++++++-- 2 files changed, 86 insertions(+), 30 deletions(-) diff --git a/apps/dokploy/components/dashboard/settings/servers/security-audit.tsx b/apps/dokploy/components/dashboard/settings/servers/security-audit.tsx index 8cce306a5..bf1f74c36 100644 --- a/apps/dokploy/components/dashboard/settings/servers/security-audit.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/security-audit.tsx @@ -26,6 +26,16 @@ export const SecurityAudit = ({ serverId }: Props) => { }, ); 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 (
@@ -36,10 +46,10 @@ export const SecurityAudit = ({ serverId }: Props) => {
- Setup Security Sugestions + Setup Security Suggestions
- Check the security sugestions + Check the security suggestions