11 - Database and Cloud Security
11 - Database and Cloud Security
Query language
Provides a uniform interface to
the database
Relational Database
Elements
Primary key
• Uniquely identifies a row
• Consists of one or more column names
Foreign key
Relation/table/file • Links one table to attributes in another
Tuple/row/record
Attribute/column/field View/virtual table
• Result of a query that returns selected
rows and columns from one or more
tables
Table 5.1
Basic Terminology for Relational Databases
Structured Query Language
(SQL)
Standardized language to define schema, manipulate, and
query data in a relational database
Several similar versions of ANSI/ISO standard
• Depending on the
• Designed to exploit the environment SQL injection
nature of Web application can also be exploited to:
pages o Modify or delete data
o Execute arbitrary operating system
commands
• Sends malicious SQL o Launch denial-of-service (DoS)
attacks
commands to the database
server
Injection Technique
Server variables
• Attackers can forge the values that are placed in HTTP and network headers and exploit this
vulnerability by placing data directly into the headers
Second-order injection
• A malicious user could rely on data already present in the system or database to trigger an SQL
injection attack, so when the attack occurs, the input that modifies the query to cause an attack does
not come from the user, but from within the system itself
Cookies
• An attacker could alter cookies such that when the application server builds an SQL query based on
the cookie’s content, the structure and function of the query is modified
End-of-line Piggybacked
Tautology
comment queries
• Manual defensive
Detection • Check queries at
coding practices runtime to see if they
• Parameterized query • Signature based conform to a model of
insertion • Anomaly based expected queries
• SQL DOM • Code analysis
Defensive Run-time
coding prevention
Database Access Control
Database access control Can support a range of
system determines: administrative policies
Centralized administration
If the user has access to the entire database • Small number of privileged users may grant and
or just portions of it revoke access rights
Ownership-based administration
What access rights the user has (create, • The creator of a table may grant and revoke access
insert, delete, update, read, write) rights to the table
Decentralized administration
• The owner of the table may grant and revoke
authorization rights to other users, allowing them to
grant and revoke access rights to the table
SQL Access Controls
• Two commands for managing access rights:
• Grant
o Used to grant one or more access rights or can be used to assign a
user to a role
• Revoke
o Revokes the access rights
• An end user who owns • An end user who operates on • User who has administrative
database objects as part of an database objects via a responsibility for part or all of
application particular application but does the database
not own any of the database
objects
Table 5.2
Fixed
Roles
in
Microsoft
SQL
Server
Inference Detection
Approach removes an inference
channel by altering the database
structure or by changing the
access control regime to prevent
inference
Inference detection during
database design
Two approaches
If an inference channel is
detected, the query is denied or
altered
Server – an organization
that receives the
encrypted data from a
data owner and makes
them available for
distribution to clients
Cloud Security
NIST SP-800-145 defines cloud computing as:
Unknown risk
profile
Table 5.4 NIST Guidelines on Cloud Security and Privacy
Issues and Recommendations
Multi-tenant model
DBMS running on a
virtual machine
instance for each cloud
subscriber
Architectural or
Provides a predefined environment for Gives the appearance of exclusive use of
operational Gives the subscriber the cloud subscriber that is shared with the instance but relies on the cloud
characteristics complete control over other tenants typically through tagging provider to establish and maintain a
of the cloud administrative tasks data with a subscriber identifier secure database environment
environment related to security
Cloud Security
As A Service
• SecaaS
• Is a segment of the SaaS offering of a CP
• Defined by The Cloud Security Alliance as the provision of
security applications and services via the cloud either to cloud-
based infrastructure and software or from the cloud to the
customers’ on-premise systems
Summary
• The need for database
security • Database access control
o SQL-based access
• Database management definition
o Cascading authorizations
systems
o Role-based access control
• Relational databases • Database encryption
o Elements of a relational database
system • Cloud computing
o Structured Query Language o Cloud computing elements
o Cloud computing reference
• SQL injection attacks architecture
o A typical SQLi attack
• Cloud security risks
o The injection technique
o SQLi attack avenues and types and countermeasures
o SQLi countermeasures • Data protection in the
• Inference cloud
• Cloud security as a
service