Builtin Rule Reference

This page lists all builtin rules that ship with Lexega. These rules are evaluated automatically unless disabled with --no-builtin.

Usage in policies: Reference any rule by its ID:

policies:
  - rule_id: SNW-STG-ENC-OFF  # Stage Encryption Disabled
    action: block
    envs: [prod]

Query Analysis (Q-xxx)

Rule IDNameRiskDescription
Q-NULL-NOTINNOT IN with Nullable Subquery🟠 HighNULL-logic hazard: NOT IN with subquery on column '{column}'. If subquery returns any NULL, entire predicate evaluates to UNKNOWN and filters all rows. Use NOT EXISTS or ensure subquery has WHERE ... IS NOT NULL.
Q-NULL-NEQInequality Drops NULLs🟡 MediumNULL-logic warning: <> or != operator on column(s) [{column}] will not match NULL values. If NULLs are valid data, use 'OR column IS NULL' or IS DISTINCT FROM.
Q-NULL-COUNTCOUNT on Nullable Column🟠 HighCOUNT({column}) on confirmed nullable column excludes NULL values. This column is nullable per catalog metadata. If counting all rows including NULLs, use COUNT(*) instead. [Catalog-enhanced]
Q-PRED-CONTRAContradictory Predicate🔴 CriticalContradictory equality: predicate can never be true (e.g., WHERE a=1 AND a=2). Query will return zero rows.
Q-PRED-RANGEImpossible Range🟠 HighImpossible range: predicates define an empty range (e.g., WHERE x>10 AND x<5). Query will return zero rows.
Q-JOIN-DISTINCT-MASKDISTINCT Masking Join Fanout🟡 MediumDISTINCT may be masking a join fan-out. If the join produces duplicate rows, DISTINCT hides rather than fixes the issue. Consider verifying join cardinality or using EXISTS.
Q-JOIN-DISTINCT-MASK-CENHDISTINCT Masking Join Fanout (Confirmed)🟠 HighDISTINCT confirmed to mask a join fan-out. Catalog shows join keys lack unique constraints, meaning the join will produce duplicates. DISTINCT hides this bug rather than fixing it.
Q-JOIN-FANOUTJoin Fan-out🟠 HighJoin produces row multiplication (1:N relationship). Aggregates or counts may be inflated. Consider using a subquery or window function.
Q-JOIN-NULL-CENHNullable JOIN Column🟠 HighJOIN on nullable column silently excludes NULL values. NULL values in this column will not match, potentially losing data. Consider LEFT JOIN or add IS NOT NULL filter. [Catalog-enhanced]
Q-JOIN-TYPEMIS-CENHJOIN Type Mismatch🟡 MediumJOIN on columns with mismatched data types. This causes implicit type conversion and may prevent index usage, resulting in slower queries. [Catalog-enhanced]
Q-JOIN-FKVIOL-CENHFK Relationship Violation🔴 CriticalJOIN doesn't follow defined foreign key relationship. The FK constraint specifies different columns than those used in the JOIN, which is likely a logic error. [Catalog-enhanced]
Q-AGG-NONDETNon-deterministic Aggregate🟡 MediumNon-deterministic expression in GROUP BY context. Results may vary between executions with same data.
Q-WIN-NONDETNon-deterministic Window🟠 HighNon-deterministic expression in window function. Results may vary between executions with same data.
Q-WIN-RANK-NOORDRanking Without ORDER BY🟡 MediumROW_NUMBER/RANK/DENSE_RANK without ORDER BY produces arbitrary ordering. Results are non-deterministic.
Q-WIN-NOPARTWindow Without PARTITION BY🟡 MediumWindow function without PARTITION BY operates over entire result set. This may cause performance issues or unexpected results.
Q-SUBQ-SCALARScalar Subquery in Projection🟡 Medium|
Q-JOIN-LEFT-FILTLEFT JOIN Nullable Side Filtered🔴 CriticalLEFT JOIN nullable side filtered in WHERE clause. This effectively converts the LEFT JOIN to an INNER JOIN, likely a bug.
Q-SCAN-NOFILTUnfiltered Multi-Table Scan🟡 MediumQuery reads multiple tables without WHERE or LIMIT clause. This may cause full table scans.
Q-JOIN-CROSSExplicit CROSS JOIN🟡 MediumExplicit CROSS JOIN between {left} and {right}. Cartesian product ({product} rows) may cause performance issues on large tables.
Q-JOIN-CROSS-IMPLImplicit CROSS JOIN🟡 MediumImplicit join syntax detected (comma-separated FROM): {tables}. Cartesian product ({product} rows) may cause performance issues. Prefer explicit JOINs.
Q-SCAN-1TBLUnfiltered Single Table Scan🟡 MediumSELECT without WHERE or LIMIT clause on table. May cause full table scan. Use tables.none_of to allowlist known-small tables.
Q-JOIN-TEMPORALTemporal Join Without Date Bounds🟡 MediumTemporal join without explicit date bounds. This may cause full table scans or incorrect results across time periods.
Q-JOIN-TEMPORAL-CENHTemporal Tables Joined Without Date Filter🟡 MediumTables with temporal columns (DATE/TIMESTAMP) are joined without date filter in WHERE or JOIN ON. This can cause unbounded historical joins with poor performance.
Q-AGG-EXPLODEAggregate Explosion Risk🟡 MediumMultiple joins with aggregation but no WHERE filter. This can cause exponential row explosion and incorrect aggregates.
Q-AGG-MANYDIMMany Dimension Aggregation🟡 MediumGROUP BY with many columns (>5) may indicate design issues or produce sparse results.
Q-AGG-NOFILTUnfiltered Aggregate🟢 LowAggregate query without WHERE clause. Consider adding filters to avoid processing entire tables.
Q-AGG-HICARDHigh-Cardinality GROUP BY🟡 MediumGROUP BY includes high-cardinality columns (IDs, emails, etc.). This can generate millions of groups causing memory pressure.
Q-AGG-NOFILT-CENHLarge Table Aggregate Without Filter🟡 MediumAggregating a large table (1M+ rows) without WHERE clause. Consider adding time/partition filters to reduce scan size.
Q-NONDETNon-deterministic Query🟡 MediumQuery contains non-deterministic elements. Results may vary between executions.
Q-WIN-HICARDWindow High Cardinality Partition🟠 HighWindow function partitioned on high-cardinality column. May cause performance issues.
Q-WIN-NOPART-CENHWindow Without PARTITION BY on Large Table🟠 HighWindow function without PARTITION BY operates on entire large table (1M+ rows) in single partition. Add PARTITION BY to reduce memory pressure.
Q-WIN-UNBOUNDEDWindow Unbounded Frame Without Partition🔴 CriticalWindow function with unbounded frame and no PARTITION BY. Extremely expensive on large datasets - entire table processed as one partition.
Q-WIN-MULTIPARTMultiple Window Partition Schemes🟡 MediumMultiple window functions with different PARTITION BY clauses. Query will re-partition data multiple times, causing additional shuffles.
Q-SUBQ-REPEATRepeated Subquery Pattern🟡 MediumRepeated subquery pattern detected. Consider using CTEs or temporary tables for better readability and potential performance improvement.
Q-SUBQ-CORR-SELCorrelated Subquery in SELECT🟠 HighCorrelated subquery in SELECT list (N+1 query pattern). Consider rewriting as JOIN for better performance.
Q-SUBQ-CORR-WHERECorrelated Subquery in WHERE🟡 MediumCorrelated subquery in WHERE/IN clause. May cause performance issues on large datasets. Consider rewriting with EXISTS or JOIN.
Q-WIN-USAGEWindow Function Usage🟢 LowWindow function usage detected. Verify PARTITION BY and ORDER BY clauses.
Q-WIN-FRAMEFrame Specification🟢 LowCustom window frame specification detected. Verify boundaries.
Q-TBL-UNBOUNDED-CENHUnbounded Query on Large Table🟠 HighUnbounded query on large table without WHERE clause. Consider adding filters to reduce data scanned.
Q-VIEW-REF-CENHQuery References Views🟡 MediumQuery references VIEW(s). Views are recomputed on every execution (not materialized).
Q-TBL-TEMP-REF-CENHQuery References Temporary Tables (Not Implemented)🟢 LowQuery references TEMPORARY table(s). Data is session-scoped and not persistent.
Q-TBL-SELSTAR-WIDE-CENHSELECT * on Wide Table🟡 MediumSELECT * on wide table (50+ columns). Scanning many unnecessary columns increases I/O and network transfer. Consider explicit column selection.

DML Signals (DML-xxx)

Rule IDNameRiskDescription
DML-WRITE-UNBOUNDEDUnbounded Write Operation🔴 CriticalUnbounded write operation detected - no WHERE clause. This affects ALL rows in the target table(s).
DML-WRITE-XSCHEMACross-Schema Write Operation🟡 MediumCross-schema write operation detected. Verify schema permissions and change control procedures.
DML-WRITE-MULTITBLMulti-Table Write Operation🟢 LowWrite operation affects multiple tables. Verify transaction boundaries and rollback plan.

Credential Exposure (CRED-xxx)

Rule IDNameRiskDescription
CRED-AWS-LEAKHardcoded AWS Access Key🔴 CriticalHardcoded AWS access key detected (AKIA.../ASIA...). CRITICAL: Never commit credentials to source code. Use secure parameter passing, secrets managers, or storage integrations instead.
CRED-PWD-LEAKHardcoded Password🔴 CriticalHardcoded password detected in SQL. CRITICAL: Use secure parameter passing (e.g., :password_param) or secrets management instead of literal passwords.
CRED-APIKEY-LEAKHardcoded API Key🔴 CriticalHardcoded API key or access token detected. CRITICAL: Store API keys in secure secrets managers, not in SQL code.
CRED-CONNSTR-LEAKHardcoded Connection String🔴 CriticalConnection string with embedded credentials detected (user:password@host). CRITICAL: Use secure credential storage instead of embedding credentials in URLs.

Table Operations (TBL-xxx)

Rule IDNameRiskDescription
TBL-RAP-RMVRow Access Policy Removed from Table🟠 HighRow Access Policy removed from table. This may expose sensitive data to unauthorized users.
TBL-MASK-RMVMasking or Projection Policy Removed from Column🔴 CriticalCRITICAL: Masking or Projection Policy removed from column. This exposes PII or sensitive data.
TBL-AGGPOL-RMVAggregation or Join Policy Removed from Table🟡 MediumAggregation or Join Policy removed from table. This may allow unrestricted data aggregation or joins.
TBL-RAP-ADDRow Access Policy Added to Table🟢 LowRow Access Policy added to table. Positive governance signal.
TBL-MASK-ADDColumn Masking or Projection Policy Added🟢 LowColumn masking or projection policy added. Positive governance signal.
TBL-TAG-ADDTag Added to Object🟢 LowTag added to object. Positive governance signal.
TBL-TAG-RMVTag Removed from Object🟡 MediumTag removed from object. Governance metadata may be incomplete.
TBL-RAP-RMV-ALLAll Row Access Policies Dropped🔴 CriticalAll Row Access Policies dropped from table. CRITICAL: All row-level access controls removed from this table.
TBL-DROPTable Dropped🔴 CriticalDROP TABLE detected. Table and all data will be permanently deleted.
TBL-COL-DROPColumn Dropped from Table🟠 HighALTER TABLE DROP COLUMN detected. Column data and dependent objects may be lost or broken.
TBL-RENAMETable Renamed🟡 MediumALTER TABLE RENAME detected. Downstream references (queries, views, jobs) may break if not updated.
TBL-COL-ADDColumn Added to Table🟢 LowALTER TABLE ADD COLUMN detected. Schema expanded; verify downstream contracts and ingestion mappings.
TBL-REPLACETable Replaced🟠 HighCREATE OR REPLACE TABLE detected. Existing table definition (and potentially data semantics) is replaced.
TBL-TRUNCATETable Truncated🔴 CriticalTRUNCATE TABLE detected. CRITICAL: All rows will be permanently deleted.

