Chp.3 Database Integrity and Security Concepts (1) (1)
Chp.3 Database Integrity and Security Concepts (1) (1)
3
Database integrity and
security concepts
CHP.3
Role-Based Access Control for
multilevel security
Role-based access control (RBAC) is a method of restricting
network access based on the roles of individual users within an
enterprise. Organizations use RBAC -- also called role-based
security -- to parse levels of access based on an employee's roles
and responsibilities.
or
Role-based Access Control – The concept of Role-based
Access Control is to create a set of permissions and assign these
permissions to a user or group. With the help of these
permissions, only limited access to users can be provided
therefore level of security is increased.
Use view in security
enforcement
Concept of view
A database view is a subset of a database and is based on a
query that runs on one or more database tables. Database views
are saved in the database as named queries and can be used to
save frequently used, complex queries. There are two types of
database views: dynamic views and static views.
Mandatory access control (MAC)
This makes the whole system centralized and under the control
of only one authority. Privacy: Data is set manually by an
administrator. No one other than admin can make changes in
category or list of users' accesses to any category. It can be
updated only by admin
Data integrity
Data integrity is the overall completeness, accuracy and
consistency of data over its entire lifecycle. When data has
integrity, mechanisms have been put in place to ensure that
data-in-use, data-in-transit and data-at-rest cannot be changed
by an unauthorized person or program.
Domain integrity
Additionaal
For example, if you have a column for "age," domain integrity
constraints in DBMS would ensure that only values between 1
and 120 can be entered into that column. This ensures that only
valid data is entered into the database.
Domain Constraints
1. Not Null:
The NOT NULL constraint prevents a column from having a NULL
value.
2. Check Constraints –: It defines a condition that each row must
satisfy which means it restricts the value of a column between ranges
3 UNIQUE Constraint --A UNIQUE Constraint ensures that any value in
a column is unique.
4 DEFAULT Constraint
When no value is defined for a column, the DEFAULT Constraint
provides a default value.
4
Domain constraints
Domain constraints can be defined as the definition of a valid set of
values for an attribute.
The data type of domain includes string, character, integer, time,
date, currency, etc. The value of the attribute must be available
in the corresponding domain.
Example:
Referential integrity
1. GRANT Command:
GRANT command is used to provide access or privileges on the database objects to the
grant command is used to confer authorization.
GRANT command has the following syntax
GRANT privilege_name
ON <tablename | viewname>
TO (user list | role_name)
[WITH GRANT OPTION]:
Thus,
Where, privilege_name is the access right or privilege granted to the user like SELECT,
INSERT,
UPDATE, DELETE etc., WITH GRANT OPTION - allows a user to grant access rights to other
users.
2 Revoke Command
RESTRICT keyword, the privilege will be revoked only from the specifled user.
3 Audit Trail
2. MAC :
The operating system in MAC will provide access to the user
based on their identities and data. For gaining access, the user
has to submit their personal information. It is very secure
because the rules and restrictions are imposed by the admin and
will be strictly followed. MAC settings and policy management will
be established in a secure network and are limited to system
administrators.
Examples- Access level of windows for ordinary users, admins,
and guests are some of the examples of MAC
Concept of view
Views in SQL are kind of virtual tables. A view also has rows and columns as they
are in a real table in the database. We can create a view by selecting fields from
one or more tables present in the database. A View can either have all the rows of a
table or specific rows based on certain condition.
syntax
CREATE VIEW view_name AS
SELECT column1, column2.....
FROM table_name
WHERE condition;
view_name: Name for the View
table_name: Name of the table
condition: Condition to select rows
DELETING VIEWS or Dropping
views
what if a created View is not needed any more? Obviously we will want to
delete it. SQL allows us to delete an existing View. We can delete or drop a
View using the DROP statement.
Syntax:
DROP VIEW view_name;
view_name: Name of the View which we want to delete.
Ex.
For example, if we want to delete the View MarksView, we can do this as: