Database Security
Database Security
Types of Security
Threats to databases
Loss of integrity
Loss of availability
Loss of confidentiality
Access control
Inference control
Flow control
Encryption
The user must log in to the DBMS by entering account id and password
whenever database access is needed.
The database system must also keep track of all operations on the
database that are applied by a certain user throughout each login
session.
To keep a record of all updates applied to the database and of the
particular user who applied each update, we can modify system log,
which includes an entry for each operation applied to the database that
may be required for recovery from a transaction failure or system crash.
If any tampering with the database is suspected, a database audit is
performed
A database audit consists of reviewing the log to examine all accesses
and operations applied to the database during a certain time period.
A database log that is used mainly for security purposes is sometimes
called an audit trail.
Discretionary Access Control Based on Granting and Revoking Privileges
The typical method of enforcing discretionary access control in a
database system is based on the granting and revoking privileges.
Types of Discretionary Privileges
The account level:
o At this level, the DBA specifies the particular privileges that each
account holds independently of the relations in the database.
The relation level (or table level):
o At this level, the DBA can control the privilege to access each
individual relation or view in the database.
The privileges at the account level apply to the capabilities provided to
the account itself and can include
o the CREATE SCHEMA or CREATE TABLE privilege, to create a
schema or base relation;
o the CREATE VIEW privilege;
o the ALTER privilege, to apply schema changes such adding or
removing attributes from relations;
o the DROP privilege, to delete relations or views;
o the MODIFY privilege, to insert, delete, or update tuples;
o and the SELECT privilege, to retrieve information from the
database by using a SELECT query
The second level of privileges applies to the relation level
o This includes base relations and virtual (view) relations.
A1 is then owner of these two relations and hence all the relation privileges
on each of them.
Suppose that A1 wants to grant A2 the privilege to insert and delete tuples in
both of these relations, but A1 does not want A2 to be able to propagate these
privileges to additional accounts:
GRANT INSERT, DELETE ON
EMPLOYEE, DEPARTMENT TO A2;
Suppose that A1 wants to allow A3 to retrieve information from either of
the two tables and also to be able to propagate the SELECT privilege to
other accounts.
A1 can issue the command:
GRANT SELECT ON EMPLOYEE, DEPARTMENT
TO A3 WITH GRANT OPTION;
A3 can grant the SELECT privilege on the EMPLOYEE relation to A4 by
issuing:
GRANT SELECT ON EMPLOYEE TO A4;
Notice that A4 cant propagate the SELECT privilege because GRANT
OPTION was not given to A4
Suppose that A1 decides to revoke the SELECT privilege on the
EMPLOYEE relation from A3; A1 can issue:
REVOKE SELECT ON EMPLOYEE FROM A3;
The DBMS must now automatically revoke the SELECT privilege on
EMPLOYEE from A4, too, because A3 granted that privilege to A4 and A3
does not have the privilege any more.
Suppose that A1 wants to give back to A3 a limited capability to SELECT
from the EMPLOYEE relation and wants to allow A3 to be able to
propagate the privilege.
The limitation is to retrieve only the NAME, BDATE, and ADDRESS
attributes and only for the tuples with DNO=5.
A1 then create the view:
CREATE VIEW A3EMPLOYEE AS
SELECT NAME, BDATE, ADDRESS
FROM EMPLOYEE
WHERE DNO = 5;
After the view is created, A1 can grant SELECT on the view
A3EMPLOYEE to A3 as follows:
GRANT SELECT ON A3EMPLOYEE TO A3
WITH GRANT OPTION;
Finally, suppose that A1 wants to allow A4 to update only the SALARY
attribute of EMPLOYEE;
A1 can issue:
GRANT UPDATE ON EMPLOYEE (SALARY) TO A4;
o The UPDATE or INSERT privilege can specify particular attributes that
may be updated or inserted in a relation.
o Other privileges (SELECT, DELETE) are not attribute specific.
Safe (database)
Money (data)
Services
Main component of operating system security environment
Operating system core utilities
Used to gain access to the OS and its features
Include
User authentication
Remote access
Administration tasks
Password policies
Files
Common threats:
File permission
File sharing
File Transfer
FTP (File Transfer Protocol):
Internet service for transferring files from one computer to another
Transmits usernames and passwords in plaintext
Root account cannot be used with FTP
Anonymous FTP: ability to log on to the FTP server without being
authenticated
Best practices:
Use Secure FTP utility if possible
Sharing Files
Naturally leads to security risks and threats
Peer-to-peer programs: allow users to share files over the Internet
Reasons for blocking file sharing:
Malicious code
Adware and spyware
Privacy and confidentiality
Pornography
Copyright issues
Memory
Hardware memory available on the system
Can be corrupted by badly written software
Two options:
Stop using the program
Apply a patch (service pack) to fix it
Authentication Methods
Authentication:
Verifies user identity
Permits access to the operating system
Physical authentication:
Allows physical entrance to company property
Magnetic cards and biometric measures
Digital card:
Also known as a security card or smart card
Similar to a credit card; uses an electronic circuit instead of a magnetic
strip
Stores user identification information
Kerberos:
Developed by MIT
Uses unique keys a.k.a. tickets for authentication purposes
Lightweight Directory Access Protocol (LDAP):
Developed by the University of Michigan
A centralized directory database stores:
Users (user name and user ID)
Passwords
Internal telephone directory
Security keys
Efficient for reading but not suited for frequently changing information
Easy to implement
Uses client/server architecture
Authorization
User Administration
Create user accounts
Set password policies
Grant privileges to users
Best practices:
Use a consistent naming convention
Always provide a password to an account and force the user to change it
at the first logon
Protect passwords
Do not use default passwords
Create a specific file system for users
Educate users on how to select a password
Lock non-used accounts
Grant privileges on a per host basis
Do not grant privileges to all machines
Use ssh, scp, and Secure FTP
Isolate a system after a compromise
Perform random auditing procedures
Password Policies
First line of defense
Dictionary attack: permutation of words in dictionary
Make hard for hackers entering your systems
Best password policy:
Matches your company missions
Enforced at all level of the organization
Best practices:
Password aging
Password reuse
Password history
Password encryption
Logon retries
Single sign-on
Memory protection
File protection
General object access control
User authentication
Security Policies
security policy statement of security we expect
the system to enforce
Military Security Policy
Confidentiality Policy
Objects (e.g. files)
Company Groups (all objects concerning a particular
company)
Conflict classes (cluster competing companies)