TMAegis
Thêm quy tắc cho mongodb

MongoDB

TMA-MONGODB-6.3

Ensure that server-side scripting is disabled if not needed

Trung bìnhCấp 2Tự độngmongodb

Mô tả

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ách kiểm tra

Phương pháp kiểm tra: Mẫu tệp

Tệp
/etc/mongod.conf
Mẫu khớp
(?m)^[ \t]*javascriptEnabled:[ \t]*['\x22]?false\b

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

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

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
mongodbhardening
Tham chiếu
CIS MongoDB 8 Benchmark v2.0.0 - 6.3 Ensure that server-side scripting is disabled if not needed

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target mongodb --level 2