Reputation: 1301
We are using Mongo DB to store different configuration objects that are used as input for execution; Often we get into soup when these configurations are modified by a user incorrectly by firing Mongo query instead of using custom exposed APIs.
In Mongo, is there any way to log user who last modified the document? Any system defined audit capability which can enable tracing the illegal entries quickly and make system failproof.
In case its not possible to do it at document level, is there an Admin control that can help track the IP and User who fired it easily?
Any help would be appreciated.
Upvotes: 0
Views: 773
Reputation: 37048
There is no audit on per-document level but enterprise version can audit user auth events with local and remote IP addresses and sessions. The full list of events is documented at https://docs.mongodb.com/manual/reference/audit-message/#std-label-audit-action-details-results
I reckon problem lies in
user incorrectly by firing Mongo query instead of using custom exposed APIs.
Don't expose mongodb to any users but API.
Upvotes: 1