Home / Guides

Server guide

SQL Server security checklist for small teams

This guide is for small businesses, agencies, and hosting teams managing SQL Server on VPS, dedicated or cPanel servers. It delivers a step‑by‑step checklist to assess, remediate, and sustain security.

7 min readUpdated November 2026 by the RootManage teamWorks on Ubuntu, Debian, AlmaLinux and Rocky unless noted

The short answer

A SQL Server security checklist outlines the essential configuration checks, hardening steps, and ongoing practices needed to protect the database from unauthorized access and common attacks. Follow it to verify settings, apply fixes, and keep the server secure over time.

Why SQL Server security matters

A data breach involving SQL Server can expose customer records, financial information, and intellectual property. For small teams, the loss of such data can damage reputation, erode client trust, and lead to costly remediation efforts. Attackers often target poorly configured databases, default accounts, or unpatched instances, making it essential to treat SQL Server security with the same rigor as any other critical asset.

Beyond the immediate impact of a breach, many jurisdictions and industry standards require protection of personal data. Non‑compliance can result in fines, legal actions, and the need for mandatory audits. Even when regulations do not apply, clients expect that their data is handled securely, and failing to meet that expectation can affect business continuity and growth.

  • Enable strong, unique passwords for all SQL accounts.
  • Apply the latest security patches and cumulative updates.
  • Restrict network access to the SQL Server port (default 1433).
  • Use encryption for data at rest and in transit.
  • Audit login attempts and privilege changes regularly.
terminal
systemctl status mssql-server   # Verify the SQL Server service is running
sudo /opt/mssql/bin/mssql-conf set network.tcpport 1433   # Ensure the default port is set (review before applying)

After running the commands, confirm that the service is active and listening on the intended port. Any errors should be investigated before proceeding with further configuration.

Initial security assessment

Start the assessment by confirming the authentication mode configured for the SQL Server instance. Determine whether Windows Authentication only or Mixed Mode (Windows plus SQL logins) is enabled, and verify that any SQL logins use strong passwords and are limited to necessary roles. Review the server's surface area by disabling unused features such as Database Mail, SQL Server Agent, or CLR integration. Reducing the attack surface limits the number of components an attacker can target.

Next, check the patch level of the SQL Server binaries and the underlying operating system. Ensure that the latest cumulative updates and security patches have been applied, and that the server is set to receive automatic updates where appropriate. Verify that the service accounts running SQL Server have the least privileges required, and that the default 'sa' account is either disabled or secured with a complex password. Document any deviations for remediation.

  • Authentication mode (Windows only vs. Mixed).
  • Enabled features and services (surface area).
  • Patch level of SQL Server and OS.
  • Service account privileges.
  • Status of the 'sa' login.
terminal
sqlcmd -S localhost -Q "SELECT SERVERPROPERTY('IsIntegratedSecurityOnly') AS AuthMode; SELECT SERVERPROPERTY('ProductVersion') AS Version;"

The query should return '1' for Windows‑only authentication or '0' for Mixed Mode, along with the current version number. Use these values to confirm the server is running the expected authentication configuration and is up‑to‑date with patches.

Hardening configuration steps

Enable TLS for all SQL Server connections to protect data in transit. Configure the server to use a certificate from a trusted CA and set the Force Encryption option to true. Verify that clients can still connect with the new TLS settings before disabling older protocols. Disable the default sa account or rename it and enforce a strong password policy. Remove the sa login from the sysadmin role and monitor its usage with audit logs. Configure the Windows firewall or your cloud security group to allow inbound traffic only on the SQL Server port (default 1433) from trusted IP ranges, and block all other ports. Use the sp_configure stored procedure to restrict remote access to only necessary protocols and enable the remote access option only if required. The combination of TLS, a disabled or renamed sa, and a tight firewall rule set creates a layered defense against most common attacks.

  • Enable TLS on the server
  • Disable or rename the sa login
  • Restrict inbound traffic to port 1433 from trusted IPs
terminal
# Example commands for a Linux environment running SQL Server
# Enable TLS by editing /etc/ssl/openssl.cnf and setting the certificate paths
# Set Force Encryption via sqlcmd
#sqlcmd -S localhost -U sa -P 'StrongPassword' -Q "EXEC sp_configure 'Force Encryption', 1; RECONFIGURE;"
# Configure firewall to allow only specific IPs
#sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="1433" protocol="tcp" accept'
#sudo firewall-cmd --reload

After applying these changes, check that a client can connect using TLS by running sqlcmd -S <server> -U <user> -P <pass> -Q "SELECT 1" and verifying the connection is encrypted. Confirm the sa login is no longer a sysadmin and that the firewall only allows traffic from the specified IP ranges.

Secure account and password policies

Strong passwords are the first line of defense against credential theft. Enforce a minimum length of twelve characters, require a mix of upper‑case, lower‑case, numbers and symbols, and disallow dictionary words or repeated patterns. SQL Server can enforce this through password policy settings on login objects: set CHECK_POLICY = ON and CHECK_EXPIRATION = ON. Regularly review password age and rotate credentials, especially for service accounts that run critical applications. Keep a log of password changes in a secure, immutable audit trail so you can track when a credential was last updated. Least‑privilege roles reduce the blast radius of a compromised account. Create separate logins for each application or user and grant only the permissions they need. Use built‑in roles such as db_datareader or db_datawriter instead of db_owner. When a user no longer requires access, disable or drop the login immediately. Combine this with an account lockout policy: set max_attempts to a low number and a short lockout_time so that repeated failed logins trigger an automatic lock, deterring brute‑force attacks.

  • - Enable Windows password policy enforcement on SQL Server logins. - Use role‑based security and avoid sysadmin for day‑to‑day tasks. - Configure account lockout: ALTER LOGIN [user] WITH CHECK_POLICY = ON, CHECK_EXPIRATION = ON;
