0
0
MongoDBquery~10 mins

Why MongoDB security matters - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable authentication in MongoDB configuration.

MongoDB
security:
  authorization: [1]
Drag options to blanks, or click blank then click option'
Anone
Bdisabled
Coptional
Denabled
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'disabled' will turn off security.
Using 'none' or 'optional' does not enforce authentication.
2fill in blank
medium

Complete the command to create a new user with readWrite role on the 'sales' database.

MongoDB
db.createUser({user: "salesUser", pwd: "password123", roles: [{ role: [1], db: "sales" }]})
Drag options to blanks, or click blank then click option'
Aread
BreadWrite
CclusterAdmin
DdbAdmin
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'read' only allows reading data, not writing.
Using 'dbAdmin' or 'clusterAdmin' gives more permissions than needed.
3fill in blank
hard

Fix the error in the command to enable TLS for MongoDB connections.

MongoDB
net:
  tls:
    mode: [1]
Drag options to blanks, or click blank then click option'
Aoptional
Benabled
CrequireTLS
Ddisabled
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enabled' is not a valid mode value.
Using 'optional' allows unencrypted connections.
4fill in blank
hard

Fill both blanks to configure MongoDB to bind only to localhost and enable authorization.

MongoDB
net:
  bindIp: [1]
security:
  authorization: [2]
Drag options to blanks, or click blank then click option'
A"127.0.0.1"
Benabled
Cdisabled
D"0.0.0.0"
Attempts:
3 left
💡 Hint
Common Mistakes
Binding to 0.0.0.0 allows all IPs, which is less secure.
Disabling authorization leaves the database open.
5fill in blank
hard

Fill all three blanks to create a user with 'read' role on 'inventory' database and set password.

MongoDB
db.createUser({user: [1], pwd: [2], roles: [{ role: [3], db: "inventory" }]})
Drag options to blanks, or click blank then click option'
A"inventoryUser"
B"invPass2024"
C"read"
D"write"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' role instead of 'read' changes permissions.
Forgetting quotes around user or password causes syntax errors.