MATIH Platform is in active MVP development. Documentation reflects current implementation status.
10. Data Catalog & Governance
Governance
Query Audit

Query Audit

Query Audit tracks all data access operations against the Data Catalog, providing a complete audit trail for governance and compliance. Audit policies define which operations are logged, who is notified, and how violations are recorded. The audit system integrates with the governance policy evaluator to capture both successful and denied access attempts.


Audit Rule Types

Rule TypeDescription
LOG_ACCESSLog all read operations on the entity
LOG_MODIFICATIONLog all write operations (INSERT, UPDATE, DELETE)
ALERT_ON_ACCESSSend an alert when the entity is accessed

Audit Policy Structure

Audit policies use the AUDIT policy type and attach to data entities through scope configuration.

FieldDescription
policyTypeSet to AUDIT
scopeTypeScope of auditing (TABLE, DATABASE, CLASSIFICATION)
scopeEntitiesSpecific entities to audit
rulesList of audit rules defining what to log
enforcementActionsActions triggered on audit events

Example Audit Policy

{
  "name": "PII Access Audit",
  "policyType": "AUDIT",
  "scopeType": "CLASSIFICATION",
  "scopeEntities": ["PII", "SENSITIVE"],
  "enforcementMode": "MONITOR",
  "rules": [
    {
      "name": "Log All Access",
      "ruleType": "LOG_ACCESS",
      "parameters": {},
      "enabled": true,
      "order": 1
    },
    {
      "name": "Alert on Modification",
      "ruleType": "ALERT_ON_ACCESS",
      "parameters": {
        "alertChannel": "security-team",
        "severity": "HIGH"
      },
      "enabled": true,
      "order": 2
    }
  ],
  "enforcementActions": [
    {
      "actionType": "LOG",
      "parameters": {
        "logLevel": "INFO",
        "includeUserContext": true
      },
      "order": 1
    },
    {
      "actionType": "NOTIFY",
      "parameters": {
        "recipients": ["data-stewards@company.com"],
        "template": "audit-alert"
      },
      "order": 2
    }
  ]
}

Audit Log Fields

Each audit log entry captures the following information from the evaluation context.

FieldDescription
entityIdUUID of the accessed entity
entityFqnFully qualified name of the entity
entityTypeType of entity (table, column, database)
operationTypeOperation performed (SELECT, INSERT, UPDATE, DELETE, EXPORT)
userIdAuthenticated user who performed the operation
userRolesRoles assigned to the user at time of access
timestampExact time of the access attempt
classificationClassification level of the accessed data
tagsTags associated with the accessed entity

Violation Tracking

The governance system records policy violations with severity levels and contextual details.

FieldDescription
policyIdID of the violated policy
policyNameHuman-readable name of the policy
ruleIdSpecific rule within the policy that was violated
ruleTypeType of the violated rule
messageDescription of the violation
severityViolation severity (LOW, MEDIUM, HIGH, CRITICAL)
contextAdditional contextual details about the violation

Retrieving Audit Data

Audit data is accessible through the governance API.

EndpointDescription
GET /v1/governance/policies/violations/recentGet recent violations for a tenant
GET /v1/governance/policies/:policyId/violationsGet violations for a specific policy
GET /v1/governance/policies/statisticsGet governance statistics including violation counts

Enforcement Actions for Audit

ActionDescription
LOGWrite an entry to the audit log
ALERTSend an alert to a monitoring channel
NOTIFYSend a notification to specified recipients
TICKETCreate a support or incident ticket
WEBHOOKCall an external webhook with audit details
WORKFLOWTrigger an approval or review workflow

Best Practices

  • Enable LOG_ACCESS on all tables classified as PII or SENSITIVE
  • Use ALERT_ON_ACCESS for high-sensitivity data that requires immediate attention
  • Set audit policies to MONITOR enforcement mode to avoid blocking legitimate queries
  • Review the violations dashboard regularly to identify unauthorized access patterns
  • Combine audit policies with retention policies to manage audit log storage