Database Privilege and Access Control
Database privilege and access control is the part of a database that decides which identity may connect, which data or administrative objects it may use, and which operations it may perform. Accounts, roles, grants, ownership, and row policies turn an organization’s access rules into checks the database enforces.
itDatabases and data storage | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
Database Privilege and Access Control
Database privilege and access control is the authorization layer inside a database system. It answers a narrow question for every attempted operation: may this identity perform this action on this object in this context? Authentication establishes the identity. Authorization evaluates its privileges. Keeping those two decisions separate makes failures easier to diagnose and policies easier to review.
A useful mental model has five parts:
- A principal represents a person, application, administrator, or workload.
- A role groups privileges around a job or service responsibility.
- A privilege permits an operation such as reading a table or creating a schema.
- A securable object is the database, schema, table, view, routine, column, or other resource being protected.
- A policy adds conditions that are finer than an object grant, such as which rows a tenant may see.
The database combines these parts into an effective permission set. Direct grants, inherited roles, ownership, built-in administrative powers, and public defaults may all contribute. A correct-looking role can therefore still produce excess access when another path adds privileges.
The authorization flow
A client first connects through an authentication method. The database maps the authenticated identity to a database principal and establishes session context. Some systems activate default roles automatically. Others let a session select or assume a role.
When the principal submits a statement, the database resolves the requested operation and target objects. A query can require more than one permission. Reading a view may also touch its underlying tables. Calling a routine may run with the caller's rights or the routine owner's rights. Creating an object can require permission on its parent schema as well as permission for the object type.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final
Supports
- Least privilege, account management, separation of duties, and access enforcement
- Review and removal of assigned authorizations
- https://www.postgresql.org/docs/current/user-manag.html
Supports
- Database principals, login roles, group roles, membership, inheritance, and role attributes
- https://www.postgresql.org/docs/current/ddl-priv.html
Supports
- Object ownership, object privilege types, PUBLIC defaults, grant options, revocation, and privilege displays
- https://www.postgresql.org/docs/current/sql-grant.html
Supports
- Object grants, role membership grants, grant option, admin option, and SQL-standard differences
- https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html
Supports
- Privileges for future objects and their dependency on the creating role and schema
- https://www.postgresql.org/docs/current/ddl-rowsecurity.html
Supports
- Row policy evaluation, default-deny behavior, command-specific policies, policy composition, and bypass rules
- https://www.postgresql.org/docs/current/sql-createview.html
Supports
- Security-invoker and security-barrier view behavior
- https://www.postgresql.org/docs/current/sql-createfunction.html
Supports
- Security-definer and security-invoker function behavior and safe security-definer configuration
- https://dev.mysql.com/doc/refman/8.0/en/access-control.html
Supports
- Separation of connection verification from request verification, account identity, grant tables, and privilege-change timing
- https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html
Supports
- Administrative, database, table, column, routine, static, and dynamic privilege scopes
- https://dev.mysql.com/doc/refman/8.4/en/roles.html
Supports
- Named privilege collections, role grants, activation, default roles, and role inspection
- https://dev.mysql.com/doc/refman/9.1/en/grant.html
Supports
- Separate object-privilege and role grants, grant authority, and admin option
- https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/getting-started-with-database-engine-permissions
Supports
- Security principals, server and database roles, permission hierarchy, least permission, monitoring, and examples
- https://learn.microsoft.com/en-us/sql/relational-databases/security/permissions-hierarchy-database-engine
Supports
- SQL Server securable and permission hierarchy
- https://learn.microsoft.com/en-us/sql/relational-databases/security/row-level-security
Supports
- Database-tier row filtering based on group membership or execution context
- https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/user-roles.html
Supports
- Enabled and nested roles, PUBLIC, security domains, and definer versus invoker rights
- https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/granting-and-revoking-roles1.html
Supports
- Role grants, nested roles, selective activation, and grant authority
- https://www.mongodb.com/docs/current/core/authorization/
Supports
- Role-based authorization, privileges on resources and actions, inherited roles, and additive access
- https://mariadb.com/docs/server/security/user-account-management/roles/roles_overview
Supports
- Role creation, assignment, activation, nesting, and definer behavior
- https://mariadb.com/docs/server/reference/sql-statements/account-management-sql-statements/grant
Supports
- Global, database, table, column, and routine privilege levels plus grant and admin options
- https://docs.snowflake.com/en/user-guide/security-access-control-overview
Supports
- DAC, RBAC, UBAC, securables, account and database roles, role hierarchy, ownership, and managed access schemas
- https://docs.snowflake.com/en/user-guide/security-access-control-considerations
Supports
- Custom-role and least-privilege access-control guidance
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/database-authentication.html
Supports
- Password, IAM, and Kerberos database authentication and minimally privileged application users
- https://github.com/sindresorhus/awesome
Supports
- Required Awesome-list starting point and route to the Database Tools list
- https://github.com/mgramin/awesome-db-tools
Supports
- Discovery of Acra, Databunker, and Inspektor in the database security section
- https://docs.cossacklabs.com/acra/
Supports
- Acra database proxy and application-level protection architecture
- https://github.com/inspektor-dev/inspektor
Supports
- Protocol-aware database proxy and contextual Open Policy Agent authorization
- https://docs.databunker.org/oss/get-started/overview
Supports
- Secure personal-record vault, token references, restricted retrieval, and API access model
- https://www.postgresql.org/about/news/postgresql-810-officially-released-422/
Supports
- November 2005 PostgreSQL 8.1 release and introduction of database roles
- https://www.postgresql.org/docs/9.0/release-9-0.html
Supports
- September 2010 mass schema grants and default privileges for future objects
- https://www.postgresql.org/docs/9.5/release-9-5.html
Supports
- January 2016 PostgreSQL row-level security milestone
- https://www.microsoft.com/en-us/sql-server/blog/2016/06/01/sql-server-2016-is-generally-available-today/
Supports
- June 2016 SQL Server release and database-engine row-level security milestone
- https://www.postgresql.org/docs/10/release-10.html
Supports
- October 2017 predefined monitoring roles milestone
- https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-11.html
Supports
- April 2018 MySQL 8.0 general availability and production role-management behavior
- https://www.postgresql.org/docs/15/release-15.html
Supports
- October 2022 security-invoker views and granular configuration privileges
- https://www.postgresql.org/docs/16/release-16.html
Supports
- September 2023 granular role-membership options, grantor tracking, and role-management changes
- https://www.postgresql.org/
Supports
- PostgreSQL Landscape identity and product destination
- https://www.mysql.com/
Supports
- MySQL Landscape identity and product destination
- https://mariadb.com/products/community-server/
Supports
- MariaDB Server Landscape identity and product destination
- https://www.microsoft.com/en-us/sql-server/
Supports
- Microsoft SQL Server Landscape identity and product destination
- https://www.oracle.com/database/
Supports
- Oracle Database Landscape identity and product destination
- https://www.mongodb.com/products/self-managed/community-edition
Supports
- MongoDB Landscape identity and product destination
- https://www.snowflake.com/en/product/platform/
Supports
- Snowflake Landscape identity and product destination
- https://aws.amazon.com/rds/
Supports
- Amazon RDS Landscape identity and product destination
