MongoDB

CLImongosh

An agent with mongosh on its PATH can reach a database. Memnox wraps the binary, reads the command before it runs, and matches it against the table below. Nothing here is a list of what we support: it is what the runtime already classifies, and the strings are the ones a rule matches on.

What it reads to authenticate

Discovery records that these exist and hashes them. It never reads a value, so a scan can say three agents reach this file and never what is inside it.

! MONGODB_URI! DATABASE_URL

What it changes

2

Allowed by default, and the obvious first thing to put behind ask.

mongosh --eval **mongosh.eval
mongosh **mongosh.run

The rule this writes

[[rules]]
name = "mongosh-destructive-asks-first"
match.actions = ["mongosh.**"]
decision.effect = "ask"
decision.reason = "This cannot be undone."

memnox protect --for mongosh writes this into memnox.policies.toml from the table above. You can edit it, and the file is yours.

Run npm i -g memnox && memnox setup to find out whether MongoDB is actually reachable from your machine. It reads your own disk and needs no account.