From 0c6327e6bf7baa4ed1d70ac77208b4e939edd009 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Thu, 19 Mar 2015 23:26:34 +0200 Subject: [PATCH] Renamed fwfilter to dbfwfilter. --- Documentation/Documentation-Contents.md | 2 +- ...l-Filter.md => Database-Firewall-Filter.md} | 18 +++++++++--------- server/modules/filter/CMakeLists.txt | 15 ++++++++------- .../filter/{fwfilter.c => dbfwfilter.c} | 0 .../modules/filter/test/fwfilter/fwtest.cnf.in | 2 +- 5 files changed, 19 insertions(+), 18 deletions(-) rename Documentation/filters/{Firewall-Filter.md => Database-Firewall-Filter.md} (82%) rename server/modules/filter/{fwfilter.c => dbfwfilter.c} (100%) diff --git a/Documentation/Documentation-Contents.md b/Documentation/Documentation-Contents.md index 7a5fb3e5b..c92189ffe 100644 --- a/Documentation/Documentation-Contents.md +++ b/Documentation/Documentation-Contents.md @@ -44,7 +44,7 @@ - [Regex Filter](filters/Regex-Filter.md) - [Tee Filter](filters/Tee-Filter.md) - [Top N Filter](filters/Top-N-Filter.md) - - [Firewall Filter](filters/Firewall-Filter.md) + - [Database Firewall Filter](filters/Database-Firewall-Filter.md) - [RabbitMQ Filter](filters/RabbitMQ-Filter.md) ## Utilities diff --git a/Documentation/filters/Firewall-Filter.md b/Documentation/filters/Database-Firewall-Filter.md similarity index 82% rename from Documentation/filters/Firewall-Filter.md rename to Documentation/filters/Database-Firewall-Filter.md index 73399521f..9dc415a8a 100644 --- a/Documentation/filters/Firewall-Filter.md +++ b/Documentation/filters/Database-Firewall-Filter.md @@ -1,26 +1,26 @@ -#Firewall filter +#Database Firewall filter ## Overview -The firewall filter is used to block queries that match a set of rules. It can be used to prevent harmful queries into the database or to limit the access to the database based on a more defined set of rules compared to the traditional GRANT-based rights management. +The database firewall filter is used to block queries that match a set of rules. It can be used to prevent harmful queries into the database or to limit the access to the database based on a more defined set of rules compared to the traditional GRANT-based rights management. ## Configuration -The firewall filter only requires a minimal set of configurations in the MaxScale.cnf file. The actual rules of the firewall filter are located in a separate text file. The following is an example of a firewall filter configuration in the MaxScale.cnf file. +The database firewall filter only requires a minimal set of configurations in the MaxScale.cnf file. The actual rules of the database firewall filter are located in a separate text file. The following is an example of a database firewall filter configuration in the MaxScale.cnf file. ``` -[Firewall] +[Database Firewall] type=filter -module=fwfilter +module=dbfwfilter rules=/home/user/rules.txt ``` ### Filter Options -The firewall filter does not support any filter options. +The database firewall filter does not support any filter options. ### Filter Parameters -The firewall filter has one mandatory parameter that defines the location of the rule file. This is the `rules` parameter and it expects an absolute path to the rule file. +The database firewall filter has one mandatory parameter that defines the location of the rule file. This is the `rules` parameter and it expects an absolute path to the rule file. ## Rule syntax @@ -32,13 +32,13 @@ rule NAME deny [wildcard | columns VALUE ... | no_where_clause] [at_times VALUE...] [on_queries [select|update|insert|delete]]` ``` -Rules always define a blocking action so the basic mode for the firewall filter is to allow all queries that do not match a given set of rules. Rules are identified by their name and have a mandatory part and optional parts. +Rules always define a blocking action so the basic mode for the database firewall filter is to allow all queries that do not match a given set of rules. Rules are identified by their name and have a mandatory part and optional parts. The first step of defining a rule is to start with the keyword `rule` which identifies this line of text as a rule. The second token is identified as the name of the rule. After that the mandatory token `deny` is required to mark the start of the actual rule definition. ### Mandatory rule parameters -The firewall filter's rules expect a single mandatory parameter for a rule. You can define multiple rules to cover situations where you would like to apply multiple mandatory rules to a query. +The database firewall filter's rules expect a single mandatory parameter for a rule. You can define multiple rules to cover situations where you would like to apply multiple mandatory rules to a query. #### Wildcard diff --git a/server/modules/filter/CMakeLists.txt b/server/modules/filter/CMakeLists.txt index 84629559b..3febf4ff5 100644 --- a/server/modules/filter/CMakeLists.txt +++ b/server/modules/filter/CMakeLists.txt @@ -26,18 +26,19 @@ add_library(topfilter SHARED topfilter.c) target_link_libraries(topfilter log_manager utils) install(TARGETS topfilter DESTINATION modules) -add_library(fwfilter SHARED fwfilter.c) -target_link_libraries(fwfilter log_manager utils query_classifier) -install(TARGETS fwfilter DESTINATION modules) +add_library(dbfwfilter SHARED dbfwfilter.c) +target_link_libraries(dbfwfilter log_manager utils query_classifier) +install(TARGETS dbfwfilter DESTINATION modules) add_library(namedserverfilter SHARED namedserverfilter.c) target_link_libraries(namedserverfilter log_manager utils) install(TARGETS namedserverfilter DESTINATION modules) -add_library(slavelag SHARED slavelag.c) -target_link_libraries(slavelag log_manager utils query_classifier) -install(TARGETS slavelag DESTINATION modules) - +if(BUILD_SLAVELAG) + add_library(slavelag SHARED slavelag.c) + target_link_libraries(slavelag log_manager utils query_classifier) + install(TARGETS slavelag DESTINATION modules) +endif() add_subdirectory(hint) diff --git a/server/modules/filter/fwfilter.c b/server/modules/filter/dbfwfilter.c similarity index 100% rename from server/modules/filter/fwfilter.c rename to server/modules/filter/dbfwfilter.c diff --git a/server/modules/filter/test/fwfilter/fwtest.cnf.in b/server/modules/filter/test/fwfilter/fwtest.cnf.in index 13a1504b9..1bdad1401 100644 --- a/server/modules/filter/test/fwfilter/fwtest.cnf.in +++ b/server/modules/filter/test/fwfilter/fwtest.cnf.in @@ -1,4 +1,4 @@ [Firewall] type=filter -module=fwfilter +module=dbfwfilter rules=@CMAKE_CURRENT_SOURCE_DIR@/rules