SV-265931r1028807_rule
V-265931
SRG-APP-000266-DB-000162
MD7X-00-006000
CAT II
10
Configure custom application code so as not to divulge sensitive information or information useful for system identification in custom application error messages.
To configure MongoDB to redact client information from its log file, do the following:
Edit the MongoDB Configuration file (default location: /etc/mongod.conf)
Add the following option to the security section:
security:
redactClientLogData: true
Restart the MongoDB server from the operating system:
$ sudo systemctl restart mongod
Check custom application code to verify that error messages do not contain information beyond what is needed for troubleshooting the issue.
If custom application error messages contain PII data, sensitive business data, or information useful for identifying the host system or database structure, this is a finding.
For example, when attempting to log in using the MongoDB shell with incorrect client credentials, the user will receive a generic error message that the authentication failed regardless of whether the user exists.
If a user is attempting to perform an operation using the MongoDB shell for which they do not have privileges, MongoDB will return a generic error message that the operation is not authorized.
To prevent too much information being displayed in the MongoDB logfiles, run the following command:
> db.getSiblingDB("admin").runCommand({getCmdLineOpts: 1}).parsed.security.redactClientLogData
If the command does not return true, this is a finding.
V-265931
False
MD7X-00-006000
Check custom application code to verify that error messages do not contain information beyond what is needed for troubleshooting the issue.
If custom application error messages contain PII data, sensitive business data, or information useful for identifying the host system or database structure, this is a finding.
For example, when attempting to log in using the MongoDB shell with incorrect client credentials, the user will receive a generic error message that the authentication failed regardless of whether the user exists.
If a user is attempting to perform an operation using the MongoDB shell for which they do not have privileges, MongoDB will return a generic error message that the operation is not authorized.
To prevent too much information being displayed in the MongoDB logfiles, run the following command:
> db.getSiblingDB("admin").runCommand({getCmdLineOpts: 1}).parsed.security.redactClientLogData
If the command does not return true, this is a finding.
M
5637