Database Security: 7 Practical Steps and Tips
In a world, increasingly reliant on technology and the internet, database security can no longer be an afterthought. Especially given the recent spate of reported data breaches in the news.
But what exactly is it about databases that appeal to cyber criminals?
Databases frequently house concentrated sensitive organizational data in an easy-to-search and analyze format, making them high-value targets for threat actors. Hence the need for database security.
What is Database Security?
Database security is a broad term that refers to all of the controls and tools that organizations use to ensure the availability, integrity, and confidentiality of their databases (i.e., data management systems and all connected software). Overall, the goal of data security is to protect:
- The Database management system (DBMS)
- The data in the database
- The physical and virtual database server, as well as the supporting hardware
- Associated applications
- The database access network and computing infrastructure
Why are any of these measures necessary? It’s simple: the consequences of a data breach can be far-reaching for your organization. You may be forced to deal with compromised intellectual property, brand reputation damage, fines and penalties for noncompliance, and additional business expenses resulting from data breaches.
Common Threats to Database Security
The following are some of the most common database security threats.
- Human Error: in recent years, password sharing, weak passwords, and other security-lax user behaviours have been cited as the cause of nearly half of reported data breaches.
- Insider Threats: one of the most common causes of database security breaches is the granting of privileged user access credentials to an excessive number of employees. This could lead to:
- A careless insider who makes mistakes that expose the database to attack
- A malicious insider with bad intentions
- An infiltrator – a threat actor who obtains authorization credentials through phishing or other unethical means.
- Database Software Vulnerabilities: the good news is all software vendors release regular security patches to address these vulnerabilities; however, failure to apply these patches quickly can expose your organization’s database to further exposure.
- NoSQL/SQL Injection Attacks: organizations that do not adhere to secure web application coding practices or conduct regular vulnerability testing are vulnerable to NoSQL and SQL injection attacks. In which arbitrary NoSQL or SQL attack strings are inserted into database queries served by HTTPS headers or web applications.
- Malware: malware is created by threat actors to exploit vulnerabilities in a database, often arriving via any endpoint device connected to the database’s network – leaving a lot of destruction in its wake.
- DDoS/DoS Attacks: during a DoS attack, a hacker floods your organization’s database with requests, causing the server to fail to fulfil legitimate requests from actual users and, in many cases, crash or become unstable.
Worse, the deluge comes from multiple servers, making it even more difficult to stop the attack.
- Buffer Overflow Exploitations: this happens when a process attempts to write more data to a fixed-length block of memory than it is permitted to hold, thus exposing the database. The excess data stored in adjacent memory addresses are then used by hackers to launch attacks against your organization’s database.
- Backups Breach: this occurs when the same stringent controls used in protecting your organization’s database are not applied to its backups, leaving it vulnerable to attacks.
- Infrastructure Sprawl: the complexity of today’s network environments, particularly as organizations’ workloads migrate to a hybrid or multi-cloud cloud architectures, has made database security solution deployment and management more difficult.
- Stringent Regulatory Requirements: the regulatory compliance environment is becoming increasingly extensive, making compliance with all mandates more difficult.
How to Evaluate Your Organization’s Database Security Requirements
Your organization’s database security should be unique to it. As such, before implementing any measure, we recommend assessing your database security environment to determine your team’s top security priorities. As a starting point, consider the following factors:
- Network and Administrative Access Controls: the goal should be to limit the number of users who have administrative access to the database. Any other scenario must be fixed
- Physical Security: is your database server (both in the cloud and on-premise) located within a secure, climate-controlled environment?
- Encryption: is all your organization’s data (including credential data) encrypted both in transit and at rest?
- User Device and Account Security: are all user devices and accounts on the database network subject to security controls at all times?
- Web and Application Server Security: are all web and application servers that interact with the database subjected to ongoing security testing to ensure they do not become a conduit for an attack?
- Database Software Security: are you running the most recent version of your database management software?
- Auditing: are all logins and operations on the database server regularly recorded and audited?
- Backup Security: are all database copies, backups, or images subject to the same (or equally stringent) security controls as the database itself?
7 Database Security Best Practices
After you’ve assessed your company’s database environment, consider implementing some of the database security controls and policies listed below to protect your database from hackers.
-
Use Firewall Protection
One of the best ways to ensure that your database server is protected from database security threats is to use a firewall, which filters and blocks all unauthorized traffic and access requests. The firewall should also block your database from initiating unauthorized outbound requests. Take this a step further by deploying a web application firewall. This is to protect against attacks such as SQL injection attacks which are often routed through web applications that interact with databases.
2. Keep Web and Database Servers Separate
In the conventional sense, this simply means keeping your database server in a secure environment and using strict access controls to keep unauthorized users out. However, it also implies hosting the database on a physical server rather than a cloud-based server. Because a web server is located in a DMZ, it is quite often more vulnerable to attacks. That is, if it is compromised, a hacker may gain root user access to your database and data – a risk reduced by keeping your database on a physical server.
3. Implement Least-Privilege User Access
One of the most common causes of database breaches is compromised user accounts. As such, it is vital that database accounts have the bare minimum of privileges in case they are compromised to limit your losses. To put it another way, limit the number of accounts with administrator access – and even then, only to the privileges required per session (trust-but-verify). However, if your organization is small, this may not be feasible, but at the very least, manage permissions through roles or groups rather than directly granting them.
If yours is a larger organization, consider automating access management so that authorized users only get temporary passwords with the privileges they need each time they need to access a database. Finally, make certain that standard account security procedures are followed:
- Deactivate accounts when employees change roles or leave the organization
- Make strong passwords mandatory
- Lock accounts after three or four failed login attempts
- Encrypt and salt stored password hashes
4. Update Your Operating System and Database Software Regularly
To protect against the most recently discovered vulnerabilities, it is critical to regularly update your operating system and database software with all newly released security patches.
Make it an organizational priority to reduce the time between when a patch is released and when it is applied to your database. Even better, automate this process. This is especially important for databases that are linked to a large number of third-party applications, each of which requires its own patch.
5. Monitor and Audit Database Activity Regularly
The best way to ensure database security is to constantly monitor and audit the activities that happen on it. Effective monitoring allows you to quickly detect suspicious activity or when an account has been compromised, or when the database is under attack. Keep an eye out for the following:
- Failed login attempts
- Misuse of applications service accounts
- Connections from unknown IP addresses
- Bulk data transfer
Consider using a Database Activity Monitoring (DAM) solution to centralize network statements and audit records in a secure repository if you need to monitor and audit multiple databases simultaneously. DAM can also be used to generate various types of compliance reports and generate alerts based on your organization’s security policy.
6. Encrypt Data and Backups
Without data encryption, hackers can easily circumvent database security controls and steal data through network connections, data files, or underlying storage. So, encrypt all data in your database. This includes both stored data (Transparent Data Encryption), data-in-transit encryption (TLS, Native Network Encryption), and data backups.
Note: using your database vendor’s native encryption tool will provide the best coverage and performance because third-party encryption tools can be problematic.
That said, encrypting data and backups is only part of the solution. Yes, it resolves the risk of an out-of-band attack, but it also introduces a new database vulnerability: decryption keys management. What’s the solution? Consider using a key management system (KMS) to centrally store, secure, and distribute the encryption keys.
Pro Tip: make sure your KMS can handle the load in all scenarios and supports encryption across your multi-tenant deployment, backups, clustering, disaster recovery, and high-availability deployments.
7. Address System Configuration Risk
Most successful database breaches are the result of one or two vectors: a compromised user account or a service misconfiguration that exposed the database. Especially given how complex today’s databases are, with hundreds of parameters that can be adjusted based on an organization’s needs, and several of which, if misconfigured, can expose the database to attacks. Therefore, we recommend that you use vendor-supplied utilities to assist you in assessing configuration risks. Schedule a database configuration scan as part of your security program at least quarterly, and keep an eye out for configuration drift to detect variations in your environment.
On a Final Note
Don’t forget to put your database security infrastructure through its paces by simulating a real-world attack. Auditing or hacking your database will put you in the mind of an attacker and help you discover vulnerabilities that you may have overlooked.
Enjoyed reading this article? How about sharing it with the world?