MongoDB
TMA-MONGODB-6.3
Ensure that server-side scripting is disabled if not needed
Description
MongoDB supports the execution of JavaScript code for certain server-side operations: mapReduce, group, $where, $accumulator, and $function aggregation operations that allow users to define custom aggregation expressions. If you do not use these operations, server-side scripting should be disabled. 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). Treat a FAIL as an accepted exception only where server-side JavaScript ($where, mapReduce, $function, $accumulator) is required.
Méthode de vérification
Méthode d'audit: Motif de fichier
- Fichier
/etc/mongod.conf- Motif
(?m)^[ \t]*javascriptEnabled:[ \t]*['\x22]?false\b
Méthode de correction
Méthode de correction: Recommandation ou correctif d'infrastructure
If server-side scripting is not required set security.javascriptEnabled: false in /etc/mongod.conf (or start mongod/mongos with --noscripting) and restart.
Propriétés
- Systèmes d'exploitation
- Tous
- Étiquettes
- mongodbhardening
- Référence
- CIS MongoDB 8 Benchmark v2.0.0 - 6.3 Ensure that server-side scripting is disabled if not needed
Vérifier cet hôte
Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.
tmaegis scan --target mongodb --level 2