TMAegis
更多 mongodb 規則

TMA-MONGO-SYSTEM-LOG-DESTINATION

Ensure system activity is logged to a file or syslog

中等級 1自動化mongodb

說明

systemLog.destination file or syslog keeps server logs persistently instead of only on stdout. Checks the YAML config file /etc/mongod.conf (SKIP when it does not exist).

檢查方式

稽核方法: 檔案正規表示式

檔案
/etc/mongod.conf
比對模式
(?m)^systemLog:[ \t]*\n(?:[ \t]*(?:#[^\n]*)?\n|[ \t]+[^\n]*\n)*?[ \t]+destination:[ \t]*['\x22]?(?:file|syslog)\b

修補方式

修補方法: 操作指南或基礎設施修補檔

Set systemLog.destination: file and systemLog.path: /var/log/mongodb/mongod.log in /etc/mongod.conf and restart mongod

屬性

作業系統
不限
標籤
mongodbdatabaselogging
參考資料
CIS MongoDB Benchmark - Audit Logging / System Log (verify section number for your release)

檢查此主機

請在您有權稽核的機器上執行此指令。掃描為唯讀操作。

shell
tmaegis scan --target mongodb