TMA-NGINX-2.2.3
Ensure the NGINX service account has an invalid shell
보통레벨 1자동nginx
설명
The NGINX service account must be configured with an invalid login shell to prevent interactive access. Reads the account from the user directive; its login shell must be nologin or false. Evaluated on the merged configuration printed by `nginx -T` (all included files; needs permission to read them). CIS marks this recommendation Manual; the automated check implements its audit procedure.
점검 방법
감사 방식: 셸 명령
shell
out=$(nginx -T 2>/dev/null) || exit 1; u=$(printf '%s\n' "$out" | awk '$1=="user"{x=$2; sub(/;$/,"",x); print x; exit}'); [ -n "$u" ] || { echo noncompliant; exit 0; }; sh=$(getent passwd "$u" | cut -d: -f7) || exit 1; case "$sh" in */nologin|/bin/false|/usr/bin/false) echo compliant;; *) echo noncompliant;; esac- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
usermod -s /sbin/nologin <nginx user> (use /usr/sbin/nologin on Debian/Ubuntu).
속성
- 운영 체제
- 모두
- 태그
- nginxaccounts
- 참고 자료
- CIS NGINX Benchmark v3.0.0 - 2.2.3 Ensure the NGINX service account has an invalid shell
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target nginx