diff --git a/tests/fixtures/generic/ufw-numbered.json b/tests/fixtures/generic/ufw-numbered.json index 76d14a27..27809d81 100644 --- a/tests/fixtures/generic/ufw-numbered.json +++ b/tests/fixtures/generic/ufw-numbered.json @@ -1 +1 @@ -{"status":"active","logging":"on","logging_level":"low","default":"deny (incoming), allow (outgoing), deny (routed)","new_profiles":"skip","rules":[{"action":"ALLOW","action_direction":"IN","index":1,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"OUT","index":2,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"DENY","action_direction":null,"index":3,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_start_port":443,"to_end_port":443,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_ip":"192.168.0.1","from_ip_prefix":32,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"DENY","action_direction":"OUT","index":4,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_start_port":443,"to_end_port":443,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_ip":"192.168.0.7","from_ip_prefix":32,"from_transport":"any","from_start_port":8080,"from_end_port":8081,"from_service":null},{"action":"ALLOW","action_direction":null,"index":5,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_ip":"192.168.0.0","from_ip_prefix":24,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":null,"index":6,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"en0","from_ip":"192.168.0.0","from_ip_prefix":24,"from_transport":"any","from_start_port":8080,"from_end_port":8081,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":7,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_interface":"en1","from_ip":"2405:204:7449:49fc:f09a:6f4a:bc93:1955","from_ip_prefix":64,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":8,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":80,"to_end_port":80,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":9,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":8080,"to_end_port":8080,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":10,"network_protocol":"ipv4","to_interface":"any","to_transport":null,"to_service":"Apache Full","to_start_port":null,"to_end_port":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":11,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_service":"Apache Full","to_start_port":null,"to_end_port":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"DENY","action_direction":"IN","index":12,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_service":"OpenSSH","to_start_port":null,"to_end_port":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":null,"index":13,"network_protocol":"ipv4","to_interface":"enp34s0","to_ip":"10.10.10.10","to_ip_prefix":32,"to_transport":"any","to_start_port":8080,"to_end_port":8080,"to_service":null,"comment":null,"from_interface":"any","from_ip":"127.0.0.1","from_ip_prefix":32,"from_transport":"any","from_start_port":8000,"from_end_port":8000,"from_service":null},{"action":"ALLOW","action_direction":null,"index":14,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_start_port":50200,"to_end_port":50300,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":15,"network_protocol":"ipv6","to_ip":"::","to_ip_prefix":0,"to_interface":"any","to_transport":"any","to_start_port":0,"to_end_port":65535,"to_service":null,"comment":null,"from_interface":"any","from_ip":"2405:204:7449:49fc:f09a:6f4a:bc93:1955","from_ip_prefix":128,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null}]} +{"status":"active","logging":"on","logging_level":"low","default":"deny (incoming), allow (outgoing), deny (routed)","new_profiles":"skip","rules":[{"action":"ALLOW","action_direction":"IN","index":1,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[22],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"OUT","index":2,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[22],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"DENY","action_direction":null,"index":3,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[443],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_transport":"any","from_ip":"192.168.0.1","from_ip_prefix":32,"from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"DENY","action_direction":"OUT","index":4,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_service":null,"to_ports":[443],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_transport":"any","from_ip":"192.168.0.7","from_ip_prefix":32,"from_service":null,"from_port_ranges":[{"start":8080,"end":8081}]},{"action":"ALLOW","action_direction":null,"index":5,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[22],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_ip":"192.168.0.0","from_ip_prefix":24,"from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":null,"index":6,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_service":null,"to_ports":[22],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"en0","from_ip":"192.168.0.0","from_ip_prefix":24,"from_service":null,"from_port_ranges":[{"start":0,"end":65535}],"from_transport":"any"},{"action":"ALLOW","action_direction":"IN","index":7,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[22],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_interface":"en1","from_ip":"2405:204:7449:49fc:f09a:6f4a:bc93:1955","from_ip_prefix":64,"from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":8,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[80],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":9,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[8080],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":10,"network_protocol":"ipv4","to_interface":"any","to_transport":null,"to_service":"Apache Full","to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":11,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_service":"Apache Full","to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"DENY","action_direction":"IN","index":12,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_service":"OpenSSH","to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":null,"index":13,"network_protocol":"ipv4","to_interface":"enp34s0","to_transport":"any","to_ip":"10.10.10.10","to_ip_prefix":32,"to_service":null,"to_ports":[8080],"comment":null,"from_interface":"any","from_transport":"any","from_ip":"127.0.0.1","from_ip_prefix":32,"from_service":null,"from_ports":[8000]},{"action":"ALLOW","action_direction":null,"index":14,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_port_ranges":[{"start":50200,"end":50300}],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":15,"network_protocol":"ipv6","to_ip":"::","to_ip_prefix":0,"to_interface":"any","to_transport":"any","to_port_ranges":[{"start":0,"end":65535}],"to_service":null,"comment":null,"from_interface":"any","from_transport":"any","from_ip":"2405:204:7449:49fc:f09a:6f4a:bc93:1955","from_ip_prefix":128,"from_port_ranges":[{"start":0,"end":65535}],"from_service":null}]} diff --git a/tests/fixtures/generic/ufw-numbered2.json b/tests/fixtures/generic/ufw-numbered2.json index bbcb1aa1..31622026 100644 --- a/tests/fixtures/generic/ufw-numbered2.json +++ b/tests/fixtures/generic/ufw-numbered2.json @@ -1 +1 @@ -{"status":"active","rules":[{"action":"ALLOW","action_direction":"IN","index":1,"network_protocol":"ipv4","to_interface":"any","to_ip":"224.0.0.251","to_ip_prefix":32,"to_transport":null,"to_service":"mDNS","to_start_port":null,"to_end_port":null,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":2,"network_protocol":"ipv4","to_ip":"0.0.0.0","to_ip_prefix":0,"to_interface":"any","to_transport":"any","to_start_port":0,"to_end_port":65535,"to_service":null,"comment":null,"from_interface":"any","from_ip":"123.123.123.123","from_ip_prefix":32,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":3,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":25,"to_end_port":25,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":4,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":80,"to_end_port":80,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":5,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":443,"to_end_port":443,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":6,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":465,"to_end_port":465,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":7,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":993,"to_end_port":993,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":8,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":995,"to_end_port":995,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":9,"network_protocol":"ipv6","to_interface":"any","to_ip":"ff02::fb","to_ip_prefix":128,"to_transport":null,"to_service":"mDNS","to_start_port":null,"to_end_port":null,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":10,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":25,"to_end_port":25,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":11,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":80,"to_end_port":80,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":12,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":443,"to_end_port":443,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":13,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":465,"to_end_port":465,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":14,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":993,"to_end_port":993,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":15,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":995,"to_end_port":995,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null}]} +{"status":"active","rules":[{"action":"ALLOW","action_direction":"IN","index":1,"network_protocol":"ipv4","to_interface":"any","to_transport":null,"to_ip":"224.0.0.251","to_ip_prefix":32,"to_service":"mDNS","comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":2,"network_protocol":"ipv4","to_ip":"0.0.0.0","to_ip_prefix":0,"to_interface":"any","to_transport":"any","to_port_ranges":[{"start":0,"end":65535}],"to_service":null,"comment":null,"from_interface":"any","from_transport":"any","from_ip":"123.123.123.123","from_ip_prefix":32,"from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":3,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[25],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":4,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[80],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":5,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[443],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":6,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[465],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":7,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[993],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":8,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[995],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":9,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_ip":"ff02::fb","to_ip_prefix":128,"to_service":"mDNS","comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":10,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[25],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":11,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[80],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":12,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[443],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":13,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[465],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":14,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[993],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":15,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[995],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null}]} diff --git a/tests/fixtures/generic/ufw.json b/tests/fixtures/generic/ufw.json index 0238ff7b..9ea2b2a2 100644 --- a/tests/fixtures/generic/ufw.json +++ b/tests/fixtures/generic/ufw.json @@ -1 +1 @@ -{"status":"active","logging":"on","logging_level":"low","default":"deny (incoming), allow (outgoing), deny (routed)","new_profiles":"skip","rules":[{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"OUT","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"DENY","action_direction":null,"index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_start_port":443,"to_end_port":443,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":"nice comment","from_interface":"any","from_ip":"192.168.0.1","from_ip_prefix":32,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"DENY","action_direction":"OUT","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_start_port":443,"to_end_port":443,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_ip":"192.168.0.7","from_ip_prefix":32,"from_transport":"any","from_start_port":8080,"from_end_port":8081,"from_service":null},{"action":"ALLOW","action_direction":null,"index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_ip":"192.168.0.0","from_ip_prefix":24,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":null,"index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"en0","from_ip":"192.168.0.0","from_ip_prefix":24,"from_transport":"any","from_start_port":8080,"from_end_port":8081,"from_service":null},{"action":"ALLOW","action_direction":"FWD","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":"commenting this rule","from_interface":"en1","from_ip":"2405:204:7449:49fc:f09a:6f4a:bc93:1955","from_ip_prefix":64,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":80,"to_end_port":80,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"REJECT","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":8080,"to_end_port":8080,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":null,"to_service":"Apache Full","to_start_port":null,"to_end_port":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":"a comment","from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_service":"Apache Full","to_start_port":null,"to_end_port":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"DENY","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_service":"OpenSSH","to_start_port":null,"to_end_port":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":null,"index":null,"network_protocol":"ipv4","to_interface":"enp34s0","to_ip":"10.10.10.10","to_ip_prefix":32,"to_transport":"any","to_start_port":8080,"to_end_port":8080,"to_service":null,"comment":null,"from_interface":"any","from_ip":"127.0.0.1","from_ip_prefix":32,"from_transport":"any","from_start_port":8000,"from_end_port":8000,"from_service":null},{"action":"DENY","action_direction":"FWD","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_start_port":50200,"to_end_port":50300,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"LIMIT","action_direction":null,"index":null,"network_protocol":"ipv6","to_ip":"::","to_ip_prefix":0,"to_interface":"any","to_transport":"any","to_start_port":0,"to_end_port":65535,"to_service":null,"comment":"this is a comment","from_interface":"any","from_ip":"2405:204:7449:49fc:f09a:6f4a:bc93:1955","from_ip_prefix":128,"from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null}]} +{"status":"active","logging":"on","logging_level":"low","default":"deny (incoming), allow (outgoing), deny (routed)","new_profiles":"skip","rules":[{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[22],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"OUT","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[22],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"DENY","action_direction":null,"index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[443],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":"nice comment","from_interface":"any","from_transport":"any","from_ip":"192.168.0.1","from_ip_prefix":32,"from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"DENY","action_direction":"OUT","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_service":null,"to_ports":[443],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_transport":"any","from_ip":"192.168.0.7","from_ip_prefix":32,"from_service":null,"from_port_ranges":[{"start":8080,"end":8081}]},{"action":"ALLOW","action_direction":null,"index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[22],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"any","from_ip":"192.168.0.0","from_ip_prefix":24,"from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":null,"index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_service":null,"to_ports":[22],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_interface":"en0","from_ip":"192.168.0.0","from_ip_prefix":24,"from_service":null,"from_port_ranges":[{"start":0,"end":65535}],"from_transport":"any"},{"action":"ALLOW","action_direction":"FWD","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[22],"to_ip":"::","to_ip_prefix":0,"comment":"commenting this rule","from_interface":"en1","from_ip":"2405:204:7449:49fc:f09a:6f4a:bc93:1955","from_ip_prefix":64,"from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[80],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"REJECT","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[8080],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":null,"to_service":"Apache Full","to_ip":"0.0.0.0","to_ip_prefix":0,"comment":"a comment","from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_service":"Apache Full","to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"DENY","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":null,"to_service":"OpenSSH","to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":null,"index":null,"network_protocol":"ipv4","to_interface":"enp34s0","to_transport":"any","to_ip":"10.10.10.10","to_ip_prefix":32,"to_service":null,"to_ports":[8080],"comment":null,"from_interface":"any","from_transport":"any","from_ip":"127.0.0.1","from_ip_prefix":32,"from_service":null,"from_ports":[8000]},{"action":"DENY","action_direction":"FWD","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_port_ranges":[{"start":50200,"end":50300}],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"LIMIT","action_direction":null,"index":null,"network_protocol":"ipv6","to_ip":"::","to_ip_prefix":0,"to_interface":"any","to_transport":"any","to_port_ranges":[{"start":0,"end":65535}],"to_service":null,"comment":"this is a comment","from_interface":"any","from_transport":"any","from_ip":"2405:204:7449:49fc:f09a:6f4a:bc93:1955","from_ip_prefix":128,"from_port_ranges":[{"start":0,"end":65535}],"from_service":null}]} diff --git a/tests/fixtures/ubuntu-18.04/ufw-numbered.json b/tests/fixtures/ubuntu-18.04/ufw-numbered.json index 16383d39..fbb008be 100644 --- a/tests/fixtures/ubuntu-18.04/ufw-numbered.json +++ b/tests/fixtures/ubuntu-18.04/ufw-numbered.json @@ -1 +1 @@ -{"status":"active","rules":[{"action":"ALLOW","action_direction":"IN","index":1,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":2,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":"80,443","to_start_port":null,"to_end_port":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":3,"network_protocol":"ipv4","to_interface":"eth0","to_transport":"any","to_start_port":80,"to_end_port":80,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":"test","from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":4,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":5,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":"80,443","to_start_port":null,"to_end_port":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":6,"network_protocol":"ipv6","to_interface":"eth0","to_transport":"any","to_start_port":80,"to_end_port":80,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":"test","from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null}]} +{"status":"active","rules":[{"action":"ALLOW","action_direction":"IN","index":1,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[22],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":2,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[80,443],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":3,"network_protocol":"ipv4","to_interface":"eth0","to_transport":"any","to_service":null,"to_ports":[80],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":"test","from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":4,"network_protocol":"ipv4","to_interface":"any","to_transport":"ipv6","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_interface":"any","from_transport":"ipv6","from_ip":"10.4.0.0","from_ip_prefix":16},{"action":"ALLOW","action_direction":"IN","index":5,"network_protocol":"ipv4","to_interface":"any","to_transport":"esp","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":6,"network_protocol":"ipv4","to_interface":"any","to_transport":"esp","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_interface":"any","from_transport":"esp","from_ip":"10.4.0.0","from_ip_prefix":16},{"action":"ALLOW","action_direction":"IN","index":7,"network_protocol":"ipv4","to_interface":"any","to_transport":"ah","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":8,"network_protocol":"ipv4","to_interface":"any","to_transport":"ah","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_interface":"any","from_transport":"ah","from_ip":"10.4.0.0","from_ip_prefix":16},{"action":"ALLOW","action_direction":"IN","index":9,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_port_ranges":[{"start":100,"end":200},{"start":300,"end":400}],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":10,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_service":null,"to_ports":[1,2],"to_port_ranges":[{"start":100,"end":200},{"start":300,"end":400}],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":11,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[22],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":12,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[80,443],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":13,"network_protocol":"ipv6","to_interface":"eth0","to_transport":"any","to_service":null,"to_ports":[80],"to_ip":"::","to_ip_prefix":0,"comment":"test","from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":14,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_port_ranges":[{"start":100,"end":200},{"start":300,"end":400}],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":15,"network_protocol":"ipv6","to_interface":"any","to_transport":"udp","to_service":null,"to_ports":[1,2],"to_port_ranges":[{"start":100,"end":200},{"start":300,"end":400}],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null}]} diff --git a/tests/fixtures/ubuntu-18.04/ufw-numbered.out b/tests/fixtures/ubuntu-18.04/ufw-numbered.out index a9ba97ff..8138cff8 100644 --- a/tests/fixtures/ubuntu-18.04/ufw-numbered.out +++ b/tests/fixtures/ubuntu-18.04/ufw-numbered.out @@ -5,7 +5,15 @@ Status: active [ 1] 22 ALLOW IN Anywhere [ 2] 80,443/tcp ALLOW IN Anywhere [ 3] 80 on eth0 ALLOW IN Anywhere # test -[ 4] 22 (v6) ALLOW IN Anywhere (v6) -[ 5] 80,443/tcp (v6) ALLOW IN Anywhere (v6) -[ 6] 80 (v6) on eth0 ALLOW IN Anywhere (v6) # test - +[ 4] 10.0.0.1/ipv6 ALLOW IN 10.4.0.0/16/ipv6 +[ 5] 10.0.0.1/esp ALLOW IN Anywhere +[ 6] 10.0.0.1/esp ALLOW IN 10.4.0.0/16/esp +[ 7] 10.0.0.1/ah ALLOW IN Anywhere +[ 8] 10.0.0.1/ah ALLOW IN 10.4.0.0/16/ah +[ 9] 100:200,300:400/tcp ALLOW IN Anywhere +[10] 1,2,100:200,300:400/udp ALLOW IN Anywhere +[11] 22 (v6) ALLOW IN Anywhere (v6) +[12] 80,443/tcp (v6) ALLOW IN Anywhere (v6) +[13] 80 (v6) on eth0 ALLOW IN Anywhere (v6) # test +[14] 100:200,300:400/tcp (v6) ALLOW IN Anywhere (v6) +[15] 1,2,100:200,300:400/udp (v6) ALLOW IN Anywhere (v6) diff --git a/tests/fixtures/ubuntu-18.04/ufw-verbose.json b/tests/fixtures/ubuntu-18.04/ufw-verbose.json index 83384f3d..d833be45 100644 --- a/tests/fixtures/ubuntu-18.04/ufw-verbose.json +++ b/tests/fixtures/ubuntu-18.04/ufw-verbose.json @@ -1 +1 @@ -{"status":"active","logging":"on","logging_level":"low","default":"deny (incoming), allow (outgoing), disabled (routed)","new_profiles":"skip","rules":[{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":"80,443","to_start_port":null,"to_end_port":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"eth0","to_transport":"any","to_start_port":80,"to_end_port":80,"to_service":null,"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":"test","from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_start_port":22,"to_end_port":22,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":"80,443","to_start_port":null,"to_end_port":null,"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"eth0","to_transport":"any","to_start_port":80,"to_end_port":80,"to_service":null,"to_ip":"::","to_ip_prefix":0,"comment":"test","from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_start_port":0,"from_end_port":65535,"from_service":null}]} +{"status":"active","logging":"on","logging_level":"low","default":"deny (incoming), allow (outgoing), disabled (routed)","new_profiles":"skip","rules":[{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[22],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[80,443],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"eth0","to_transport":"any","to_service":null,"to_ports":[80],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":"test","from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"ipv6","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_interface":"any","from_transport":"ipv6","from_ip":"10.4.0.0","from_ip_prefix":16},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"esp","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"esp","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_interface":"any","from_transport":"esp","from_ip":"10.4.0.0","from_ip_prefix":16},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"ah","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"ah","to_ip":"10.0.0.1","to_ip_prefix":32,"comment":null,"from_interface":"any","from_transport":"ah","from_ip":"10.4.0.0","from_ip_prefix":16},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"tcp","to_service":null,"to_port_ranges":[{"start":100,"end":200},{"start":300,"end":400}],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv4","to_interface":"any","to_transport":"udp","to_service":null,"to_ports":[1,2],"to_port_ranges":[{"start":100,"end":200},{"start":300,"end":400}],"to_ip":"0.0.0.0","to_ip_prefix":0,"comment":null,"from_ip":"0.0.0.0","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"any","to_service":null,"to_ports":[22],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_ports":[80,443],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"eth0","to_transport":"any","to_service":null,"to_ports":[80],"to_ip":"::","to_ip_prefix":0,"comment":"test","from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"tcp","to_service":null,"to_port_ranges":[{"start":100,"end":200},{"start":300,"end":400}],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null},{"action":"ALLOW","action_direction":"IN","index":null,"network_protocol":"ipv6","to_interface":"any","to_transport":"udp","to_service":null,"to_ports":[1,2],"to_port_ranges":[{"start":100,"end":200},{"start":300,"end":400}],"to_ip":"::","to_ip_prefix":0,"comment":null,"from_ip":"::","from_ip_prefix":0,"from_interface":"any","from_transport":"any","from_port_ranges":[{"start":0,"end":65535}],"from_service":null}]} diff --git a/tests/fixtures/ubuntu-18.04/ufw-verbose.out b/tests/fixtures/ubuntu-18.04/ufw-verbose.out index a653d609..a826d052 100644 --- a/tests/fixtures/ubuntu-18.04/ufw-verbose.out +++ b/tests/fixtures/ubuntu-18.04/ufw-verbose.out @@ -8,7 +8,15 @@ To Action From 22 ALLOW IN Anywhere 80,443/tcp ALLOW IN Anywhere 80 on eth0 ALLOW IN Anywhere # test +10.0.0.1/ipv6 ALLOW IN 10.4.0.0/16/ipv6 +10.0.0.1/esp ALLOW IN Anywhere +10.0.0.1/esp ALLOW IN 10.4.0.0/16/esp +10.0.0.1/ah ALLOW IN Anywhere +10.0.0.1/ah ALLOW IN 10.4.0.0/16/ah +100:200,300:400/tcp ALLOW IN Anywhere +1,2,100:200,300:400/udp ALLOW IN Anywhere 22 (v6) ALLOW IN Anywhere (v6) 80,443/tcp (v6) ALLOW IN Anywhere (v6) 80 (v6) on eth0 ALLOW IN Anywhere (v6) # test - +100:200,300:400/tcp (v6) ALLOW IN Anywhere (v6) +1,2,100:200,300:400/udp (v6) ALLOW IN Anywhere (v6)