Esempio n. 1
0
 def test_contains_tcpudp(self, generic_rule: RuleGeneric):
     ruletcpudp = RuleTCPUDP()
     ruletcpudp.src = "192.168.23.1"
     ruletcpudp.dst = "192.168.24.1"
     ruletcpudp.permit = True
     ruletcpudp.active = False
     ruletcpudp.objectid = 1234567
     ruletcpudp.is_access_rule = True
     ruletcpudp.logging.interval = 60
     ruletcpudp.logging.level = "Debugging"
     ruletcpudp.remark = "EIGRP Test Rule"
     ruletcpudp.position = 17
     assert ruletcpudp not in generic_rule
     generic_rule.protocol = 0
     assert ruletcpudp in generic_rule
Esempio n. 2
0
 def generic_rule(self):
     rule = RuleTCPUDP()
     rule.src = "192.168.23.31"
     rule.dst = "192.168.24.0/24"
     rule.src_port = "any"
     rule.dst_port = "ssh"
     rule.permit = True
     rule.active = False
     rule.objectid = 1234567
     rule.is_access_rule = True
     rule.logging.interval = 60
     rule.logging.level = "Debugging"
     rule.protocol = "tcp"
     rule.remark = "SSH Test Rule"
     rule.position = 17
     return rule