Implementing Best Practices

Basic Hygiene

Visibility
  1. Send administrative-related activity logs to a centralized logging system.

  2. Log all network traffic, both accepted and dropped.

  3. Alert on the following conditions:

    1. Failed and successful logins.

    2. Changes in roles and assigned privileges.

    3. Configuration changes.

    4. Software installation and deletion.

    5. System or native database errors and alerts.

Default Deny
  1. Only allow connections from trusted sources.

  2. Disable external administrative access.

  3. Disable default network ports.

Least Privilege
  1. Users and systems (e.g., applications) should have the least privileges necessary to perform their job functions or tasks.

    1. Schemas should be limited to function with a minimum set of information.

  2. Restrict administrative privileges to authorized users (such as DBA’s Systems administrations, Application administrators).

  3. Conduct regular audits of privileges.

Segmentation
  1. Place database servers in a dedicated segment apart from applications and other services.

Configuration
  1. Patching:

    1. Install the latest operating system patches.

    2. Install the latest database security and stability updates.

  2. Utilize separate database servers.

    1. Do not Install databases on the same system the application runs on.

  3. Utilize encryption.

    1. If available, utilize encryption of all data held within the database.

  4. Create regular backups.

    1. Back up databases regularly and schedule testing of these backups often.

    2. Store backups separately, even physically separated, from the database when possible.

    3. Restrict authorization to backup, access, and restore data to a smaller or different set of users than regular database users.

    4. Patch the host operating system regularly.

  5. Secure default accounts.

    1. Remove default accounts, if possible.

    2. Disable any default accounts if removing them is not an option.

    3. Set a random, complex password that is not shared among users if removing or disabling default accounts is impossible.

Advanced Hygiene

Visibility
  1. Implement alerts from security controls, local firewall, EDR, and anti-malware.

  2. Log queries, including user identity and size of results. 1.Alert on:

    1. First-time access by a user to a database.

    2. Large query results.

    3. Creation or destruction by users.

Default Deny
  1. Implement application control on database servers preventing unnecessary applications from executing.

Segmentation
  1. Only allow connections over a local socket.

    1. Disable TCP access.

  2. Place the database in a separate isolated environment.

    1. Ensure databases are not in the same network segment as application servers, ideally in a network segment only for databases.

  3. Separate DEV & UAT environments from production.

    1. Do not share accounts between environments.

    2. Do not store production data in development & UAT environments.

Configuration
  1. Do not use built-in database accounts like root, SA, or SYS.

  2. Lock database administration accounts down to local-only access.

  3. Store transaction logs on a separate disk.

  4. Create backups

    1. Ensure that backups are encrypted.

    2. Ensure backups have appropriate permissions assigned.

  5. Invest in FIM (File Integrity Monitoring)

Resilient Operations

Visibility
  1. Implement behavior analytics with alerting for:

    1. Successive or simultaneous logins from physically distant geographies.

    2. Source IP addresses used to access databases.

    3. Source ISPs for remote user access.

    4. Queries issued by users.

    5. Amount of data returned by queries per user.

  2. For administrative users, use more sensitive alerting for behavior analysis.

Default Deny
  1. Only allow connections from encrypted sources.

  2. Configure the database to bind on localhost.

  3. Implement an application layer firewall allowing the minimal set of operations required for normal use.

Least Privilege
  1. Utilize granular access controls for table, column, and row access.

Segmentation
  1. Place each database server in a dedicated segment with filtering capabilities.

  2. Segment data within databases. For example, partitioning data based on user or customer accounts prevents accidental data leakage or cross-pollination.

Configuration
  1. Ensure change management procedures are well documented and followed.

  2. Utilize encryption key management systems to ensure the regular rotation of encryption keys

Database Security Resources