diff --git a/EXAMPLES.md b/EXAMPLES.md index 26fdfd74..282b8ba7 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -3149,10 +3149,10 @@ ufw status verbose numbered | jc --ufw -p "to_end_port": 22, "to_service": null, "to_ip": "0.0.0.0", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -3170,10 +3170,10 @@ ufw status verbose numbered | jc --ufw -p "to_end_port": 22, "to_service": null, "to_ip": "::", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "::", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -3191,10 +3191,10 @@ ufw status verbose numbered | jc --ufw -p "to_start_port": null, "to_end_port": null, "to_ip": "0.0.0.0", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -3208,14 +3208,14 @@ ufw status verbose numbered | jc --ufw -p "network_protocol": "ipv6", "to_interface": "any", "to_ip": "2405:204:7449:49fc:f09a:6f4a:bc93:1955", - "to_ip_prefix": "128", + "to_ip_prefix": 128, "to_transport": "any", "to_start_port": 0, "to_end_port": 65535, "to_service": null, "comment": null, "from_ip": "::", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -3229,14 +3229,14 @@ ufw status verbose numbered | jc --ufw -p "network_protocol": "ipv4", "to_interface": "en0", "to_ip": "10.10.10.10", - "to_ip_prefix": "32", + "to_ip_prefix": 32, "to_transport": "any", "to_start_port": 0, "to_end_port": 65535, "to_service": null, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, diff --git a/docs/parsers/ufw.md b/docs/parsers/ufw.md index d9b117a5..ef9b34c0 100644 --- a/docs/parsers/ufw.md +++ b/docs/parsers/ufw.md @@ -33,17 +33,17 @@ Schema: "to_ip": string, "to_ip_prefix": integer, "to_interface": string, - "to_transport": string, # null if to_service is set - "to_start_port": integer, # null if to_service is set - "to_end_port": integer, # null if to_service is set - "to_service": string, # null if any above are set + "to_transport": string, # null if to_service is set and not a list of ports + "to_start_port": integer, # null if to_service is set and not a list of ports + "to_end_port": integer, # null if to_service is set and not a list of ports + "to_service": string, # null if any above are set (can also be a list of ports) "from_ip": string, "from_ip_prefix": integer, "from_interface": string, - "from_transport": string, # null if from_service is set - "from_start_port": integer, # null if from_service is set - "from_end_port": integer, # null if from_service is set - "from_service": string, # null if any above are set + "from_transport": string, # null if to_service is set and not a list of ports + "from_start_port": integer, # null if to_service is set and not a list of ports + "from_end_port": integer, # null if to_service is set and not a list of ports + "from_service": string, # null if any above are set (can also be a list of ports) "comment": string # null if no comment } ] @@ -70,10 +70,10 @@ Examples: "to_end_port": 22, "to_service": null, "to_ip": "0.0.0.0", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -91,10 +91,10 @@ Examples: "to_end_port": 22, "to_service": null, "to_ip": "::", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "::", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -112,10 +112,10 @@ Examples: "to_start_port": null, "to_end_port": null, "to_ip": "0.0.0.0", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -129,14 +129,14 @@ Examples: "network_protocol": "ipv6", "to_interface": "any", "to_ip": "2405:204:7449:49fc:f09a:6f4a:bc93:1955", - "to_ip_prefix": "128", + "to_ip_prefix": 128, "to_transport": "any", "to_start_port": 0, "to_end_port": 65535, "to_service": null, "comment": null, "from_ip": "::", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -150,14 +150,14 @@ Examples: "network_protocol": "ipv4", "to_interface": "en0", "to_ip": "10.10.10.10", - "to_ip_prefix": "32", + "to_ip_prefix": 32, "to_transport": "any", "to_start_port": 0, "to_end_port": 65535, "to_service": null, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, diff --git a/jc/parsers/ufw.py b/jc/parsers/ufw.py index e04be244..e2613e96 100644 --- a/jc/parsers/ufw.py +++ b/jc/parsers/ufw.py @@ -30,17 +30,17 @@ Schema: "to_ip": string, "to_ip_prefix": integer, "to_interface": string, - "to_transport": string, # null if to_service is set - "to_start_port": integer, # null if to_service is set - "to_end_port": integer, # null if to_service is set - "to_service": string, # null if any above are set + "to_transport": string, # null if to_service is set and not a list of ports + "to_start_port": integer, # null if to_service is set and not a list of ports + "to_end_port": integer, # null if to_service is set and not a list of ports + "to_service": string, # null if any above are set (can also be a list of ports) "from_ip": string, "from_ip_prefix": integer, "from_interface": string, - "from_transport": string, # null if from_service is set - "from_start_port": integer, # null if from_service is set - "from_end_port": integer, # null if from_service is set - "from_service": string, # null if any above are set + "from_transport": string, # null if to_service is set and not a list of ports + "from_start_port": integer, # null if to_service is set and not a list of ports + "from_end_port": integer, # null if to_service is set and not a list of ports + "from_service": string, # null if any above are set (can also be a list of ports) "comment": string # null if no comment } ] @@ -67,10 +67,10 @@ Examples: "to_end_port": 22, "to_service": null, "to_ip": "0.0.0.0", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -88,10 +88,10 @@ Examples: "to_end_port": 22, "to_service": null, "to_ip": "::", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "::", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -109,10 +109,10 @@ Examples: "to_start_port": null, "to_end_port": null, "to_ip": "0.0.0.0", - "to_ip_prefix": "0", + "to_ip_prefix": 0, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -126,14 +126,14 @@ Examples: "network_protocol": "ipv6", "to_interface": "any", "to_ip": "2405:204:7449:49fc:f09a:6f4a:bc93:1955", - "to_ip_prefix": "128", + "to_ip_prefix": 128, "to_transport": "any", "to_start_port": 0, "to_end_port": 65535, "to_service": null, "comment": null, "from_ip": "::", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0, @@ -147,14 +147,14 @@ Examples: "network_protocol": "ipv4", "to_interface": "en0", "to_ip": "10.10.10.10", - "to_ip_prefix": "32", + "to_ip_prefix": 32, "to_transport": "any", "to_start_port": 0, "to_end_port": 65535, "to_service": null, "comment": null, "from_ip": "0.0.0.0", - "from_ip_prefix": "0", + "from_ip_prefix": 0, "from_interface": "any", "from_transport": "any", "from_start_port": 0,