diff --git a/benchmarks/services/3.25-ensure-xinetd-is-not-installed.md b/benchmarks/services/3.25-ensure-xinetd-is-not-installed.md new file mode 100644 index 0000000000000000000000000000000000000000..e7e6521bf0b4c7d2c62aeb6ba2e753b46f632951 --- /dev/null +++ b/benchmarks/services/3.25-ensure-xinetd-is-not-installed.md @@ -0,0 +1,38 @@ +# 3.25 确保xinetd被卸载 + +## 安全等级 + +- Level 1 + +## 描述 + +eXtended InterNET 守护进程 ( xinetd ) 是一个开源的超级守护进程,用于取代原始 inetd 守护进程。 xinetd 能够监听许多常用服务并调度合适的守护进程以正确响应服务请求。 + +若 xinetd 服务非必要,建议将其卸载。 + +## 修复建议 + +目标:确保xinetd被卸载 + +1. 运行以下命令卸载 xinetd。 + +```bash +# dnf remove -y xinetd +``` + +## 扫描检测 + +执行修复前检测xinetd是否安装 + +1. 运行以下命令以检测是否安装 xinetd。 + +```bash +# rpm -q xinetd +package xinetd is not installed +``` + +输出结果为`package xinetd is not installed`则表示未安装xinetd。 + +## 参考 + +- cis: \ No newline at end of file diff --git a/docs/summary-of-rules.md b/docs/summary-of-rules.md index e30eccc175cf4ac6de3c3f388066d12e13d0eee0..88e6d592ece5a8a0410fbb55bb59591370c052c3 100644 --- a/docs/summary-of-rules.md +++ b/docs/summary-of-rules.md @@ -96,6 +96,7 @@ | 3.22 | 3.22-uninstall-the-ypbind-server.md | 3.22 卸载 ypbind | benchmarks/services | 1 | | 3.23 | 3.23-disable-rsh.md | 3.23 禁用rsh | benchmarks/services | 1 | | 3.24 | 3.24-disable-ntalk.md | 3.24 禁用ntalk | benchmarks/services | 1 | +| 3.25 | 3.25-ensure-xinetd-is-not-installed.md | 3.25 确保xinetd被卸载 | benchmarks/services | 1 | | 4.1 | 4.1-ensure-message-of-the-day-is-configured-properly.md | 4.1 确保登录提示消息的内容符合要求 | benchmarks/system-configurations | 1 | | 4.2 | 4.2-ensure-local-login-warning-banner-is-configured-properly.md | 4.2 确保本地登录提示消息的内容符合要求 | benchmarks/system-configurations | 1 | | 4.3 | 4.3-ensure-remote-login-warning-banner-is-configured-properly.md | 4.3 确保远程登录提示消息的内容符合要求 | benchmarks/system-configurations | 1 | diff --git a/remediation-kits/services/3.25-ensure-xinetd-is-not-installed.sh b/remediation-kits/services/3.25-ensure-xinetd-is-not-installed.sh new file mode 100644 index 0000000000000000000000000000000000000000..43110c0ec7429f88005f614efc5c70d1193fb083 --- /dev/null +++ b/remediation-kits/services/3.25-ensure-xinetd-is-not-installed.sh @@ -0,0 +1 @@ +dnf remove -y xinetd \ No newline at end of file diff --git a/scanners/services/3.25-ensure-xinetd-is-not-installed.sh b/scanners/services/3.25-ensure-xinetd-is-not-installed.sh new file mode 100644 index 0000000000000000000000000000000000000000..5abb602bdc9d0b840efc539ff4625ad399fa8c48 --- /dev/null +++ b/scanners/services/3.25-ensure-xinetd-is-not-installed.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +result=false + +rpm -q xinetd | grep -Psiq "^package\s+xinetd\s+is\s+not\s+installed$" && result=true + +if [ "$result" == true ]; then + echo "pass" +else + echo "fail" +fi \ No newline at end of file