View Operations (VIEW-xxx)

Rule IDNameRiskDescription
VIEW-REPLACEView Replaced🟡 MediumCREATE OR REPLACE VIEW detected. Existing view definition is replaced and downstream logic may change.
VIEW-CHGView Modified🟡 MediumALTER VIEW changes a view definition or attributes. Views control data access patterns; changes affect all queries through the view.
VIEW-DROPView Dropped🟡 MediumDROP VIEW removes a view. Dependent queries and applications will break. Check for CASCADE to identify cascading object removal.
VIEW-CASCADE-DROPView Dropped with CASCADE🟠 HighDROP VIEW ... CASCADE removes the view AND all dependent objects (other views, rules). Cascading drops can silently remove data access controls.

Schema Operations (SCHEMA-xxx)

Rule IDNameRiskDescription
SCHEMA-DROPSchema Dropped🔴 CriticalDROP SCHEMA detected. CRITICAL: All objects in schema will be permanently deleted.
SCHEMA-CLONESchema Cloned🟡 MediumSchema cloned from existing schema. Verify access controls are appropriate for the clone.
SCHEMA-NAME-CHGSchema Renamed🟡 MediumSchema renamed. Verify all references to the old name are updated.
SCHEMA-PROPS-CHGSchema Properties Modified🟡 MediumSchema properties modified. Configuration change may affect behavior.
SCHEMA-TAG-ADDSchema Tag Set🟢 LowSchema tag assigned. Governance metadata updated.
SCHEMA-TAG-RMVSchema Tag Removed🟡 MediumSchema tag removed. Governance metadata may be incomplete. Verify tag removal is intentional.

Database Operations (DB-xxx)

Rule IDNameRiskDescription
DB-CLONEDatabase Cloned🟡 MediumDatabase cloned from existing database. Verify access controls are appropriate for the clone.
DB-DROPDatabase Dropped🔴 CriticalDROP DATABASE detected. CRITICAL: All schemas, tables, and data within the database will be permanently deleted.
DB-NAME-CHGDatabase Renamed🟡 MediumDatabase renamed. Verify all references to the old name are updated.
DB-PROPS-CHGDatabase Properties Modified🟡 MediumDatabase properties modified. Configuration change may affect behavior.
DB-TAG-ADDDatabase Tag Set🟢 LowDatabase tag assigned. Governance metadata updated.
DB-TAG-RMVDatabase Tag Removed🟡 MediumDatabase tag removed. Governance metadata may be incomplete. Verify tag removal is intentional.

Masking Policies (MASK-xxx)

Rule IDNameRiskDescription
MASK-ALLOW-ALLMasking Policy No-Op Passthrough🔴 CriticalMasking Policy body passes through the original value without masking. CRITICAL: Policy is effectively a no-op and sensitive data may be exposed.
MASK-NEWMasking Policy Created🟢 LowMasking Policy created. Positive governance signal.
MASK-BODY-CHGMasking Policy Logic Changed🔴 CriticalMasking Policy logic changed. CRITICAL: Data protection logic modified.
MASK-NAME-CHGMasking Policy Renamed🟠 HighMasking Policy renamed. Dependent columns may be affected.
MASK-TAG-RMVMasking Policy Tag Removed🟡 MediumTag removed from Masking Policy. Governance metadata may be incomplete.
MASK-TAG-ADDMasking Policy Tag Added🟢 LowTag added to Masking Policy. Positive governance signal.
MASK-COMMENT-ADDMasking Policy Comment Added🟢 LowComment added to Masking Policy. Positive documentation signal.
MASK-COMMENT-RMVMasking Policy Comment Removed🟢 LowComment removed from Masking Policy. Documentation lost.
MASK-DROPMasking Policy Dropped🔴 CriticalMasking Policy dropped. CRITICAL: Column data protection removed. All columns using this policy will be unmasked.

Row Access Policies (RAP-xxx)

Rule IDNameRiskDescription
RAP-NEWRow Access Policy Created🟢 LowRow Access Policy created. Ensure proper testing and documentation.
RAP-ALLOW-ALLRow Access Policy Allow-All Predicate🔴 CriticalRow Access Policy predicate is always true. CRITICAL: Policy is effectively a no-op and does not restrict row access. Applies to Snowflake, BigQuery, and PostgreSQL RLS.
RAP-BODY-CHGRow Access Policy Logic Changed🔴 CriticalRow Access Policy logic changed. CRITICAL: Access control logic modified.
RAP-NAME-CHGRow Access Policy Renamed🟠 HighRow Access Policy renamed. Dependent objects may be affected.
RAP-TAG-RMVRow Access Policy Tag Removed🟡 MediumTag removed from Row Access Policy. Governance metadata may be incomplete.
RAP-TAG-ADDRow Access Policy Tag Added🟢 LowTag added to Row Access Policy. Positive governance signal.
RAP-COMMENT-ADDRow Access Policy Comment Added🟢 LowComment added to Row Access Policy. Positive documentation signal.
RAP-COMMENT-RMVRow Access Policy Comment Removed🟢 LowComment removed from Row Access Policy. Documentation lost.
RAP-DROPRow Access Policy Dropped🔴 CriticalRow Access Policy dropped. CRITICAL: Row-level access controls removed. All tables using this policy will no longer filter rows.

Grant & Access (GRT-xxx)

Rule IDNameRiskDescription
GRT-ALL-PRIVGrant All Privileges🟠 HighAvoid GRANT ALL PRIVILEGES. Use specific privilege grants to follow the principle of least privilege.
GRT-WITH-OPTGrant With Grant Option🟠 HighAvoid WITH GRANT OPTION. This allows the grantee to re-grant privileges and can lead to privilege escalation.
GRT-TO-PUBLICGrant to PUBLIC🔴 CriticalAvoid granting privileges to PUBLIC. The PUBLIC role includes all users in the account, which may expose data unintentionally.
GRT-OWNER-XFEROwnership Transfer🟠 HighOwnership transfer detected. Verify approval and ensure proper access controls remain in place.
GRT-TO-SHAREGrant to Share🔴 CriticalData sharing boundary crossed: granting to SHARE exposes data outside the account. Verify data classification and approval.
GRT-ACCESS-EXPRole Grant Expands Effective Access🟡 MediumRole hierarchy change detected. Child role inherits privileges from parent role, affecting downstream roles and users.
GRT-ACCESS-EXP-HIRole Grant Significantly Expands Access🟠 HighHIGH: Role hierarchy change significantly expands effective access. Child role inherits 50+ privileges or affects 10+ users.
GRT-SYSROLE-EXPCritical System Role Grant🔴 CriticalCRITICAL: Grant involves privileged system role (ACCOUNTADMIN, SECURITYADMIN, SYSADMIN, USERADMIN, PUBLIC). This has account-wide security implications.
GRT-BROAD-PRIVBroad Object Privilege Grant🟡 MediumBroad privilege grant detected. Object privilege affects multiple roles and users via role inheritance.
GRT-BROAD-PRIV-HIVery Broad Object Privilege Grant🟠 HighHIGH: Object privilege grant affects 20+ users via role inheritance. Review if this access scope is intentional.

Functions & Procedures (UDF/PROC/FUNC-xxx)

Rule IDNameRiskDescription
PROC-NEWProcedure Created🟢 LowStored procedure created. Verify business logic and access controls.
PROC-DYNSQLProcedure Contains Dynamic SQL🟠 HighStored procedure contains EXECUTE IMMEDIATE (dynamic SQL). SQL injection risk if inputs are not validated.
UDF-NEWFunction Created🟢 LowUser-defined function created. Verify return type and usage patterns.
UDF-DYNSQLFunction Contains Dynamic SQL🟠 HighUser-defined function contains EXECUTE IMMEDIATE (dynamic SQL). SQL injection risk if inputs are not validated.
FUNC-DROPFunction Dropped🟡 MediumDROP FUNCTION detected. Function definition removed. Verify no dependencies.
PROC-DROPProcedure Dropped🟡 MediumDROP PROCEDURE detected. Procedure definition removed. Verify no dependencies.
UDF-SECURE-RMVFunction SECURE Removed🟠 HighSECURE flag removed from function. Function body is now visible to users with USAGE privilege.
UDF-EXTACC-CFGFunction External Access Configured🟡 MediumFunction configured with external access integrations or secrets. Review access permissions.
PROC-SECURE-RMVProcedure SECURE Removed🟠 HighSECURE flag removed from procedure. Procedure body is now visible to users with USAGE privilege.
PROC-EXECAS-OWNERProcedure EXECUTE AS OWNER🟡 MediumProcedure set to EXECUTE AS OWNER. RISK: If owner has elevated privileges (e.g., deploy role), this grants all callers elevated access. Consider EXECUTE AS CALLER for better privilege isolation.
PROC-EXECAS-CALLERProcedure EXECUTE AS CALLER🟢 LowProcedure set to EXECUTE AS CALLER. Runs with invoker's privileges. Safer than OWNER if procedure owner has elevated rights (e.g., deploy role). Context-dependent security.
PROC-EXECAS-RESTRICTProcedure EXECUTE AS RESTRICTED CALLER🟠 HighProcedure set to EXECUTE AS RESTRICTED CALLER. This is a significant compromise between security models - review carefully.
PROC-EXTACC-CFGProcedure External Access Configured🟡 MediumProcedure configured with external access integrations or secrets. Review access permissions.

Dynamic SQL (DYNSQL-xxx)

Rule IDNameRiskDescription
DYNSQLDynamic SQL Execution🟠 HighEXECUTE IMMEDIATE statement detected (dynamic SQL). SQL injection risk if inputs are not validated. Consider using parameterized queries.

External Tables (EXTTBL-xxx)

Rule IDNameRiskDescription
EXTTBL-NEWExternal Table Created🟢 LowExternal table created. Federated data source registered for querying.

Diff Signals (DIFF-xxx)

