TMA-MONGO-SYSTEM-LOG-DESTINATION
Ensure system activity is logged to a file or syslog
MediumLevel 1Automatedmongodb
Description
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).
How it is checked
Audit method: File pattern
- File
/etc/mongod.conf- Pattern
(?m)^systemLog:[ \t]*\n(?:[ \t]*(?:#[^\n]*)?\n|[ \t]+[^\n]*\n)*?[ \t]+destination:[ \t]*['\x22]?(?:file|syslog)\b
How it is fixed
Fix method: Guidance or infrastructure patch
Set systemLog.destination: file and systemLog.path: /var/log/mongodb/mongod.log in /etc/mongod.conf and restart mongod
Properties
- Operating systems
- Any
- Tags
- mongodbdatabaselogging
- Reference
- CIS MongoDB Benchmark - Audit Logging / System Log (verify section number for your release)
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
shell
tmaegis scan --target mongodb