terminal
-- Example: enforce password policy on a login
ALTER LOGIN [app_user] WITH CHECK_POLICY = ON, CHECK_EXPIRATION = ON;
-- Example: set lockout policy (Windows side, not SQL Server)
-- (Review your domain policy for max_attempts and lockout_time)

Verify that the login shows CHECK_POLICY = ON in its properties and that failed login attempts trigger a lockout in the Windows Event Log.

Backup and audit settings

Backup and audit settings are essential for protecting data and maintaining compliance. Enable encrypted backups so that data at rest cannot be read if the storage media is compromised. Use the database’s built‑in encryption feature or a third‑party tool that supports AES‑256. Store backup files in a separate, access‑controlled location and rotate them regularly.

Regular audit logs give you visibility into who accessed the database, what changes were made, and when. Configure the audit to capture logins, query execution, schema changes, and permission alterations. Store the logs in a secure, tamper‑evident repository and review them weekly. Automated alerts on suspicious activity help you respond before damage occurs.

  • Enable encryption on all backup files
  • Rotate backups daily or weekly
  • Store logs in a separate, secured location
  • Review audit logs at least once a week
  • Set up alerts for failed login attempts
terminal
# Example: enable backup encryption on Linux using a wrapper script
# (run this after creating the backup)
# backup.sh
#!/bin/bash
pg_dump -U dbuser -F c mydb > /tmp/mydb.dump
openssl enc -aes-256-cbc -salt -in /tmp/mydb.dump -out /var/backups/mydb.dump.enc -k mysecretkey
rm /tmp/mydb.dump

Verify that the backup file ends with .enc and that the audit log contains entries for the backup operation.

Common pitfalls to avoid

Many small teams enable mixed authentication on SQL Server to simplify login for Windows users. While convenient, it opens a larger attack surface because SQL logins are stored in a database and can be brute‑forced if not properly locked out. A better practice is to use Windows authentication only, or to enforce strong password policies and account lockout thresholds for any SQL logins that must exist. Always review the login list regularly and remove unused accounts. Granting sysadmin rights to users or groups is another common mistake. The sysadmin role gives unrestricted access to all databases, configuration, and backup/restore operations. Even a single compromised account with this role can destroy data or expose credentials. Assign the minimal set of permissions required for a task, and use role‑based access control to keep sysadmin privileges to a single, tightly controlled account.

Ongoing maintenance and monitoring

Ongoing maintenance and monitoring are essential for keeping SQL Server environments secure. Schedule regular patching cycles, such as monthly or quarterly, and apply all critical and security updates released by Microsoft. Use the built‑in Windows Update service or a configuration management tool to automate the download and installation of updates. After each patch, verify that the SQL Server service restarts correctly and that no authentication or connectivity issues arise. Complement patching with vulnerability scans and log reviews. Run a vulnerability scanner, like OpenVAS or Nessus, against the server to detect missing patches, weak passwords, or open ports. Configure the SQL Server audit feature to log failed login attempts, privilege changes, and schema modifications. Review the logs weekly for unusual activity, such as repeated failed logins or unexpected user creation, and adjust firewall rules or account policies accordingly.

  • - Keep a patch calendar and document every update. - Use a separate test environment to validate patches before production. - Enable SQL Server audit logs for critical actions. - Run vulnerability scans at least once a month. - Review logs for repeated failed logins or new user accounts.
terminal
# Example: check for pending Windows updates
powershell -Command "Get-WindowsUpdate -AcceptAll -Install"
# Example: run a quick OpenVAS scan (placeholder, adjust for your setup)
sudo openvas-start && sudo openvas-omp --get-scan-results "SQLServerScan"

Check that the audit logs contain entries for every successful and failed login, and that the vulnerability scan reports no critical findings.

If you would rather have engineers do this for you, see Linux server management, Windows server management or emergency malware cleanup.

Questions people ask

How can I verify that my SQL Server instance is running the latest security patches?

You can check the SQL Server version and patch level by running `SELECT @@VERSION;` in SSMS or sqlcmd. Compare the result with the latest version listed on Microsoft’s official SQL Server release notes page. If the build number is older, download and install the latest cumulative update from Microsoft.

What is the safest way to disable the built‑in SA account without breaking applications?

The safest approach is to rename the SA account or change its password and then disable it with `ALTER LOGIN sa DISABLE;`. Ensure any applications that rely on SA are updated to use a dedicated, less privileged login before making the change. Take a database backup first.

Which firewall ports should be opened for remote SQL Server connections?

For remote connections you normally open TCP port 1433. If you use named instances or dynamic ports, also allow UDP port 1434 for the SQL Browser service. Only open these ports on the firewall that fronts the SQL Server host, and restrict them to trusted IP ranges.

How often should I review audit logs and what key events should I look for?

Review audit logs at least once a week. Look for failed login attempts, successful logins from unfamiliar IPs, changes to server roles, creation or deletion of logins, and any alterations to database permissions. Log review should be part of your regular security maintenance schedule.

Want a person to look at it?

Tell us what you see. We reply with what we think is wrong and what it would take to fix it.