SELinux setup for MongoDB

If you want to configure SELINUX for Mongo in simple way - try audit2why on your /var/log/audit/audit.log to see what kinds of violations would have been denied, and build custom policies with audit2allow. It works in 80% of incidents.

If you'll still have problems - run audit2why and fix another issues manually. Maybe we can help you on this step.


Running sudo sealert -a /var/log/audit/audit.log gave some useful insights here and recommendations for SELinux config changes. (We have changed the dbPath value in mongod.conf also.)