Module 5 -- Database Security -- DBMS


Index

  1. Authentication
  2. 2. Authorization and Access Control
  3. 1. Discretionary Access Control (DAC)
  4. 2. Mandatory Access Control (MAC)
  5. 3. Role based Access Control
  6. 3. Intrusion Detection
  7. Working of Intrusion Detection System(IDS)
  8. 4. SQL Injection

Authentication

1. Authentication

🔑 Think of it as a gatekeeper asking: "Are you really who you claim to be?"


2. Authorization and Access Control

🛡️ Think: "Okay, you’re in. But what can you do here?"


Access Control Models

1. Discretionary Access Control (DAC)

Pasted image 20250520224206.png

🔸 Definition:

In DAC, the data owner (user) decides who gets access and what kind of access (read/write/execute) they get.

🔸 Example:

If you create a table, you can grant read or write access to any user you choose.

GRANT SELECT ON Employee TO User1;

🔸 Pros:

🔸 Cons:

🔸 Use Case:


2. Mandatory Access Control (MAC)

Pasted image 20250520224457.png

🔸 Definition:

MAC is a strict, non-discretionary model where access is governed by a central authority using security labels.

🔸 Example:

🔸 Pros:

🔸 Cons:

🔸 Use Case:


3. Role based Access Control

Pasted image 20250520224547.png

🔸 Definition:

In RBAC, permissions are assigned to roles, not individuals. Users are assigned to roles, and get the permissions of that role.

🔸 Example:

-- Assign permissions to role
GRANT SELECT, INSERT ON Reports TO Manager;

-- Assign user to role
GRANT Manager TO Alice;

🔸 Pros:

🔸 Cons:

🔸 Use Case:


🔁 Comparison Table

Feature DAC MAC RBAC
Who controls access Owner/user Central authority Role-based (admin defined)
Flexibility High Low Medium to High
Security Level Medium High High
Suitable For Small systems Military, Government Large enterprises, organizations
Can users share access? Yes No Not directly, only through roles
Examples Unix file permissions Classified document systems ERP systems, CMS platforms

3. Intrusion Detection

https://www.geeksforgeeks.org/intrusion-detection-system-ids/

Common Methods of Intrusion

Working of Intrusion Detection System(IDS)

Pasted image 20250520224859.png

Classification of Intrusion Detection System(IDS)

(I just copied this from geeksforgeeks, no need go too much in-depth, just get a basic idea of this).

Intrusion Detection System are classified into 5 types:


Benefits of IDS


Disadvantages of IDS


4. SQL Injection

For example,

SELECT * FROM users WHERE username = 'admin' --' AND password = '';

The -- comments out the rest, bypassing the password check.

This can be prevented by: