MongoDB Config Auditor
Your mongod.conf decides who can connect without a password, which networks can reach the server, and whether a crash loses your data. Read it before an attacker does.
A MongoDB config audit is a static review of a mongod.conf file — its authentication, network, durability and logging settings — checked line by line against known-good practice, without running the server. Paste yours here and this auditor reads it in your browser — never uploaded — and flags authentication off, a bindIp of 0.0.0.0, TLS disabled, test commands enabled, journaling off, a small oplog and the logging gaps that hide incidents, with a 0–100 score. The companion article MongoDB config security audit guide explains each check. Also see the Redis Config Auditor and the MySQL/Postgres Config Auditor.
Last updated:
1. Audit a config
Results
🔒 The audit runs entirely in your browser: the config is never uploaded, never stored, and never sent anywhere. A config names network bindings, file paths and access rules — that is exactly why it stays on your machine.
What a mongod.conf is
A MongoDB config (mongod.conf) is a YAML file of nested sections: net, security, storage, systemLog, replication, processManagement, operationProfiling and setParameter, each with indented key: value lines. # starts a comment, values may be quoted, and lists use - item or inline [a, b] form. Keys are case-sensitive — bindIp is not bindip — and YAML forbids tabs for indentation.
The sections fall into four concerns: who may connect (security.authorization, keyFile, authentication mechanisms), which networks can reach the server (net.bindIp, net.port, net.tls), what survives a crash (storage.journal, storage.engine, replication.oplogSizeMB), and what you can see afterwards (systemLog, operationProfiling, auditLog). The auditor reads all four with the same scoring.
The single most important fact about mongod.conf is its default: authentication is OFF unless you turn it on. A fresh install with no security.authorization line accepts any connection and lets it read and write everything — the misconfiguration behind the waves of ransomed open MongoDB instances. The auditor treats a missing authorization line as its highest-severity finding for exactly that reason.
Two things the auditor deliberately does not follow: the config is YAML, and the parser covers the subset real configs use — anchors, multi-line blocks and tags are reported as unparseable rather than silently misread — and the running server is out of scope: getParameter and db.adminCommand can show different values from the file on disk, and the auditor never connects to a server.
What this auditor does — and what it does not
It parses the config in your browser — nested YAML sections, comments, quoted strings, booleans, numbers and lists — and runs 38 rules over the settings: authorization and keyFile, bindIp and bindIpAll, TLS mode and certificates, server-side JavaScript, test commands, authentication mechanisms, cluster auth mode, journaling and the storage engine, profiling, logging and audit, the oplog, fork and connection limits. Scoring starts at 100; each error deducts 10 (capped at 50), each warning 4 (capped at 28), each info 1 (capped at 10). Bands: 90+ Excellent, 70–89 Good, 50–69 Needs work, below 50 Poor. Two infos are noted but never scored: redactClientLogData on, and SASL/LDAP settings present.
It does not run the server, check file permissions, or read the running values: it reads exactly the text you give it. It cannot see total RAM, so a cacheSizeGB finding never claims a size is wrong — only that no size is set. It cannot see the running values (getParameter), real network exposure, the MongoDB version, keyFile permissions on disk, TLS certificate validity, or the users and roles in the admin database. A finding is a pattern, not a verdict — a default port on a public interface behind a firewall is a different risk from the same line on an open server. Read each finding with its evidence and decide with your context.
The broken demo is a small mongod.conf built to trip the rules on purpose — no authorization, a bindIp of 0.0.0.0, TLS disabled, server-side JavaScript on, journaling off, a removed storage engine, test commands enabled, full profiling and a 256 MB oplog — and scores 31 (Poor), with 18 findings across all three severities. The hardened demo is the same shape with every finding fixed, and scores 100.
Be honest about what a static audit cannot see
This audit reads text. It cannot see the values the server is actually running with — a config file on disk and the running server can disagree after a missed restart — nor total RAM, real network exposure, the MongoDB version and whether it is end-of-life, keyFile permissions on disk, TLS certificate validity, or the users and roles in the admin database. It also cannot see files the config does not contain: the users who can actually log in live in the database, not in mongod.conf.
And a high score is not a safe MongoDB. The rules encode widely agreed practice — the MongoDB manual's security checklist, configuration options and authentication pages — but they are a checklist, not a penetration test. “No findings” means no risky pattern was found in this text — not that the server behind it is secure.
Key facts
| security.authorization | The setting that turns MongoDB authentication on. MongoDB ships with authentication OFF: without security.authorization: enabled, anyone who can connect can read and write everything. It is the one line that decides whether your database is open to the internet. |
| net.bindIp | The setting that picks which network interfaces mongod listens on. 127.0.0.1 means local clients only; 0.0.0.0 means every interface, including the public internet if the host is exposed. bindIpAll: true is the same exposure in one flag. |
| security.keyFile | The shared-secret file replica-set members use to authenticate to each other. Without it, any mongod can join the replica set; with it, members prove they hold the same secret. It must be an absolute path with restrictive permissions (mode 400), which the auditor notes but cannot verify from the config. |
| net.tls.mode | Whether mongod encrypts client connections: disabled means credentials and data travel in cleartext; allowTLS and preferTLS let a client downgrade to cleartext; requireTLS refuses unencrypted connections. requireTLS without a certificateKeyFile is a contradictory config — mongod will fail to start. |
| SCRAM-SHA-256 | The modern MongoDB password authentication mechanism, set via setParameter.authenticationMechanisms. SCRAM-SHA-1 is the older, weaker form; MONGODB-CR is the legacy challenge-response mechanism, removed in modern MongoDB — its presence means the install is ancient. |
| storage.journal | The write-ahead journal: with journaling enabled, mongod can replay writes after a crash instead of losing them. Disabling it trades durability for speed, and a crash can lose writes since the last checkpoint. |
| replication.oplogSizeMB | The size of the oplog, the capped collection that records every write for replication. A small oplog means a secondary that falls behind can no longer catch up from the oplog and needs a full resync. The guideline is roughly 5% of disk, at least 1 GB for production. |
| Format reference | MongoDB Manual — Security Checklist · MongoDB Manual — Configuration File Options · MongoDB Manual — Authentication |
Frequently asked questions
Why does the audit run in my browser instead of on a server?
Because a config can name things you do not publish: network bindings, file paths, key file locations and internal hostnames. Sending that to a server to audit it would create the exact exposure the audit is meant to catch. Parsing it locally means the config never leaves your machine.
My config has findings — is my MongoDB unsafe?
Not necessarily. A finding is a pattern that matched, and some matches are intended: a default port behind a firewall that only allows localhost, or full profiling during an active investigation. Start with the errors — no authorization, a public bind, test commands enabled, a removed engine — then the warnings, and treat the infos as a checklist of defaults worth setting explicitly.
I set authorization: enabled — am I done with authentication?
No — that only turns authentication on; you still need users. Authorization enabled with no users in the admin database means nobody can log in at all (including you, until you create the first user via the localhost exception). And in a replica set, members also need a shared keyFile, or any mongod can join the set. The auditor checks the config side; the users live in the database, which a static audit cannot see.