Rule IDNameRiskDescription
DIFF-WRITE-WHERE-RMVUnbounded Write After WHERE Removed🔴 CriticalWrite statement became unbounded after WHERE clause was removed. CRITICAL: May affect entire table.
DIFF-LIMIT-RMV-MULTILIMIT Removed (Multi-Table)🔴 CriticalLIMIT removed from multi-table query. Potential cartesian explosion with {table_count} tables.
DIFF-LIMIT-RMVLIMIT Removed (Single-Table)🟠 HighLIMIT {previous_limit} removed. Query is now unbounded.
DIFF-JOIN-CROSS-ADDCROSS JOIN Introduced🔴 CriticalJOIN changed from {from_kind} to CROSS. Cartesian product risk.
DIFF-SAMPLE-ADDSAMPLE Added🔴 CriticalSAMPLE/TABLESAMPLE added. Query now operates on SUBSET of data!
DIFF-WHERE-RMVWHERE Clause Removed🟠 HighWHERE clause removed. Query is now unbounded.
DIFF-JOIN-RMVJOIN Removed🟠 HighJOIN removed. Data relationship lost.
DIFF-DISTINCT-RMVDISTINCT Removed🟠 HighDISTINCT removed. Query may now return duplicate rows.
DIFF-JOIN-NARROWJOIN Type Narrowed🟠 HighJOIN changed from {from_kind} to {to_kind}. May silently drop rows.
DIFF-JOIN-TYPE-CHGJOIN Type Changed🟡 MediumJOIN type changed from {from_kind} to {to_kind}. Verify result set behavior.
DIFF-HAVING-RMVHAVING Removed🟠 HighHAVING clause removed. Aggregate filtering lost.
DIFF-GROUPBY-COL-RMVGROUP BY Column Removed🟠 HighGROUP BY column removed. May cause aggregate explosion or changed grouping.
DIFF-QUALIFY-RMV-MULTIQUALIFY Removed (Multi-Table with Window Functions)🟠 HighQUALIFY clause removed from multi-table query with window functions. Window function filtering lost.
DIFF-QUALIFY-RMVQUALIFY Removed🟡 MediumQUALIFY clause removed. Window function filtering lost.
DIFF-COL-RMVColumn Removed🟢 LowColumn removed from output. Downstream consumers may break.
DIFF-TBL-RMVTable Removed from Query🟡 MediumTable removed from query. Data relationship changed.
DIFF-AGG-FUNC-CHGAggregate Function Changed🟠 HighAggregate function changed from {from_function} to {to_function}. Verify business logic.
DIFF-JOIN-COND-CHGJOIN Condition Changed🟠 HighJOIN condition changed. Data relationship logic altered.
DIFF-WHERE-COND-CHGWHERE Condition Changed🟠 HighWHERE clause predicates changed. Query filtering logic altered.
DIFF-WIN-PART-CHGWindow Partition Changed🟠 HighWindow function partition changed. Results may differ.
DIFF-ORDERBY-CHGORDER BY Changed🟢 LowORDER BY clause changed. Result ordering affected.
DIFF-CTE-RMVCTE Removed🟡 MediumCTE (Common Table Expression) removed. Query structure simplified.
DIFF-XSCHEMA-ADDCross-Schema Access Introduced🟡 MediumQuery now accesses tables across different schemas.
DIFF-LIMIT-INCRLIMIT Increased🟡 MediumLIMIT increased from {from_limit} to {to_limit}. More data may be returned.
DIFF-LIMIT-DECRLIMIT Decreased🟢 LowLIMIT decreased from {from_limit} to {to_limit}. Query is more restrictive. ✓
DIFF-SETOP-CHGSET Operation Changed🟡 MediumSET operation changed from {from_op} to {to_op}. Query logic altered.
DIFF-UNION-TO-UNIONALLUNION Changed to UNION ALL🟠 HighUNION changed to UNION ALL. Deduplication lost - may return duplicate rows.
DIFF-WHERE-ADDWHERE Clause Added🟢 LowWHERE clause added. Query is now bounded. ✓
DIFF-LIMIT-ADDLIMIT Added🟢 LowLIMIT added. Query is now bounded. ✓
DIFF-DISTINCT-ADDDISTINCT Added🟢 LowDISTINCT added. Duplicates will be removed. ✓
DIFF-QUALIFY-ADDQUALIFY Added🟢 LowQUALIFY clause added for window function filtering. ✓
DIFF-HAVING-ADDHAVING Added🟢 LowHAVING clause added for aggregate filtering. ✓
DIFF-WRITE-WHERE-ADDWrite Statement Became Bounded🟢 LowWrite statement became bounded with WHERE clause. ✓
DIFF-TBL-ADDTable Added🟢 LowNew table added to query.
DIFF-JOIN-ADDJOIN Added🟢 LowNew JOIN added to query.
DIFF-COL-ADDColumn Added🟢 LowNew column added to output.
DIFF-CTE-ADDCTE Added🟢 LowCTE (Common Table Expression) added. Query structure enhanced.
DIFF-STMT-KIND-CHGStatement Kind Changed🟠 HighStatement type changed from {from_kind} to {to_kind}. Verify intent.
DIFF-WIN-FRAME-CHGWindow Frame Changed🟠 HighWindow frame changed. Running totals, rankings, or cumulative calculations affected.
DIFF-WIN-PART-RMVWindow Partition Removed🟠 HighPARTITION BY removed from window function. Function now operates over entire result set instead of per-group. Rankings, row numbers, and aggregates will be computed globally.
DIFF-AGG-DISTINCT-RMVAggregate DISTINCT Removed🟠 HighDISTINCT removed from aggregate function. May now count/sum duplicate values.
DIFF-AGG-DISTINCT-ADDAggregate DISTINCT Added🟡 MediumDISTINCT added to aggregate function. May reduce result values.
DIFF-AGG-ARG-CHGAggregate Argument Changed🟡 MediumAggregate function input changed from {from_argument} to {to_argument}. Verify correct column.
DIFF-AGG-ARG-REFACTORAggregate Argument Refactored🟢 LowAggregate function input refactored. Likely a column extraction.
DIFF-GROUPBY-COL-ADDGROUP BY Column Added🟡 MediumGROUP BY column added. Aggregation granularity changed.
DIFF-AGG-ADDAggregate Added🟢 LowNew aggregate function added to query.
DIFF-AGG-RMVAggregate Removed🟡 MediumAggregate function removed from query. Calculation lost.
DIFF-HAVING-CHGHAVING Clause Changed🟡 MediumHAVING clause filter logic changed. Aggregate filtering behavior affected.
DIFF-SAMPLE-RMVSAMPLE Removed🟢 LowSAMPLE/TABLESAMPLE removed. Query now operates on full data. ✓
DIFF-SETOP-ADDSET Operation Added🟡 MediumSET operation (UNION/INTERSECT/EXCEPT) added. Query logic extended.
DIFF-SETOP-RMVSET Operation Removed🟡 MediumSET operation removed. Query logic simplified.
DIFF-SUBQ-PRED-CHGSubquery Predicate Changed🟡 MediumPredicate changed within a subquery. Subquery filtering behavior affected.
DIFF-SUBQ-SCOPE-CHGSubquery Scope Changed🟠 HighSubquery scope type changed (e.g., EXISTS→NOT EXISTS). Query logic inverted.

Snowflake (SNW-xxx)

