Database and Security Flashcards
How does a DBMS provide security for database users?
A DBMS provides security by assigning each database user an account with a unique username and password. These credentials are used to identify a user and control their access to the database.
What is the role of usernames and passwords in DBMS security?
Usernames and passwords are used as credentials to authenticate and verify the identity of a user. These credentials are essential for controlling access to the database and ensuring that only authorized users can interact with the data.
What actions does a DBMS verify when a user attempts to interact with the database?
When a user tries to interact with the database, the DBMS verifies the following actions:
Retrieve data
Modify data
Modify the database structure
How does the DBMS use passwords in the security process?
The DBMS verifies passwords during the authentication process. When a user attempts to access the database, the provided password is checked against the stored password associated with the user’s account. If the passwords match, the user is authenticated, and their permissions are checked.
Why is controlling access to information important in a DBMS?
Controlling access to information is crucial in a DBMS to ensure that only authorized users can view, modify, or alter the database. This helps in maintaining the confidentiality, integrity, and security of the data, preventing unauthorized access or tampering.
In SQL, what are the common privileges used to control access to tables and other database objects?
The common privileges used in SQL to control access to tables and other database objects include:
SELECT privilege
INSERT privilege
UPDATE privilege
DELETE privilege
Who has all privileges on all objects in a database, and how can these privileges be granted to others?
The owner (creator) of a database has all privileges on all objects in the database. The owner can grant these privileges to others.
What privileges does the owner (creator) of an object have, and how can these privileges be passed on to others?
The owner (creator) of an object has all privileges on that object. The owner can pass these privileges on to others.
How are privileges granted in SQL, and what are the components of the GRANT statement?
Privileges are granted in SQL using the GRANT statement. The components of the GRANT statement include:
<privileges>: A list of privileges such as SELECT, INSERT, UPDATE, DELETE, or ALL.
<object>: The name of a table or view.
<users>: A list of user names or PUBLIC.
[WITH GRANT OPTION]: An optional clause that means users can pass their granted privileges on to others.
</users></object></privileges>
What is the significance of the WITH GRANT OPTION in the GRANT statement?
The WITH GRANT OPTION in the GRANT statement means that the users receiving the privileges can pass those privileges on to others. It allows for cascading the delegation of privileges in the security model.
How can you remove a privilege that you have granted to another user in SQL?
To remove a privilege that you have granted, you use the REVOKE statement in SQL. The syntax is as follows:
REVOKE <privileges>
ON <object>
FROM <users>;</users></object></privileges>
What happens if a user has the same privilege from multiple users, and one user revokes the privilege?
If a user has the same privilege from multiple users, and one user revokes the privilege, the user will still retain the privilege from the other users. The revocation only affects the privileges granted by the specific user issuing the REVOKE statement.
In the context of privilege revocation, what happens to privileges that are dependent on the revoked one?
When a privilege is revoked, all privileges that are dependent on the revoked one are also revoked. This ensures consistency in the security model.
Provide an example scenario of granting and revoking privileges among users in SQL.
Example Scenario:
‘Admin’ grants ALL privileges to ‘King’ and SELECT privilege to ‘Princess’ with the grant option.
‘King’ grants ALL privileges to ‘Farmer’.
‘Princess’ grants SELECT privilege to ‘Farmer’.
If ‘Admin’ revokes privileges from ‘King’, both ‘King’ and ‘Farmer’ lose their privileges. ‘Princess’ retains her SELECT privilege.
What does the “WITH GRANT OPTION” mean in the context of granting privileges?
The “WITH GRANT OPTION” in the GRANT statement means that the users receiving the privileges can pass those privileges on to others. It allows for the delegation of privileges in the security model.
How do privileges work at the level of tables in a database?
Privileges in a database work at the level of tables, allowing control over access to entire tables. These privileges can include restrictions on operations such as SELECT, INSERT, UPDATE, and DELETE.
Can you restrict access by column using privileges in a database?
Yes, you can restrict access by column using privileges in a database. This means you can control which columns a user has permission to access or modify.