TMAegis
mongodb 관련 규칙 더 보기

TMA-MONGODB-7.1

Ensure appropriate key file permissions are set

높음레벨 1자동mongodb

설명

In the Shared Cluster, the certificate or keyfile is utilized for authentications. Implementing proper file permissions on the certificate or keyfile will prevent unauthorized access to it. 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). Every keyFile, PEMKeyFile, certificateKeyFile and clusterFile referenced in the config must be mode 600 or stricter (a referenced file that cannot be read also fails).

점검 방법

감사 방식: 셸 명령

shell
[ -r /etc/mongod.conf ] || exit 1; bad=0; for f in $(awk '/^[[:space:]]*(keyFile|PEMKeyFile|certificateKeyFile|clusterFile):/ {v=$2; gsub(/["\047]/, "", v); print v}' /etc/mongod.conf); do p=$(stat -c %a "$f" 2>/dev/null) || { bad=1; continue; }; [ $((0$p & 077)) -eq 0 ] || bad=1; done; [ $bad -eq 0 ] && echo compliant || echo noncompliant
예상 출력
compliant

조치 방법

조치 방식: 가이드 또는 인프라 패치

chmod 600 <keyfile/PEM key> and chown mongodb:mongodb <keyfile/PEM key> for every key file referenced in /etc/mongod.conf.

속성

운영 체제
모두
태그
mongodbpermissionstls
참고 자료
CIS MongoDB 8 Benchmark v2.0.0 - 7.1 Ensure appropriate key file permissions are set

이 호스트 점검하기

감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.

shell
tmaegis scan --target mongodb