Rule IDNameRiskDescription
SNW-STG-ENC-OFFStage Encryption Disabled🔴 CriticalEncryption disabled on stage. CRITICAL: This exposes data at rest to potential breaches.
SNW-STG-ENC-ONStage Encryption Enabled🟢 LowEncryption enabled on stage. Positive security signal.
SNW-STG-CRED-CHGStage Credentials Changed🟠 HighStorage credentials changed on stage. Verify authorization and audit trail.
SNW-STG-TAG-SETStage Tag Set🟢 LowTag set on stage. Positive governance signal for metadata tracking.
SNW-STG-TAG-RMVStage Tag Removed🟡 MediumTag removed from stage. Verify governance metadata tracking is maintained.
SNW-STG-INTG-CHGStage Integration Changed🟡 MediumStorage integration changed on stage. Verify access controls.
SNW-STG-INTG-SETStage Integration Set🟢 LowStorage integration set on stage. External storage access configured.
SNW-ROLE-PRIV-USEPrivileged Role Hardcoded in Script🔴 CriticalCRITICAL: Privileged role should not be hardcoded in scripts. Use role grants or session variables instead.
SNW-GRT-PRIV-ROLEPrivileged Role Grant🔴 CriticalPrivilege escalation detected: granting privileged system role. This gives full administrative control and should require explicit approval.
SNW-API-INTG-NEWAPI Integration Created🔴 CriticalCRITICAL: API Integration created. New external API access established. Verify endpoint security.
SNW-API-INTG-NOPFXAPI Prefix Restrictions Missing or Removed🟡 MediumAPI Integration created or modified WITHOUT prefix restrictions. Unrestricted API access may be granted. Consider setting API_ALLOWED_PREFIXES or API_BLOCKED_PREFIXES.
SNW-API-INTG-ONAPI Integration Enabled🟢 LowAPI Integration enabled. Info: Integration is active.
SNW-API-INTG-CREDRMVAPI Key UNSET from API Integration🟠 HighAPI Key UNSET from API Integration. HIGH: Authentication credential removed. Verify this change is intentional.
SNW-API-INTG-CREDCHGAPI Credential Changed🟠 HighAPI credential changed on API Integration. HIGH: Authentication credential or cloud IAM reference modified. Audit trail required.
SNW-API-INTG-OFFAPI Integration Disabled🟠 HighAPI Integration disabled. HIGH: Integration is no longer active. Verify dependent services are not impacted.
SNW-MASK-EXEMPTMasking Policy EXEMPT_OTHER_POLICIES Enabled🔴 CriticalMasking Policy created with EXEMPT_OTHER_POLICIES = TRUE. CRITICAL: May bypass other data protection policies.
SNW-NETPOL-NEWNetwork Policy Created🔴 CriticalNetwork Policy created. CRITICAL: New network access controls established.
SNW-NETPOL-IPALLOW-CFGNetwork Policy ALLOWED_IP_LIST Configured🟢 LowNetwork Policy ALLOWED_IP_LIST configured. IP allowlist established.
SNW-NETPOL-IPBLOCK-CFGNetwork Policy BLOCKED_IP_LIST Configured🟢 LowNetwork Policy BLOCKED_IP_LIST configured. IP blocklist established.
SNW-NETPOL-RULELIST-CFGNetwork Policy ALLOWED_NETWORK_RULE_LIST Configured🟡 MediumNetwork Policy ALLOWED_NETWORK_RULE_LIST configured. Network rules referenced.
SNW-NETPOL-SETNetwork Policy SET Operation🔴 CriticalNetwork Policy SET operation. CRITICAL: This replaces the entire IP/rule list. Verify authorization and review new configuration.
SNW-NETPOL-ADDNetwork Policy ADD Operation🟠 HighNetwork Policy ADD operation. Network rules or IPs added.
SNW-NETPOL-RMVNetwork Policy REMOVE Operation🔴 CriticalNetwork Policy REMOVE operation. CRITICAL: Network restrictions removed.
SNW-NETPOL-NAME-CHGNetwork Policy Renamed🟠 HighNetwork Policy renamed. Dependent objects may be affected.
SNW-NETPOL-TAG-ADDNetwork Policy Tag Added🟢 LowTag added to Network Policy. Positive governance signal.
SNW-NETPOL-TAG-RMVNetwork Policy Tag Removed🟡 MediumTag removed from Network Policy. Governance metadata may be incomplete.
SNW-NETPOL-COMMENT-RMVNetwork Policy Comment Removed🟢 LowComment removed from Network Policy. Documentation cleared.
SNW-NETPOL-DROPNetwork Policy Dropped🔴 CriticalNetwork Policy dropped. CRITICAL: Network access controls removed.
SNW-STGINTG-NEWStorage Integration Created🟠 HighStorage Integration created. HIGH: Grants external cloud storage access. Verify credentials and allowed locations.
SNW-STGINTG-NEW-OFFStorage Integration Created but Disabled🟡 MediumStorage Integration created but disabled. MEDIUM: Verify this is intentional staging.
SNW-STGINTG-OFFStorage Integration Disabled🔴 CriticalStorage Integration disabled. CRITICAL: External data access cut off. Verify dependent pipelines won't fail.
SNW-STGINTG-ONStorage Integration Enabled🟢 LowStorage Integration enabled. Positive security signal - external access restored.
SNW-STGINTG-AWS-CHGAWS Role ARN Changed🔴 CriticalAWS Role ARN changed. CRITICAL: Cloud credentials modified. Verify new role has correct permissions.
SNW-STGINTG-AZURE-CHGAzure Tenant ID Changed🔴 CriticalAzure Tenant ID changed. CRITICAL: Cloud credentials modified. Verify new tenant has correct permissions.
SNW-STGINTG-LOC-CHGStorage Allowed Locations Changed🟠 HighStorage allowed locations changed. HIGH: Data access scope modified. Verify new locations are authorized.
SNW-STGINTG-BLOCKLOC-CHGStorage Blocked Locations Changed🟠 HighStorage blocked locations changed. HIGH: Data access restrictions modified. Verify block list is still secure.
SNW-STGINTG-TAG-ADDStorage Integration Tag Added🟢 LowStorage Integration tag added. Positive governance signal.
SNW-STGINTG-TAG-RMVStorage Integration Tag Removed🟡 MediumStorage Integration tag removed. MEDIUM: Governance metadata lost. Verify this is intentional.
SNW-STGINTG-DROPStorage Integration Dropped🔴 CriticalStorage Integration dropped. CRITICAL: External data access permanently removed. Verify dependent stages/pipes won't fail.
SNW-NOTIFINTG-NEWNotification Integration Created🟢 LowNotification integration created. External notification configured.
SNW-SESSPOL-IDLE-LONGSession Policy Long Idle Timeout🟠 HighSession Policy created with long idle timeout (>24 hours). HIGH: Consider shorter timeout for better security.
SNW-SESSPOL-UIIDLE-LONGSession Policy Long UI Idle Timeout🟠 HighSession Policy created with long UI idle timeout (>24 hours). HIGH: Consider shorter timeout for better security.
SNW-SESSPOL-IDLE-UNSETSession Idle Timeout UNSET🔴 CriticalSession idle timeout UNSET. CRITICAL: Sessions can remain active indefinitely. This weakens security posture significantly.
SNW-SESSPOL-UIIDLE-UNSETUI Idle Timeout UNSET🔴 CriticalUI idle timeout UNSET. CRITICAL: UI sessions can remain active indefinitely. Verify this doesn't create unattended access risk.
SNW-SESSPOL-IDLE-LONGSETSession Idle Timeout SET to Long Duration🟠 HighSession idle timeout SET to long duration (>24 hours). HIGH: Consider shorter timeout for better security.
SNW-SESSPOL-UIIDLE-LONGSETUI Idle Timeout SET to Long Duration🟠 HighUI idle timeout SET to long duration (>24 hours). HIGH: Consider shorter timeout for better security.
SNW-SESSPOL-IDLE-CHGSession Idle Timeout Modified🟡 MediumSession idle timeout modified. Review new timeout value.
SNW-SESSPOL-DROPSession Policy Dropped🔴 CriticalSession Policy dropped. CRITICAL: Session governance controls removed. All roles/users referencing this policy lose session management.
SNW-SESSPOL-NEWSession Policy Created🟢 LowSession Policy created. Positive governance signal — session timeout controls configured.
SNW-SESSPOL-NAME-CHGSession Policy Renamed🟡 MediumSession Policy renamed. Verify all roles/users referencing this policy are updated.
SNW-SESSPOL-TAG-ADDSession Policy Tag Set🟢 LowSession Policy tag set. Positive governance signal — metadata tag added.
SNW-SESSPOL-TAG-RMVSession Policy Tag Removed🟡 MediumSession Policy tag removed. Governance metadata lost. Verify this is intentional.
SNW-SESSPOL-COMMENT-ADDSession Policy Comment Set🟢 LowComment added to Session Policy. Positive documentation signal.
SNW-SESSPOL-COMMENT-RMVSession Policy Comment Removed🟢 LowComment removed from Session Policy. Documentation lost.
SNW-NOTIFINTG-CHGNotification Integration Modified🟢 LowNotification integration modified. Verify configuration.
SNW-EXTACC-NEWExternal Access Integration Created🟡 MediumExternal access integration created. Network egress configured.
SNW-EXTACC-DROPExternal Access Integration Dropped🟠 HighExternal access integration dropped. Network egress removed.
SNW-EXTACC-OFFExternal Access Integration Disabled🟠 HighExternal access integration disabled. Network egress suspended.
SNW-EXTACC-ONExternal Access Integration Enabled🟡 MediumExternal access integration enabled. Network egress activated.
SNW-EXTACC-HOSTS-CHGExternal Access Allowed Hosts Changed🔴 CriticalExternal access allowed hosts changed. CRITICAL: Network egress scope modified.
SNW-EXTACC-NETRULES-CHGExternal Access Network Rules Changed🟠 HighExternal access network rules changed. Verify egress restrictions.
SNW-EXTACC-SECRETS-CHGExternal Access Secrets Changed🔴 CriticalExternal access allowed secrets changed. CRITICAL: Credential access modified.
SNW-EXTACC-SECRET-RMVExternal Access Secret Removed🟠 HighExternal access secret removed from allowed list.
SNW-EXTACC-NETRULE-ADDExternal Access Network Rule Added🟡 MediumNetwork rule added to external access integration.
SNW-EXTACC-NETRULE-RMVExternal Access Network Rule Removed🟠 HighNetwork rule removed from external access integration.
SNW-EXTACC-COMMENT-CHGExternal Access Comment Changed🟢 LowExternal access integration comment changed.
SNW-EXTACC-TAG-ADDExternal Access Tag Added🟢 LowTag added to external access integration. Positive governance.
SNW-EXTACC-TAG-RMVExternal Access Tag Removed🟡 MediumTag removed from external access integration.
SNW-EXTACC-NAME-CHGExternal Access Name Changed🟠 HighExternal access integration renamed. Dependent objects may break.
SNW-EXTACC-OWNER-CHGExternal Access Owner Changed🟠 HighExternal access integration ownership changed.
SNW-EXTACC-CHGExternal Access Modified🟡 MediumExternal access integration modified. Verify configuration.
SNW-AUTHPOL-NEWAuthentication Policy Created🟢 LowAuthentication policy created. Identity verification configured.
SNW-AUTHPOL-DROPAuthentication Policy Dropped🔴 CriticalAuthentication policy dropped. CRITICAL: Identity verification controls removed.
SNW-AUTHPOL-OFFAuthentication Policy Disabled🔴 CriticalAuthentication policy disabled. CRITICAL: Identity verification suspended.
SNW-AUTHPOL-CHGAuthentication Policy Modified🟠 HighAuthentication policy modified. Verify identity verification settings.
SNW-AUTHPOL-METHODS-CHGAuthentication Methods Changed🔴 CriticalAuthentication policy methods changed. CRITICAL: Identity verification approach modified.
SNW-AUTHPOL-MFA-CHGAuthentication MFA Requirement Changed🔴 CriticalAuthentication policy MFA requirements changed. CRITICAL: Multi-factor security modified.
SNW-AUTHPOL-CLIENT-CHGAuthentication Client Types Changed🟠 HighAuthentication policy client types changed. Connection method restrictions modified.
SNW-AUTHPOL-SECINTG-CHGAuthentication Security Integrations Changed🔴 CriticalAuthentication policy security integrations changed. CRITICAL: SSO/SAML configuration modified.
SNW-AUTHPOL-ONAuthentication Policy Enabled🟢 LowAuthentication policy enabled. Positive security signal.
SNW-PWDPOL-HISTORY-UNSETPassword History UNSET🟠 HighPassword history UNSET. HIGH: Reverts to default (0), users can reuse passwords immediately.
SNW-AUTHPOL-MFA-OFFAuthentication Policy MFA Not Required🔴 CriticalAuthentication Policy created without MFA requirement. CRITICAL: Multi-factor authentication not enforced, accounts vulnerable to credential compromise.
SNW-PWDPOL-RETRIES-UNSETPassword Max Retries Unset🔴 CriticalPassword max retries UNSET. CRITICAL: Reverts to default, may allow unlimited login attempts enabling brute-force attacks.
SNW-PWDPOL-LOCKOUT-UNSETPassword Lockout Unset🔴 CriticalPassword lockout time UNSET. CRITICAL: Reverts to default, may remove account lockout protection enabling brute-force attacks.
SNW-PWDPOL-NEWPassword Policy Created🟡 MediumPassword Policy created. Positive security signal - password controls in place.
SNW-PWDPOL-MINLEN-CRITPassword Policy Critical Weak Min Length🔴 CriticalPassword Policy created with CRITICAL weak minimum length (<8 characters). This violates basic security standards.
SNW-PWDPOL-MINLEN-WEAKPassword Policy Weak Min Length🟠 HighPassword Policy created with weak minimum length (8-11 characters). HIGH: CIS/CISA recommend ≥12 characters (NIST SP 800-63B requires ≥8).
SNW-PWDPOL-COMPLEX-WEAKPassword Policy Weak Complexity🟠 HighPassword Policy created with weak complexity requirements (<2 character classes). HIGH: Passwords may be easily guessable.
SNW-PWDPOL-NOEXPIRYPassword Policy No Expiration🔴 CriticalPassword Policy created with NO expiration (PASSWORD_MAX_AGE_DAYS = 0). CRITICAL: Passwords never expire.
SNW-PWDPOL-EXPIRY-LONGPassword Policy Long Expiration🟠 HighPassword Policy created with long expiration (>180 days). HIGH: Consider shorter expiration period.
SNW-PWDPOL-RETRIES-HIGHPassword Policy High Max Retries🔴 CriticalPassword Policy created with high max retries (>10). CRITICAL: Account brute-force risk.
SNW-PWDPOL-RETRIES-CHGPassword Policy Moderate Max Retries🟠 HighPassword Policy created with moderate max retries (6-10). HIGH: Consider limiting to 5 or fewer.
SNW-PWDPOL-LOCKOUT-SHORTPassword Policy Short Lockout Time🟠 HighPassword Policy created with short lockout time (<5 minutes). HIGH: Account brute-force window too small.
SNW-PWDPOL-NOHISTPassword Policy No History🟠 HighPassword Policy created with NO history (PASSWORD_HISTORY = 0). HIGH: Users can reuse passwords immediately.
SNW-PWDPOL-MINLEN-CRITWEAKPassword Min Length Set to Weak🔴 CriticalPassword minimum length SET to CRITICAL weak value (<8). This violates basic security standards.
SNW-PWDPOL-MINLEN-WEAKENPassword Min Length Weakened🟠 HighPassword minimum length weakened (8-11 characters). HIGH: CIS/CISA recommend ≥12 characters (NIST SP 800-63B requires ≥8).
SNW-PWDPOL-EXPIRY-OFFPassword Expiration Disabled🔴 CriticalPassword expiration DISABLED (PASSWORD_MAX_AGE_DAYS = 0). CRITICAL: Passwords never expire.
SNW-PWDPOL-EXPIRY-LONGSETPassword Expiration Set to Long🟠 HighPassword expiration SET to long duration (>180 days). HIGH: Consider shorter period.
SNW-PWDPOL-RETRIES-INCRPassword Max Retries Increased🔴 CriticalPassword max retries INCREASED (>10). CRITICAL: Account brute-force risk significantly increased.
SNW-PWDPOL-LOCKOUT-CUTPassword Lockout Time Shortened🟠 HighPassword lockout time SHORTENED (<5 minutes). HIGH: Brute-force attack window reduced too much.
SNW-PWDPOL-HIST-OFFPassword History Disabled🟠 HighPassword history DISABLED (PASSWORD_HISTORY = 0). HIGH: Users can reuse passwords immediately.
SNW-PWDPOL-MINLEN-UNSETPassword Minimum Length Unset🔴 CriticalPassword minimum length UNSET. CRITICAL: Reverts to default (8 characters), weakening security.
SNW-PWDPOL-EXPIRY-UNSETPassword Expiration Unset🔴 CriticalPassword expiration UNSET. CRITICAL: Reverts to default, may remove expiration entirely.
SNW-PWDPOL-NAME-CHGPassword Policy Renamed🟠 HighPassword Policy renamed. HIGH: This may break user/role assignments referencing this policy.
SNW-PWDPOL-DROPPassword Policy Dropped🔴 CriticalPassword Policy dropped. CRITICAL: Password strength controls removed. Verify this doesn't weaken authentication security.
SNW-PWDPOL-TAG-ADDPassword Policy Tag Set🟢 LowPassword Policy tag set. Positive governance signal — metadata tag added.
SNW-PWDPOL-TAG-RMVPassword Policy Tag Removed🟡 MediumPassword Policy tag removed. Governance metadata lost. Verify this is intentional.
SNW-PWDPOL-COMMENT-RMVPassword Policy Comment Removed🟢 LowComment removed from Password Policy. Documentation lost.
SNW-PWDPOL-MINLEN-CFGPassword Policy Min Length Configured🟢 LowPassword Policy minimum length configured. Positive governance signal.
SNW-PWDPOL-COMPLEX-CFGPassword Policy Complexity Configured🟢 LowPassword Policy complexity requirements configured. Positive governance signal.
SNW-PWDPOL-LOCKOUT-CFGPassword Policy Lockout Configured🟢 LowPassword Policy lockout configured. Positive governance signal — brute-force protection active.
SNW-PWDPOL-HIST-CFGPassword Policy History Configured🟢 LowPassword Policy history configured. Positive governance signal — password reuse prevented.
SNW-PWDPOL-EXPIRY-CFGPassword Policy Expiration Configured🟢 LowPassword Policy expiration configured. Passwords will expire per policy.
SNW-PWDPOL-EXPIRY-FAIRPassword Policy Moderate Expiration🟢 LowPassword Policy has moderate expiration period (30-89 days). Consider tighter expiration for sensitive environments.
SNW-PWDPOL-EXPIRY-STALEPassword Policy Long Expiration🟡 MediumPassword Policy has long expiration period (>=90 days). Passwords remain valid for extended periods.
SNW-PWDPOL-LOCKOUT-WEAKPassword Policy Short Lockout🟡 MediumPassword Policy has short lockout time (<5 minutes). Brute-force attacks have reduced penalty window.
SNW-PWDPOL-MAXLEN-LOWPassword Policy Max Length Restrictive🟡 MediumPassword Policy has restrictive maximum length. Users cannot create long, complex passwords.
SNW-AGGPOL-NEWAggregation Policy Created🟠 HighAggregation Policy created. HIGH: This controls minimum group sizes for aggregation queries to prevent small group disclosures. Verify MIN_GROUP_SIZE is adequate for your privacy requirements.
SNW-AGGPOL-NOCONSTAggregation Policy No Aggregation Constraint🔴 CriticalAggregation Policy uses NO_AGGREGATION_CONSTRAINT. CRITICAL: This removes all aggregation protections, allowing small group queries that may disclose sensitive information.
SNW-AGGPOL-GRPSZ-CRITAggregation Policy Min Group Size Critical🔴 CriticalAggregation Policy has dangerously low MIN_GROUP_SIZE (< 3). CRITICAL: Groups smaller than 3 can easily lead to re-identification.
SNW-AGGPOL-GRPSZ-LOWAggregation Policy Min Group Size Low🟠 HighAggregation Policy has low MIN_GROUP_SIZE (3-4). HIGH: While better than 1-2, groups of 3-4 still pose re-identification risks.
SNW-AGGPOL-GRPSZ-STRONGAggregation Policy Strong Min Group Size🟢 LowAggregation Policy has strong MIN_GROUP_SIZE (≥10). LOW: Good privacy protection. This significantly reduces re-identification risk.
SNW-AGGPOL-CONDAggregation Policy Uses Conditional Logic🟡 MediumAggregation Policy uses conditional logic (CASE expressions). MEDIUM: Conditional policies can have different protections for different scenarios. Verify all branches have adequate MIN_GROUP_SIZE values.
SNW-AGGPOL-NOCONST-CHGAggregation Policy Changed to No Constraint🔴 CriticalAggregation Policy body changed to NO_AGGREGATION_CONSTRAINT. CRITICAL: Protection removed entirely. This exposes data to unrestricted aggregation queries.
SNW-AGGPOL-TAG-ADDAggregation Policy Tag Set🟢 LowAggregation Policy tag set. LOW: Metadata tag added to policy. Informational only.
SNW-AGGPOL-TAG-RMVAggregation Policy Tag Removed🟡 MediumAggregation Policy tag removed. Governance metadata lost. Verify this is intentional.
SNW-AGGPOL-COMMENT-ADDAggregation Policy Comment Set🟢 LowComment added to Aggregation Policy. Positive documentation signal.
SNW-AGGPOL-COMMENT-RMVAggregation Policy Comment Removed🟢 LowComment removed from Aggregation Policy. Documentation lost.
SNW-AGGPOL-CHGAggregation Policy Altered🟡 MediumAggregation Policy altered. MEDIUM: Policy modified. Review changes to ensure they maintain adequate privacy protections.
SNW-AGGPOL-NAME-CHGAggregation Policy Renamed🟡 MediumAggregation Policy renamed. MEDIUM: Policy name changed. Verify references to this policy are updated in dependent objects and documentation.
SNW-AGGPOL-DROPAggregation Policy Dropped🔴 CriticalAggregation Policy dropped. CRITICAL: Aggregation protections removed. This removes minimum group size constraints, potentially exposing sensitive data through small group aggregations.
SNW-PROJPOL-NEWProjection Policy Created🟢 LowProjection policy created. Column visibility controls configured.
SNW-PROJPOL-DROPProjection Policy Dropped🟠 HighProjection policy dropped. Column visibility controls removed.
SNW-PROJPOL-CHGProjection Policy Modified🟡 MediumProjection policy modified. Review changes to ensure column visibility controls remain adequate.
SNW-PROJPOL-NAME-CHGProjection Policy Renamed🟡 MediumProjection policy renamed. Verify references to this policy are updated in dependent objects.
SNW-PROJPOL-ALLOWLISTProjection Policy Allow List Configured🟡 MediumProjection policy uses PROJECTION_CONSTRAINT with ALLOW list. Verify the allowed projections are appropriate for data sensitivity.
SNW-PROJPOL-ENFORCE-OFFProjection Policy Enforcement Disabled🔴 CriticalProjection policy enforcement disabled (ENFORCEMENT = 'NONE'). CRITICAL: Column visibility controls are not enforced.
SNW-PROJPOL-ENFORCE-ONProjection Policy Enforcement Enabled🟢 LowProjection policy enforcement enabled. Positive governance signal — column visibility controls are active.
SNW-PROJPOL-CONDProjection Policy Uses Conditional Logic🟡 MediumProjection policy uses conditional logic (CASE expressions). Verify all branches maintain appropriate column visibility controls.
SNW-PROJPOL-TAG-ADDProjection Policy Tag Set🟢 LowProjection Policy tag set. Positive governance signal — metadata tag added.
SNW-PROJPOL-TAG-RMVProjection Policy Tag Removed🟡 MediumProjection Policy tag removed. Governance metadata lost. Verify this is intentional.
SNW-PROJPOL-COMMENT-ADDProjection Policy Comment Set🟢 LowComment added to Projection Policy. Positive documentation signal.
SNW-PROJPOL-COMMENT-RMVProjection Policy Comment Removed🟢 LowComment removed from Projection Policy. Documentation lost.
SNW-UNKNOWNUnknown Syntax Detected🟠 HighUnknown syntax detected. Cannot verify compliance for this statement. Review against latest Snowflake documentation.
SNW-EXPORT-UNBOUNDEDUnbounded Data Export🟠 HighCOPY INTO exports data to external location without filtering. Full table contents may be exposed.
SNW-STG-DROPStage Dropped🟡 MediumDROP STAGE detected. Stage and any staged files will be removed.
SNW-DB-FROM-SHAREDatabase Created From Share🟠 HighDatabase created from share. Data is being accessed from external provider. Verify data governance compliance.
SNW-DB-REPLICADatabase Created As Replica🟡 MediumDatabase created as replica. Data is being replicated from another region/account.
SNW-DB-SWAPDatabase Swapped🟠 HighDatabase swapped with another database. All objects exchanged between databases. Verify access controls.
SNW-DB-RETENTION-CHGDatabase Data Retention Changed🟠 HighDatabase data retention period changed. Time Travel and Fail-safe capabilities may be affected.
SNW-DB-REPL-ONDatabase Replication Enabled🟠 HighDatabase replication enabled. Data will be replicated to other accounts/regions. Verify compliance with data residency requirements.
SNW-DB-REPL-OFFDatabase Replication Disabled🟠 HighDatabase replication disabled. Disaster recovery capabilities reduced.
SNW-DB-FAILOVER-ONDatabase Failover Enabled🟡 MediumDatabase failover enabled. Account can be promoted as failover target.
SNW-DB-FAILOVER-OFFDatabase Failover Disabled🟠 HighDatabase failover disabled. Disaster recovery failover capability removed.
SNW-DB-FAILOVER-PROMOTEDatabase Failover Promoted🔴 CriticalCRITICAL: Database promoted to primary. This is a failover event. The database is now writable and replication direction has changed.
SNW-DB-REFRESHDatabase Refreshed🟡 MediumDatabase refresh initiated from primary. Local changes may be overwritten.
SNW-SCHEMA-MGDACC-NEWSchema Created With Managed Access🟢 LowSchema created with MANAGED ACCESS. Centralized privilege management enabled - only schema owner can grant privileges.
SNW-SCHEMA-DROPSchema Dropped (Specific)🔴 CriticalDROP SCHEMA detected. CRITICAL: All tables, views, and objects within the schema will be permanently deleted.
SNW-SCHEMA-SWAPSchema Swapped🟠 HighSchema swapped with another schema. All objects exchanged between schemas. Verify access controls.
SNW-SCHEMA-RETENTION-CHGSchema Data Retention Changed🟠 HighSchema data retention period changed. Time Travel and Fail-safe capabilities for all objects in schema may be affected.
SNW-SCHEMA-MGDACC-ONSchema Managed Access Enabled🟢 LowSchema MANAGED ACCESS enabled. Centralized privilege management now active - only schema owner can grant privileges on objects.
SNW-SCHEMA-MGDACC-OFFSchema Managed Access Disabled🟠 HighSchema MANAGED ACCESS disabled. Object owners can now grant privileges. Review privilege grants for compliance.
SNW-DYNTBL-NEWDynamic Table Created🟢 LowDynamic table created. Materialized view with automatic refresh.
SNW-DYNTBL-PARSE-ERRDynamic Table Query Parse Error🟡 MediumDynamic table query could not be parsed. Lineage extraction incomplete.
SNW-DYNTBL-DROPDynamic Table Dropped🟠 HighDynamic table dropped. Materialized view and automatic refresh removed.
SNW-DYNTBL-SUSPDynamic Table Suspended🟢 LowDynamic table suspended. Automatic refresh paused.
SNW-DYNTBL-RESUMEDynamic Table Resumed🟢 LowDynamic table resumed. Automatic refresh reactivated.
SNW-DYNTBL-NAME-CHGDynamic Table Renamed🟡 MediumDynamic table renamed. Update dependent references.
SNW-DYNTBL-SWAPDynamic Table Swapped🟡 MediumDynamic table swapped with another. Verify data integrity.
SNW-DYNTBL-TAG-ADDDynamic Table Tag Set🟢 LowTag set on dynamic table. Positive governance signal for metadata tracking.
SNW-DYNTBL-TAG-RMVDynamic Table Tag Removed🟡 MediumTag removed from dynamic table. Verify governance metadata tracking is maintained.
SNW-DYNTBL-RAP-ADDDynamic Table Row Access Policy Applied🟡 MediumRow access policy applied to dynamic table. Access controls configured.
SNW-DYNTBL-RAP-RMVDynamic Table Row Access Policy Removed🟠 HighRow access policy removed from dynamic table. Access controls weakened.
SNW-DYNTBL-MASK-ADDDynamic Table Masking Policy Applied🟡 MediumMasking policy applied to dynamic table column. Data protection configured.
SNW-DYNTBL-MASK-RMVDynamic Table Masking Policy Removed🟠 HighMasking policy removed from dynamic table column. Data protection weakened.
SNW-TASK-NEWTask Created🟢 LowScheduled task created. Automated SQL execution configured.
SNW-TASK-DROPTask Dropped🟠 HighScheduled task dropped. Automated workflow removed.
SNW-TASK-RESUMETask Resumed🟡 MediumTask resumed. Automated execution is now active.
SNW-TASK-SUSPENDTask Suspended🟢 LowTask suspended. Automated execution paused.
SNW-TASK-BODY-CHGTask Body Modified🟡 MediumTask SQL body modified. Review the new logic for correctness.
SNW-TASK-DEP-CHGTask Dependencies Modified🟡 MediumTask dependency chain modified. Verify DAG execution order.
SNW-TASK-EXECASTask Execute Privilege Configured🟠 HighTask EXECUTE AS configured. Verify privilege escalation is intentional.
SNW-TASK-PARSE-ERRTask Body Parse Error🟡 MediumTask body SQL could not be parsed. Lineage extraction incomplete.
SNW-STREAM-NEWStream Created🟢 LowStream created. CDC tracking enabled on source object.
SNW-STREAM-DROPStream Dropped🟠 HighStream dropped. CDC tracking removed - downstream consumers may be affected.
SNW-STREAM-APPENDONLYStream Append Only Mode🟢 LowStream configured with APPEND_ONLY mode. Only INSERT operations will be tracked.
SNW-STREAM-INSERTONLYStream Insert Only Mode🟢 LowStream configured with INSERT_ONLY mode for external table.

