Stabilizing the ASB v2 RemediateEnsurePortmapServiceIsDisabled check (#714)

This commit is contained in:
Marius Niculescu 2024-06-06 21:39:41 -07:00 коммит произвёл GitHub
Родитель eb4078a755
Коммит a42a795a6e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 15 добавлений и 4 удалений

Просмотреть файл

@ -3501,10 +3501,21 @@ static int RemediateEnsureRpcidmapdServiceIsDisabled(char* value, void* log)
static int RemediateEnsurePortmapServiceIsDisabled(char* value, void* log)
{
UNUSED(value);
StopAndDisableDaemon(g_rpcbind, log);
StopAndDisableDaemon(g_rpcbindService, log);
StopAndDisableDaemon(g_rpcbindSocket, log);
return (0 == strncmp(g_pass, AuditEnsurePortmapServiceIsDisabled(log), strlen(g_pass))) ? 0 : ENOENT;
if (IsDaemonActive(g_rpcbindSocket, log))
{
StopAndDisableDaemon(g_rpcbindSocket, log);
}
if (IsDaemonActive(g_rpcbindService, log))
{
StopAndDisableDaemon(g_rpcbindService, log);
}
if (IsDaemonActive(g_rpcbind, log))
{
StopAndDisableDaemon(g_rpcbind, log);
}
return (CheckDaemonNotActive(g_rpcbind, NULL, log) &&
CheckDaemonNotActive(g_rpcbindService, NULL, log) &&
CheckDaemonNotActive(g_rpcbindSocket, NULL, log)) ? 0 : ENOENT;
}
static int RemediateEnsureNetworkFileSystemServiceIsDisabled(char* value, void* log)