Class JdbcLoggerSqlFirewallTrigger

java.lang.Object
org.kawanfw.sql.api.server.firewall.trigger.JdbcLoggerSqlFirewallTrigger
All Implemented Interfaces:
SqlFirewallTrigger

public class JdbcLoggerSqlFirewallTrigger
extends Object
implements SqlFirewallTrigger
A trigger that will INSERT the SqlEvent info and the sqlFirewallManager class name into a aceql_denied_request SQL table.
Table structure is:
 
create table aceql_denied_request
(               
  date_event            timestamp       not null,  
  username              varchar(254)    not null,         
  ip_address            varchar(254)    not null, 
  sql_database          varchar(254)    not null,       
  sql_firewall_manager  varchar(254)    not null,
  sql_statement         varchar(4000)   not null,
  is_metadata           integer                 , 
  is_prepared_statement integer                 ,
  parameter_values      varchar(4000)   not null
);
 
 
Since:
11.0
Author:
Nicolas de Pomereu
  • Constructor Details

    • JdbcLoggerSqlFirewallTrigger

      public JdbcLoggerSqlFirewallTrigger()
  • Method Details

    • runIfStatementRefused

      public void runIfStatementRefused​(SqlEvent sqlEvent, SqlFirewallManager sqlFirewallManager, Connection connection) throws IOException, SQLException
      LInsert into the aceql_denied_request SQL table ClientEvent and the SqlFirewallManager class name
      Specified by:
      runIfStatementRefused in interface SqlFirewallTrigger
      Parameters:
      sqlEvent - the SQL event asked by the client side. Contains all info about the SQL call (client username, database name, IP Address of the client, and SQL statement details).
      sqlFirewallManager - the instance that triggers this call.
      connection - The current SQL/JDBC Connection
      Throws:
      IOException - if an IOException occurs
      SQLException - if a SQLException occurs