TMA-FREEBSD-4.5.2.2
Ensure root user umask is configured
높음레벨 1자동freebsd
설명
The user file-creation mode mask (umask) is used to determine the file permission for newly created directories and files. In FreeBSD, the default permissions for any newly created directory is 0755 (rwxr-xr-x), and for any newly created file it is 0644 (rw-r-- r--). The umask modifies the default FreeBSD permissions by restricting (masking) these permissions. Audit: automated read-only check derived from the CIS audit procedure; it prints "compliant" when the control is met.
점검 방법
감사 방식: 셸 명령
shell
command -v grep >/dev/null 2>&1 || exit 1; out=$( { grep -Esi -- "^[[:space:]]*umask[[:space:]]+(([0-7][0-7][01][0-7]\b|[0-7][0-7][0-7][0-6]\b)|([0-7][01][0-7]\b|[0-7][0-7][0-6]\b)|(u=[rwx]{1,3},)?(((g=[rx]?[rx]?w[rx]?[rx]?\b)(,o=[rwx]{1,3})?)|((g=[wrx]{1,3},)?o=[wrx]{1,3}\b)))" /root/.profile /root/.shrc ; } 2>/dev/null ); [ -z "$out" ] && echo compliant || printf '%s\n' "$out" | head -n 20- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
Edit /root/.profile and /root/.shrc and remove, comment out, or update any line with umask to be 0027 or more restrictive.
속성
- 운영 체제
- 모두
- 태그
- freebsdaccounts
- 참고 자료
- CIS FreeBSD 14 Benchmark v1.0.1 - 4.5.2.2 Ensure root user umask is configured
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target freebsd