BigQuery (BQ-xxx)

Rule IDNameRiskDescription
BQ-EXPORT-UNBOUNDEDUnbounded Data Export (BigQuery)🟠 HighEXPORT DATA exports query results to external storage without WHERE filtering. Full table contents may be exposed.
BQ-EXPORT-AWS-LEAKHardcoded AWS Key in EXPORT DATA🔴 CriticalHardcoded AWS access key detected in EXPORT DATA statement. Use secure credential management instead.
BQ-EXPORT-PWD-LEAKHardcoded Password in EXPORT DATA🔴 CriticalHardcoded password detected in EXPORT DATA statement. Use secure parameter passing instead.
BQ-EXPORT-APIKEY-LEAKHardcoded API Key in EXPORT DATA🔴 CriticalHardcoded API key or access token detected in EXPORT DATA statement. Store API keys in secure secrets managers.
BQ-EXPORT-CONNSTR-LEAKHardcoded Connection String in EXPORT DATA🔴 CriticalConnection string with embedded credentials detected in EXPORT DATA statement. Use secure credential storage.
BQ-LOAD-EXTSTOREExternal Cloud Storage in LOAD DATA (BigQuery)🟡 MediumLOAD DATA references external cloud storage (GCS/S3/Azure). Verify source data integrity and access controls.
BQ-LOAD-AWS-LEAKHardcoded AWS Key in LOAD DATA🔴 CriticalHardcoded AWS access key detected in LOAD DATA statement. Use secure credential management instead.
BQ-LOAD-PWD-LEAKHardcoded Password in LOAD DATA🔴 CriticalHardcoded password detected in LOAD DATA statement. Use secure parameter passing instead.
BQ-LOAD-APIKEY-LEAKHardcoded API Key in LOAD DATA🔴 CriticalHardcoded API key or access token detected in LOAD DATA statement. Store API keys in secure secrets managers.
BQ-LOAD-CONNSTR-LEAKHardcoded Connection String in LOAD DATA🔴 CriticalConnection string with embedded credentials detected in LOAD DATA statement. Use secure credential storage.
BQ-SNAP-TBL-NEWSnapshot Table Created🟢 LowSnapshot table created. Point-in-time clone of source table.
BQ-SNAP-TBL-DROPSnapshot Table Dropped🟡 MediumSnapshot table dropped. Point-in-time recovery path removed for this dataset.
BQ-SEARCHIDX-NEWSearch Index Created🟢 LowSearch index created for full-text search capabilities.
BQ-SEARCHIDX-DROPSearch Index Dropped🟡 MediumSearch index dropped. Full-text search performance on this table may degrade.
BQ-VECIDX-NEWVector Index Created🟢 LowVector index created for ML embedding similarity search.
BQ-VECIDX-CHGVector Index Modified🟢 LowVector index modified (e.g., REBUILD). Validate embedding search quality/performance baselines.
BQ-VECIDX-DROPVector Index Dropped🟡 MediumVector index dropped. ML embedding search performance on this table may degrade.
BQ-EXTTBL-EXTSTOREExternal Cloud Storage in External Table (BigQuery)🟡 MediumCREATE EXTERNAL TABLE references external cloud storage (GCS/S3/Azure). Verify source integrity and access boundaries.
BQ-EXTTBL-AWS-LEAKHardcoded AWS Key in External Table🔴 CriticalHardcoded AWS access key detected in CREATE EXTERNAL TABLE. Use secure credential management instead.
BQ-EXTTBL-PWD-LEAKHardcoded Password in External Table🔴 CriticalHardcoded password detected in CREATE EXTERNAL TABLE. Use secure parameter passing instead.
BQ-EXTTBL-APIKEY-LEAKHardcoded API Key in External Table🔴 CriticalHardcoded API key or access token detected in CREATE EXTERNAL TABLE. Store API keys in secure secrets managers.
BQ-EXTTBL-CONNSTR-LEAKHardcoded Connection String in External Table🔴 CriticalConnection string with embedded credentials detected in CREATE EXTERNAL TABLE. Use secure credential storage.
BQ-MODEL-NEWML Model Created🟢 LowBigQuery ML model created. Training data pipeline established.
BQ-MODEL-DROPML Model Dropped🟡 MediumBigQuery ML model dropped. Dependent prediction queries will fail.
BQ-MODEL-CHGML Model Modified🟢 LowBigQuery ML model options modified.
BQ-MODEL-EXPORTML Model Exported🟡 MediumBigQuery ML model exported to external storage. Model artifacts leaving BigQuery.
BQ-MODEL-UNBOUNDEDUnbounded BQML Training Query🟠 HighBQML training query has no WHERE/filter conditions. Model may train on unintended full datasets.
BQ-MODEL-EXPORT-EXTSTOREExternal Cloud Storage in EXPORT MODEL (BigQuery)🟡 MediumEXPORT MODEL writes artifacts to external cloud storage. Verify destination boundaries and retention controls.
BQ-MODEL-AWS-LEAKHardcoded AWS Key in BQML Statement🔴 CriticalHardcoded AWS access key detected in CREATE/ALTER/EXPORT MODEL. Use secure credential management instead.
BQ-MODEL-PWD-LEAKHardcoded Password in BQML Statement🔴 CriticalHardcoded password detected in CREATE/ALTER/EXPORT MODEL. Use secure parameter passing instead.
BQ-MODEL-APIKEY-LEAKHardcoded API Key in BQML Statement🔴 CriticalHardcoded API key or access token detected in CREATE/ALTER/EXPORT MODEL. Store API keys in secure secrets managers.
BQ-MODEL-CONNSTR-LEAKHardcoded Connection String in BQML Statement🔴 CriticalConnection string with embedded credentials detected in CREATE/ALTER/EXPORT MODEL. Use secure credential storage.
BQ-ASSERT-CFGASSERT Statement Present🟢 LowASSERT statement present. Data quality/runtime invariant check is enforced.
BQ-ASSERT-NODESCASSERT Missing Description🟢 LowASSERT statement missing descriptive message. Failures may be harder to triage in logs and runtime pipelines.
BQ-MODEL-REMOTEML Model Remote Connection🟠 HighBigQuery ML model uses REMOTE WITH CONNECTION. Model calls external endpoint — review connection security and data exposure.

