Database_Security_Flashcards

1
Q

What are the key components of database security?

A
  1. Physical Security
  2. Network Security
  3. Access Control
  4. Application Security
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main elements to ensure in database security?

A
  1. Data Integrity
  2. Confidentiality
  3. Availability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is SQL Injection?

A

A malicious technique where attackers execute unauthorized SQL commands by exploiting vulnerabilities in the input fields of an application, leading to unauthorized access and manipulation of the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are common threats to database security?

A
  1. SQL Injection
  2. Phishing
  3. Malware and Ransomware
  4. Accidental Misuse
  5. Malicious Insiders
  6. Theft
  7. Natural Disasters
  8. DoS and DDoS Attacks
  9. Man-in-the-Middle Attacks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Principle of Least Privilege (PoLP)?

A

Ensure that users and applications have only the minimum levels of access needed to perform their tasks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the best practices for securing physical databases?

A
  1. Access Controls
  2. Environmental Controls
  3. Hardware Security
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some methods to prevent SQL injection attacks?

A
  1. Input Validation
  2. Data Sanitization
  3. Prepared Statements and Parameterized Queries
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are essential security measures for databases?

A
  1. Encryption
  2. Backup and Recovery Plans
  3. Security Policies and Procedures
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In PostgreSQL, what are the attributes of roles?

A
  1. LOGIN / NOLOGIN
  2. SUPERUSER / NOSUPERUSER
  3. CREATEDB / NOCREATEDB
  4. CREATEROLE / NOCREATEROLE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you create a role in PostgreSQL?

A

CREATE ROLE username;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you grant and revoke privileges in PostgreSQL?

A

Granting: GRANT SELECT ON database TO username;
Revoking: REVOKE SELECT ON database FROM username;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you manage role memberships in PostgreSQL?

A

GRANT it_staff TO john_doe;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What command displays all roles and their attributes in PostgreSQL?

A

\du

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the command to create a user with login rights in PostgreSQL?

A

CREATE USER john_doe WITH LOGIN PASSWORD ‘password’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between CREATE ROLE and CREATE USER in PostgreSQL?

A

There is no difference in terms of command syntax; the key difference lies in whether the LOGIN privilege is granted. Use CREATE ROLE for groups and CREATE USER for actual users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly