Security
Database security deals with the techniques used for protecting the database against persons who are not authorized to access certain parts of a database or the whole database. Security mechanism deal with two principal aspects of database use
- the ability of a database system to avoid unauthorized access.
- The ability of a database system to maintain consistency in data when changes are made to the data by authorized users.
Database security is a very broad area that addresses many issues, including
- legal and ethical issues regarding the right to access certain information
- policy issues at the governmental, institutional or corporate level
- system related issues
- multiple security levels in some organizations
Here, the DBMS typically includes a database security and authentication subsystem that is responsible for ensuring the security as portions of a database against unauthorized access. It is now usual to refer to two types of database security mechanisms.
- Discretionary security mechanism
- Mandatory Security mechanisms.
Access Control:
The database administrator (DBA) is the central authority for managing a database system. The DBA’s responsibilities include granting privileges to us who need to use the system and classifying users and data in accordance with the policy of the organization. The DBA has a DBA account in the DBMS, sometimes called a system or super user account, which provides powerful capabilities that are not made available to registered database accounts and users, user groups and for performing the following types of actions:
a). Account Creation:- This action creates a new account and password for a user or a group of users to enable them to access the DBMS.
Syntax: > create user
Example: > create user
b). Privilege Granting:- This action permits the DBA to grant certain privilege to certain account to certain object.
Syntax: > grant
Example> grant select on dept to ritesh;
c). Privilege Revocation: This action permits the DBA to revoke (cancel) certain privileges that were previously given to certain account.
Syntax:> revoke Example> revoke select on dept from ritesh; d). Security level assignment: This action consists of assigning user accounts to the appropriate security classification level. Action 1 is used to control access to the DBMS as a whole whereas actions 2 and 3 are used to control discretionary database authorizations, and action 4 is used to control mandatory authorization. Encryption and Decryption The various provisions that a database system may make authorization may still not provide sufficient protection for highly sensitive data. In such cases, data may be stored encrypted form. It is not possible for encrypted data to be read or the sender knows how to decrypt them. There are a vast number of techniques for the encryption. Simple encryption techniques may not provide adequate security, since it may be easy for an unauthorized user to break the code. A good encryption technique has the following properties - it is relatively simple for authorized users to encrypt and decrypt data. - It depends not on the secrecy of the algorithm, but rather on a parameter of the algorithm called the encryption key. - Its encryption key is extremely difficult for an intruder to determine. On approach, the data encryption standard (DES), issued 1977, does both a substitution of characters and a rearrangement of their order on the basis of an encryption key. For this scheme to work, the authorized users must provided with the encryption key via a secure mechanism. This requirement is a major weakness, since the scheme is no more secure than the security of the mechanism by which the encryption key is transmitted. The DES standard was reaffirmed in 1983, 1987 and again in 1993. However, weakness in DES was recognized in 1993 as reaching a point where a new standard to be called the Advanced Encryption Standard (AES), needed to be selected. In 2000, the Rijndael Algorithm was selected to be the AES. The Rijndael Algorithm was chosen for its significantly strong level of its security and its relative ease of implementation or current computer systems as well as such devices as smart card. Decryption:- The desired recipient after receiving the encrypted test, perform the inverse operation to extract the original message. Concurrency Control When executing several transactions concurrently in an uncontrolled manner then several problems may occur. What is Transaction? A transaction is an operation against the database which comprises a series of changes to one or more tables. There are two classes of transactions. DML transactions which can consist of any number of DML statements and which ORACLE treats as a single entity or logical unit of work, and DDL transactions which can only consist of one DDL statement. In order to changes to become permanent, they must be committed to the database. The COMMIT command makes database changes permanent; ROLLBACK allows us to discard or abandon changes. The change, or changes made to the database between two commit commands therefore make up a transaction. Until a transaction is committed, none of its changes are visible to other users. Uncommitted changes may be abandoned by typing ROLLBACK, ROLLBACK will return the data to the state it was in immediately after your last COMMIT by discarding all changes made since the last commit. Controlling Transactions with SQL Statements The following SQL statements are used to control when commit or rollback occur: COMMIT sql> commit; - Make changes in the current transaction permanent. - Erase all savepoints in the transaction - Ends the transaction - Releases the transaction’s locks - you should explicitly end transactions in application programs using the COMMIT (or ROLLBACK) statement. If you do not explicitly commit the transaction and the program terminates abnormally, the last uncommitted transaction will be rolled back. sql> SET AUTO[COMMIT] ON/OFF; (if ON:- COMIT issued automatically when each INSERT, UPDATE or DELETE command is issued. And if OFF:- COMMIT command can be issued explicitly by the user.) SAVEPOINT sql> savepoint - can be used to divide a transaction into smaller portions. - Savepoints allow you to arbitrarily “hold” your work at any point in time, with the option of later committing that work or undoing all or a portion of it. Thus, for a long transaction, you can save parts of it as your proceed, finally committing or rolling back. If you make an error, you need not resubmit every statement. - If you create a second savepoint with the same name as an earlier savepoint, the earlier savepoint is deleted. ROLLBACK sql>ROLLBACK to [SAVEPOINT] - The rollback statement is used to undo work. - If you use ROLLBACK without a TO SAVEPOINT clause it, ends the transaction, undoes all changes in current transaction, erases all savepoints in that transaction, releases the trasaction’s locks. - Helps to rollback a portion of your transaction. Transaction is the group of operations which are to be executed as a single block of task. Transactions arise frequently in database eg. - transferring fund from one account to another - selling of items in shopping centers - shifting of employees from one department to another Transaction must passes, ACID properties Atomicity Consistency Isolation Durability Atomicity: When a transaction that updates the database occur either all of the updates occurs, or non of the update occurs even if a hardware or software failure occurs during the transaction. Eg. Updating 10 columns of table customer. IF DBMS is not atomic and power failure occurred midway during transaction then the database will be in unknown state. Transferring of amount form account A to account B. If the h/w or s/w error occurred in the mid way in the database with no atomicity, then the amount will be lost. Consistency: Any change to the value of an instance should be consistent with the other changes to the values of that instance. Eg. Students lending book from library. Selling items in shopping center. Isolation: Isolation prevents changes in concurrent transaction from conflicting with each other. Isolation also allow multiple users to each use the data base as if he is the only user. Isolation is primarily accomplished through lock. To lock a table or record prevents other transaction from reading or writing the data in that table or record until the current transaction is finished. Durability: When a hardware or software failure occurs, then information in the database must be accurate up to last committed transaction before failure. Typical state diagram is: State Diagram of Transaction Active: The initial state after the transaction has issue its start operation and the execution process going on. Partially Committed: the state in which execution of transaction has completed but the changes resides only in memory and has not been written to hard disk. Committed: the state in which the transaction has been successfully performed and written to hard disk. Failed: the state at which transaction cannot proceed. It may be due to system error, system crash like power failure or due to unexpected situations like unexpected input. Aborted: the state at which the database has been rolled back to its previous consistent state before the execution of the transaction that could not complete successfully. from
![]()
![]()

0 comments:
Post a Comment