TrustLogix Policy Synchronization
Overview
Clients currently create and deploy policies on the TrustLogix platform to their respective data sources. However, there is a challenge in keeping the policies intact on objects when recreation of the objects happens as part of the development life cycle (either manually or via CI/CD pipelines).
To address this, there is a clear need for automation to keep the policy attachments. The automatic redeployment of the process is required to keep the policy reattached to the recreated objects so that sensitive objects are protected, thereby ensuring their security.
TrustLogix has introduced the automation service, called Policy Sync Service, to resolve this issue. This document provides end-to-end information on its internal workings.
The TrustLogix-managed Policy Sync Service can be activated upon request.

Sync Policy types Supported
Object-based RBAC
Object-based ABAC (RLS & Masking)
Tag-based ABAC (RLS & Masking)
1. Objectives
Ensure governance policies remain enforced after object recreation.
Automatically detect drift between defined policies and actual enforcement.
Provide both on-demand and time-window (scheduled) remediation.
Maintain auditability and deterministic policy deployment.
2. Key Concepts
Object Recreation Drift When a table/view is recreated, previously attached RBAC/RLS/Masking policies are removed.
Policy Deployment Mode Intermediate state where policies are identified as applicable but not yet enforced.
Tag Reference Store (Tag Ref) Metadata repository containing object ↔ tag mappings used for tag-based sync.
Last Sync Timestamp Watermark used to identify delta objects.
3. Assumptions — Tag-Based Policies
Tag Latency Exists (Up to 2 Hours - Only for Snowflake)
In Snowflake:
Tag assignment is immediate.
But tag visibility in metadata views may be delayed.
Tag references in ACCOUNT_USAGE may have latency.
Tag propagation across replication may be delayed.
Sync Service Behavioral Assumptions
If Tag Not Found:
System assumes one of:
Tag not yet applied
Tag applied but not propagated
User forgot to apply tag
Because of latency, system must:
Move policy to Pending Retry state
Retry up to configured attempts
4. Lifecycle — Object-Based Policies
4.1 Creation & Initial Enforcement
An object (table/view) is created.
RBAC policy is defined and applied to objects.
ABAC RLS policy is created and attached.
Masking policy is applied to sensitive columns.
The object enters the Governed State.
4.2 Drift Scenario — Object Recreated
User drops/recreates objects.
Policies are no longer attached.
Object enters Ungoverned Drift State.
4.3 On-Demand Policy Sync Flow
Trigger: User knows event time and runs sync.
Flow
User triggers On-Demand Policy Sync Service.
Service reads configured last timestamp. [First time it will scan last 3 hours logs]
Identify objects recreated after timestamp.
For each object:
Lookup historical policy metadata.
Detects RBAC policy mapping.
Detects ABAC RLS policy mapping.
Detects masking configuration.
Mark policies as Deploy Mode in Trustlogix.
The Trustlet engine applies policies.
Object returns to Governed State.
4.3.1 On-Demand Policy Sync On Few Policies
Flow
Select only specific suggested policies
Allow users to manually choose which policies from the suggestion list should be processed.
Scenario
Drift engine identifies:
20 policies out of sync
Admin wants to fix only 3 immediately
Instead of full sync, admin selects:
Policy A
Policy C
Policy F
System Behavior
Accept selected policies
Validate policy state (Active / Drifted)
Process only selected policies
Ignore others
Why This Matters
✔ Reduces execution scope ✔ Avoids impacting unrelated policies ✔ Enables staged rollout ✔ Supports emergency fixes
Sync Only Those Selected Policies
Ensure the system enforces policies strictly within the selected scope.
Scenario
User selects 2 policies:
Policy 1 → mapped to 10 tables
Policy 2 → mapped to 5 views
System must:
Evaluate only these 15 objects
Not scan or evaluate other policies
Internal Flow
Fetch selected policies
Identify mapped objects
Perform drift detection per object
Generate delta enforcement plan
Deploy only required changes
Result
Controlled execution boundary
No cross-policy interference
No global scan
Note: Un selected policies will be skipped and no action will be taken for those policies.
Avoid Re-Syncing Already Enforced Policies
Prevent re-execution of policies already correctly enforced.
Scenario
Policy appears in drift list due to:
Cached metadata delay
Object recreated but auto-tagged
Manual DBA enforcement already done
Actual Snowflake state is compliant.
Required System Behavior
Before enforcement:
Validate current datasource state:
Check POLICY_REFERENCES
Check grants
Check masking attachments
Compare expected vs actual state
If identical → Skip deployment
4.4 Scheduled Policy Sync Flow (Object-Based)
Trigger: Background job (e.g., hourly).
Flow
Scheduler runs sync jobs & scans the logs.
Scan metadata for objects recreated in the last 1 hour. [First time it will scan the last 3 hours of log data.]
For each object:
Check if object-level policies exist in TrustLogix.
Move policies to Deploy Mode.
Execute deployment.
Log audit record.
5. Lifecycle — Tag-Based Policies
5.1 Creation & Tagging
An object is created.
The object is tagged (domain/classification).
Columns are tagged (PII, Sensitive, etc.).
Tag metadata populated into Tag Ref.
ABAC tag-based RLS policy created.
ABAC tag-based masking policy created.
The object enters the Governed State.
5.2 Drift Scenario — Object Recreated
The object is recreated.
Tags and policies are no longer attached.
Object enters Tag Drift State.
5.3 On-Demand Tag-Based Sync Flow
Pre-requisite: Tag Ref must contain updated mappings.
Flow
The user triggers on-demand sync.
Sync service reads the last timestamp.
Identify objects tagged/untagged after timestamp.
Object tags
Column tags
Identify applicable ABAC policies.
Move policies to Deploy Mode.
Deploy policies and reapply grants.
Object returns to Governed State.
5.4 Scheduled Tag-Based Sync Flow
Trigger: Periodic job (e.g., hourly).
Flow
Scheduler runs sync jobs & scans the logs.
Sync service reads the last timestamp.
Identify objects tagged/untagged after timestamp.
Object tags
Column tags
Identify applicable ABAC policies.
Move policies to Deploy Mode.
Deploy policies and reapply grants.
Object returns to Governed State.
5.4.1 Object tags not populated for scheduled sync service
Flow
Handle scenarios where:
A user recreates an object (table/view)
Required governance tags are not yet populated
Tag-based policies cannot be enforced immediately
Scheduled Sync must retry intelligently before skipping
This ensures:
No premature policy failures
Controlled retry mechanism
Reduced false drift alerts
Stable enforcement behavior
6. Policy States
State
Description
Draft
Policy defined but not evaluated
Active
Policy attached and enforced
Drifted
Object exists but policy missing
Publish Mode
Policy queued for enforcement
Deployed
Deployment successful
Failed
Deployment error
7. Metadata & Inputs
Required Metadata
Object creation timestamp
Object recreation event
Policy catalog (RBAC / RLS / Masking)
Tag Ref mappings
Last sync watermark
8. Audit & Observability
Each sync run should log:
Sync type (On-Demand / Scheduled)
Time window processed
Objects evaluated
Policies redeployed
Failures
9. CI/CD Policy Sync API
API Endpoint
POST
Description: sync policies based on object names provided.
Request:
NOTE: If client wants to do policy sync only for configured DBs, please enable this flag while sending the request. Please share the DB list to the TrustLogix support team.
Body: JSON
Authentication
API requests require authentication. Please refer to the Trustlogix API documentation for details on how to authenticate your requests. This typically involves a JWT token.
Last updated
Was this helpful?

