Class SchemaValidationDriver

All Implemented Interfaces:
Driver

@DriverCapability(prefix="schema", description="Validates SQL statements against a defined schema (table/column whitelist or blacklist)", capabilities={"security","validation"}) @DriverParameter(name="allowedTables",type=STRING,description="Semicolon-separated list of allowed table names (whitelist mode)") @DriverParameter(name="blockedTables",type=STRING,description="Semicolon-separated list of blocked table names (blacklist mode)") @DriverParameter(name="allowedColumns",type=STRING,description="Semicolon-separated list of allowed column patterns") @DriverParameter(name="blockedColumns",type=STRING,description="Semicolon-separated list of blocked column patterns") @DriverParameter(name="mode",type=STRING,description="Validation mode",defaultValue="whitelist",enumValues={"whitelist","blacklist","metadata"}) @DriverParameter(name="caseSensitive",type=BOOLEAN,description="Whether table/column names are case-sensitive",defaultValue="false") @DriverParameter(name="message",type=STRING,description="Custom error message prefix",defaultValue="SchemaValidationDriver") @DriverParameter(name="loadFromDb",type=BOOLEAN,description="Load allowed tables from database metadata",defaultValue="false") @DriverParameter(name="schemaPattern",type=STRING,description="Schema pattern for metadata loading") @DriverParameter(name="tableTypes",type=STRING,description="Semicolon-separated table types for metadata",defaultValue="TABLE;VIEW") public class SchemaValidationDriver extends AbstractProxyDriver
SchemaValidationDriver validates SQL statements against a defined schema.

URL format: jdbc:schema[param=value,...]:jdbc:target:...

Modes:

  • whitelist - Only tables in allowedTables list are permitted
  • blacklist - All tables except those in blockedTables list are permitted
  • metadata - Load allowed tables from database metadata at connection time

Example URLs:

 jdbc:schema[allowedTables=users;orders;products]:jdbc:postgresql://localhost/mydb
 jdbc:schema[blockedTables=audit_log;secrets,mode=blacklist]:jdbc:mysql://localhost/db
 jdbc:schema[mode=metadata,schemaPattern=public]:jdbc:postgresql://localhost/mydb
 jdbc:schema[blockedColumns=ssn;credit_card]:jdbc:postgresql://localhost/mydb