Unit 5:
1. Database Security Architecture and Concepts
Security of databases refers to the array of controls, tools, and procedures designed to
ensure and safeguard confidentiality, integrity, and accessibility.
• Security for databases must cover and safeguard the following aspects:
• The database containing data.
• Database management systems (DBMS)
• Any applications that are associated with it.
• Physical database servers or the database server virtual, and the hardware that
runs it.
• The infrastructure for computing or network that is used to connect to the
database.
• Security of databases is a complicated and challenging task that requires all
aspects of security practices and technologies. The more usable and accessible
the database is, the more susceptible we are to threats from security. The more
vulnerable it is to attacks and threats, the more difficult it is to access and utilize.
• a data breach refers to a breach of data integrity in databases. The amount of
damage an incident like a data breach can cause our business is contingent on
various consequences or elements.
Database Security
Security of databases refers to the array of controls, tools, and procedures
designed to ensure and safeguard confidentiality, integrity, and
accessibility. This tutorial will concentrate on confidentiality because it's a
component that is most at risk in data security breaches.
Security for databases must cover and safeguard the following aspects:
o The database containing data.
o Database management systems (DBMS)
o Any applications that are associated with it.
o Physical database servers or the database server virtual, and the
hardware that runs it.
o The infrastructure for computing or network that is used to connect
to the database.
Security of databases is a complicated and challenging task that requires
all aspects of security practices and technologies. This is inherently at
odds with the accessibility of databases. The more usable and accessible
the database is, the more susceptible we are to threats from security. The
more vulnerable it is to attacks and threats, the more difficult it is to
access and utilize.
Why Database Security is Important?
According to the definition, a data breach refers to a breach of data integrity in
databases. The amount of damage an incident like a data breach can cause our
business is contingent on various consequences or elements.
o Intellectual property that is compromised: Our intellectual
property--trade secrets, inventions, or proprietary methods -- could
be vital for our ability to maintain an advantage in our industry. If
our intellectual property has been stolen or disclosed and our
competitive advantage is lost, it could be difficult to keep or
recover.
o The damage to our brand's reputation: Customers or partners
may not want to purchase goods or services from us (or deal with
our business) If they do not feel they can trust our company to
protect their data or their own.
o The concept of business continuity (or lack of it): Some
businesses cannot continue to function until a breach has been
resolved.
o Penalties or fines to be paid for not complying: The cost of not
complying with international regulations like the Sarbanes-Oxley Act
(SAO) or Payment Card Industry Data Security Standard (PCI DSS)
specific to industry regulations on data privacy, like HIPAA or
regional privacy laws like the European Union's General Data
Protection Regulation (GDPR) could be a major problem with fines in
worst cases in excess of many million dollars for each violation.
o Costs for repairing breaches and notifying consumers about
them: Alongside notifying customers of a breach, the company that
has been breached is required to cover the investigation and
forensic services such as crisis management, triage repairs to the
affected systems, and much more.
Common Threats and Challenges for Database
Security
Numerous software configurations that are not correct, weaknesses, or
patterns of carelessness or abuse can lead to a breach of security. Here
are some of the most prevalent kinds of reasons for security attacks and
the reasons.
Insider Dangers
An insider threat can be an attack on security from any three sources
having an access privilege to the database.
o A malicious insider who wants to cause harm
o An insider who is negligent and makes mistakes that expose the database
to attack. vulnerable to attacks
o An infiltrator is an outsider who acquires credentials by using a method
like phishing or accessing the database of credential information in the
database itself.
Insider dangers are among the most frequent sources of security breaches
to databases. They often occur as a consequence of the inability of
employees to have access to privileged user credentials.
Human Error
The unintentional mistakes, weak passwords or sharing passwords, and
other negligent or uninformed behaviours of users remain the root causes
of almost half (49 percent) of all data security breaches.
Database Software Vulnerabilities can be Exploited
Hackers earn their money by identifying and exploiting vulnerabilities in
software such as databases management software. The major database
software companies and open-source databases management platforms
release regular security patches to fix these weaknesses. However, failing
to implement the patches on time could increase the risk of being hacked.
SQL/NoSQL Injection Attacks
A specific threat to databases is the infusing of untrue SQL as well as
other non-SQL string attacks in queries for databases delivered by web-
based apps and HTTP headers. Companies that do not follow the safe
coding practices for web applications and conduct regular vulnerability
tests are susceptible to attacks using these.
DDoS (DoS/DDoS) Attacks
In a denial-of-service (DoS) attack in which the attacker overwhelms the
targeted server -- in this case, the database server with such a large
volume of requests that the server is unable to meet no longer legitimate
requests made by actual users. In most cases, the server is unstable or
even fails to function.
Malware
Malware is software designed to exploit vulnerabilities or cause harm to
databases. Malware can be accessed via any device that connects to the
databases network.
Attacks on Backups
Companies that do not protect backup data using the same rigorous
controls employed to protect databases themselves are at risk of
cyberattacks on backups.
Applications of Database Security
As databases are almost always accessible via the network, any security
risk to any component or part of the infrastructure can threaten the
database. Likewise, any security attack that impacts a device or
workstation could endanger the database. Therefore, security for
databases must go beyond the limits of the database.
In evaluating the security of databases in our workplace to determine our
organization's top priorities, look at each of these areas.
o Security for physical security: If the database servers are on-
premises or the cloud data centre, they should be placed in a
secure, controlled climate. (If our server for database is located in a
cloud-based data centre, the cloud provider will handle the security
on our behalf.)
o Access to the network and administrative restrictions: The
practical minimum number of users granted access to the database
and their access rights should be restricted to the minimum level
required to fulfil their tasks. Additionally, access to the network is
limited to the minimum permissions needed.
o End security of the user account or device: Be aware of who
has access to the database and when and how data is used.
Monitoring tools for data can notify you of data-related activities
that are uncommon or seem to be dangerous. Any device that
connects to the network hosting the database must be physically
secured (in the sole control of the appropriate person) and be
subject to security checks throughout the day.
o Security: ALL data--including data stored in databases, as well as
credential information should be secured using the highest-quality
encryption when in storage and while in transport. All encryption
keys must be used in accordance with the best practices guidelines.
o Security of databases using software: Always use the most
current version of our software to manage databases and apply any
patches immediately after they're released.
o Security for web server applications and websites: Any
application or web server that connects to the database could be a
target and should be subjected to periodic security testing and best
practices management.
o Security of backups: All backups, images, or copies of the
database should have the identical (or equally rigorous) security
procedures as the database itself.
o Auditing: Audits of security standards for databases should be
conducted every few months. Record all the logins on the server as
well as the operating system. Also, record any operations that are
made on sensitive data, too.
Data protection tools and platforms
Today, a variety of companies provide data protection platforms and
tools. A comprehensive solution should have all of the following features:
o Discovery: The ability to discover is often needed to meet regulatory
compliance requirements. Look for a tool that can detect and categorize
weaknesses across our databases, whether they're hosted in the cloud or
on-premises. It will also provide recommendations to address any
vulnerabilities that are discovered.
o Monitoring of Data Activity: The solution should be capable of
monitoring and analysing the entire data activity in all databases, whether
our application is on-premises, in the cloud, or inside a container. It will
alert us to suspicious activity in real-time to allow us to respond more
quickly to threats. It also provides visibility into the state of our
information through an integrated and comprehensive user interface. It is
also important to choose a system that enforces rules that govern policies,
procedures, and the separation of duties. Be sure that the solution we
select is able to generate the reports we need to comply with the
regulations.
o The ability to Tokenize and Encrypt Data: In case of an incident,
encryption is an additional line of protection against any compromise. Any
software we choose to use must have the flexibility to protect data cloud,
on-premises hybrid, or multi-cloud environments. Find a tool with volume,
file, and application encryption features that meet our company's
regulations for compliance. This could require tokenization (data
concealing) or advanced key management of security keys.
o Optimization of Data Security and Risk Analysis: An application that
will provide contextual insights through the combination of security data
with advanced analytics will allow users to perform optimizing, risk
assessment, and reporting in a breeze. Select a tool that is able to keep
and combine large amounts of recent and historical data about the
security and state of your databases. Also, choose a solution that provides
data exploration, auditing, and reporting capabilities via an extensive but
user-friendly self-service dashboard.
2. Grant & Revoke Commands
MySQL | Grant / Revoke
We have already learned about how to create users in MySQL using
MySQL | create user statement. However, using the Create User
Statement only creates a new user but does not grant any
privileges to the user account. Therefore to grant privileges to a
user account, the GRANT statement is used.
Syntax:
GRANT privileges_names ON object TO user;
privileges_name: These are the access rights or privileges granted to the
user.
object: It is the name of the database object to which permissions are being
granted. In the case of granting privileges on a table, this would be the table
name.
user: It is the name of the user to whom the privileges would be granted.
Privileges: The privileges that can be granted to the users are listed below along with
the description:
Let us now learn about different ways of granting privileges to the
users:
Granting SELECT Privilege to a User in a Table:
1. To grant Select Privilege to a table named “users” where
User Name is Amit, the following GRANT statement should
be executed.
2. The general syntax of specifying a username
is: ‘user_name’@’address’
3. If the user ‘Amit’ is on the local host then we have to
mention it as ‘Amit’@’localhost’. Or suppose if the ‘Amit’
username is on 192.168.1.100 IP address then we have to
mention it as ‘Amit’@’192.168.1.100’.
‘user_name’@’address’ – When you’re granting or revoking
permissions in MySQL, you use the ‘username’ or ‘hostname’
format to tell which users are allowed or denied.
GRANT SELECT ON Users TO 'Amit'@'localhost;'
Granting more than one Privilege to a User in a
Table: To grant multiple Privileges to a user named “Amit”
in a table “users”, the following GRANT statement should
be executed.
GRANT SELECT, INSERT, DELETE, UPDATE ON Users TO
'Amit'@'localhost';
Granting All the Privilege to a User in a Table: To
Grant all the privileges to a user named “Amit” in a table
“users”, the following Grant statement should be executed.
GRANT ALL ON Users TO 'Amit'@'localhost';
https://www.geeksforgeeks.org/mysql-grant-revoke-privileges/ link for detailed study
3. Database Application Security Model
Application security denotes the security precautionary measures
utilized at the application level to prevent the stealing or capturing
of data or code inside the application. It also includes the security
measurements made during the advancement and design of
applications, as well as techniques and methods for protecting the
applications whenever. Application security is the discipline of
processes, tools, and works on planning to protect applications
from dangers all through the whole application lifecycle. It can
assist associations in protecting a wide range of applications (like
inheritance, work area, web, portable) used by partners including
clients, colleagues, and representatives.
Types of Application Security:
Authentication: Authentication is a method of ensuring
that only authorized users. A weakness known as cross-site
scripting (XSS) permits an attacker to introduce client-side
code into a site page. The attacker gets direct access to the
user’s data.rs to have access of controlling the application.
Authentication methods confirm that the user is who they
guarantee to be. While signing into an application, this can
be performed by requiring the user to supply a user name
and password. There is also multi-level authentication
which ensures maximum security, for example, something
you know (a password), something you have(a cell phone),
and something you are (a biometric).
Authorization: After authentication, the user is allowed
to access and use the application. The application of the
user is only validated after comparing the identification of
the user to approve the access, thus authentication has to
be always before the authorization step.
Encryption: After the verification and authorization of the
user while using the application other security protocols
can protect the data from threats. Encryption is done to
keep sensitive data safe while flowing from end-user to
cloud in cloud-based applications.
Logging: Assuming a security break happens in an
application, logging can help with figuring out who
accessed the data and how it happened. Application log
records monitor who accessed and what portions of the
application have been accessed.
Application Security Testing: A strategy that guarantees
that these security controls are working actually.
4. Database Auditing Models
There are lots of components attached to your data, and any one of them can become a reason
for data breach or theft. For instance, when you install and configure a new database instance,
it creates a starter database with a default configuration including users and passwords.
Auditing database activities is a crucial part of tightening your database security.
This may create a database vulnerability due to the fact that a database user, such as a DBA,
may have permission to edit data in tables or change permissions on default schemas so that
he can access data even if he is not allowed to.
some of the important activities that need to be audited for security and compliance reasons
are mentioned below:
User Access and Authentication
This is the entry point for any culprit from within or outside an organization. A privileged
user may be able to change or extract financial information from customer data or he may try
to access the system at a time when he is not allowed to with wrong intentions.
Auditing these activities helps companies identify a data breach before it is too late or at least
assist with implementing better security configurations to stop losses from occurring.
Database Objects
Database objects that either hold user or company data, as well as procedures or logics that
define the functionality of a system, and people with permission on these objects can all
manipulate the structure and thus become a reason for data corruption or data theft on a
continuous basis. And none of this can be tracked if auditing is not enabled.
Auditing should be implemented for all important tables, views, procedures, database links,
and runtime logical flows that control certain functionality for business applications.
Data
The most critical part of any organization is its data. There can be many users who might
have permission to manipulate data, and it is important that all confidential and restricted data
should not be edited by other unauthorized users.
Identifying and tracking details such as the user, time, data, and change can help companies
comply with many data compliance rules, and this auditing function will take on added
importance with the new GDPR compliance requirements.
Network
Data today is also huge and mobile. You may have something on-premise as well as some in
the public cloud, which may demand a large amount of networking. Auditing a network will
help you understand copious volumes of data and also identify the network resource
requirement for better configuration of your network infrastructure.
Additionally, when you move data from one location to another, your data is vulnerable to
theft and loss. This means you need to set up transparent data encryptions as well.
Overall Database Utilization
Auditing the overall database utilization can give you an excellent idea of the cost of running
a server as well as enable you to be ready for any resource additions and modifications before
they are actually needed. You can also configure helpful alerts based on this auditing.
AUDIT MODELS:
A database security audit model is a framework or set of procedures
designed to assess and evaluate the security of a database system. The
goal of a security audit is to identify vulnerabilities, weaknesses, and
potential threats to the confidentiality, integrity, and availability of the
data stored in a database.
Here are some key components and considerations for a database
security audit model:
1. Access Controls:
Review user accounts and permissions to ensure that they are
appropriate and adhere to the principle of least privilege.
Check for unauthorized access and ensure that users have
only the necessary privileges required for their roles.
2. Authentication and Authorization:
Evaluate the strength of authentication mechanisms, such as
password policies and multi-factor authentication.
Verify that proper authorization checks are in place to prevent
unauthorized access to sensitive data.
3. Encryption:
Examine the use of encryption for data in transit and data at
rest to protect sensitive information from unauthorized
access.
Ensure that encryption algorithms and key management
practices are robust.
4. Audit Trails and Logging:
Review the logging mechanisms to track database activities
and user actions.
Verify that audit logs capture relevant information, are
protected from tampering, and are regularly monitored.
5. Database Configuration:
Assess the configuration settings of the database to ensure
that they align with security best practices.
Check for default accounts, unused features, and unnecessary
services that may pose security risks.
6. Patch Management:
Ensure that the database system is up-to-date with the latest
security patches.
Regularly check for and apply vendor-supplied patches to
address known vulnerabilities.
7. Database Backups:
Verify the adequacy of database backup and recovery
procedures.
Test the restoration process to ensure that data can be
recovered in the event of a security incident or data loss.
8. Incident Response and Monitoring:
Assess the effectiveness of incident response plans and
procedures.
Ensure that monitoring tools are in place to detect and
respond to suspicious activities promptly.
9. Compliance:
Ensure compliance with relevant regulatory requirements and
industry standards (e.g., GDPR, HIPAA, PCI DSS).
Document and address any non-compliance issues.
10. User Training and Awareness:
Evaluate the effectiveness of user training programs in
promoting security awareness.
Ensure that users understand their roles and responsibilities in
maintaining database security.
11. Third-Party Integration:
Review security controls for third-party applications or tools
integrated with the database.
Assess the security practices of vendors providing database-
related services.
12. Physical Security:
Consider physical security measures to protect the servers
hosting the database, such as access controls, surveillance,
and environmental controls.