diff --git a/drawings/cisco_ftd/.$Rules.drawio.bkp b/drawings/cisco_ftd/.$Rules.drawio.bkp
new file mode 100644
index 0000000..9164399
--- /dev/null
+++ b/drawings/cisco_ftd/.$Rules.drawio.bkp
@@ -0,0 +1,319 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/drawings/cisco_ftd/.$Rules.drawio.dtmp b/drawings/cisco_ftd/.$Rules.drawio.dtmp
new file mode 100644
index 0000000..59b3605
--- /dev/null
+++ b/drawings/cisco_ftd/.$Rules.drawio.dtmp
@@ -0,0 +1,322 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
+
+
+
+
diff --git a/drawings/cisco_ftd/net_objects.drawio b/drawings/cisco_ftd/net_objects.drawio
new file mode 100644
index 0000000..16750a8
--- /dev/null
+++ b/drawings/cisco_ftd/net_objects.drawio
@@ -0,0 +1,325 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lambda/playground.py b/lambda/playground.py
new file mode 100644
index 0000000..dae2964
--- /dev/null
+++ b/lambda/playground.py
@@ -0,0 +1,4 @@
+kek = lambda x: True if x == "Disabled" else False
+
+print(kek("Disabled"))
+print(kek("Kek"))
diff --git a/network/ipv4_playground.py b/network/ipv4_playground.py
new file mode 100644
index 0000000..209b885
--- /dev/null
+++ b/network/ipv4_playground.py
@@ -0,0 +1,6 @@
+import ipaddress
+
+
+network = "192.168.2.0"
+res = ipaddress.ip_network(network)
+print(res)
diff --git a/network/ipv4_subnet_calc.py b/network/ipv4_subnet_calc.py
new file mode 100644
index 0000000..99950c7
--- /dev/null
+++ b/network/ipv4_subnet_calc.py
@@ -0,0 +1,19 @@
+# 255.255.255.0 24
+# 255.255.0.0 16
+# 255.0.0.0 8
+
+def subnet_mask_to_cidr(subnet_mask):
+ # Split the subnet mask into its octets
+ octets = subnet_mask.split('.')
+
+ # Convert each octet to binary and count the number of 1s
+ binary_representation = ''.join(format(int(octet), '08b') for octet in octets)
+ print(binary_representation)
+ cidr = binary_representation.count('1')
+
+ return cidr
+
+# Example usage
+subnet_mask = '255.255.255.240'
+cidr = subnet_mask_to_cidr(subnet_mask)
+print(f"The CIDR notation for subnet mask {subnet_mask} is /{cidr}")
diff --git a/regex/regex_and_fqdn.py b/regex/regex_and_fqdn.py
new file mode 100644
index 0000000..eb2ed6a
--- /dev/null
+++ b/regex/regex_and_fqdn.py
@@ -0,0 +1,17 @@
+import re
+
+fqdns = [
+ "ad6.example.com",
+ "ad4.example.com",
+ "ad.example.com",
+ "www.example.com",
+ "pipa",
+]
+
+pattern = re.compile(
+ r"^((?![-])[-_A-Z\d]{1,63}(?.+)\s\(((?P\d+\s\w+)|(?P.+-.+)|(?P([a-zA-Z0-9._-])+)|(?P(\d+\.){3}\d+\/\d{1,3}))\)$)|^(?P\w+$)"
+)
+for test_string in entries:
+ match = pattern.match(test_string)
+ if match:
+ print(f"Matched: {test_string}")
+ print("Groups:", match.groupdict())
+ else:
+ print(f"No match: {test_string}")
+ print("")
+
+addresses: List[str] = [
+ "2001:DB8:0:CD30::100",
+ "192.168.0.0/16",
+ "::/0",
+ "2001:DB8::0DB8:800:200C:417A",
+]
+
+for addr in addresses:
+ try:
+ res = ipaddress.ip_address(addr)
+ print(res)
+ continue
+ except ValueError:
+ print(f"{addr} is not an address, trying network")
+ try:
+ res = ipaddress.ip_network(addr)
+ print(res)
+ except ValueError:
+ print(f"{addr} is not a network, ERROR~!!!")
diff --git a/tmp.json b/tmp.json
index 0d3db36..da36881 100644
--- a/tmp.json
+++ b/tmp.json
@@ -1,33 +1,584 @@
[
{
- "group_name": "test_user_group",
- "description": "descr_user_group",
- "members": [
- "LOCAL\test_user1",
- "LOCAL\test_user2"
+ "rule_name": "test_rule",
+ "action": "Allow",
+ "source_zones": [
+ "outside_zone"
],
- "groups": []
- },
- {
- "group_name": "DM_INLINE_USER_1",
- "description": "",
- "members": [
- "LOCAL\test_user1",
- "LOCAL\test_user2"
+ "destination_zones": [
+ "inside_zone"
],
- "groups": [
- "test_user_group"
+ "source_ports": [
+ "Bittorrent (protocol 6, port 6881-6889)",
+ "DNS over TCP (protocol 6, port 53)",
+ "FTP (protocol 6, port 21)",
+ "SMTP (protocol 6, port 25)",
+ "SMTPS (protocol 6, port 465)",
+ "SNMP (protocol 17, port 161)",
+ "SSH (protocol 6, port 22)",
+ "SYSLOG (protocol 17, port 514)"
+ ],
+ "destination_ports": [
+ "NFSD-UDP (protocol 17, port 2049)",
+ "NTP-UDP (protocol 17, port 123)",
+ "TCP high ports (protocol 6, port 1021-65535)",
+ "TELNET (protocol 6, port 23)",
+ "Yahoo Messenger Messages (protocol 6, port 5050)"
+ ],
+ "usernames": [
+ "9999999",
+ "9999997",
+ "9999996"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Enabled",
+ "dc_end": "Enabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0",
+ "url_entries": [
+ "test_url - test.url.ru",
+ "yandex name url - ya.ru"
+ ],
+ "applications": [
+ "1-800-Flowers (535)",
+ "1.1.1.1 App (6889)"
]
},
{
- "group_name": "DM_INLINE_USER_2",
- "description": "",
- "members": [
- "LOCAL\test_user1",
- "LOCAL\test_user2"
+ "rule_name": "Test2",
+ "action": "Allow",
+ "source_zones": [
+ "inside_zone"
],
- "groups": [
- "test_user_group"
- ]
+ "destination_zones": [
+ "outside_zone"
+ ],
+ "source_networks": [
+ "any-ipv4 (0.0.0.0/0)"
+ ],
+ "destination_networks": [
+ "any-ipv4 (0.0.0.0/0)"
+ ],
+ "source_ports": [
+ "DNS over TCP (protocol 6, port 53)"
+ ],
+ "destination_ports": [
+ "TCP high ports (protocol 6, port 1021-65535)"
+ ],
+ "usernames": [
+ "9999999"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Enabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule3",
+ "action": "Allow",
+ "source_zones": [
+ "inside_zone"
+ ],
+ "source_networks": [
+ "IPv4-Private-172.16.0.0-12 (172.16.0.0/12)"
+ ],
+ "destination_networks": [
+ "IPv4-Private-172.16.0.0-12 (172.16.0.0/12)"
+ ],
+ "source_ports": [
+ "SSH (protocol 6, port 22)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule4",
+ "action": "Allow",
+ "source_zones": [
+ "inside_zone"
+ ],
+ "destination_zones": [
+ "outside_zone"
+ ],
+ "source_networks": [
+ "Asia (50 countries)"
+ ],
+ "destination_networks": [
+ "test_host (192.168.2.1)"
+ ],
+ "destination_ports": [
+ "test_port_obj (protocol 70)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Enabled",
+ "dc_end": "Enabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule5",
+ "action": "Allow",
+ "destination_zones": [
+ "inside_zone"
+ ],
+ "source_networks": [
+ "test_range (2001:DB8:0:CD30::10-2001:DB8:0:CD30::100)"
+ ],
+ "destination_networks": [
+ "test_fqdn (ad.example.com)",
+ "test_fqdnv4 (ad4.example.com)",
+ "test_fqdnv6 (ad6.example.com)"
+ ],
+ "source_ports": [
+ "Yahoo Messenger Voice Chat UDP (protocol 17, port 5000-5010)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule6",
+ "action": "Allow",
+ "source_ports": [
+ "test_tcp_port (protocol 6, port 65535)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule7",
+ "action": "Allow",
+ "source_zones": [
+ "outside_zone"
+ ],
+ "source_networks": [
+ "antarctica"
+ ],
+ "source_ports": [
+ "HTTP (protocol 6, port 80)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0",
+ "time_range": "test_time_range",
+ "eff_start_datetime": "31-12-2024 12:00",
+ "eff_end_datetime": "31-12-2025 12:00",
+ "daily_start_time": "12:00",
+ "daily_end_time": "23:00",
+ "daily_days": "Monday"
+ },
+ {
+ "rule_name": "Rule8",
+ "action": "Allow",
+ "source_zones": [
+ "inside_zone",
+ "outside_zone"
+ ],
+ "destination_zones": [
+ "inside_zone",
+ "outside_zone"
+ ],
+ "source_networks": [
+ "IPv4-Private-10.0.0.0-8 (10.0.0.0/8)",
+ "IPv4-Private-172.16.0.0-12 (172.16.0.0/12)",
+ "IPv4-Private-192.168.0.0-16 (192.168.0.0/16)",
+ "OutsideIPv4DefaultRoute (0.0.0.0/0)",
+ "test_fqdnv4 (ad4.example.com)",
+ "TEST_GEO_GROUP (82 countries)"
+ ],
+ "destination_networks": [
+ "IPv4-Private-10.0.0.0-8 (10.0.0.0/8)",
+ "test_host (192.168.2.1)"
+ ],
+ "source_ports": [
+ "AOL (protocol 6, port 5190)",
+ "Bittorrent (protocol 6, port 6881-6889)",
+ "DNS over TCP (protocol 6, port 53)",
+ "port_test (protocol 17, port 56)"
+ ],
+ "destination_ports": [
+ "AOL (protocol 6, port 5190)",
+ "Bittorrent (protocol 6, port 6881-6889)",
+ "DNS over TCP (protocol 6, port 53)",
+ "DNS over UDP (protocol 17, port 53)",
+ "FTP (protocol 6, port 21)",
+ "RADIUS (protocol 17, port 1645)",
+ "RIP (protocol 17, port 520)",
+ "SIP (protocol 17, port 5060)",
+ "SNMP (protocol 17, port 161)",
+ "SYSLOG (protocol 17, port 514)",
+ "TFTP (protocol 17, port 69)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Enabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule9",
+ "action": "Allow",
+ "source_zones": [
+ "outside_zone"
+ ],
+ "destination_zones": [
+ "inside_zone"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule10",
+ "action": "Allow",
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0",
+ "time_range": "test_time_range2",
+ "eff_start_datetime": "31-12-2024 12:00",
+ "eff_end_datetime": "31-12-2025 12:00",
+ "range_start_time": "12:00",
+ "range_end_time": "23:00",
+ "range_start_day": "Monday",
+ "range_end_day": "Tuesday"
+ },
+ {
+ "rule_name": "Rule11",
+ "action": "Allow",
+ "destination_ports": [
+ "port_destination (protocol 115)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule12",
+ "action": "Allow",
+ "source_ports": [
+ "RIP (protocol 17, port 520)",
+ "SIP (protocol 17, port 5060)",
+ "SNMP (protocol 17, port 161)"
+ ],
+ "destination_ports": [
+ "DNS over UDP (protocol 17, port 53)",
+ "NFSD-UDP (protocol 17, port 2049)",
+ "RADIUS (protocol 17, port 1645)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule13",
+ "action": "Allow",
+ "destination_ports": [
+ "Bittorrent (protocol 6, port 6881-6889)",
+ "FTP (protocol 6, port 21)",
+ "icmp_port_obj (protocol 1, type 3, code 4)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule14",
+ "action": "Allow",
+ "destination_networks": [
+ "Asia (50 countries)",
+ "Europe (55 countries)"
+ ],
+ "source_ports": [
+ "SMTPS (protocol 6, port 465)",
+ "SSH (protocol 6, port 22)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule15",
+ "action": "Allow",
+ "destination_networks": [
+ "test_fqdnv6 (ad6.example.com)"
+ ],
+ "source_ports": [
+ "SYSLOG (protocol 17, port 514)",
+ "TFTP (protocol 17, port 69)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "Rule16",
+ "action": "Allow",
+ "destination_networks": [
+ "IPv4-Private-172.16.0.0-12 (172.16.0.0/12)",
+ "IPv4-Private-192.168.0.0-16 (192.168.0.0/16)",
+ "test_host (192.168.2.1)",
+ "test_net_obj (192.168.2.0/24)",
+ "brazil",
+ "chile",
+ "colombia",
+ "ecuador",
+ "Asia (50 countries)",
+ "Europe (55 countries)"
+ ],
+ "destination_ports": [
+ "IPv6-ICMP_any_obj (protocol 58)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule1",
+ "action": "Allow",
+ "source_networks": [
+ "range_ipv4 (192.168.2.1-192.168.2.25)"
+ ],
+ "destination_networks": [
+ "test_fqdnv4 (ad4.example.com)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule2",
+ "action": "Fast-path",
+ "source_zones": [
+ "inside_zone"
+ ],
+ "destination_zones": [
+ "outside_zone"
+ ],
+ "source_networks": [
+ "test_range_ipv6 (2001:DB8:0:CD30::10-2001:DB8:0:CD30::100)"
+ ],
+ "destination_networks": [
+ "Australia (29 countries)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule3",
+ "action": "Block",
+ "destination_zones": [
+ "outside_zone"
+ ],
+ "source_networks": [
+ "any-ipv6 (::/0)"
+ ],
+ "destination_networks": [
+ "TEST_GEO_GROUP2 (110 countries)"
+ ],
+ "source_ports": [
+ "FTP (protocol 6, port 21)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule4",
+ "action": "Allow",
+ "source_networks": [
+ "network_test_ipv4 (192.168.2.0/255.255.255.0)",
+ "network_test_ipv4_2 (192.168.2.0/31)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule5",
+ "action": "Allow",
+ "source_networks": [
+ "TEST_GEO_GROUP (82 countries)",
+ "TEST_GEO_GROUP2 (110 countries)",
+ "Africa (58 countries)",
+ "Antarctica (3 countries)",
+ "Asia (50 countries)",
+ "Australia (29 countries)",
+ "Europe (55 countries)",
+ "North America (42 countries)",
+ "South America (15 countries)"
+ ],
+ "destination_networks": [
+ "IPv4-Private-10.0.0.0-8 (10.0.0.0/8)",
+ "IPv4-Private-172.16.0.0-12 (172.16.0.0/12)",
+ "IPv4-Private-192.168.0.0-16 (192.168.0.0/16)",
+ "range_ipv4 (192.168.2.1-192.168.2.25)",
+ "test_fqdnv4 (ad4.example.com)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule6",
+ "action": "Allow",
+ "destination_zones": [
+ "outside_zone"
+ ],
+ "source_networks": [
+ "test_host_ipv4 (192.168.2.1)"
+ ],
+ "destination_networks": [
+ "test_net_obj (192.168.2.0/24)"
+ ],
+ "source_ports": [
+ "test_tcp_port (protocol 6, port 65535)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule7",
+ "action": "Fast-path",
+ "source_networks": [
+ "test_host_ipv6 (2001:DB8::0DB8:800:200C:417A)"
+ ],
+ "destination_networks": [
+ "any-ipv6 (::/0)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule8",
+ "action": "Allow",
+ "destination_zones": [
+ "inside_zone"
+ ],
+ "source_networks": [
+ "test_fqdn_ipv4_ipv6 (ad.example.com)"
+ ],
+ "destination_networks": [
+ "HTTPS-ACCESS-CLI-__+0 (::/0)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
+ },
+ {
+ "rule_name": "network_rule9",
+ "action": "Allow",
+ "source_zones": [
+ "outside_zone"
+ ],
+ "source_networks": [
+ "test_fqdn_ipv4 (www.example.com)"
+ ],
+ "destination_networks": [
+ "IPv4-Private-All-RFC1918 (group)",
+ "IPv4-Private-10.0.0.0-8 (10.0.0.0/8)",
+ "IPv4-Private-172.16.0.0-12 (172.16.0.0/12)",
+ "IPv4-Private-192.168.0.0-16 (192.168.0.0/16)"
+ ],
+ "dc_status": "Enabled",
+ "dc_beginning": "Disabled",
+ "dc_end": "Disabled",
+ "dc_files": "Disabled",
+ "safe_search": "No",
+ "rule_hits": "0",
+ "variable_set": "Object missing: 76fa83ea-c972-11e2-8be8-8e45bb1343c0"
}
]
diff --git a/tmp.py b/tmp.py
index 45e10e7..1934140 100644
--- a/tmp.py
+++ b/tmp.py
@@ -1,12 +1,5 @@
-def main():
- icmp6 = "echo, echo-reply, membership-query, membership-reduction, membership-report, neighbor-advertisement, neighbor-redirect, neighbor-solicitation, packet-too-big, parameter-problem, router-advertisement, router-renumbering, router-solicitation, time-exceeded"
- icmp = "alternate-address, conversion-error, echo, echo-reply, information-reply, information, request, mask-reply, mask-request, mobile-redirect, parameter-problem, redirect, router-advertisement, router-solicitation, source-quench, time-exceeded, timestamp-reply, timestamp-request, traceroute, unreachable"
- result = [x.strip() for x in icmp.split(",")]
- result6 = [x.strip() for x in icmp6.split(",")]
+lel = ["country", "countries"]
- total = result + result6
- total = set(total)
- return "|".join(total)
+kaka = "110 countries"
-
-print(main())
+print(any(ele in kaka for ele in lel))