PostgreSQL (PG-xxx)

Rule IDNameRiskDescription
PG-RLS-CHGPG RLS Policy Modified🟡 MediumRow-level security policy modified. Review the updated USING/WITH CHECK expressions to ensure data access remains correctly restricted.
PG-RLS-NAME-CHGPG RLS Policy Renamed🟢 LowRow-level security policy renamed. Verify dependent references are updated.
PG-RLS-DROPPG RLS Policy Dropped🔴 CriticalRow-level security policy dropped. CRITICAL: Row-level data protection removed. All rows may become visible to users who were previously restricted.
PG-RLS-CASCADE-DROPPG RLS Policy Dropped with CASCADE🔴 CriticalRow-level security policy dropped with CASCADE. CRITICAL: Cascading removal may affect dependent objects beyond this policy.
PG-RLS-PERMISSIVEPG RLS Policy Is Permissive🟡 MediumRLS policy created as PERMISSIVE. Multiple permissive policies are combined with OR, which may be less restrictive than intended. Consider RESTRICTIVE policies for tighter control.
PG-RLS-WEAK-CHECKPG RLS Policy Allow-All Write Check🔴 CriticalPostgreSQL RLS policy WITH CHECK expression is always true. CRITICAL: Policy does not restrict write operations — any row can be inserted or updated.
PG-TRIG-NEWPG Trigger Created🟡 MediumTrigger created. Triggers execute automatically and can have significant performance and security implications. Review the trigger function.
PG-TRIG-NAME-CHGPG Trigger Renamed🟢 LowTrigger renamed. Update any references to this trigger.
PG-TRIG-CHGPG Trigger Modified🟡 MediumTrigger altered (dependency changed). Review the updated trigger configuration.
PG-TRIG-DROPPG Trigger Dropped🟠 HighTrigger dropped. Automated logic previously enforced by this trigger will no longer execute. Verify data integrity.
PG-TRIG-CASCADE-DROPPG Trigger Dropped with CASCADE🔴 CriticalTrigger dropped with CASCADE. Cascading removal may affect dependent objects.
PG-COPY-FROMPG COPY FROM (Data Import)🟡 MediumCOPY FROM imports data into a table. Verify the data source is trusted and the target table is correct.
PG-COPY-TOPG COPY TO (Data Export)🟠 HighCOPY TO exports data from a table. This may expose sensitive data — verify authorization and destination.
PG-COPY-PROGRAMPG COPY PROGRAM (Shell Execution)🔴 CriticalCOPY with PROGRAM executes a shell command on the server. CRITICAL SECURITY RISK: This allows arbitrary command execution with database server privileges.
PG-DOMAIN-NOTNULL-DROPPG Domain NOT NULL Dropped🟠 HighNOT NULL constraint removed from domain. Columns using this domain may now accept NULL values, potentially causing data quality issues.
PG-DOMAIN-CONSTR-DROPPG Domain Constraint Dropped🟠 HighConstraint removed from domain. Data validation enforced by this constraint is no longer active.
PG-DOMAIN-CONSTR-CASCADE-DROPPG Domain Constraint Dropped with CASCADE🔴 CriticalDomain constraint dropped with CASCADE. Cascading removal may affect dependent objects and columns.
PG-DOMAIN-CHGPG Domain Modified🟡 MediumDomain altered. Review changes to ensure data type semantics remain correct.
PG-DOMAIN-NAME-CHGPG Domain Renamed🟢 LowDomain renamed. Verify all dependent columns and types reference the new name.
PG-DOMAIN-OWNER-CHGPG Domain Owner Changed🟡 MediumDomain ownership changed. Verify the new owner has appropriate permissions.
PG-DOMAIN-DROPPG Domain Dropped🟠 HighDomain dropped. Columns using this domain type will be affected.
PG-DOMAIN-CASCADE-DROPPG Domain Dropped with CASCADE🔴 CriticalDomain dropped with CASCADE. All dependent columns, constraints, and types will be removed.
PG-SYS-CFG-CHGPG ALTER SYSTEM (Server Config Change)🔴 CriticalALTER SYSTEM modifies server-level configuration parameters. CRITICAL: This affects all databases and users on the server. Changes take effect after reload/restart.
PG-TBLSPC-CHGPG ALTER TABLESPACE (Storage Configuration Change)🟡 MediumALTER TABLESPACE modifies storage configuration (location, options, ownership). Review impact on I/O performance and storage allocation.
PG-OWNED-DROPPG DROP OWNED (Mass Object Removal)🔴 CriticalDROP OWNED removes all objects owned by the specified roles. CRITICAL: This is a mass deletion operation that can cause significant data loss.
PG-OWNED-REASSIGNPG REASSIGN OWNED (Ownership Transfer)🟠 HighREASSIGN OWNED transfers ownership of all objects from one role to another. Verify the target role has appropriate permissions.
PG-IDX-NAME-CHGPG Index Renamed🟢 LowIndex renamed. Update any references to this index.
PG-IDX-CHGPG Index Modified🟡 MediumIndex altered (tablespace or properties changed). Review impact on query performance.
PG-IDX-REBUILDPG REINDEX🟡 MediumREINDEX rebuilds indexes. This may cause temporary performance impact and lock contention.
PG-MATVIEW-REFRESHPG Materialized View Refreshed🟢 LowMaterialized view refreshed. This rebuilds the cached data from the underlying query.
PG-TBL-LOCKPG LOCK TABLE🟠 HighExplicit table lock acquired. This can cause blocking and deadlocks. Verify the lock mode is appropriate.
PG-SESSION-DISCARDPG DISCARD (Session State Reset)🟡 MediumDISCARD resets session state (plans, sequences, temporary objects). Verify this is intentional.
PG-RULE-NEWPG CREATE RULE (Query Rewrite)🟠 HighCREATE RULE defines a query rewrite rule. Rules silently transform queries, which can lead to unexpected behavior. Consider triggers as a more transparent alternative.
PG-PUB-CHGPG Publication Modified🟡 MediumLogical replication publication modified. Changes affect which data is replicated to subscribers.
PG-SUB-CHGPG Subscription Modified🟡 MediumLogical replication subscription modified. Changes affect data replication from the publisher.
PG-ANON-EXECPG Anonymous Code Block Executed🟠 HighDO $ block executes anonymous code. Cannot be tracked by name, audited, or rolled back. Review for privilege escalation, data modification, and unintended side effects.
PG-EXT-NEWPG Extension Installed🟠 HighCREATE EXTENSION installs server-side code (C functions, operators, types). Some extensions (e.g. dblink, postgres_fdw, pg_stat_statements) grant powerful capabilities. Requires superuser or trusted extension support.
PG-EXT-CASCADE-NEWPG Extension Installed with CASCADE🔴 CriticalCREATE EXTENSION ... CASCADE installs the extension AND all its dependencies automatically. Dependencies are installed without explicit review, increasing the attack surface.
PG-ROLE-NEWRole Created🟡 MediumCREATE ROLE/USER adds a new database principal. Review granted privileges, login capability, and role membership to prevent privilege creep.
PG-ROLE-CHGRole Modified🟠 HighALTER ROLE/USER modifies a database principal's attributes. Changes to privilege flags (SUPERUSER, CREATEDB, CREATEROLE, REPLICATION, LOGIN) can significantly affect security posture.
PG-ROLE-DROPRole Dropped🟠 HighDROP ROLE/USER removes a database principal. Dependent objects (owned tables, grants) may become inaccessible. Use REASSIGN OWNED before dropping.
PG-EXT-DROPExtension Dropped🟠 HighDROP EXTENSION removes a PostgreSQL extension. Security extensions (pgcrypto, pg_audit) may be silently removed, weakening data protection.
PG-EXT-CASCADE-DROPExtension Dropped with CASCADE🔴 CriticalDROP EXTENSION ... CASCADE removes the extension AND all dependent objects. This can silently drop functions, views, and columns that depend on extension types.
PG-RULE-CHGRule Modified🟡 MediumALTER RULE modifies a PostgreSQL query rewrite rule. Rules can redirect INSERT/UPDATE/DELETE to different tables, affecting data integrity.
PG-RULE-DROPRule Dropped🟠 HighDROP RULE removes a query rewrite rule. If the rule enforced data routing or security constraints, those protections are removed.
PG-RULE-CASCADE-DROPRule Dropped with CASCADE🟠 HighDROP RULE ... CASCADE removes the rule AND all dependent objects. Cascading drops can affect data integrity constraints.
PG-TRIG-OFFTrigger Disabled🔴 CriticalALTER TABLE ... DISABLE TRIGGER disables a trigger. CRITICAL: Audit triggers, referential integrity triggers, and security enforcement triggers will stop firing. This is a common attack vector.
PG-ROLE-SETSession Role Changed🟠 HighSET ROLE or SET SESSION AUTHORIZATION changes the current session identity. This can escalate privileges or impersonate other users.
PG-SESSION-CHGSession State Changed🟡 MediumSET or RESET modifies session configuration (search_path, etc.). search_path changes can enable schema hijacking attacks.
PG-SESSION-SETSession Parameter Set🟢 LowSET modifies a session configuration parameter.
PG-IDX-DROPIndex Dropped🟢 LowDROP INDEX removes an index. May degrade query performance on dependent queries.
PG-IDX-CASCADE-DROPIndex Dropped with CASCADE🟡 MediumDROP INDEX ... CASCADE removes an index and all dependent objects.
PG-SEQ-DROPSequence Dropped🟢 LowDROP SEQUENCE removes a sequence generator. Columns using this sequence for defaults will break.
PG-SEQ-CASCADE-DROPSequence Dropped with CASCADE🟡 MediumDROP SEQUENCE ... CASCADE removes the sequence and all dependent objects (columns with DEFAULT nextval, etc.).
PG-TYPE-DROPType Dropped🟢 LowDROP TYPE removes a user-defined type. Columns or functions using this type will break.
PG-TYPE-CASCADE-DROPType Dropped with CASCADE🟡 MediumDROP TYPE ... CASCADE removes the type and all dependent columns, functions, and casts.
PG-TBLSPC-NEWTablespace Created🟢 LowCREATE TABLESPACE defines a new storage location for database objects.
PG-TBLSPC-DROPTablespace Dropped🟡 MediumDROP TABLESPACE removes a storage location. Objects in this tablespace must be relocated first.

