[FEATURE]Compile table must register plugin table to get compile ex_data
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
[
|
||||
{
|
||||
"table_id":0,
|
||||
"table_name": "FILE_COMPILE",
|
||||
"db_tables": ["NTC_COMPILE", "WHITE_LIST_COMPILE"],
|
||||
"table_name": "NTC_COMPILE",
|
||||
"table_type":"compile",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
@@ -13,6 +12,30 @@
|
||||
},
|
||||
{
|
||||
"table_id":1,
|
||||
"table_name": "WHITE_LIST_COMPILE",
|
||||
"table_type":"compile",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"compile_id":1,
|
||||
"tags":6,
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":2,
|
||||
"table_name": "FILE_COMPILE",
|
||||
"db_tables": ["NTC_COMPILE", "WHITE_LIST_COMPILE"],
|
||||
"default_compile_table":2,
|
||||
"table_type":"compile",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"compile_id":1,
|
||||
"tags":6,
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":3,
|
||||
"table_name":"NTC_GROUP2GROUP",
|
||||
"table_type":"group2group",
|
||||
"valid_column":3,
|
||||
@@ -23,10 +46,10 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":2,
|
||||
"table_id":4,
|
||||
"table_name":"NTC_GROUP2COMPILE",
|
||||
"table_type":"group2compile",
|
||||
"associated_compile_table_id":0,
|
||||
"associated_compile_table_id":2,
|
||||
"valid_column":3,
|
||||
"custom": {
|
||||
"group_id":1,
|
||||
@@ -37,7 +60,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":3,
|
||||
"table_id":5,
|
||||
"table_name":"NTC_UNIVERSAL_IP",
|
||||
"table_type":"ip_plus",
|
||||
"valid_column":11,
|
||||
@@ -55,7 +78,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":4,
|
||||
"table_id":6,
|
||||
"table_name":"NTC_UNIVERSAL_PROTO_TYPE",
|
||||
"table_type":"intval",
|
||||
"valid_column":5,
|
||||
@@ -67,7 +90,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":5,
|
||||
"table_id":7,
|
||||
"table_name":"WHITE_LIST_IP",
|
||||
"table_type":"ip_plus",
|
||||
"valid_column":11,
|
||||
@@ -85,7 +108,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":7,
|
||||
"table_id":8,
|
||||
"table_name":"FILE_HTTP_URL",
|
||||
"db_tables": ["NTC_HTTP_URL", "WHITE_LIST_DOMAIN"],
|
||||
"table_type":"expr",
|
||||
@@ -100,7 +123,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":8,
|
||||
"table_id":9,
|
||||
"table_name":"FILE_HTTP_HDR_REGION",
|
||||
"db_tables":["NTC_HTTP_REQ_HDR", "NTC_HTTP_RES_HDR"],
|
||||
"table_type":"expr_plus",
|
||||
@@ -116,7 +139,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":9,
|
||||
"table_id":10,
|
||||
"table_name":"FILE_HTTP_BODY_REGION",
|
||||
"db_tables":["NTC_HTTP_REQ_BODY", "NTC_HTTP_RES_BODY"],
|
||||
"table_type":"expr",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"compile_table": "COMPILE",
|
||||
"compile_table": "COMPILE_DEFAULT",
|
||||
"group_table": "GROUP",
|
||||
"rules": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"compile_table": "COMPILE",
|
||||
"group2compile_table": "GROUP2COMPILE",
|
||||
"compile_table": "COMPILE_DEFAULT",
|
||||
"group2compile_table": "GROUP2COMPILE_DEFAULT",
|
||||
"group2group_table": "GROUP2GROUP",
|
||||
"rules": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"compile_table": "COMPILE",
|
||||
"group2compile_table": "GROUP2COMPILE",
|
||||
"compile_table": "COMPILE_DEFAULT",
|
||||
"group2compile_table": "GROUP2COMPILE_DEFAULT",
|
||||
"group2group_table": "GROUP2GROUP",
|
||||
"rules": [
|
||||
{
|
||||
|
||||
@@ -311,12 +311,12 @@ int test_add_expr_command(struct maat *maat_inst, const char *expr_table,
|
||||
memset(huge_serv_def, 's', sizeof(huge_serv_def) - 1);
|
||||
huge_serv_def[sizeof(huge_serv_def) - 1] = '\0';
|
||||
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_ADD,
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE_DEFAULT", MAAT_OP_ADD,
|
||||
compile_id, huge_serv_def, 1, timeout);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
long long group_id = maat_cmd_incrby(maat_inst, "SEQUENCE_GROUP", 1);
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE", MAAT_OP_ADD,
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE_DEFAULT", MAAT_OP_ADD,
|
||||
group_id, compile_id, 0, expr_table, 1, timeout);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
@@ -330,7 +330,7 @@ int test_add_expr_command(struct maat *maat_inst, const char *expr_table,
|
||||
|
||||
int del_command(struct maat *maat_inst, int compile_id)
|
||||
{
|
||||
return compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_DEL,
|
||||
return compile_table_set_line(maat_inst, "COMPILE_DEFAULT", MAAT_OP_DEL,
|
||||
compile_id, "null", 1, 0);
|
||||
}
|
||||
|
||||
@@ -1378,8 +1378,8 @@ TEST_F(MaatHsStringScan, dynamic_config) {
|
||||
|
||||
maat_state_reset(state);
|
||||
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
|
||||
/* compile table add line */
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
@@ -2130,8 +2130,8 @@ TEST_F(MaatRsStringScan, dynamic_config) {
|
||||
EXPECT_EQ(n_hit_result, 0);
|
||||
maat_state_reset(state);
|
||||
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
|
||||
/* compile table add line */
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
@@ -2711,8 +2711,8 @@ TEST_F(MaatIPScan, dynamic_config) {
|
||||
EXPECT_EQ(n_hit_result, 0);
|
||||
maat_state_reset(state);
|
||||
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
|
||||
/* compile table add line */
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
@@ -4776,7 +4776,7 @@ void compile_ex_param_dup(int table_id, void **to, void **from, long argl, void
|
||||
TEST_F(CompileTable, CompileRuleUpdate) {
|
||||
struct maat *maat_inst = CompileTable::_shared_maat_inst;
|
||||
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
int ret = compile_table_set_line(maat_inst, compile_table_name,
|
||||
MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
@@ -4977,21 +4977,26 @@ TEST_F(Policy, CompileRuleTags) {
|
||||
}
|
||||
|
||||
TEST_F(Policy, CompileEXData) {
|
||||
|
||||
const char *url = "firewall should hit";
|
||||
const char *table_name = "HTTP_URL";
|
||||
const char *plugin_table_name = "COMPILE_FIREWALL_PLUGIN";
|
||||
const char *conj_compile_table_name = "COMPILE_FIREWALL_CONJUNCTION";
|
||||
const char *phy_compile_table_name = "COMPILE_FIREWALL_DEFAULT";
|
||||
const char *expect_name = "I have a name";
|
||||
long long results[ARRAY_SIZE] = {0};
|
||||
size_t n_hit_result = 0;
|
||||
int thread_id = 0;
|
||||
const char *url = "firewall should hit";
|
||||
const char *table_name = "HTTP_URL";
|
||||
const char *compile_table_name = "COMPILE_FIREWALL";
|
||||
const char *expect_name = "I have a name";
|
||||
struct maat *maat_inst = Policy::_shared_maat_inst;
|
||||
struct maat_state *state = maat_state_new(maat_inst, thread_id);
|
||||
|
||||
int table_id = maat_get_table_id(maat_inst, table_name);
|
||||
int compile_table_id = maat_get_table_id(maat_inst, compile_table_name);
|
||||
int plugin_table_id = maat_get_table_id(maat_inst, plugin_table_name);
|
||||
int conj_compile_table_id = maat_get_table_id(maat_inst, conj_compile_table_name);
|
||||
int phy_compile_table_id = maat_get_table_id(maat_inst, phy_compile_table_name);
|
||||
|
||||
int ex_data_counter = 0;
|
||||
int ret = maat_plugin_table_ex_schema_register(maat_inst, compile_table_name,
|
||||
int ret = maat_plugin_table_ex_schema_register(maat_inst, plugin_table_name,
|
||||
compile_ex_param_new,
|
||||
compile_ex_param_free,
|
||||
compile_ex_param_dup,
|
||||
@@ -4999,7 +5004,7 @@ TEST_F(Policy, CompileEXData) {
|
||||
ASSERT_TRUE(ret == 0);
|
||||
EXPECT_EQ(ex_data_counter, 1);
|
||||
|
||||
ret = maat_state_set_scan_compile_table(state, compile_table_id);
|
||||
ret = maat_state_set_scan_compile_table(state, conj_compile_table_id);
|
||||
EXPECT_EQ(ret, 0);
|
||||
|
||||
ret = maat_scan_string(maat_inst, table_id, url, strlen(url),
|
||||
@@ -5008,7 +5013,12 @@ TEST_F(Policy, CompileEXData) {
|
||||
EXPECT_EQ(n_hit_result, 1);
|
||||
EXPECT_EQ(results[0], 198);
|
||||
|
||||
void *ex_data = maat_plugin_table_get_ex_data(maat_inst, compile_table_id,
|
||||
int compile_table_ids[ARRAY_SIZE];
|
||||
ret = maat_state_get_compile_table_ids(state, results, 1, compile_table_ids);
|
||||
EXPECT_EQ(ret, 1);
|
||||
EXPECT_EQ(compile_table_ids[0], phy_compile_table_id);
|
||||
|
||||
void *ex_data = maat_plugin_table_get_ex_data(maat_inst, plugin_table_id,
|
||||
(char *)&results[0], sizeof(long long));
|
||||
ASSERT_TRUE(ex_data!=NULL);
|
||||
struct rule_ex_param *param = (struct rule_ex_param *)ex_data;
|
||||
@@ -5049,6 +5059,14 @@ TEST_F(Policy, SubGroup) {
|
||||
EXPECT_EQ(ret, MAAT_SCAN_HIT);
|
||||
EXPECT_EQ(results[0], 153);
|
||||
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
int phy_compile_table_id = maat_get_table_id(maat_inst, compile_table_name);
|
||||
|
||||
int compile_table_ids[ARRAY_SIZE];
|
||||
ret = maat_state_get_compile_table_ids(state, results, 1, compile_table_ids);
|
||||
EXPECT_EQ(ret, 1);
|
||||
EXPECT_EQ(compile_table_ids[0], phy_compile_table_id);
|
||||
|
||||
maat_state_free(state);
|
||||
}
|
||||
|
||||
@@ -5572,8 +5590,8 @@ TEST_F(MaatCmdTest, SetIP) {
|
||||
size_t n_hit_result = 0;
|
||||
int thread_id = 0;
|
||||
const char *ip_table_name = "IP_CONFIG";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
struct maat *maat_inst = MaatCmdTest::_shared_maat_inst;
|
||||
struct maat_state *state = maat_state_new(maat_inst, thread_id);
|
||||
|
||||
@@ -5627,6 +5645,7 @@ TEST_F(MaatCmdTest, SetExpr) {
|
||||
|
||||
const char *keywords1 = "Hiredis";
|
||||
const char *keywords2 = "C Client";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
char escape_buff1[256], escape_buff2[256];
|
||||
char keywords[512];
|
||||
|
||||
@@ -5656,10 +5675,10 @@ TEST_F(MaatCmdTest, SetExpr) {
|
||||
EXPECT_TRUE(results[0] == compile_id || results[0] == (compile_id - 1));
|
||||
maat_state_reset(state);
|
||||
|
||||
ret = compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_DEL, compile_id-1,
|
||||
ret = compile_table_set_line(maat_inst, compile_table_name, MAAT_OP_DEL, compile_id-1,
|
||||
"null", 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
ret = compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_DEL, compile_id,
|
||||
ret = compile_table_set_line(maat_inst, compile_table_name, MAAT_OP_DEL, compile_id,
|
||||
"null", 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
sleep(WAIT_FOR_EFFECTIVE_S);
|
||||
@@ -5684,9 +5703,9 @@ TEST_F(MaatCmdTest, SetExpr8) {
|
||||
const char *scan_data8 = "string1, string2, string3, string4, string5, string6, string7, string8";
|
||||
const char *scan_data7 = "string1, string2, string3, string4, string5, string6, string7";
|
||||
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *table_name = "KEYWORDS_TABLE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
|
||||
const char *keywords8 = "string1&string2&string3&string4&string5&string6&string7&string8";
|
||||
const char *keywords7 = "string1&string2&string3&string4&string5&string6&string7";
|
||||
@@ -5755,6 +5774,8 @@ TEST_F(MaatCmdTest, SameFilterRefByOneCompile) {
|
||||
const char *vtable_name = "HTTP_URL_FILTER";
|
||||
const char *scan_data = "http://filtermenot.com";
|
||||
const char *keywords = "menot.com";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
long long results[ARRAY_SIZE] = {0};
|
||||
size_t n_hit_result = 0;
|
||||
int thread_id = 0;
|
||||
@@ -5765,17 +5786,17 @@ TEST_F(MaatCmdTest, SameFilterRefByOneCompile) {
|
||||
ASSERT_GT(table_id, 0);
|
||||
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_ADD,
|
||||
int ret = compile_table_set_line(maat_inst, compile_table_name, MAAT_OP_ADD,
|
||||
compile_id, "null", 2, 0); // compile has two clause
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
//clause1 & clause2 has same filter => {vtable_id, group_id}
|
||||
long long group_id = maat_cmd_incrby(maat_inst, "SEQUENCE_GROUP", 1);
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE", MAAT_OP_ADD,
|
||||
ret = group2compile_table_set_line(maat_inst, g2c_table_name, MAAT_OP_ADD,
|
||||
group_id, compile_id, 0, vtable_name, 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE", MAAT_OP_ADD,
|
||||
ret = group2compile_table_set_line(maat_inst, g2c_table_name, MAAT_OP_ADD,
|
||||
group_id, compile_id, 0, vtable_name, 2, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
@@ -5882,9 +5903,9 @@ TEST_F(MaatCmdTest, ReturnRuleIDWithDescendingOrder) {
|
||||
|
||||
TEST_F(MaatCmdTest, SubGroup) {
|
||||
const char *table_name = "HTTP_URL";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *g2g_table_name = "GROUP2GROUP";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *scan_data1 = "www.v2ex.com/t/573028#程序员的核心竞争力是什么";
|
||||
const char *keyword1 = "程序员&核心竞争力";
|
||||
const char *scan_data2 = "https://ask.leju.com/bj/detail/12189672562229248/?bi=tg&type=sina-pc"
|
||||
@@ -6038,8 +6059,8 @@ TEST_F(MaatCmdTest, SubGroup) {
|
||||
|
||||
TEST_F(MaatCmdTest, RefGroup) {
|
||||
const char *table_name = "HTTP_URL";
|
||||
const char* g2c_table_name = "GROUP2COMPILE";
|
||||
const char* compile_table_name = "COMPILE";
|
||||
const char* compile_table_name = "COMPILE_DEFAULT";
|
||||
const char* g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char* scan_data1 = "m.facebook.com/help/2297503110373101?helpref=hc_nav&refid=69";
|
||||
const char* keyword1 = "something-should-not-hit";
|
||||
const char* keyword2 = "facebook.com/help/2297503110373101";
|
||||
@@ -6116,8 +6137,8 @@ TEST_F(MaatCmdTest, RefGroup) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, VirtualTable) {
|
||||
const char* g2c_table_name = "GROUP2COMPILE";
|
||||
const char* compile_table_name = "COMPILE";
|
||||
const char* compile_table_name = "COMPILE_DEFAULT";
|
||||
const char* g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char* table_name="HTTP_SIGNATURE";
|
||||
int thread_id = 0;
|
||||
struct maat *maat_inst = MaatCmdTest::_shared_maat_inst;
|
||||
@@ -6512,11 +6533,12 @@ void plugin_ex_dup_cb(int table_id, void **to, void **from, long argl, void *arg
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, CompileEXData) {
|
||||
const char *compile_table_name = "COMPILE_FIREWALL";
|
||||
const char *plugin_table_name = "COMPILE_FIREWALL_PLUGIN";
|
||||
const char *compile_table_name = "COMPILE_FIREWALL_DEFAULT";
|
||||
struct maat *maat_inst = MaatCmdTest::_shared_maat_inst;
|
||||
int *ex_data_counter = MaatCmdTest::_ex_data_counter;
|
||||
int compile_table_id = maat_get_table_id(maat_inst, compile_table_name);
|
||||
EXPECT_GT(compile_table_id, 0);
|
||||
int plugin_table_id = maat_get_table_id(maat_inst, plugin_table_name);
|
||||
EXPECT_GT(plugin_table_id, 0);
|
||||
|
||||
long long compile1_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
int ret = compile_table_set_line(maat_inst, compile_table_name, MAAT_OP_ADD,
|
||||
@@ -6529,7 +6551,7 @@ TEST_F(MaatCmdTest, CompileEXData) {
|
||||
sleep(WAIT_FOR_EFFECTIVE_S);
|
||||
|
||||
*ex_data_counter = 0;
|
||||
ret = maat_plugin_table_ex_schema_register(maat_inst, compile_table_name,
|
||||
ret = maat_plugin_table_ex_schema_register(maat_inst, plugin_table_name,
|
||||
compile_ex_param_new,
|
||||
compile_ex_param_free,
|
||||
compile_ex_param_dup,
|
||||
@@ -6537,14 +6559,14 @@ TEST_F(MaatCmdTest, CompileEXData) {
|
||||
ASSERT_TRUE(ret == 0);
|
||||
EXPECT_EQ(*ex_data_counter, 2);
|
||||
|
||||
void *ex_data = maat_plugin_table_get_ex_data(maat_inst, compile_table_id,
|
||||
void *ex_data = maat_plugin_table_get_ex_data(maat_inst, plugin_table_id,
|
||||
(char *)&compile1_id,
|
||||
sizeof(long long));
|
||||
ASSERT_TRUE(ex_data != NULL);
|
||||
struct rule_ex_param *param = (struct rule_ex_param *)ex_data;
|
||||
EXPECT_EQ(param->id, 1111);
|
||||
|
||||
ex_data = maat_plugin_table_get_ex_data(maat_inst, compile_table_id,
|
||||
ex_data = maat_plugin_table_get_ex_data(maat_inst, plugin_table_id,
|
||||
(char *)&compile2_id,
|
||||
sizeof(long long));
|
||||
ASSERT_TRUE(ex_data != NULL);
|
||||
@@ -6553,10 +6575,10 @@ TEST_F(MaatCmdTest, CompileEXData) {
|
||||
|
||||
ret = compile_table_set_line(maat_inst, compile_table_name, MAAT_OP_DEL,
|
||||
compile2_id, "test:compile2,2222", 1, 0);
|
||||
sleep(WAIT_FOR_EFFECTIVE_S * 5);
|
||||
sleep(WAIT_FOR_EFFECTIVE_S);
|
||||
EXPECT_EQ(param->id, 2222);
|
||||
sleep(2);
|
||||
//exceed gc_timeout_s(11s), the data pointed by param has been freed
|
||||
//excced gc_timeout_s(3s), the data pointed by param has been freed
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, PluginEXData) {
|
||||
@@ -6896,8 +6918,8 @@ TEST_F(MaatCmdTest, UpdateBoolPlugin) {
|
||||
|
||||
#define COMPILE_ID_NUMS 1000
|
||||
TEST_F(MaatCmdTest, GroupInMassCompiles) {
|
||||
const char* g2c_table_name = "GROUP2COMPILE";
|
||||
const char* compile_table_name = "COMPILE";
|
||||
const char* g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char* compile_table_name = "COMPILE_DEFAULT";
|
||||
const char* table_url = "HTTP_URL";
|
||||
const char* table_appid = "APP_ID";
|
||||
int thread_id = 0;
|
||||
@@ -7001,8 +7023,8 @@ TEST_F(MaatCmdTest, GroupInMassCompiles) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, HitGroup) {
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *g2g_table_name = "GROUP2GROUP";
|
||||
const char *http_sig_table_name = "HTTP_SIGNATURE";
|
||||
const char *ip_table_name = "IP_CONFIG";
|
||||
@@ -7127,15 +7149,16 @@ TEST_F(MaatCmdTest, HitGroup) {
|
||||
|
||||
struct maat_hit_group hit_groups[128];
|
||||
memset(hit_groups, 0, sizeof(hit_groups));
|
||||
int n_hit_group = maat_state_get_direct_hit_groups(state, MAAT_LIST_TYPE_INC,
|
||||
hit_groups, 128);
|
||||
size_t n_hit_group = maat_state_get_direct_hit_group_cnt(state);
|
||||
maat_state_get_direct_hit_groups(state, hit_groups, n_hit_group);
|
||||
EXPECT_EQ(n_hit_group, 1);
|
||||
EXPECT_EQ(hit_groups[0].item_id, item1_id);
|
||||
EXPECT_EQ(hit_groups[0].group_id, group1_id);
|
||||
EXPECT_EQ(hit_groups[0].vtable_id, http_req_table_id);
|
||||
|
||||
memset(hit_groups, 0, sizeof(hit_groups));
|
||||
n_hit_group = maat_state_get_indirect_hit_groups(state, hit_groups, 128);
|
||||
n_hit_group = maat_state_get_indirect_hit_group_cnt(state);
|
||||
maat_state_get_indirect_hit_groups(state, hit_groups, n_hit_group);
|
||||
EXPECT_EQ(n_hit_group, 1);
|
||||
EXPECT_EQ(hit_groups[0].item_id, 0);
|
||||
EXPECT_EQ(hit_groups[0].group_id, group11_id);
|
||||
@@ -7160,8 +7183,8 @@ TEST_F(MaatCmdTest, HitGroup) {
|
||||
EXPECT_EQ(scan_count, 2);
|
||||
|
||||
memset(hit_groups, 0, sizeof(hit_groups));
|
||||
n_hit_group = maat_state_get_direct_hit_groups(state, MAAT_LIST_TYPE_INC,
|
||||
hit_groups, 128);
|
||||
n_hit_group = maat_state_get_direct_hit_group_cnt(state);
|
||||
maat_state_get_direct_hit_groups(state, hit_groups, n_hit_group);
|
||||
EXPECT_EQ(n_hit_group, 1);
|
||||
|
||||
EXPECT_EQ(hit_groups[0].item_id, item2_id);
|
||||
@@ -7169,7 +7192,8 @@ TEST_F(MaatCmdTest, HitGroup) {
|
||||
EXPECT_EQ(hit_groups[0].vtable_id, http_res_table_id);
|
||||
|
||||
memset(hit_groups, 0, sizeof(hit_groups));
|
||||
n_hit_group = maat_state_get_indirect_hit_groups(state, hit_groups, 128);
|
||||
n_hit_group = maat_state_get_indirect_hit_group_cnt(state);
|
||||
maat_state_get_indirect_hit_groups(state, hit_groups, n_hit_group);
|
||||
EXPECT_EQ(n_hit_group, 1);
|
||||
EXPECT_EQ(hit_groups[0].item_id, 0);
|
||||
EXPECT_EQ(hit_groups[0].group_id, group21_id);
|
||||
@@ -7201,8 +7225,8 @@ TEST_F(MaatCmdTest, HitGroup) {
|
||||
EXPECT_EQ(scan_count, 4);
|
||||
|
||||
memset(hit_groups, 0, sizeof(hit_groups));
|
||||
n_hit_group = maat_state_get_direct_hit_groups(state, MAAT_LIST_TYPE_INC,
|
||||
hit_groups, 128);
|
||||
n_hit_group = maat_state_get_direct_hit_group_cnt(state);
|
||||
maat_state_get_direct_hit_groups(state, hit_groups, n_hit_group);
|
||||
EXPECT_EQ(n_hit_group, 2);
|
||||
|
||||
EXPECT_EQ(hit_groups[0].item_id, item4_id);
|
||||
@@ -7221,8 +7245,8 @@ TEST_F(MaatCmdTest, HitGroup) {
|
||||
EXPECT_EQ(scan_count, 5);
|
||||
|
||||
memset(hit_groups, 0, sizeof(hit_groups));
|
||||
n_hit_group = maat_state_get_direct_hit_groups(state, MAAT_LIST_TYPE_INC,
|
||||
hit_groups, 128);
|
||||
n_hit_group = maat_state_get_direct_hit_group_cnt(state);
|
||||
maat_state_get_direct_hit_groups(state, hit_groups, n_hit_group);
|
||||
EXPECT_EQ(n_hit_group, 1);
|
||||
|
||||
EXPECT_EQ(hit_groups[0].item_id, item5_id);
|
||||
@@ -7236,8 +7260,8 @@ TEST_F(MaatCmdTest, HitGroup) {
|
||||
|
||||
TEST_F(MaatCmdTest, HitPath) {
|
||||
const char *g2g_table_name = "GROUP2GROUP";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *http_sig_table_name = "HTTP_SIGNATURE";
|
||||
const char *ip_table_name = "IP_CONFIG";
|
||||
const char *keywords_table_name = "KEYWORDS_TABLE";
|
||||
@@ -7503,8 +7527,8 @@ that the edges be all directed in the same direction.";
|
||||
|
||||
TEST_F(MaatCmdTest, HitPathHasNotGroup) {
|
||||
const char *g2g_table_name = "GROUP2GROUP";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *http_sig_table_name = "HTTP_SIGNATURE";
|
||||
const char *ip_table_name = "IP_CONFIG";
|
||||
const char *keywords_table_name = "KEYWORDS_TABLE";
|
||||
@@ -7777,8 +7801,8 @@ TEST_F(MaatCmdTest, SameSuperGroupRefByMultiCompile) {
|
||||
char temp[1024]={0};
|
||||
int thread_id = 0;
|
||||
const char *g2g_table_name = "GROUP2GROUP";
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *http_sig_table_name = "HTTP_SIGNATURE";
|
||||
struct maat *maat_inst = MaatCmdTest::_shared_maat_inst;
|
||||
|
||||
@@ -7871,8 +7895,8 @@ TEST_F(MaatCmdTest, SameSuperGroupRefByMultiCompile) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, SameScanStatusWhenClauseUpdate_TSG6419) {
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char* compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char* compile_table_name = "COMPILE_DEFAULT";
|
||||
const char* ip_table_name = "IP_PLUS_CONFIG";
|
||||
const char *app_id_table_name = "APP_ID";
|
||||
int thread_id = 0;
|
||||
@@ -7967,8 +7991,8 @@ TEST_F(MaatCmdTest, SameScanStatusWhenClauseUpdate_TSG6419) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, GroupEdit) {
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *ip_table_name = "IP_PLUS_CONFIG";
|
||||
const char *app_id_table_name = "APP_ID";
|
||||
int thread_id = 0;
|
||||
@@ -8090,8 +8114,8 @@ TEST_F(MaatCmdTest, GroupEdit) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, CompileDelete_TSG6548) {
|
||||
const char* g2c_table_name = "GROUP2COMPILE";
|
||||
const char* compile_table_name = "COMPILE";
|
||||
const char* g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char* compile_table_name = "COMPILE_DEFAULT";
|
||||
const char* ip_table_name = "IP_PLUS_CONFIG";
|
||||
int thread_id = 0;
|
||||
struct maat *maat_inst = MaatCmdTest::_shared_maat_inst;
|
||||
@@ -8163,8 +8187,8 @@ TEST_F(MaatCmdTest, CompileDelete_TSG6548) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, UpdateDeadLockDetection) {
|
||||
const char* g2c_table_name = "GROUP2COMPILE";
|
||||
const char* compile_table_name = "COMPILE";
|
||||
const char* g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char* compile_table_name = "COMPILE_DEFAULT";
|
||||
const char* table_http_url = "HTTP_URL";
|
||||
int thread_id = 0;
|
||||
struct maat *maat_inst = MaatCmdTest::_shared_maat_inst;
|
||||
@@ -8239,8 +8263,8 @@ TEST_F(MaatCmdTest, UpdateDeadLockDetection) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, StreamScanWhenExprTableIncUpdate) {
|
||||
const char* g2c_table_name = "GROUP2COMPILE";
|
||||
const char* compile_table_name = "COMPILE";
|
||||
const char* g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char* compile_table_name = "COMPILE_DEFAULT";
|
||||
const char* scan_table_name = "KEYWORDS_TABLE";
|
||||
int thread_id = 0;
|
||||
struct maat *maat_inst = MaatCmdTest::_shared_maat_inst;
|
||||
@@ -8302,8 +8326,8 @@ TEST_F(MaatCmdTest, StreamScanWhenExprTableIncUpdate) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, StreamScanSegfaultWhenVersionRollBack_TSG6324) {
|
||||
const char* g2c_table_name = "GROUP2COMPILE";
|
||||
const char* compile_table_name = "COMPILE";
|
||||
const char* g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char* compile_table_name = "COMPILE_DEFAULT";
|
||||
const char* scan_table_name = "KEYWORDS_TABLE";
|
||||
int thread_id = 0;
|
||||
struct maat *maat_inst = MaatCmdTest::_shared_maat_inst;
|
||||
@@ -8361,8 +8385,8 @@ TEST_F(MaatCmdTest, StreamScanSegfaultWhenVersionRollBack_TSG6324) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, IPAndStreamScanWhenIncUpdate) {
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *expr_table_name = "KEYWORDS_TABLE";
|
||||
const char *ip_table_name = "IP_PLUS_CONFIG";
|
||||
int thread_id = 0;
|
||||
@@ -8454,8 +8478,8 @@ TEST_F(MaatCmdTest, IPAndStreamScanWhenIncUpdate) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, IPAndStreamScanWhenFullUpdate) {
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *ip_table_name = "IP_PLUS_CONFIG";
|
||||
const char *expr_table_name = "KEYWORDS_TABLE";
|
||||
int thread_id = 0;
|
||||
@@ -8546,8 +8570,8 @@ TEST_F(MaatCmdTest, IPAndStreamScanWhenFullUpdate) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, IPAndStringScanWhenIncUpdate) {
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *expr_table_name = "HTTP_URL";
|
||||
const char *ip_table_name = "IP_PLUS_CONFIG";
|
||||
const char *keywords = "IP&stringinc";
|
||||
@@ -8638,8 +8662,8 @@ TEST_F(MaatCmdTest, IPAndStringScanWhenIncUpdate) {
|
||||
}
|
||||
|
||||
TEST_F(MaatCmdTest, IPAndStringScanWhenFullupdate) {
|
||||
const char *g2c_table_name = "GROUP2COMPILE";
|
||||
const char *compile_table_name = "COMPILE";
|
||||
const char *g2c_table_name = "GROUP2COMPILE_DEFAULT";
|
||||
const char *compile_table_name = "COMPILE_DEFAULT";
|
||||
const char *ip_table_name = "IP_PLUS_CONFIG";
|
||||
const char *expr_table_name = "HTTP_URL";
|
||||
const char *keywords = "IP&string";
|
||||
|
||||
@@ -306,11 +306,11 @@ static void test_add_expr_command(struct maat *maat_inst, const char *table_name
|
||||
const char *keywords)
|
||||
{
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE_DEFAULT", MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
long long group_id = maat_cmd_incrby(maat_inst, "SEQUENCE_GROUP", 1);
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE", MAAT_OP_ADD, group_id,
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE_DEFAULT", MAAT_OP_ADD, group_id,
|
||||
compile_id, 0, table_name, 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
@@ -324,11 +324,11 @@ static void test_add_ip_command(struct maat *maat_inst, const char *table_name,
|
||||
const char *ip, uint16_t port)
|
||||
{
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE_DEFAULT", MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
long long group_id = maat_cmd_incrby(maat_inst, "SEQUENCE_GROUP", 1);
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE", MAAT_OP_ADD, group_id,
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE_DEFAULT", MAAT_OP_ADD, group_id,
|
||||
compile_id, 0, table_name, 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
@@ -342,11 +342,11 @@ static void test_add_integer_command(struct maat *maat_inst, const char *table_n
|
||||
int low_bound, int up_bound)
|
||||
{
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE_DEFAULT", MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
long long group_id = maat_cmd_incrby(maat_inst, "SEQUENCE_GROUP", 1);
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE", MAAT_OP_ADD, group_id,
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE_DEFAULT", MAAT_OP_ADD, group_id,
|
||||
compile_id, 0, table_name, 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
@@ -360,11 +360,11 @@ static void test_add_flag_command(struct maat *maat_inst, const char *table_name
|
||||
long long flag, long long flag_mask)
|
||||
{
|
||||
long long compile_id = maat_cmd_incrby(maat_inst, "TEST_SEQ", 1);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE", MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
int ret = compile_table_set_line(maat_inst, "COMPILE_DEFAULT", MAAT_OP_ADD, compile_id, "null", 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
long long group_id = maat_cmd_incrby(maat_inst, "SEQUENCE_GROUP", 1);
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE", MAAT_OP_ADD, group_id,
|
||||
ret = group2compile_table_set_line(maat_inst, "GROUP2COMPILE_DEFAULT", MAAT_OP_ADD, group_id,
|
||||
compile_id, 0, table_name, 1, 0);
|
||||
EXPECT_EQ(ret, 1);
|
||||
|
||||
|
||||
@@ -1872,27 +1872,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 175,
|
||||
"service": 0,
|
||||
"action": 0,
|
||||
"do_blacklist": 0,
|
||||
"do_log": 0,
|
||||
"user_region": "ipv4_composition.match",
|
||||
"is_valid": "yes",
|
||||
"groups": [
|
||||
{
|
||||
"group_name": "ipv4_composition.source",
|
||||
"virtual_table": "COMPOSITION_IP_SOURCE",
|
||||
"not_flag": 0
|
||||
},
|
||||
{
|
||||
"group_name": "ipv4_composition.destination",
|
||||
"virtual_table": "COMPOSITION_IP_DESTINATION",
|
||||
"not_flag": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 176,
|
||||
"service": 0,
|
||||
@@ -1925,23 +1904,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 177,
|
||||
"service": 0,
|
||||
"action": 0,
|
||||
"do_blacklist": 0,
|
||||
"do_log": 0,
|
||||
"user_region": "ipv4_composition.session.match",
|
||||
"is_valid": "yes",
|
||||
"groups": [
|
||||
{
|
||||
"group_name": "ipv4_composition.session",
|
||||
"virtual_table": "COMPOSITION_IP_SESSION",
|
||||
"not_flag": 0,
|
||||
"clause_index": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 178,
|
||||
"service": 1,
|
||||
@@ -2003,45 +1965,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 180,
|
||||
"service": 0,
|
||||
"action": 0,
|
||||
"do_blacklist": 0,
|
||||
"do_log": 0,
|
||||
"user_region": "Hierarchy_VirtualWithTwoPhysical",
|
||||
"is_valid": "yes",
|
||||
"groups": [
|
||||
{
|
||||
"group_name": "FQDN_OBJ1",
|
||||
"virtual_table": "VIRTUAL_SSL_SNI",
|
||||
"not_flag": 0,
|
||||
"clause_index": 0
|
||||
},
|
||||
{
|
||||
"group_name": "FQDN_CAT1",
|
||||
"virtual_table": "VIRTUAL_SSL_SNI",
|
||||
"not_flag": 0,
|
||||
"clause_index": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 181,
|
||||
"service": 0,
|
||||
"action": 0,
|
||||
"do_blacklist": 0,
|
||||
"do_log": 0,
|
||||
"user_region": "ipv4_composition.match",
|
||||
"is_valid": "yes",
|
||||
"groups": [
|
||||
{
|
||||
"group_name": "IPv4-composition-source-only",
|
||||
"virtual_table": "COMPOSITION_IP_SOURCE",
|
||||
"not_flag": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 182,
|
||||
"service": 1,
|
||||
@@ -2127,27 +2050,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 185,
|
||||
"service": 0,
|
||||
"action": 0,
|
||||
"do_blacklist": 0,
|
||||
"do_log": 0,
|
||||
"user_region": "ipv4_composition.NOT_match",
|
||||
"is_valid": "yes",
|
||||
"groups": [
|
||||
{
|
||||
"group_name": "IPv4-composition-NOT-client-ip",
|
||||
"virtual_table": "COMPOSITION_IP_SOURCE",
|
||||
"not_flag": 0
|
||||
},
|
||||
{
|
||||
"group_name": "IPv4-composition-NOT-server-ip",
|
||||
"virtual_table": "COMPOSITION_IP_DESTINATION",
|
||||
"not_flag": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 186,
|
||||
"service": 1,
|
||||
@@ -2560,7 +2462,7 @@
|
||||
"do_blacklist": 1,
|
||||
"do_log": 1,
|
||||
"user_region": "Something:I\\bhave\\ba\\bname,7799",
|
||||
"compile_table_name": "COMPILE_FIREWALL",
|
||||
"compile_table_name": "COMPILE_FIREWALL_DEFAULT",
|
||||
"is_valid": "yes",
|
||||
"groups": [
|
||||
{
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
[
|
||||
{
|
||||
"table_id":0,
|
||||
"table_name":"COMPILE",
|
||||
"db_tables":["COMPILE_DEFAULT", "COMPILE_ALIAS"],
|
||||
"table_name":"COMPILE_DEFAULT",
|
||||
"table_type":"compile",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"gc_timeout_s": 3,
|
||||
"compile_id":1,
|
||||
"tags":6,
|
||||
"clause_num":9
|
||||
@@ -14,22 +12,20 @@
|
||||
},
|
||||
{
|
||||
"table_id":1,
|
||||
"table_name":"GROUP2COMPILE",
|
||||
"db_tables":["GROUP2COMPILE_DEFAULT", "GROUP2COMPILE_ALIAS"],
|
||||
"table_type":"group2compile",
|
||||
"associated_compile_table_id":0,
|
||||
"valid_column":3,
|
||||
"table_name":"COMPILE_ALIAS",
|
||||
"table_type":"compile",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"group_id":1,
|
||||
"compile_id":2,
|
||||
"not_flag":4,
|
||||
"virtual_table_name":5,
|
||||
"clause_index":6
|
||||
"compile_id":1,
|
||||
"tags":6,
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"table_id":2,
|
||||
"table_name":"COMPILE_FIREWALL",
|
||||
"table_name":"COMPILE_CONJUNCTION",
|
||||
"db_tables":["COMPILE_DEFAULT", "COMPILE_ALIAS"],
|
||||
"default_compile_table":2,
|
||||
"table_type":"compile",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
@@ -40,7 +36,8 @@
|
||||
},
|
||||
{
|
||||
"table_id":3,
|
||||
"table_name":"GROUP2COMPILE_FIREWALL",
|
||||
"table_name":"GROUP2COMPILE",
|
||||
"db_tables":["GROUP2COMPILE_DEFAULT", "GROUP2COMPILE_ALIAS"],
|
||||
"table_type":"group2compile",
|
||||
"associated_compile_table_id":2,
|
||||
"valid_column":3,
|
||||
@@ -54,6 +51,43 @@
|
||||
},
|
||||
{
|
||||
"table_id":4,
|
||||
"table_name":"COMPILE_FIREWALL_DEFAULT",
|
||||
"table_type":"compile",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"compile_id":1,
|
||||
"tags":6,
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":5,
|
||||
"table_name":"COMPILE_FIREWALL_CONJUNCTION",
|
||||
"db_tables":["COMPILE_FIREWALL_DEFAULT"],
|
||||
"table_type":"compile",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"compile_id":1,
|
||||
"tags":6,
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":6,
|
||||
"table_name":"GROUP2COMPILE_FIREWALL",
|
||||
"table_type":"group2compile",
|
||||
"associated_compile_table_id":5,
|
||||
"valid_column":3,
|
||||
"custom": {
|
||||
"group_id":1,
|
||||
"compile_id":2,
|
||||
"not_flag":4,
|
||||
"virtual_table_name":5,
|
||||
"clause_index":6
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":7,
|
||||
"table_name":"GROUP2GROUP",
|
||||
"table_type":"group2group",
|
||||
"valid_column":4,
|
||||
@@ -64,7 +98,33 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":5,
|
||||
"table_id":8,
|
||||
"table_name":"COMPILE_PLUGIN",
|
||||
"db_tables":["COMPILE_DEFAULT", "COMPILE_ALIAS"],
|
||||
"table_type":"plugin",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"integer",
|
||||
"key_len":8,
|
||||
"key":1
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":9,
|
||||
"table_name":"COMPILE_FIREWALL_PLUGIN",
|
||||
"db_tables":["COMPILE_FIREWALL_DEFAULT"],
|
||||
"table_type":"plugin",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"integer",
|
||||
"key_len":8,
|
||||
"key":1
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":10,
|
||||
"table_name":"HTTP_REGION",
|
||||
"db_tables":["HTTP_URL", "HTTP_HOST"],
|
||||
"table_type":"expr",
|
||||
@@ -79,7 +139,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":6,
|
||||
"table_id":11,
|
||||
"table_name":"KEYWORDS_TABLE",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -93,7 +153,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":7,
|
||||
"table_id":12,
|
||||
"table_name":"IP_CONFIG",
|
||||
"table_type":"ip_plus",
|
||||
"valid_column":11,
|
||||
@@ -111,7 +171,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":8,
|
||||
"table_id":13,
|
||||
"table_name":"CONTENT_SIZE",
|
||||
"table_type":"intval",
|
||||
"valid_column":5,
|
||||
@@ -123,18 +183,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":9,
|
||||
"table_id":14,
|
||||
"table_name":"QD_ENTRY_INFO",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"integer",
|
||||
"key_len":8,
|
||||
"key":1
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":10,
|
||||
"table_id":15,
|
||||
"table_name":"HTTP_SIGNATURE",
|
||||
"table_type":"expr_plus",
|
||||
"valid_column":8,
|
||||
@@ -149,7 +210,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":11,
|
||||
"table_id":16,
|
||||
"table_name":"IMAGE_FP",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -163,11 +224,12 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":12,
|
||||
"table_id":17,
|
||||
"table_name":"TEST_EFFECTIVE_RANGE_TABLE",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"integer",
|
||||
"key_len":8,
|
||||
"key":1,
|
||||
@@ -175,11 +237,12 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":13,
|
||||
"table_id":18,
|
||||
"table_name":"TEST_FOREIGN_KEY",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"pointer",
|
||||
"key":2,
|
||||
"tag":3,
|
||||
@@ -187,7 +250,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":14,
|
||||
"table_id":19,
|
||||
"table_name":"TEST_PLUGIN_EXDATA_TABLE",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
@@ -199,18 +262,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":15,
|
||||
"table_id":20,
|
||||
"table_name":"IR_INTERCEPT_IP",
|
||||
"table_type":"plugin",
|
||||
"valid_column":14,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"pointer",
|
||||
"key":2,
|
||||
"tag":18
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":16,
|
||||
"table_id":21,
|
||||
"table_name":"APP_PAYLOAD",
|
||||
"table_type":"expr_plus",
|
||||
"valid_column":8,
|
||||
@@ -225,7 +289,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":17,
|
||||
"table_id":22,
|
||||
"table_name":"TROJAN_PAYLOAD",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -240,7 +304,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":18,
|
||||
"table_id":23,
|
||||
"table_name":"MAIL_ADDR",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -254,7 +318,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":19,
|
||||
"table_id":24,
|
||||
"table_name":"IP_PLUS_CONFIG",
|
||||
"table_type":"ip_plus",
|
||||
"valid_column":11,
|
||||
@@ -272,32 +336,32 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":20,
|
||||
"table_id":25,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":21,
|
||||
"table_id":26,
|
||||
"table_name":"HTTP_REQUEST_HEADER",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "HTTP_SIGNATURE"
|
||||
},
|
||||
{
|
||||
"table_id":22,
|
||||
"table_id":27,
|
||||
"table_name":"HTTP_RESPONSE_HEADER",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "HTTP_SIGNATURE"
|
||||
},
|
||||
{
|
||||
"table_id":23,
|
||||
"table_id":28,
|
||||
"table_name":"VIRTUAL_IP_PLUS_TABLE",
|
||||
"db_tables":["VIRTUAL_IP_PLUS_SOURCE", "VIRTUAL_IP_PLUS_DESTINATION"],
|
||||
"table_type":"virtual",
|
||||
"physical_table": "IP_PLUS_CONFIG"
|
||||
},
|
||||
{
|
||||
"table_id":24,
|
||||
"table_id":29,
|
||||
"table_name":"TEST_IP_PLUGIN_WITH_EXDATA",
|
||||
"table_type":"ip_plugin",
|
||||
"valid_column":6,
|
||||
@@ -310,7 +374,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":25,
|
||||
"table_id":30,
|
||||
"table_name":"AS_NUMBER",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -324,19 +388,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":26,
|
||||
"table_id":31,
|
||||
"table_name":"SOURCE_IP_ASN",
|
||||
"table_type":"virtual",
|
||||
"physical_table":"AS_NUMBER"
|
||||
},
|
||||
{
|
||||
"table_id":27,
|
||||
"table_id":32,
|
||||
"table_name":"DESTINATION_IP_ASN",
|
||||
"table_type":"virtual",
|
||||
"physical_table":"AS_NUMBER"
|
||||
},
|
||||
{
|
||||
"table_id":28,
|
||||
"table_id":33,
|
||||
"table_name":"GeoLocation",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -350,13 +414,13 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":29,
|
||||
"table_id":34,
|
||||
"table_name":"SOURCE_IP_GEO",
|
||||
"table_type":"virtual",
|
||||
"physical_table":"GeoLocation"
|
||||
},
|
||||
{
|
||||
"table_id":30,
|
||||
"table_id":35,
|
||||
"table_name":"INTERGER_PLUS",
|
||||
"table_type":"intval_plus",
|
||||
"valid_column":6,
|
||||
@@ -369,7 +433,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":31,
|
||||
"table_id":36,
|
||||
"table_name":"TEST_FQDN_PLUGIN_WITH_EXDATA",
|
||||
"table_type":"fqdn_plugin",
|
||||
"valid_column":5,
|
||||
@@ -381,7 +445,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":32,
|
||||
"table_id":37,
|
||||
"table_name":"APP_ID",
|
||||
"table_type":"intval",
|
||||
"valid_column":5,
|
||||
@@ -393,7 +457,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":33,
|
||||
"table_id":38,
|
||||
"table_name":"EMPTY_KEYWORD",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -407,7 +471,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":34,
|
||||
"table_id":39,
|
||||
"table_name":"EMPTY_INTERGER",
|
||||
"table_type":"intval",
|
||||
"valid_column":5,
|
||||
@@ -419,7 +483,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":35,
|
||||
"table_id":40,
|
||||
"table_name":"TEST_BOOL_PLUGIN_WITH_EXDATA",
|
||||
"table_type":"bool_plugin",
|
||||
"valid_column":4,
|
||||
@@ -430,7 +494,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":36,
|
||||
"table_id":41,
|
||||
"table_name":"FLAG_CONFIG",
|
||||
"table_type":"flag",
|
||||
"valid_column":5,
|
||||
@@ -442,7 +506,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":37,
|
||||
"table_id":42,
|
||||
"table_name":"FLAG_PLUS_CONFIG",
|
||||
"table_type":"flag_plus",
|
||||
"valid_column":6,
|
||||
@@ -455,11 +519,12 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":38,
|
||||
"table_id":43,
|
||||
"table_name":"TEST_PLUGIN_LONG_KEY_TYPE_TABLE",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"integer",
|
||||
"key_len":8,
|
||||
"key":2,
|
||||
@@ -467,11 +532,12 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":39,
|
||||
"table_id":44,
|
||||
"table_name":"TEST_PLUGIN_INT_KEY_TYPE_TABLE",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"integer",
|
||||
"key_len":4,
|
||||
"key":2,
|
||||
@@ -479,24 +545,25 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":40,
|
||||
"table_id":45,
|
||||
"table_name":"TEST_PLUGIN_IP_KEY_TYPE_TABLE",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
"custom": {
|
||||
"gc_timeout_s":3,
|
||||
"key_type":"ip_addr",
|
||||
"addr_type":1,
|
||||
"key":2
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":41,
|
||||
"table_id":46,
|
||||
"table_name":"HTTP_URL_FILTER",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "HTTP_URL"
|
||||
},
|
||||
{
|
||||
"table_id":42,
|
||||
"table_id":47,
|
||||
"table_name":"IP_PERF_CONFIG",
|
||||
"table_type":"ip_plus",
|
||||
"valid_column":11,
|
||||
@@ -514,7 +581,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":43,
|
||||
"table_id":48,
|
||||
"table_name":"INTEGER_PERF_CONFIG",
|
||||
"table_type":"intval",
|
||||
"valid_column":5,
|
||||
@@ -526,7 +593,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":44,
|
||||
"table_id":49,
|
||||
"table_name":"EXPR_LITERAL_PERF_CONFIG",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -540,7 +607,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":45,
|
||||
"table_id":50,
|
||||
"table_name":"EXPR_REGEX_PERF_CONFIG",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -554,7 +621,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":46,
|
||||
"table_id":51,
|
||||
"table_name":"FLAG_PERF_CONFIG",
|
||||
"table_type":"flag",
|
||||
"valid_column":5,
|
||||
@@ -566,7 +633,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":47,
|
||||
"table_id":52,
|
||||
"table_name":"TEST_IPPORT_PLUGIN_WITH_EXDATA",
|
||||
"table_type":"ipport_plugin",
|
||||
"valid_column":6,
|
||||
@@ -580,67 +647,67 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":48,
|
||||
"table_id":53,
|
||||
"table_name":"VIRTUAL_IP_CONFIG",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "IP_CONFIG"
|
||||
},
|
||||
{
|
||||
"table_id":49,
|
||||
"table_id":54,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS_1",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":50,
|
||||
"table_id":55,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS_2",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":51,
|
||||
"table_id":56,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS_3",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":52,
|
||||
"table_id":57,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS_4",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":53,
|
||||
"table_id":58,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS_5",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":54,
|
||||
"table_id":59,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS_6",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":55,
|
||||
"table_id":60,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS_7",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":56,
|
||||
"table_id":61,
|
||||
"table_name":"HTTP_RESPONSE_KEYWORDS_8",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":57,
|
||||
"table_id":62,
|
||||
"table_name":"HTTP_DUMMY",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
},
|
||||
{
|
||||
"table_id":58,
|
||||
"table_id":63,
|
||||
"table_name":"HTTP_NOT_LOGIC",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "KEYWORDS_TABLE"
|
||||
|
||||
Reference in New Issue
Block a user