CouchDB Security and Authentication Essentials Quiz Quiz

Explore key concepts in security and authentication for CouchDB, including access control, user management, and safe database practices. Perfect for anyone seeking to strengthen their understanding of protecting data and managing users effectively in CouchDB environments.

  1. Default Access Settings

    When a new database is created in CouchDB with default settings, who can read and write to it?

    1. Anyone with network access
    2. Only system administrators
    3. Only the creator
    4. Authenticated users only

    Explanation: By default, new databases allow anyone with network access to both read and write data unless specific security settings are applied. Only allowing the creator or system administrators would require additional configurations. Restricting access to authenticated users only is not the default setup. Misunderstanding these defaults can expose data unintentionally.

  2. Admin Role Functions

    Which action is only allowed for an administrator in CouchDB?

    1. Reading documents
    2. Browsing the database
    3. Creating documents
    4. Modifying the _security object

    Explanation: Only administrators can modify the _security object, which controls access permissions in the database. While any user may create or read documents if the database is open, changing security configuration is a privileged task. Simply browsing the database does not require special privileges unless explicitly restricted.

  3. User Authentication Methods

    Which method does CouchDB use for authenticating users by default?

    1. Kerberos ticket-based
    2. HTTP Basic Authentication
    3. LDAP integration by default
    4. OAuth by default

    Explanation: CouchDB uses HTTP Basic Authentication by default, where credentials are base64-encoded in HTTP headers. OAuth and LDAP may be configured separately but are not enabled by default. Kerberos ticket-based authentication is not a built-in method in the standard setup.

  4. Purpose of _users Database

    What is the primary purpose of the _users database in CouchDB?

    1. Storing user credentials and metadata
    2. Managing conflict resolution
    3. Storing design documents only
    4. Holding document attachments

    Explanation: The _users database is designed to store user documents, including credentials and metadata related to users. Document attachments and design documents are stored within other databases or specific documents. While conflict resolution is part of database operations, it is not the focus of the _users database.

  5. Securing Sensitive Data

    Which action best helps protect sensitive data in a CouchDB database?

    1. Allowing open read access
    2. Only using small documents
    3. Disabling replication
    4. Configuring correct _security object settings

    Explanation: Properly configuring the _security object ensures that only authorized users can access or modify sensitive data. Open read access puts sensitive data at risk, while disabling replication doesn't address security but affects data availability. Document size does not impact security directly.

  6. Session Cookies in Authentication

    In CouchDB, how are session cookies typically used during authentication?

    1. To assign admin roles automatically
    2. To encrypt all documents
    3. To maintain a user's logged-in state
    4. To store raw passwords

    Explanation: Session cookies are used to keep users logged in without requiring credentials for every request. Storing raw passwords in cookies is unsafe and not a standard practice. Cookies do not encrypt documents or grant admin roles automatically.

  7. Adding New Users

    How is a new user record most commonly added to CouchDB for authentication?

    1. Sending an email invitation
    2. Uploading an attachment to any database
    3. Modifying the _replicator database
    4. Creating a document in the _users database

    Explanation: To add a new user, you create a properly structured document in the _users database. Sending email invitations is not part of the authentication system by default. The _replicator database handles replication tasks, not users, and uploading attachments is unrelated to user creation.

  8. Principle of Least Privilege

    Applying the principle of least privilege in CouchDB means what?

    1. Giving users only the permissions they need
    2. Granting users admin rights by default
    3. Letting all users delete system files
    4. Allowing everyone to edit all databases

    Explanation: This principle ensures users are granted only permissions necessary for their tasks, reducing security risks. Allowing universal edit access or default admin rights violates this concept. Allowing deletion of system files is both unsafe and uncommon.

  9. Enabling HTTPS

    Why should you enable HTTPS in a CouchDB setup handling sensitive information?

    1. To encrypt data between client and server
    2. To speed up database queries
    3. To store data in different formats
    4. To compress network traffic

    Explanation: Enabling HTTPS encrypts data transmitted between clients and the server, protecting against interception. Compression may happen via other means but is not the purpose of HTTPS. Query speed or data storage formats are not affected by enabling HTTPS.

  10. Default Guest User

    In CouchDB, what can the 'guest' user do by default on an unsecured database?

    1. Nothing until registered
    2. Manage admin configurations
    3. Only read design documents
    4. Read and write documents

    Explanation: The guest user, representing unauthenticated users, can read and write documents on unsecured databases by default. They cannot manage admin configurations, which require privileges. Restricting guests to design documents or requiring registration needs explicit settings.