Module Ivppt
Module Ivppt
Database Security
THREATS, DEFENSE, PL/SQL, AND LOCKING
Security and Integrity Threats
✅ 1. Authentication
• Verifies user identity.
• Methods: Passwords, Biometrics, Multi-Factor Authentication (MFA)
✅ 2. Authorization
• Controls access to data based on roles/permissions.
• Example: Role-Based Access Control (RBAC)
✅ 3. Encryption
• Protects data from unauthorized reading.
• Types:
• At-Rest Encryption: Stored data
• In-Transit Encryption: Data during transfer (e.g., TLS/SSL)
✅ 4. Auditing and Logging
• Tracks user activities and changes.
• Useful for forensics, compliance, and anomaly detection.
✅ 5. Database Firewalls
• Protects against:
• SQL injection
• DoS attacks
• Filters unauthorized or abnormal queries.
✅ 6. Backup & Recovery Systems
• Ensures data can be restored after:
• Hardware failure
• Human error
• Cyberattack
Goal: Protect confidentiality, integrity, and availability of
data.
Statistical Database Auditing &
Control
🔸 2. Randomized Perturbation
•Add small random noise to results to obscure exact values.
🔸 3. Query-Set-Size Control
•Limit access based on how many times or how narrowly users can filter data.
Security Issues – Granting &
Revoking Privileges
SQL Privilege Commands:
GRANT SELECT, INSERT ON employees TO user1;
REVOKE INSERT ON employees FROM user1;
Security Issues:
🔐 PL/SQL Supports:
• Definer's rights vs. Invoker's rights
• Privilege escalation control
• Secure packages and procedures
PL/SQL Security Capabilities
Locks Prevent:
•Dirty reads
•Lost updates
•Inconsistent retrieval
Types of Locks:
•Explicit Locks: Acquired manually using LOCK TABLE, SELECT ... FOR UPDATE
Lock Levels:
•Row-level
•Table-level
Explicit LockingBEGIN
SELECT salary INTO :salary FROM employees
WHERE employee_id = 101 FOR UPDATE;
END;
Oracle’s Named Exception
Handlers
What Are Exception Handlers?
• Handle runtime errors during PL/SQL execution.
• Improve program stability and error reporting.
Predefined Exceptions in Oracle