MongoDB
TMA-MONGODB-7.2
Ensure appropriate database file permissions are set
높음레벨 1자동mongodb
설명
MongoDB database files need to be protected using file permissions. The benchmark rates this recommendation Manual; the automated check covers its objective pass criterion. Checks the YAML config file /etc/mongod.conf (SKIP when it does not exist). storage.dbPath (default /var/lib/mongodb) must be 770 or stricter, with no access for other users.
점검 방법
감사 방식: 셸 명령
shell
[ -r /etc/mongod.conf ] || exit 1; d=$(awk '/^[[:space:]]*dbPath:/ {v=$2; gsub(/["\047]/, "", v); print v}' /etc/mongod.conf); d=${d:-/var/lib/mongodb}; p=$(stat -c %a "$d" 2>/dev/null) || exit 1; if [ $((0$p & 007)) -eq 0 ]; then echo compliant; else echo "mode $p"; fi- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
chmod 770 <dbPath> and chown mongodb:mongodb <dbPath> (default /var/lib/mongodb).
속성
- 운영 체제
- 모두
- 태그
- mongodbpermissions
- 참고 자료
- CIS MongoDB 8 Benchmark v2.0.0 - 7.2 Ensure appropriate database file permissions are set
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target mongodb