读取本地json配置文件,可以进行SNAT的IP替换;DNAT暂未测试;未进行回归测试;
This commit is contained in:
@@ -1,3 +1,60 @@
|
||||
[main]
|
||||
######0:intercept;1:bypass
|
||||
default_work_mode=1
|
||||
######0:not replay;1:replay
|
||||
replay_win_update=1
|
||||
######0:G 1:two network card
|
||||
sendpkt_mode=0
|
||||
#####0:not join pkts in listq;1:join pkts in listq
|
||||
write_listqueue_switch=0
|
||||
#####0:join fds in listq;1:not join fds in listq
|
||||
send_fds_mode=0
|
||||
ratelimit_switch=1
|
||||
replace_switch=1
|
||||
|
||||
domain_path=/home/server_unixsocket_file
|
||||
socketopt_mark=101
|
||||
|
||||
logger_level=10
|
||||
logger_filepath=./log/kni.log
|
||||
|
||||
[tun]
|
||||
tun_path=/dev/net/tun
|
||||
tun_name=tun0
|
||||
|
||||
[field_stat]
|
||||
filestat2_filename=./log/kni_fs2.log
|
||||
filestat2_sip=0.0.0.0
|
||||
filestat2_sport=0
|
||||
|
||||
|
||||
[dynmic_maat]
|
||||
#0:iris;1:json;2:redis
|
||||
dyn_maat_readconf_mode=1
|
||||
dyn_redis_server=10.3.34.1
|
||||
dyn_redis_port=6379
|
||||
dyn_redis_db_index=5
|
||||
dyn_scandir_interval=1000
|
||||
dyn_effect_interval=60000
|
||||
dyn_stat_file_path=./log/kni_dyn_maat_stat
|
||||
dyn_table_info_path=./kniconf/maat_table_info.conf
|
||||
|
||||
|
||||
[static_maat]
|
||||
#0:iris;1:json;2:redis
|
||||
maat_readconf_mode=1
|
||||
redis_server=10.3.34.1
|
||||
redis_port=6379
|
||||
redis_db_index=4
|
||||
scandir_interval=1000
|
||||
effect_interval=1000
|
||||
stat_file_path=./log/kni_static_maat_stat
|
||||
table_info_path=./kniconf/maat_table_info.conf
|
||||
full_cfg_dir=/home/mesasoft/tango_rules/full/index
|
||||
inc_cfg_dir=/home/mesasoft/tango_rules/inc/index
|
||||
|
||||
|
||||
|
||||
[Module]
|
||||
table_info_path=./kniconf/maat_table_info.conf
|
||||
full_cfg_dir=/home/mesasoft/tango_rules/full/index
|
||||
@@ -23,3 +80,6 @@ dyn_maat_readconf_mode=1
|
||||
dyn_redis_server=192.168.11.243
|
||||
dyn_redis_port=6379
|
||||
dyn_redis_db_index=5
|
||||
|
||||
write_listqueue_switch=0
|
||||
send_fds_mode=1
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
1 WHITE_LIST_COMPILE compile GBK GBK no 0
|
||||
1 PXY_INTERCEPT_COMPILE compile GBK GBK no 0
|
||||
2 WHITE_LIST_GROUP group GBK GBK no 0
|
||||
2 PXY_INTERCEPT_GROUP group GBK GBK no 0
|
||||
3 WHITE_LIST_IP ip GBK GBK no 0
|
||||
3 PXY_INTERCEPT_IP ip GBK GBK no 0
|
||||
1 WHITE_LIST_COMPILE compile escape --
|
||||
1 PXY_INTERCEPT_COMPILE compile escape --
|
||||
2 WHITE_LIST_GROUP group --
|
||||
2 PXY_INTERCEPT_GROUP group --
|
||||
3 WHITE_LIST_IP ip --
|
||||
3 PXY_INTERCEPT_IP ip --
|
||||
4 WHITE_LIST_DOMAIN expr GBK GBK yes 0
|
||||
4 PXY_INTERCEPT_DOMAIN expr GBK GBK yes 0
|
||||
5 PXY_INTERCEPT_PKT_BIN expr GBK GBK yes 0
|
||||
6 IPD_DYN_COMPILE compile GBK GBK no 0
|
||||
6 IPD_DYN_COMPILE compile GBK GBK no 0
|
||||
7 IPD_DYN_GROUP group GBK GBK no 0
|
||||
8 IPD_RELATED_DOMAIN expr GBK GBK yes 0
|
||||
9 PXY_OBJ_SPOOFING_IP_POOL plugin {"key":11,"valid":9} --
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"compile_table": "WHITE_LIST_COMPILE",
|
||||
"group_table": "WHITE_LIST_GROUP",
|
||||
"compile_table": "PXY_INTERCEPT_COMPILE",
|
||||
"group_table": "PXY_INTERCEPT_GROUP",
|
||||
"rules": [
|
||||
{
|
||||
"compile_id": 1,
|
||||
"service": 1,
|
||||
"action":123,
|
||||
"action":48,
|
||||
"do_blacklist": 1,
|
||||
"do_log": 1,
|
||||
"effective_rage": 0,
|
||||
"user_region": "anything",
|
||||
"user_region": "spoofing_ip_pool=10;nat_type=snat;",
|
||||
"is_valid": "yes",
|
||||
"groups": [
|
||||
{
|
||||
"group_name": "group_1",
|
||||
"group_name": "Untitled",
|
||||
"regions": [
|
||||
{
|
||||
"table_name": "WHITE_LIST_IP",
|
||||
"table_name": "PXY_INTERCEPT_IP",
|
||||
"table_type": "ip",
|
||||
"table_content": {
|
||||
"addr_type": "ipv4",
|
||||
"src_ip": "192.168.11.119",
|
||||
"src_ip": "192.168.11.80",
|
||||
"mask_src_ip": "255.255.255.255",
|
||||
"src_port": "0",
|
||||
"mask_src_port": "65535",
|
||||
@@ -35,33 +35,14 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"compile_id": 2,
|
||||
"service": 48,
|
||||
"action": 123,
|
||||
"do_blacklist": 1,
|
||||
"do_log": 1,
|
||||
"effective_rage": 0,
|
||||
"user_region": "anything",
|
||||
"is_valid": "yes",
|
||||
"groups": [
|
||||
{
|
||||
"group_name": "group_2",
|
||||
"regions": [
|
||||
{
|
||||
"table_name": "WHITE_LIST_DOMAIN",
|
||||
"table_type": "string",
|
||||
"table_content": {
|
||||
"keywords": "www.baidu.com",
|
||||
"expr_type": "regex",
|
||||
"match_method": "sub",
|
||||
"format":"uncase plain"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"plugin_table": [
|
||||
{
|
||||
"table_name": "PXY_OBJ_SPOOFING_IP_POOL",
|
||||
"table_content": [
|
||||
"1\t4\t0\t192.168.11.127\t0\t0\t\t0\t0\t1\t123\t10\t{}\t20181217-0:22"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user