-
MongoDB Daemon: MongoDB is run as a daemon (
mongod
) that starts and manages the database. To secure the database, authentication needs to be configured. -
Authentication Configuration:
- Before launching MongoDB, configure the authentication by specifying a username and password that will allow users to securely authenticate into the MongoDB server.
- This can be done by preparing a MongoDB configuration file (e.g.,
mongod.conf
) that includes the user profile for authentication.
-
Launching MongoDB via Docker:
- Use Docker to launch the MongoDB Community Server on the EC2 instance. This is essentially a way to start the MongoDB daemon in an isolated environment.
- When running the Docker container, mount the MongoDB configuration file that includes the security settings (e.g., user profiles, password).
-
EC2 MongoDB Server:
- Once the MongoDB daemon is running inside the Docker container on the EC2 instance, it will have the security configurations attached to it.
-
Connection and Authentication:
- When making a connection request to the MongoDB server, ensure that the connection string includes the correct authentication information (username and password) to gain access.
This setup ensures that your MongoDB database for EEG data is securely managed and accessible only to authenticated users.
To set up authentication for mongod, follow this guide: Use SCRAM to Authenticate Clients on Self-Managed Deployments