TMAegis
Más reglas para mongodb

MongoDB

TMA-MONGODB-6.3

Ensure that server-side scripting is disabled if not needed

MediaNivel 2Automatizadamongodb

Descripción

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.

Cómo se verifica

Método de auditoría: Patrón de archivo

Archivo
/etc/mongod.conf
Patrón
(?m)^[ \t]*javascriptEnabled:[ \t]*['\x22]?false\b

Cómo se corrige

Método de corrección: Guía o parche de infraestructura

If server-side scripting is not required set security.javascriptEnabled: false in /etc/mongod.conf (or start mongod/mongos with --noscripting) and restart.

Propiedades

Sistemas operativos
Cualquiera
Etiquetas
mongodbhardening
Referencia
CIS MongoDB 8 Benchmark v2.0.0 - 6.3 Ensure that server-side scripting is disabled if not needed

Verificar este host

Ejecute esto en un equipo que tenga permiso para auditar. El escaneo es de solo lectura.

shell
tmaegis scan --target mongodb --level 2