File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 867867 {
868868 "value" : " 1.1.1.1" ,
869869 "expiration" : 0
870+ },
871+ {
872+ "value" : " 9f7b:5e67:5472:4464:90b0:6b0a:9aa6:f9dc" ,
873+ "expiration" : 0
870874 }
871875 ]
872876 },
Original file line number Diff line number Diff line change @@ -73,13 +73,24 @@ def test_blocking_before(self):
7373class Test_Blocking_client_ip_with_forwarded :
7474 """Test if blocking is supported on http.client_ip address"""
7575
76- def setup_blocking (self ):
76+ def setup_blocking_ipv4 (self ):
7777 self .rm_req_block = weblog .get (
78- headers = {"Forwarded" : 'host="example.host";by=2.2.2.2;proto=http;for=1.1.1.1:6543' }
78+ headers = {"Forwarded" : 'for=127.0.0.1; host="example.host";by=2.2.2.2;proto=http;for=1.1.1.1:6543' }
7979 )
8080
81- def test_blocking (self ):
82- """Can block the request forwarded for the ip"""
81+ def test_blocking_ipv4 (self ):
82+ """Can block the request forwarded for the ip (in IPv4 format)"""
83+
84+ assert self .rm_req_block .status_code == 403
85+ interfaces .library .assert_waf_attack (self .rm_req_block , rule = "blk-001-001" )
86+
87+ def setup_blocking_ipv6 (self ):
88+ self .rm_req_block = weblog .get (
89+ headers = {"Forwarded" : 'for="[::1]";for="[9f7b:5e67:5472:4464:90b0:6b0a:9aa6:f9dc]:4485"' },
90+ )
91+
92+ def test_blocking_ipv6 (self ):
93+ """Can block the request forwarded for the ip (in IPv6 format)"""
8394
8495 assert self .rm_req_block .status_code == 403
8596 interfaces .library .assert_waf_attack (self .rm_req_block , rule = "blk-001-001" )
You can’t perform that action at this time.
0 commit comments