Class DenyDdlManager

java.lang.Object
org.kawanfw.sql.api.server.firewall.DefaultSqlFirewallManager
org.kawanfw.sql.api.server.firewall.DenyDdlManager
All Implemented Interfaces:
SqlFirewallManager

public class DenyDdlManager
extends DefaultSqlFirewallManager
implements SqlFirewallManager
Firewall manager that denies any DDL (Data Definition Language) call.
Since:
4.0
Author:
Nicolas de Pomereu
  • Constructor Details

    • DenyDdlManager

      public DenyDdlManager()
  • Method Details

    • allowSqlRunAfterAnalysis

      public boolean allowSqlRunAfterAnalysis​(String username, String database, Connection connection, String ipAddress, String sql, boolean isPreparedStatement, List<Object> parameterValues) throws IOException, SQLException
      Description copied from interface: SqlFirewallManager
      Allows, for the passed client username and its IP address, to know if statement is a prepared statement an to analyze the string representation of the SQL statement that is received on the server.
      If the analysis defined by the method returns false, the SQL statement won't be executed.
      Specified by:
      allowSqlRunAfterAnalysis in interface SqlFirewallManager
      Overrides:
      allowSqlRunAfterAnalysis in class DefaultSqlFirewallManager
      Parameters:
      username - the client username to check the rule for.
      database - the database name as defined in the JDBC URL field
      connection - The current SQL/JDBC Connection
      ipAddress - the IP address of the client user
      sql - the SQL statement
      isPreparedStatement - Says if the statement is a prepared statement
      parameterValues - the parameter values of a prepared statement in the natural order, empty list for a (non prepared) statement
      Returns:
      false if the SQL statement is DDL (Data Definition Language).
      Throws:
      IOException - if an IOException occurs
      SQLException - if a SQLException occurs
    • runIfStatementRefused

      public void runIfStatementRefused​(String username, String database, Connection connection, String ipAddress, boolean isMetadataQuery, String sql, List<Object> parameterValues) throws IOException, SQLException
      Logs the info using DefaultDatabaseConfigurator.getLogger() Logger.
      Specified by:
      runIfStatementRefused in interface SqlFirewallManager
      Overrides:
      runIfStatementRefused in class DefaultSqlFirewallManager
      Parameters:
      username - the discarded client username
      database - the database name as defined in the JDBC URL field
      connection - The current SQL/JDBC Connection
      ipAddress - the IP address of the client user
      isMetadataQuery - Says if the client request was an AceQL specific Metadata Query API
      sql - the SQL statement
      parameterValues - the parameter values of a prepared statement in the natural order, empty list for a (non prepared) statement
      Throws:
      IOException - if an IOException occurs
      SQLException - if a SQLException occurs