Database Security 1
Database Security 1
Database security refers to the measures taken to protect a database from unauthorized access, misuse,
and threats such as cyberattacks, data leaks, and breaches. It ensures confidentiality, integrity, and
availability (CIA) of data stored in the database.
• Ensures availability – Protects against attacks that can bring the system down.
• Legal and regulatory compliance – Helps organizations adhere to laws like GDPR, HIPAA, and
PCI DSS.
A. External Threats
1. SQL Injection Attacks – Attackers inject malicious SQL queries to manipulate or extract data.
B. Internal Threats
Security models define how databases enforce access control and security policies.
• Example: A database administrator has full access, while employees can only read data.
• Access is based on attributes such as user location, device type, time of access.
• Example: A user can only access a database during work hours from an office network.
3. Least Privilege Principle – Users get only the minimum permissions needed.
B. Data Encryption
• Uses database logs and Security Information and Event Management (SIEM) systems.
1. Use Firewalls and Network Security Measures – Prevent direct database access from the
internet.
sql
CopyEdit
FLUSH PRIVILEGES;
• The user secure_user can only read and insert data in company_db.
name VARCHAR(100),
);