Databricks (DBX-xxx)

Rule IDNameRiskDescription
DBX-SCHEMA-MGLOCSchema Managed Location Set🟡 MediumSchema created with MANAGED LOCATION. Data storage location overrides catalog/metastore default. Verify external location permissions.
DBX-SCHEMA-LOCSchema Location Set🟢 LowSchema created with custom LOCATION. Data will be stored at specified path instead of default warehouse directory.
DBX-SCHEMA-OWNER-CHGSchema Ownership Transferred🟠 HighSchema ownership transferred via OWNER TO. New owner gains full control including DROP privileges. Verify authorization.
DBX-SCHEMA-PREDOPT-CHGSchema Predictive Optimization Changed🟢 LowSchema predictive optimization setting changed. This affects automatic optimization behavior for objects in the schema.
DBX-SCHEMA-COLLAT-CHGSchema Default Collation Changed🟢 LowSchema default collation changed. New objects in the schema will use the updated collation. Existing objects are not affected.
DBX-SCHEMA-DBPROPS-CHGSchema DBPROPERTIES Modified🟡 MediumSchema DBPROPERTIES modified. Database properties affect schema metadata and may impact behavior.
DBX-TBL-OPTDelta Table Optimization🟢 LowOPTIMIZE compacts small files in a Delta table. May be resource-intensive on large tables — schedule during off-peak hours.
DBX-VACUUM-ZEROVACUUM with Zero Retention🔴 CriticalVACUUM RETAIN 0 HOURS. CRITICAL: All historical data files will be permanently deleted immediately, destroying time travel capability and breaking any concurrent operations. This is irreversible data loss.
DBX-VACUUM-LOWRETVACUUM with Low Retention🟠 HighVACUUM with retention period below 7 days (168 hours). This may delete data files needed for time travel or concurrent operations, leading to data loss or query failures.
DBX-TBL-CLUSTER-OFFClustering Removed (CLUSTER BY NONE)🟠 HighCLUSTER BY NONE disables liquid clustering on a Delta table. Newly inserted or updated data will no longer be clustered, degrading query performance over time. OPTIMIZE will no longer recluster data. Verify this is intentional.
DBX-TBL-RESTOREDelta Table Restore🟠 HighRESTORE reverts a Delta table to a previous version. This is a data-modifying operation that replaces the current table state with a prior snapshot — downstream consumers may see unexpected data.
DBX-CAT-NEWCatalog Created🟢 LowCREATE CATALOG provisions a new Unity Catalog namespace. All schemas, tables, and other objects within will inherit its permissions and default settings.
DBX-CAT-OWNER-CHGCatalog Ownership Transfer🟠 HighALTER CATALOG ... OWNER TO transfers full administrative control of the catalog. The new owner gains MANAGE permissions on all objects within. Verify the target principal is authorized.
DBX-CAT-CASCADE-DROPCatalog Dropped with CASCADE🔴 CriticalDROP CATALOG CASCADE destroys the catalog AND all contained schemas, tables, views, and functions. This is an irreversible bulk data-loss operation.
DBX-CAT-DROPCatalog Dropped🟠 HighDROP CATALOG removes a Unity Catalog namespace. The catalog must be empty unless CASCADE is specified. Verify no downstream dependencies exist.
DBX-CAT-TAG-CHGCatalog Tags Modified🟡 MediumCatalog-level tags modified. Tags control governance policies (masking, row filters) across all objects in the catalog. Verify tag values are intentional.
DBX-CAT-TAG-RMVCatalog Tags Removed🟡 MediumCatalog-level tags removed. Removing tags may disable governance policies (masking, row filtering) that depend on them.
DBX-CAT-PREDOPT-CHGCatalog Predictive Optimization Changed🟢 LowPredictive optimization setting changed on catalog. This affects automatic maintenance operations (OPTIMIZE, VACUUM) for all tables within the catalog.
DBX-VOL-NEWVolume Created🟢 LowCREATE VOLUME provisions a new Unity Catalog volume for file storage. External volumes reference cloud storage; managed volumes are fully governed by Unity Catalog.
DBX-VOL-OWNER-CHGVolume Ownership Transfer🟠 HighALTER VOLUME ... OWNER TO transfers full administrative control of the volume. The new owner gains MANAGE permissions on the volume and its contents.
DBX-VOL-DROPVolume Dropped🟠 HighDROP VOLUME removes a Unity Catalog volume. Managed volumes lose stored files after 7 days; external volumes lose only metadata. This cannot be undone.
DBX-VOL-NAME-CHGVolume Renamed🟡 MediumALTER VOLUME ... RENAME TO changes the volume name. Existing file paths referencing /Volumes/catalog/schema/old_name will break.
DBX-VOL-TAG-CHGVolume Tags Modified🟢 LowVolume-level tags modified. Tags enable governance classification and policy enforcement on the volume.
DBX-VOL-TAG-RMVVolume Tags Removed🟡 MediumVolume-level tags removed. Removing tags may disable governance policies that depend on them for the volume.
DBX-GRT-CAT-ALLPRIVGrant All Privileges on Catalog🔴 CriticalGRANT ALL PRIVILEGES ON CATALOG detected. This grants every privilege on the entire Unity Catalog namespace — including all schemas, tables, views, and volumes within it. Use fine-grained grants (e.g., USE CATALOG, CREATE SCHEMA) instead.
DBX-GRT-CAT-MANAGEGrant MANAGE on Catalog🔴 CriticalGRANT MANAGE ON CATALOG detected. MANAGE provides broad administrative control over Unity Catalog objects and permissions. Verify this grant is explicitly approved.
DBX-GRT-SCHEMA-MANAGEGrant MANAGE on Schema🟠 HighGRANT MANAGE ON SCHEMA detected. MANAGE allows delegated privilege administration within the schema. Ensure least-privilege scope and approval.
DBX-GRT-VOL-MANAGEGrant MANAGE on Volume🟠 HighGRANT MANAGE ON VOLUME detected. This enables broad administration over Unity Catalog volume access and metadata. Verify governance intent.
DBX-RVK-CAT-ALLPRIVRevoke All Privileges on Catalog🟠 HighREVOKE ALL PRIVILEGES ON CATALOG detected. This can immediately remove broad access and disrupt workloads. Verify blast radius and rollout timing.
DBX-RVK-CAT-MANAGERevoke MANAGE on Catalog🟡 MediumREVOKE MANAGE ON CATALOG detected. Catalog-level administrative control is being removed from a principal. Verify this is expected and staged to avoid operational disruption.
DBX-TBL-CLONE-SHALLOWShallow Clone Created🟡 MediumSHALLOW CLONE created. Shallow clones share underlying data files with the source table — they do not duplicate data. If the source table is VACUUM'd or dropped, the clone may become unreadable. Prefer DEEP CLONE for durable, independent copies.
DBX-EXTLOC-NEWExternal Location Created🟡 MediumExternal location created. This maps a cloud storage path to a Unity Catalog location with a storage credential. Verify the URL and credential are authorized.
DBX-EXTLOC-URL-CHGExternal Location URL Modified🟡 MediumExternal location URL modified. This changes the mapped cloud storage path for the location. Verify the new URL is intended and access boundaries remain correct.
DBX-EXTLOC-CRED-CHGExternal Location Credential Modified🟠 HighExternal location storage credential changed. This alters which cloud principal accesses the storage path. Verify least-privilege access and authorization boundaries.
DBX-EXTLOC-OWNER-CHGExternal Location Ownership Changed🟠 HighExternal location ownership transferred. The new owner gains administrative control over the location and its storage mapping. Verify this transfer is authorized.
DBX-EXTLOC-DROPExternal Location Dropped🟠 HighExternal location dropped. Unity Catalog objects relying on this location may lose access to underlying cloud storage. Verify dependency impact before dropping.
DBX-MERGE-SCHEMA-EVOMerge Schema Evolution Enabled🟡 MediumMERGE WITH SCHEMA EVOLUTION enabled. Target Delta table schema may be automatically altered to match source columns. Validate schema-governance controls and downstream compatibility.
DBX-CRED-NEWStorage Credential Created🟡 MediumStorage credential created. This grants cloud storage access (e.g., IAM role, service account) to Unity Catalog. Verify the credential is authorized and follows least-privilege principles.
DBX-CRED-DROPStorage Credential Dropped🟠 HighStorage credential dropped. External locations and tables depending on this credential will lose access. Verify no active resources depend on this credential.
DBX-CRED-OWNER-CHGStorage Credential Ownership Changed🟠 HighStorage credential ownership transferred. The new owner gains full control over cloud storage access. Verify this transfer is authorized.
DBX-CRED-NAME-CHGStorage Credential Renamed🟡 MediumStorage credential renamed. External locations referencing the old name may need to be updated.
DBX-CONN-NEWConnection Created🟡 MediumExternal connection created. This establishes a federated connection to an external data system (e.g., PostgreSQL, MySQL, Snowflake). Verify the connection type, host, and credentials are authorized.
DBX-CONN-DROPConnection Dropped🟠 HighExternal connection dropped. Foreign catalogs and federated queries depending on this connection will fail. Verify no active resources depend on this connection.
DBX-CONN-OWNER-CHGConnection Ownership Changed🟠 HighExternal connection ownership transferred. The new owner gains full control over the federated connection and its credentials. Verify this transfer is authorized.
DBX-CONN-NAME-CHGConnection Renamed🟡 MediumExternal connection renamed. Foreign catalogs and queries referencing the old connection name may need to be updated.
DBX-CONN-CHGConnection Options Modified🟡 MediumExternal connection options changed. Connection credentials (host, port, password) have been modified. Verify the new options are correct and authorized.
DBX-TBL-PROPS-CHGTable Properties Modified🟡 MediumDelta table properties modified via SET TBLPROPERTIES. Properties like delta.deletedFileRetentionDuration, delta.logRetentionDuration, or delta.appendOnly control data retention, time travel, and mutability. Verify the new values are authorized and won't cause data loss.
DBX-TBL-PROPS-RMVTable Properties Removed🟠 HighDelta table properties removed via UNSET TBLPROPERTIES. Removing properties like delta.deletedFileRetentionDuration or delta.appendOnly resets them to system defaults, which may reduce retention periods or re-enable mutations on append-only tables.
DBX-TBL-CACHETable Cached🟢 LowCACHE TABLE caches a table or query result in Spark's in-memory cache. This consumes cluster memory and may affect other workloads. Schedule during off-peak hours for large tables.
DBX-TBL-UNCACHETable Uncached🟢 LowUNCACHE TABLE removes a table from Spark's in-memory cache. Subsequent queries will read from storage, which may increase latency.
DBX-FLOW-NEWFlow Created🟢 LowCREATE FLOW defines a Lakeflow CDC pipeline (AUTO CDC INTO or APPLY CHANGES INTO). Verify keys, sequencing, and SCD mode align with data governance expectations.
DBX-GRT-CAT-MODIFYGrant MODIFY on Catalog🔴 CriticalGRANT MODIFY ON CATALOG detected. MODIFY in Databricks combines INSERT, UPDATE, and DELETE privileges on ALL current and future tables in the catalog. This is equivalent to granting full DML on every table. Use schema- or table-level grants instead.
DBX-GRT-SCHEMA-MODIFYGrant MODIFY on Schema🟠 HighGRANT MODIFY ON SCHEMA detected. MODIFY combines INSERT, UPDATE, and DELETE on all current and future tables in the schema. Verify this scope is intended.
DBX-GRT-EXTUSE-LOCGrant EXTERNAL USE LOCATION🔴 CriticalGRANT EXTERNAL USE LOCATION detected. This allows temporary credential vending for external processing engines to access Unity Catalog external locations. CRITICAL data exfiltration risk — ALL PRIVILEGES intentionally excludes this privilege.
DBX-GRT-EXTUSE-SCHEMAGrant EXTERNAL USE SCHEMA🔴 CriticalGRANT EXTERNAL USE SCHEMA detected. This allows temporary credential vending for external engines to access tables via Iceberg REST APIs. CRITICAL data exfiltration risk — ALL PRIVILEGES intentionally excludes this privilege.
DBX-GRT-EXTLOC-WRFILESGrant WRITE FILES on External Location🟠 HighGRANT WRITE FILES detected. This allows direct writes to cloud object storage configured as an external location. Databricks recommends using WRITE VOLUME instead for governed access.
DBX-GRT-EXTLOC-RDFILESGrant READ FILES on External Location🟡 MediumGRANT READ FILES detected. This allows direct reads from cloud object storage configured as an external location. Databricks recommends using READ VOLUME instead for governed access.
DBX-GRT-CRED-CREATEGrant CREATE STORAGE CREDENTIAL🟠 HighGRANT CREATE STORAGE CREDENTIAL detected. This allows the grantee to create new cloud storage credentials in the metastore — a highly privileged infrastructure operation.
DBX-GRT-EXTLOC-CREATEGrant CREATE EXTERNAL LOCATION🟠 HighGRANT CREATE EXTERNAL LOCATION detected. This allows the grantee to map new cloud storage paths into Unity Catalog — a privileged infrastructure operation.
DBX-GRT-SHARE-SETPERMGrant SET SHARE PERMISSION🟠 HighGRANT SET SHARE PERMISSION detected. Combined with USE SHARE and USE RECIPIENT, this enables the grantee to share data with external organizations via Delta Sharing. Verify data-sharing authorization.

