TMAegis
More rules for mongodb

TMA-MONGO-BIND-ALL

Ensure mongod does not listen on all interfaces

HighLevel 1Automatedmongodb

Description

bindIp 0.0.0.0 or bindIpAll exposes the database on every network interface; bind only to localhost and required private addresses. 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)^[ \t]*(?:bindIp:[^#\n]*0\.0\.0\.0|bindIp:[^#\n]*::(?:[ ,'\x22]|$)|bindIpAll:[ \t]*true)

How it is fixed

Fix method: Guidance or infrastructure patch

Set net.bindIp to 127.0.0.1 plus the specific private addresses required (remove bindIpAll), then restart mongod

Properties

Operating systems
Any
Tags
mongodbdatabasenetwork
Reference
CIS MongoDB Benchmark - Network Exposure / Bind Address (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