feat: add audit logs and temporal constraints

This commit is contained in:
2026-02-20 00:23:06 +01:00
parent 6d74edd570
commit 3696665892
7 changed files with 550 additions and 24 deletions
+18 -2
View File
@@ -98,8 +98,24 @@ AS $$ ... $$;
### 4. Audit Critical Operations
```sql
-- Log policy changes and authorization decisions
-- (morbac_pg does not include audit logging by default)
-- Enable audit logging on security-critical tables
SELECT morbac.enable_audit('user_roles');
SELECT morbac.enable_audit('rules');
SELECT morbac.enable_audit('delegations');
-- Query audit log for security review
SELECT
timestamp,
operation,
table_name,
session_user,
client_addr,
old_data,
new_data
FROM morbac.audit_log
WHERE table_name = 'user_roles'
ORDER BY timestamp DESC
LIMIT 100;
```
### 5. Regular Updates