Informational (INFO-xxx)

Rule IDNameRiskDescription
INFO-Q-PRED-TEMPORALTemporal Query Pattern⚪ InfoTemporal predicate detected using CURRENT_DATE/CURRENT_TIMESTAMP. Results change daily, affecting cache hit rates.
INFO-DB-NEWDatabase Created⚪ InfoDatabase created. New database provisioned.
INFO-DB-UNDROPDatabase Recovered⚪ InfoDatabase recovered using UNDROP. Previously dropped database has been restored.
INFO-SCHEMA-NEWSchema Created⚪ InfoSchema created. New schema provisioned.
INFO-SCHEMA-UNDROPSchema Recovered⚪ InfoSchema recovered using UNDROP. Previously dropped schema has been restored.
INFO-TBL-UNDROPTable Recovered⚪ InfoTable recovered using UNDROP. Previously dropped table has been restored.
INFO-UDF-SECURE-ADDFunction Secured⚪ InfoFunction secured. Function body is now hidden from users without ownership.
INFO-PROC-SECURE-ADDProcedure Secured⚪ InfoProcedure secured. Procedure body is now hidden from users without ownership.
INFO-PG-RLS-NEWPG Row-Level Security Policy Created⚪ InfoRow-level security policy created. Positive governance signal — data access is being restricted at the row level.
INFO-PG-DOMAIN-NEWPG Domain Created⚪ InfoDomain created. Positive governance signal — custom type constraints are being defined.
INFO-PG-DOMAIN-CONSTR-ADDPG Domain Constraint Added⚪ InfoConstraint added to domain. Positive governance signal — data validation is being strengthened.
INFO-PG-TRIG-ONTrigger Enabled⚪ InfoALTER TABLE ... ENABLE TRIGGER restores trigger firing. Positive signal: security/audit enforcement re-activated.
INFO-PG-IDX-NEWIndex Created⚪ InfoCREATE INDEX adds an index. Positive governance signal — improves query performance.
INFO-PG-SEQ-NEWSequence Created⚪ InfoCREATE SEQUENCE defines a new sequence generator.
INFO-PG-SEQ-CHGSequence Modified⚪ InfoALTER SEQUENCE modifies a sequence generator. Changes to INCREMENT, RESTART, or ownership may affect dependent tables.
INFO-PG-TYPE-NEWType Created⚪ InfoCREATE TYPE defines a new composite, enum, or range type.
INFO-PG-TYPE-CHGType Modified⚪ InfoALTER TYPE modifies a user-defined type (add/rename values, change owner, etc.).
INFO-PG-COMMENT-CHGComment Changed⚪ InfoCOMMENT ON modifies object metadata. Positive governance signal — improves documentation.
INFO-PG-MAINT-VACUUMMaintenance Executed (VACUUM)⚪ InfoVACUUM reclaims storage and updates statistics. Routine maintenance operation.
INFO-PG-MAINT-ANALYZEMaintenance Executed (ANALYZE)⚪ InfoANALYZE updates table statistics for the query planner. Routine maintenance operation.
INFO-PG-MAINT-CLUSTERMaintenance Executed (CLUSTER)⚪ InfoCLUSTER reorders table data according to an index. May cause brief lock on the table.
INFO-PG-NOTIFY-SUBNotification Channel Subscribed⚪ InfoLISTEN subscribes to a notification channel.
INFO-PG-NOTIFY-SENDNotification Sent⚪ InfoNOTIFY sends a notification on a channel.
INFO-PG-NOTIFY-UNSUBNotification Channel Unsubscribed⚪ InfoUNLISTEN unsubscribes from a notification channel.
INFO-PG-AGG-NEWAggregate Created⚪ InfoCREATE AGGREGATE defines a new aggregate function.
INFO-PG-OP-NEWOperator Created⚪ InfoCREATE OPERATOR defines a new operator.
INFO-DBX-TBL-HISTDelta Table History Review⚪ InfoDESCRIBE HISTORY retrieves the provenance log for a Delta table. This is a read-only audit operation — no data is modified.
INFO-DBX-TBL-REPAIRPartition Metadata Repair⚪ InfoREPAIR TABLE (MSCK REPAIR TABLE) updates the Hive metastore partition metadata for a partitioned table. This is a metadata maintenance operation; it does not rewrite table data.
INFO-DBX-TBL-CLUSTER-CFGClustering Configured⚪ InfoLiquid clustering configured on Delta table. Run OPTIMIZE to apply clustering to existing data.
INFO-TBL-CLONETable Cloned⚪ InfoTable cloned. CLONE creates a copy of a table. In Snowflake, clones are zero-copy and share storage until modified. In Databricks, SHALLOW clones share data files while DEEP clones duplicate them.
INFO-DBX-CAT-COMMENT-CHGCatalog Comment Changed⚪ InfoCOMMENT ON CATALOG modifies Unity Catalog metadata. Positive governance signal — improves catalog documentation and discoverability.
INFO-DBX-VOL-COMMENT-CHGVolume Comment Changed⚪ InfoCOMMENT ON VOLUME modifies Unity Catalog volume metadata. Positive governance signal — improves storage documentation.
INFO-DBX-CONN-COMMENT-CHGConnection Comment Changed⚪ InfoCOMMENT ON CONNECTION modifies Unity Catalog connection metadata. Positive governance signal — documents external data source purpose and ownership.
INFO-DBX-TBL-CACHE-LAZYTable Lazy Cached⚪ InfoCACHE LAZY TABLE registers a table for deferred caching — data is only cached on first access. Lower impact than eager CACHE TABLE.

Generated from builtin_rules.yaml at build time.

Need Help?

Can't find what you're looking for? Check out our GitHub or reach out to support.