Skip to content

Authentication enabled but still able to connect to test collection without username and password #631

@akash-swami-invimatic-io

Description

I am running mongo docker using docker compose file with below configurations.

version: '3.1'
services:
  mongo:
    image: mongo
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: some_password
    ports:
      - "127.0.0.1:27017:27017"

when I exec to mongo container and connect to mongodb through mongosh command without mentioning username and password its still connecting. Based on my understanding when authentication is enabled it should not connect to test database as well.

image

I am just started working with mongodb so please let me know if this is expected behavior or I am missing some configuration while creating container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions