Documentation

Access Control

RBAC, ABAC, Row-Level Security, dynamic data masking, SSO/JWT, LDAP, OAuth2/OIDC — fine-grained authorisation at every level.

Role-Based Access Control (RBAC)

sql
-- Create roles
CREATE ROLE analyst;
CREATE ROLE data_admin;

-- Grant privileges
GRANT SELECT ON ALL TABLES IN SCHEMA public TO analyst;
GRANT ALL ON ALL TABLES IN SCHEMA public TO data_admin;

-- Create user with role
CREATE USER alice IDENTIFIED BY 'secure_pass';
GRANT analyst TO alice;

Row-Level Security (RLS)

RLS policies filter rows based on the current user, ensuring each user only sees data they are authorised to access:

sql
-- Enable RLS on a table
ALTER TABLE orders ENABLE ROW LEVEL SECURITY;

-- Policy: users only see their own orders
CREATE POLICY user_orders ON orders
  USING (user_id = current_user_id());

-- Policy: managers see all orders in their department
CREATE POLICY manager_orders ON orders
  FOR SELECT TO manager_role
  USING (department = current_user_department());

Dynamic Data Masking

Mask sensitive columns in query results without changing stored data:

sql
-- Mask SSN: show only last 4 digits
ALTER TABLE patients ALTER COLUMN ssn SET (mask = 'XXX-XX-####');

-- Mask email: show only domain
ALTER TABLE users ALTER COLUMN email SET (mask = '****@domain');

-- Full access for specific role
GRANT UNMASK ON patients TO compliance_officer;

LDAP / Active Directory

Authenticate users against an existing LDAP or Active Directory server:

FeatureDetails
ProtocolLDAP v3, pure C11 client (no libldap)
EncryptionLDAPS port 636 via native TLS
User lookupSubtree search for user DN
Group mappingUp to 16 LDAP group → DB role mapping rules
Bind methodSimple bind with user credentials
conf
# /etc/absdb/absdb.conf
[ldap]
enabled   = true
server    = ldaps://ad.company.com:636
base_dn   = dc=company,dc=com
bind_dn   = cn=absdb-svc,ou=services,dc=company,dc=com
bind_pass = ${LDAP_BIND_PASS}
user_filter = (sAMAccountName=%s)
group_map = CN=DBAdmins,OU=Groups -> db_admin
group_map = CN=Analysts,OU=Groups -> analyst

OAuth2 / OIDC JWT

Authenticate with JWT tokens from Auth0, Okta, Keycloak, Azure AD, or Google:

FeatureDetails
AlgorithmsHS256, RS256, ES256
Claims extractionsub, iss, exp, custom role_claim
JWKS cacheUp to 16 keys, auto-refresh
Clock skewConfigurable tolerance (default 60s)
conf
# /etc/absdb/absdb.conf
[jwt]
enabled     = true
issuer      = https://company.auth0.com/
audience    = https://api.company.com
jwks_uri    = https://company.auth0.com/.well-known/jwks.json
role_claim  = https://company.com/roles

Attribute-Based Access Control (ABAC)

ABAC extends RBAC with contextual attributes such as time-of-day, IP address, client certificate, and custom session attributes. Policies combine role checks with attribute checks for fine-grained control.

Related Documentation

Security Overview Encryption Compliance

Ready to run Absolute DB?

~154 KB binary · zero external dependencies · 2,737 tests passing

Download Free → View Pricing