commit cd905412161700fbc5dea05e6958d39f3d2c27de Author: pro100ton Date: Sat Nov 2 14:14:15 2024 +0300 Initial migration diff --git a/.$widgets.drawio.bkp b/.$widgets.drawio.bkp new file mode 100644 index 0000000..188d3dd --- /dev/null +++ b/.$widgets.drawio.bkp @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.$widgets.drawio.dtmp b/.$widgets.drawio.dtmp new file mode 100644 index 0000000..927447e --- /dev/null +++ b/.$widgets.drawio.dtmp @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.env b/.env new file mode 100644 index 0000000..abbeae3 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +DOCKER_POSTGRES_PASS = "qwertY123" \ No newline at end of file diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..a99d4e2 --- /dev/null +++ b/.env.template @@ -0,0 +1 @@ +DOCKER_POSTGRES_PASS = "docker_postgres_password" \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e99e36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a27878b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,27 @@ +{ + "workbench.colorTheme": "Box UK Contrast (rainglow)", + "cSpell.words": [ + "descr", + "dotenv", + "spoofmac", + "sqlalchemy" + ], + "cSpell.language": "en,ru", + "sqltools.connections": [ + { + "previewLimit": 50, + "server": "localhost", + "port": 5432, + "driver": "PostgreSQL", + "name": "docker_training_bd", + "database": "postgres", + "username": "postgres", + "password": "qwertY123" + } + ], + "[python]": { + "editor.defaultFormatter": "ms-python.autopep8" + }, + "vim.smartRelativeLine": true, + "python.formatting.provider": "none", +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2d3cc8a --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# T0xa's sandox files +Файлы в данном репо используются @ashalimov для хранения тестовых кодовых сниппетов \ No newline at end of file diff --git a/array_shifter.py b/array_shifter.py new file mode 100644 index 0000000..059e5c1 --- /dev/null +++ b/array_shifter.py @@ -0,0 +1,9 @@ +def priorities_shifter(element_to_move, index_to_place, initial_array): + initial_array.remove(element_to_move) + initial_array.insert(index_to_place, element_to_move) # Insert the element at the desired index + return initial_array + + +if __name__ == "__main__": + initial_array = [0,1,2,3,4,5,6,7] + print(priorities_shifter(5, 1, initial_array)) diff --git a/asa/cisco_connecter.py b/asa/cisco_connecter.py new file mode 100644 index 0000000..8255a42 --- /dev/null +++ b/asa/cisco_connecter.py @@ -0,0 +1,31 @@ +import logging + +from netmiko.cisco import CiscoAsaSSH + +logging.basicConfig(filename="test.log", level=logging.DEBUG) +logger = logging.getLogger("netmiko") + + +class AsaConnector: + + def _session_creator(self) -> CiscoAsaSSH: + cisco_asa = { + "device_type": "cisco_asa", + "host": "172.31.142.14", + "username": "user", + "password": "T1Rules@123", + "port": 22, + } + session = CiscoAsaSSH(**cisco_asa) + session.asa_login() + return session + + def session_login(self): + asa_session = self._session_creator() + asa_session.asa_login() + version = asa_session.send_command("show version") + print(version) + return version + + +connector = AsaConnector().session_login() diff --git a/asa/parsing_enhancment/access-list-parsers.txt b/asa/parsing_enhancment/access-list-parsers.txt new file mode 100644 index 0000000..1156f77 --- /dev/null +++ b/asa/parsing_enhancment/access-list-parsers.txt @@ -0,0 +1,9 @@ +Start + ^access\-list\s+cached\s+ACL* -> NoRecord + ^\s+alert\-interval* -> NoRecord + ^\s+access\-list\s* -> NoRecord + ^access-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+remark\s+${REMARK}\s*$$ -> Record + ^access\-list\s+${ACL_NAME};\s+${ACL_TOT_ELEM}\s+elements;\s+name\s+hash:\s+${ACL_NAME_HASH}\s* -> Record + ^access\-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+${TYPE}\s+${ACTION}\s+(${PROTOCOL}|object\s+${SVC_OBJECT}|object\-group\s+${SVC_OBJECT_GRP}+)\s+(user\s+${USER}\s+|object\-group\-user\s+${USER_GROUP}\s+){0,1}(object\-group\-security\s+${SRC_SECURITY_GROUP_NAME}\s+){0,1}(${SRC_V6HOST}|${SRC_V6NETWORK}\/${SRC_V6MASK}|interface\s+${SRC_INTFC}|object\-group\s+${SRC_OBJECT_GRP}|object\s+${SRC_OBJECT}|host\s+${SRC_HOST}|${SRC_NETWORK}\s+${SRC_MASK}|${SRC_ANY})\s+((eq\s+${SRC_PORT}|lt\s+${SRC_PORT_LESS_THAN}|gt\s+${SRC_PORT_GREATER_THAN}|range\s+${SRC_PORT_RANGE_START}\s+${SRC_PORT_RANGE_END}|object\-group\s+${SRC_PORT_GRP}|object\s+${SRC_PORT_OBJECT})\s+){0,1}(object\-group\-security\s+${DST_SECURITY_GROUP}\s+){0,1}(interface\s+${DST_INTFC}|object\-group\s+${DST_OBJECT_GRP}|object\s+${DST_OBJECT}|host\s+${DST_HOST}|${DST_V6HOST}|${DST_V6NETWORK}\/${DST_V6MASK}|${DST_NETWORK}\s+${DST_MASK}|${DST_ANY})\s+((eq\s+${DST_PORT}|lt\s+${DST_PORT_LESS_THAN}|gt\s+${DST_PORT_GREATER_THAN}|range\s+${DST_PORT_RANGE_START}\s+${DST_PORT_RANGE_END}|object\-group\s+${DST_PORT_GRP}|object\s+${DST_PORT_OBJECT})\s+){0,1}(${ICMP_KEY_VALUE}(\s+${ICMP_VALUE})?\s+){0,1}((log\s+(${LOG_LEVEL}\s+interval\s+${LOG_INTERVAL}|disable|default))\s+){0,1}(time\-range\s+${TIME_RANGE}\s+){0,1}(${ACE_STATE}\s+){0,1}\(hitcnt=${HIT_COUNT}\)\s+(\(inactive\)\s+){0,1}${LINE_HASH}\s* -> Continue + ^${RAW_LINE} -> Record + ^.* -> Error "Did not match any rules" diff --git a/asa/parsing_enhancment/access-list-values.txt b/asa/parsing_enhancment/access-list-values.txt new file mode 100644 index 0000000..4dd3ec8 --- /dev/null +++ b/asa/parsing_enhancment/access-list-values.txt @@ -0,0 +1,74 @@ +Value ACL_NAME (\S+) +Value ACL_TOT_ELEM (\d+) +Value ACL_NAME_HASH (0x\w+) +Value USER (\S+) +Value REMARK (.+?) +Value USER_GROUP (\S+) +Value SRC_SERVICE (\S+) +Value TYPE (standard|extended) +Value LINE_NUM (\d+) +Value ACTION (permit|deny) +Value PROTOCOL ([a-z0-9]+) +Value SOURCE (\S+) +Value ACE_STATE (inactive) +Value SVC_OBJECT_GRP (\S+) +Value SVC_OBJECT (\S+) +Value SRC_INTFC (\S+) +Value SRC_OBJECT_GRP (\S+) +Value SECURITY_GROUP (\S+) +Value SRC_OBJECT (\S+) +Value SRC_HOST (\d+\.\d+\.\d+\.\d+) +Value SRC_V6HOST ([0-9a-f:]+) +Value SRC_NETWORK (\d+\.\d+\.\d+\.\d+) +Value SRC_V6NETWORK ([0-9a-f:]+) +Value SRC_MASK (\d+\.\d+\.\d+\.\d+) +Value SRC_V6MASK (\d{1,3}) +Value SRC_ANY (any[46]{0,1}) +Value DST_INTFC (\S+) +Value DST_OBJECT_GRP (\S+) +Value DST_OBJECT (\S+) +Value DST_HOST (\d+\.\d+\.\d+\.\d+) +Value DST_V6HOST ([0-9a-f:]+) +Value DST_NETWORK (\d+\.\d+\.\d+\.\d+) +Value DST_V6NETWORK ([0-9a-f:]+) +Value DST_MASK (\d+\.\d+\.\d+\.\d+) +Value DST_V6MASK (\d{1,3}) +Value DST_ANY (any[46]{0,1}) +Value DST_PORT (\S+) +Value DST_PORT_LESS_THAN (\S+) +Value DST_PORT_GREATER_THAN (\S+) +Value DST_PORT_RANGE_START (\S+) +Value DST_PORT_RANGE_END (\S+) +Value DST_PORT_GRP ($services_groups) +Value DST_PORT_OBJECT (\S+) +Value DST_ICMP_TYPE ((?!log|time|inactive)\S+) +Value SRC_SECURITY_GROUP (\S+) +Value SRC_SECURITY_GROUP_NAME (\S+) +Value DST_SECURITY_GROUP_NAME (\S+) +Value DST_SECURITY_GROUP (\S+) +Value SRC_SECURITY_GROUP_TAG (\S+) +Value DST_SECURITY_GROUP_TAG (\S+) +Value HIT_COUNT (\d+) +Value LINE_HASH (0x\w+) +Value DST_SERVICE (\S+) +Value LOG_LEVEL ([a-z0-9]+) +Value LOG_INTERVAL (\d+) +Value TIME_RANGE (\S+) +Value ENTRY_PORT ([a-z\-]+\s+\d+|[\w\-]+) +Value ENTRY_PORT_LESS_THAN ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_GREATER_THAN ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_RANGE_START ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_RANGE_END ([a-z\-]+\s+\d+|\w+) +Value ICMP_KEY_VALUE (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|\d{1,3}) +Value ICMP_VALUE (\d+) +Value SRC_SERVICE_OBJECT_GROUP (\S+) +Value SRC_PORT (\S+) +Value SRC_PORT_LESS_THAN (\S+) +Value SRC_PORT_GREATER_THAN (\S+) +Value SRC_PORT_RANGE_START (\S+) +Value SRC_PORT_RANGE_END (\S+) +Value SRC_PORT_GRP (\S+) +Value SRC_PORT_OBJECT (\S+) +Value RAW_LINE (.*) + + diff --git a/asa/parsing_enhancment/access-list.txt b/asa/parsing_enhancment/access-list.txt new file mode 100644 index 0000000..a47bb04 --- /dev/null +++ b/asa/parsing_enhancment/access-list.txt @@ -0,0 +1,83 @@ +Value ACL_NAME (\S+) +Value ACL_TOT_ELEM (\d+) +Value ACL_NAME_HASH (0x\w+) +Value USER (\S+) +Value REMARK (.+?) +Value USER_GROUP (\S+) +Value SRC_SERVICE (\S+) +Value TYPE (standard|extended) +Value LINE_NUM (\d+) +Value ACTION (permit|deny) +Value PROTOCOL ([a-z0-9]+) +Value SOURCE (\S+) +Value ACE_STATE (inactive) +Value SVC_OBJECT_GRP (\S+) +Value SVC_OBJECT (\S+) +Value SRC_INTFC (\S+) +Value SRC_OBJECT_GRP (\S+) +Value SECURITY_GROUP (\S+) +Value SRC_OBJECT (\S+) +Value SRC_HOST (\d+\.\d+\.\d+\.\d+) +Value SRC_V6HOST ([0-9a-f:]+) +Value SRC_NETWORK (\d+\.\d+\.\d+\.\d+) +Value SRC_V6NETWORK ([0-9a-f:]+) +Value SRC_MASK (\d+\.\d+\.\d+\.\d+) +Value SRC_V6MASK (\d{1,3}) +Value SRC_ANY (any[46]{0,1}) +Value DST_INTFC (\S+) +Value DST_OBJECT_GRP (\S+) +Value DST_OBJECT (\S+) +Value DST_HOST (\d+\.\d+\.\d+\.\d+) +Value DST_V6HOST ([0-9a-f:]+) +Value DST_NETWORK (\d+\.\d+\.\d+\.\d+) +Value DST_V6NETWORK ([0-9a-f:]+) +Value DST_MASK (\d+\.\d+\.\d+\.\d+) +Value DST_V6MASK (\d{1,3}) +Value DST_ANY (any[46]{0,1}) +Value DST_PORT (\S+) +Value DST_PORT_LESS_THAN (\S+) +Value DST_PORT_GREATER_THAN (\S+) +Value DST_PORT_RANGE_START (\S+) +Value DST_PORT_RANGE_END (\S+) +Value DST_PORT_GRP (1|2|3|4|5|5|5) +Value DST_PORT_OBJECT (\S+) +Value DST_ICMP_TYPE ((?!log|time|inactive)\S+) +Value SRC_SECURITY_GROUP (\S+) +Value SRC_SECURITY_GROUP_NAME (\S+) +Value DST_SECURITY_GROUP_NAME (\S+) +Value DST_SECURITY_GROUP (\S+) +Value SRC_SECURITY_GROUP_TAG (\S+) +Value DST_SECURITY_GROUP_TAG (\S+) +Value HIT_COUNT (\d+) +Value LINE_HASH (0x\w+) +Value DST_SERVICE (\S+) +Value LOG_LEVEL ([a-z0-9]+) +Value LOG_INTERVAL (\d+) +Value TIME_RANGE (\S+) +Value ENTRY_PORT ([a-z\-]+\s+\d+|[\w\-]+) +Value ENTRY_PORT_LESS_THAN ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_GREATER_THAN ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_RANGE_START ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_RANGE_END ([a-z\-]+\s+\d+|\w+) +Value ICMP_KEY_VALUE (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|\d{1,3}) +Value ICMP_VALUE (\d+) +Value SRC_SERVICE_OBJECT_GROUP (\S+) +Value SRC_PORT (\S+) +Value SRC_PORT_LESS_THAN (\S+) +Value SRC_PORT_GREATER_THAN (\S+) +Value SRC_PORT_RANGE_START (\S+) +Value SRC_PORT_RANGE_END (\S+) +Value SRC_PORT_GRP (\S+) +Value SRC_PORT_OBJECT (\S+) +Value RAW_LINE (.*) + + +Start + ^access\-list\s+cached\s+ACL* -> NoRecord + ^\s+alert\-interval* -> NoRecord + ^\s+access\-list\s* -> NoRecord + ^access-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+remark\s+${REMARK}\s*$$ -> Record + ^access\-list\s+${ACL_NAME};\s+${ACL_TOT_ELEM}\s+elements;\s+name\s+hash:\s+${ACL_NAME_HASH}\s* -> Record + ^access\-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+${TYPE}\s+${ACTION}\s+(${PROTOCOL}|object\s+${SVC_OBJECT}|object\-group\s+${SVC_OBJECT_GRP}+)\s+(user\s+${USER}\s+|object\-group\-user\s+${USER_GROUP}\s+){0,1}(object\-group\-security\s+${SRC_SECURITY_GROUP_NAME}\s+){0,1}(${SRC_V6HOST}|${SRC_V6NETWORK}\/${SRC_V6MASK}|interface\s+${SRC_INTFC}|object\-group\s+${SRC_OBJECT_GRP}|object\s+${SRC_OBJECT}|host\s+${SRC_HOST}|${SRC_NETWORK}\s+${SRC_MASK}|${SRC_ANY})\s+((eq\s+${SRC_PORT}|lt\s+${SRC_PORT_LESS_THAN}|gt\s+${SRC_PORT_GREATER_THAN}|range\s+${SRC_PORT_RANGE_START}\s+${SRC_PORT_RANGE_END}|object\-group\s+${SRC_PORT_GRP}|object\s+${SRC_PORT_OBJECT})\s+){0,1}(object\-group\-security\s+${DST_SECURITY_GROUP}\s+){0,1}(interface\s+${DST_INTFC}|object\-group\s+${DST_OBJECT_GRP}|object\s+${DST_OBJECT}|host\s+${DST_HOST}|${DST_V6HOST}|${DST_V6NETWORK}\/${DST_V6MASK}|${DST_NETWORK}\s+${DST_MASK}|${DST_ANY})\s+((eq\s+${DST_PORT}|lt\s+${DST_PORT_LESS_THAN}|gt\s+${DST_PORT_GREATER_THAN}|range\s+${DST_PORT_RANGE_START}\s+${DST_PORT_RANGE_END}|object\-group\s+${DST_PORT_GRP}|object\s+${DST_PORT_OBJECT})\s+){0,1}(${ICMP_KEY_VALUE}(\s+${ICMP_VALUE})?\s+){0,1}((log\s+(${LOG_LEVEL}\s+interval\s+${LOG_INTERVAL}|disable|default))\s+){0,1}(time\-range\s+${TIME_RANGE}\s+){0,1}(${ACE_STATE}\s+){0,1}\(hitcnt=${HIT_COUNT}\)\s+(\(inactive\)\s+){0,1}${LINE_HASH}\s* -> Continue + ^${RAW_LINE} -> Record + ^.* -> Error "Did not match any rules" diff --git a/asa/parsing_enhancment/main.py b/asa/parsing_enhancment/main.py new file mode 100644 index 0000000..ecc8d50 --- /dev/null +++ b/asa/parsing_enhancment/main.py @@ -0,0 +1,23 @@ +from string import Template + +# Read the content of files +with open("access-list-values.txt", "r") as f: + access_list_values_template = Template(f.read()) + +with open("access-list-parsers.txt", "r") as f: + parsers = f.read() + +# Substitute values into the template +d = { + "services_groups": "1|2|3|4|5|5|5" + "services_objects": "1|2|3|4", +} +access_list_values = access_list_values_template.substitute(d) + +# Write to the output file +with open("access-list.txt", "w") as f: + f.write(access_list_values) + f.write(parsers) + +print(access_list_values) +print(parsers) diff --git a/asa/policies_crud/api_template.json b/asa/policies_crud/api_template.json new file mode 100644 index 0000000..c995774 --- /dev/null +++ b/asa/policies_crud/api_template.json @@ -0,0 +1,36 @@ +{ + "interface": "str", + "type": "str", + "action": "str", + "enabled": "bool", + "description": [ + "str" + ], + "source": { + "type": "str", + "value": { + "ip_version": "str", + "address": "str", + "name": "str", + "group": "str", + "interface": "str" + } + }, + "destination": { + "type": "str", + "value": { + "ip_version": "str", + "address": "str", + "name": "str", + "group": "str", + "interface": "str" + }, + }, + "source_service": "", + "destination_service": "", + "logging": { + "enabled": "bool", + "level": "int", + "interval": "int" + } +} \ No newline at end of file diff --git a/asa/policies_parser.tfsm b/asa/policies_parser.tfsm new file mode 100644 index 0000000..2f629e8 --- /dev/null +++ b/asa/policies_parser.tfsm @@ -0,0 +1,69 @@ +Value Required ACL_NAME (\S+) +Value ACL_TOT_ELEM (\d+) +Value ACL_NAME_HASH (0x\w+) +Value USER (\S+) +Value REMARK (.+?) +Value USER_GROUP (\S+) +Value SRC_SERVICE (\S+) +Value TYPE (standard|extended) +Value LINE_NUM (\d+) +Value ACTION (permit|deny) +Value PROTOCOL ([a-z0-9]+) +Value SOURCE (\S+) +Value ACE_STATE (inactive) +Value SVC_OBJECT_GRP (\S+) +Value SVC_OBJECT (\S+) +Value SRC_INTFC (\S+) +Value SRC_OBJECT_GRP (\S+) +Value SRC_OBJECT (\S+) +Value SRC_HOST (\d+\.\d+\.\d+\.\d+) +Value SRC_V6HOST ([0-9a-f:]+) +Value SRC_NETWORK (\d+\.\d+\.\d+\.\d+) +Value SRC_V6NETWORK ([0-9a-f:]+) +Value SRC_MASK (\d+\.\d+\.\d+\.\d+) +Value SRC_V6MASK (\d{1,3}) +Value SRC_ANY (any[46]{0,1}) +Value DST_INTFC (\S+) +Value DST_OBJECT_GRP (\S+) +Value DST_OBJECT (\S+) +Value DST_HOST (\d+\.\d+\.\d+\.\d+) +Value DST_V6HOST ([0-9a-f:]+) +Value DST_NETWORK (\d+\.\d+\.\d+\.\d+) +Value DST_V6NETWORK ([0-9a-f:]+) +Value DST_MASK (\d+\.\d+\.\d+\.\d+) +Value DST_V6MASK (\d{1,3}) +Value DST_ANY (any[46]{0,1}) +Value DST_PORT (\S+) +Value DST_PORT_LESS_THAN (\S+) +Value DST_PORT_GREATER_THAN (\S+) +Value DST_PORT_RANGE_START (\S+) +Value DST_PORT_RANGE_END (\S+) +Value DST_PORT_GRP (\S+) +Value DST_PORT_OBJECT (\S+) +Value DST_ICMP_TYPE ((?!log|time|inactive)\S+) +Value SRC_SECURITY_GROUP_NAME (\S+) +Value DST_SECURITY_GROUP_NAME (\S+) +Value SRC_SECURITY_GROUP_TAG (\S+) +Value DST_SECURITY_GROUP_TAG (\S+) +Value HIT_COUNT (\d+) +Value LINE_HASH (0x\w+) +Value DST_SERVICE (\S+) +Value LOG_LEVEL ([a-z0-9]+) +Value LOG_INTERVAL (\d+) +Value TIME_RANGE (\S+) +Value ENTRY_PORT ([a-z\-]+\s+\d+|[\w\-]+) +Value ENTRY_PORT_LESS_THAN ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_GREATER_THAN ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_RANGE_START ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_RANGE_END ([a-z\-]+\s+\d+|\w+) + + +Start + ^access\-list\s+cached\s+ACL* -> NoRecord + ^\s+alert\-interval* -> NoRecord + ^access\-list\s+${ACL_NAME};\s+${ACL_TOT_ELEM}\s+elements;\s+name\s+hash:\s+${ACL_NAME_HASH}\s* -> Record + ^access\-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+${TYPE}\s+${ACTION}\s+(${PROTOCOL}|object\-group\s+${SVC_OBJECT_GRP}+)\s+(user\s+${USER}\s+|object\-group\-user\s+${USER_GROUP}\s+){0,1}(object\-group\-security\s+${SRC_OBJECT_GRP}\s+){0,1}(object\-group\s+${SRC_OBJECT}|${SRC_ANY}|interface\s+${SRC_INTFC}|${SRC_HOST})\s+(eq\s+${SRC_SERVICE}\s+){0,1}(object\-group\-security\s+${DST_OBJECT_GRP}\s+){0,1}(${DST_ANY}|interface\s+${DST_INTFC}|${DST_HOST}|${DST_NETWORK}\s+${DST_MASK})\s+((log\s+(${LOG_LEVEL}\s+interval\s+${LOG_INTERVAL}|disable|default))\s+){0,1}(eq\s+${DST_SERVICE}\s+){0,1}(object\-group\s+${DST_PORT_GRP}\s+){0,1}((eq\s+${ENTRY_PORT}|lt\s+${ENTRY_PORT_LESS_THAN}|gt\s+${ENTRY_PORT_GREATER_THAN}|range\s+${ENTRY_PORT_RANGE_START}\s+${ENTRY_PORT_RANGE_END})\s+){0,1}(time\-range\s+${TIME_RANGE}\s+){0,1}(${ACE_STATE}\s+){0,1}\(hitcnt=${HIT_COUNT}\)\s+(\(inactive\)\s+){0,1}${LINE_HASH}\s* -> Record + ^\s+access\-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+${TYPE}\s+${ACTION}\s+(${PROTOCOL}|object\-group\s+${SVC_OBJECT_GRP})\s+(user\s+${USER}\s+|object\-group\-user\s+${USER_GROUP}\s+){0,1}(security\-group\s+name\s+${SRC_SECURITY_GROUP_NAME}\s+|security\-group\s+tag\s+${SRC_SECURITY_GROUP_TAG}\s+){0,1}(${SRC_ANY}|interface\s+${SRC_INTFC}|${SRC_HOST})\s+(eq\s+${SRC_SERVICE}\s+){0,1}(security\-group\s+name\s+${DST_SECURITY_GROUP_NAME}\s+|security\-group\s+tag\s+${DST_SECURITY_GROUP_TAG}\s+){0,1}(${DST_ANY}|interface\s+${DST_INTFC}|${DST_NETWORK}\s+${DST_MASK}|${DST_HOST})\s+((log\s+(${LOG_LEVEL}\s+interval\s+${LOG_INTERVAL}|disable|default))\s+){0,1}(eq\s+${DST_SERVICE}\s+){0,1}(object\-group\s+${DST_PORT_GRP}\s+){0,1}((eq\s+${ENTRY_PORT}|lt\s+${ENTRY_PORT_LESS_THAN}|gt\s+${ENTRY_PORT_GREATER_THAN}|range\s+${ENTRY_PORT_RANGE_START}\s+${ENTRY_PORT_RANGE_END})\s+){0,1}(time\-range\s+${TIME_RANGE}\s+){0,1}(${ACE_STATE}\s+){0,1}\(hitcnt=${HIT_COUNT}\)\s+(\(inactive\)\s+){0,1}${LINE_HASH}\s* -> Record + ^access-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+remark\s+${REMARK}\s*$$ -> Record + ^.* -> Error "Did not match any rules" + diff --git a/asa/policies_samples/1 b/asa/policies_samples/1 new file mode 100644 index 0000000..cfdc0aa --- /dev/null +++ b/asa/policies_samples/1 @@ -0,0 +1,8 @@ +Start + ^access\-list\s+cached\s+ACL* -> NoRecord + ^\s+alert\-interval* -> NoRecord + ^access\-list\s+${ACL_NAME};\s+${ACL_TOT_ELEM}\s+elements;\s+name\s+hash:\s+${ACL_NAME_HASH}\s* -> Record + ^access\-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+${TYPE}\s+${ACTION}\s+(${PROTOCOL}|object\s+${SVC_OBJECT}|object\-group\s+${SVC_OBJECT_GRP}+)\s+(user\s+${USER}\s+|object\-group\-user\s+${USER_GROUP}\s+){0,1}(object\-group\-security\s+${SRC_SECURITY_GROUP_NAME}\s+){0,1}(interface\s+${SRC_INTFC}|object\-group\s+${SRC_OBJECT_GRP}|object\s+${SRC_OBJECT}|host\s+${SRC_HOST}|${SRC_NETWORK}\s+${SRC_MASK}|${SRC_ANY})\s+((eq\s+${SRC_PORT}|lt\s+${SRC_PORT_LESS_THAN}|gt\s+${SRC_PORT_GREATER_THAN}|range\s+${SRC_PORT_RANGE_START}\s+${SRC_PORT_RANGE_END}|object\-group\s+${SRC_PORT_GRP}|object\s+${SRC_PORT_OBJECT})\s+){0,1}(object\-group\-security\s+${DST_SECURITY_GROUP}\s+){0,1}(interface\s+${DST_INTFC}|object\-group\s+${DST_OBJECT_GRP}|object\s+${DST_OBJECT}|host\s+${DST_HOST}|${DST_NETWORK}\s+${DST_MASK}|${DST_ANY})\s+((eq\s+${DST_PORT}|lt\s+${DST_PORT_LESS_THAN}|gt\s+${DST_PORT_GREATER_THAN}|range\s+${DST_PORT_RANGE_START}\s+${DST_PORT_RANGE_END}|object\-group\s+${DST_PORT_GRP}|object\s+${DST_PORT_OBJECT})\s+){0,1}(${ICMP_KEY_VALUE}(\s+${ICMP_VALUE})?\s+){0,1}((log\s+(${LOG_LEVEL}\s+interval\s+${LOG_INTERVAL}|disable|default))\s+){0,1}(time\-range\s+${TIME_RANGE}\s+){0,1}(${ACE_STATE}\s+){0,1}\(hitcnt=${HIT_COUNT}\)\s+(\(inactive\)\s+){0,1}${LINE_HASH}\s* -> Record + ^\s+access\-list\s* -> NoRecord + ^access-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+remark\s+${REMARK}\s* -> Record + ^.* -> Error "Did not match any rules" diff --git a/asa/policies_samples/2 b/asa/policies_samples/2 new file mode 100644 index 0000000..6eea531 --- /dev/null +++ b/asa/policies_samples/2 @@ -0,0 +1,27 @@ +access-list privet; 18 elements; name hash: 0xefbebe65 +access-list privet line 1 remark description_test +access-list privet line 2 extended permit ospf object-group-user DM_INLINE_USER_2 any any log notifications interval 300 time-range test (hitcnt=0) 0xf6a7844b +access-list privet line 3 remark Description_string1 +access-list privet line 4 remark Description_string2 +access-list privet line 5 extended permit tcp object-group-user DM_INLINE_USER_3 any4 eq ftp any log alerts interval 300 time-range test (hitcnt=0) 0xc1b3a980 +access-list privet line 6 extended permit tcp any any object-group SERVICE_TEST_GROUP_TCP (hitcnt=0) 0xcd904c71 + access-list privet line 6 extended permit tcp any any eq bgp (hitcnt=0) 0xd0c07b5e +access-list privet line 7 extended permit tcp any object-group-security test_resolved_sec_group any object-group TCP_TEST_GROUP (hitcnt=0) 0xabd765ab + access-list privet line 7 extended permit tcp any security-group name resolved(unresolved) any range 100 200 (hitcnt=0) (inactive) 0x2d20941a +access-list privet line 8 extended permit 22 any any (hitcnt=0) 0x78153e47 +access-list privet line 9 extended permit ip any any (hitcnt=0) 0xda4ada01 +access-list privet line 10 extended permit object-group TCPUDP any eq tacacs any eq talk (hitcnt=0) 0x8ba25c62 + access-list privet line 10 extended permit udp any eq tacacs any eq talk (hitcnt=0) 0x0ca1b296 + access-list privet line 10 extended permit tcp any eq tacacs any eq talk (hitcnt=0) 0x6e50e509 +access-list privet line 11 extended permit object-group TCPUDP any any object-group TCPUDP_SERVICE_GROUP_TEST inactive (hitcnt=0) (inactive) 0x58d4348f + access-list privet line 11 extended permit udp any any eq domain inactive (hitcnt=0) (inactive) 0x76f558c7 + access-list privet line 11 extended permit udp any any eq nfs inactive (hitcnt=0) (inactive) 0x1adfbbe0 + access-list privet line 11 extended permit tcp any any eq domain inactive (hitcnt=0) (inactive) 0xcb660d27 + access-list privet line 11 extended permit tcp any any eq nfs inactive (hitcnt=0) (inactive) 0xaddac76f +access-list privet line 12 extended permit udp object-group TEST_NET_GROUP any (hitcnt=0) 0x702ed2e2 + access-list privet line 12 extended permit udp any6 any (hitcnt=0) 0x2b0a59df + access-list privet line 12 extended permit udp any4 any (hitcnt=0) 0xf9aecfa0 + access-list privet line 12 extended permit udp 172.31.142.0 255.255.255.0 any (hitcnt=0) 0x6d00c1e3 +access-list privet line 13 extended permit ip any object range_object_net log critical interval 300 time-range test (hitcnt=0) 0x15480b53 + access-list privet line 13 extended permit ip any range 192.254.24.6 192.254.24.15 log critical interval 300 time-range test (hitcnt=0) 0x15480b53 +access-list privet line 14 extended permit ip host 145.252.24.2 any (hitcnt=0) 0xc29e3a56 diff --git a/asa/recursion_groups.py b/asa/recursion_groups.py new file mode 100644 index 0000000..747771f --- /dev/null +++ b/asa/recursion_groups.py @@ -0,0 +1,254 @@ +from tokenize import group + + +network_groups = { + "FQDN_GROUP": { + "name": "FQDN_GROUP", + "description": "123", + "members": [ + { + "type": "object", + "net_object": "FQDN_OBJ" + } + ] + }, + "ds_group_1": { + "name": "ds_group_1", + "description": "some description", + "members": [ + { + "net_object": "2001:db8:85a3::", + "prefix_length": "65" + }, + { + "type": "172.31.142.0", + "host": "255.255.255.0" + }, + { + "type": "object", + "net_object": "ds_object_fqdn_v4" + }, + { + "type": "object", + "net_object": "ds_object_network_v4" + }, + { + "type": "object", + "net_object": "tetetet" + }, + { + "type": "group", + "grp_object": "FQDN_GROUP" + } + ] + }, + "net_group1": { + "name": "net_group1", + "description": "", + "members": [ + { + "type": "group", + "grp_object": "FQDN_GROUP" + }, + { + "type": "object", + "net_object": "ds_object_host_v6" + }, + { + "type": "object", + "net_object": "ds_object_network_v4" + } + ] + }, + "net_group2": { + "name": "net_group2", + "description": "", + "members": [ + { + "net_object": "2001:db8:85a3::", + "prefix_length": "65" + }, + { + "type": "group", + "grp_object": "ds_group_1" + }, + { + "type": "group", + "grp_object": "net_group1" + } + ] + }, + "net_group3": { + "name": "net_group3", + "description": "", + "members": [ + { + "type": "object", + "net_object": "ds_object_range_v6" + }, + { + "type": "object", + "net_object": "hostname" + }, + { + "type": "group", + "grp_object": "net_group2" + }, + { + "type": "object", + "net_object": "tetetet" + } + ] + }, + "net_group4": { + "name": "net_group4", + "description": "", + "members": [ + { + "type": "172.31.142.0", + "host": "255.255.255.0" + }, + { + "type": "group", + "grp_object": "net_group3" + }, + { + "type": "object", + "net_object": "net_obj_ipv6" + } + ] + } +} + +network_objects = { + "FQDN_OBJ": { + "description": "descr", + "type": "fqdn", + "fqdn_ip_version": "v4", + "fqdn_address": "www.example.com" + }, + "hostname": { + "type": "subnet", + "network": "192.168.116.0", + "netmask": "255.255.255.0" + }, + "tetetet": { + "description": "123", + "type": "host", + "host": "1.2.3.4" + }, + "range_test": { + "description": "range descr", + "type": "range", + "start_ip": "1.2.3.4", + "end_ip": "4.3.2.1" + }, + "ds_object_host_v4": { + "description": "some_descr", + "type": "host", + "host": "1.2.3.4" + }, + "ds_object_host_v6": { + "description": "some descr", + "type": "host", + "host": "d46:3dfb:8158:f9fe:132a:d956:f7c8:a69a" + }, + "ds_object_range_v4": { + "type": "range", + "start_ip": "1.2.3.4", + "end_ip": "5.6.7.8" + }, + "ds_object_range_v6": { + "description": "some descr", + "type": "range", + "start_ip": "d46:3dfb:8158:f9fe:132a:d956:f7c8:a69a", + "end_ip": "d46:3dfb:8158:f9fe:132a:d956:f7c8:a69b" + }, + "ds_object_network_v4": { + "type": "subnet", + "network": "1.2.3.0", + "netmask": "255.255.255.0" + }, + "ds_object_fqdn_v4": { + "type": "fqdn", + "fqdn_ip_version": "v4", + "fqdn_address": "www.ya.ru" + }, + "ds_object_fqdn_v6": { + "description": "some descr", + "type": "fqdn", + "fqdn_ip_version": "v6", + "fqdn_address": "www.example.com" + }, + "net_obj_ipv6": { + "type": "subnet", + "network": "2001:db8:85a3::", + "prefix_length": "48" + }, + "172.31.142.54": { + "type": "host", + "host": "172.31.142.54" + }, + "1.1.1.1": { + "type": "host", + "host": "1.1.1.1" + } +} + + +def parse_member(group_member, parsed_members): + member_type = group_member.get("type", None) + if not member_type: + parsed_members.append(group_member) + return parsed_members + if member_type == "object": + parsed_members.append(network_objects[group_member["net_object"]]) + return parsed_members + if group_member["type"] == "group": + group_members = network_groups[group_member["grp_object"]]["members"] + for in_member in group_members: + parse_member(in_member, parsed_members) + else: + parsed_members.append(group_member) + return parsed_members + + +parsed_groups = {} +for group_name, group_inners in network_groups.items(): + tmp_members = [] + for member in group_inners["members"]: + parse_member(member, tmp_members) + del group_inners["members"] + parsed_groups[group_name] = group_inners + parsed_groups[group_name]["members"] = tmp_members + + + +# GPT Code + +# def parse_member(group_member, parsed_members, network_objects, network_groups): +# member_type = group_member.get("type") +# if not member_type: +# parsed_members.append(group_member) +# elif member_type == "object": +# parsed_members.append(network_objects.get(group_member["net_object"])) +# elif member_type == "group": +# group_members = network_groups.get(group_member["grp_object"], {}).get("members", []) +# for in_member in group_members: +# parse_member(in_member, parsed_members, network_objects, network_groups) + + +# def optimize_groups(network_objects, network_groups): +# parsed_groups = {} +# for group_name, group_inners in network_groups.items(): +# tmp_members = [] +# for member in group_inners.get("members", []): +# parse_member(member, tmp_members, network_objects, network_groups) +# parsed_groups[group_name] = group_inners.copy() +# parsed_groups[group_name]["members"] = tmp_members +# del parsed_groups[group_name]["members"] # Removing redundant members +# return parsed_groups + + +# # Example usage +# optimized_groups = optimize_groups(network_objects, network_groups) \ No newline at end of file diff --git a/asa/recursion_services.py b/asa/recursion_services.py new file mode 100644 index 0000000..5b8ca30 --- /dev/null +++ b/asa/recursion_services.py @@ -0,0 +1,1627 @@ +import json +from pprint import pprint +raw_service_objects = [ + { + "name": "service_tcp_destination", + "description": "TCP: Only destination", + "type": "tcp", + "destination": "1" + }, + { + "name": "service_udp_all", + "description": "UDP: source and destination", + "type": "udp", + "source": "2", + "destination": "1" + }, + { + "name": "service_icmp_all", + "description": "ICMP: type + code", + "type": "icmp", + "icmp_type": "1", + "icmp_code": "2" + }, + { + "name": "service_icmp6_all", + "description": "ICMP6: type + code", + "type": "icmp", + "icmp_type": "254", + "icmp_code": "0" + }, + { + "name": "service_protocol_23", + "description": "Protocol: 23", + "protocol": "23" + }, + { + "name": "service_protocol_name", + "description": "Protocol: Name \"ip\"", + "protocol": "ip" + }, + { + "name": "service_tcp_source", + "description": "TCP: Only source", + "type": "tcp", + "source": "123" + }, + { + "name": "service_tcp_all", + "description": "TCP: destination and source", + "type": "tcp", + "source": "2", + "destination": "1" + }, + { + "name": "service_udp_source", + "description": "UDP: Only source", + "type": "udp", + "source": "1" + }, + { + "name": "service_udp_destination", + "description": "UDP: only destination", + "type": "udp", + "destination": "1" + }, + { + "name": "service_icmp_type", + "description": "ICMP: only type", + "type": "icmp" + }, + { + "name": "service_icmp6_type", + "description": "ICMP6: type only", + "type": "icmp" + }, + { + "name": "service_protocol_12", + "description": "Protocol: 12", + "protocol": "12" + }, + { + "name": "service_tcp_no_descr", + "type": "tcp", + "source": "2", + "destination": "1" + }, + { + "name": "tcp_obj", + "description": "descr", + "type": "tcp", + "destination": "455" + }, + { + "name": "udp_obj", + "description": "descr", + "type": "udp", + "destination": "456" + }, + { + "name": "icmp_obj", + "description": "descr", + "type": "icmp", + "icmp_type": "250", + "icmp_code": "5" + }, + { + "name": "icmp6_obj", + "description": "descr", + "type": "icmp", + "icmp_type": "250", + "icmp_code": "5" + }, + { + "name": "protocol_obj", + "description": "descr", + "protocol": "252" + } +] + +service_objects = {} +for item in raw_service_objects: + name = item["name"] + service_objects[name] = item + +base_service_groups = { + "test_service_group": { + "name": "test_service_group", + "type": "", + "description": "", + "members": [ + { + "service_object_name": "service_udp_all" + }, + { + "service_object_name": "service_tcp_destination" + } + ] + }, + "tcpudp_service_grp": { + "name": "tcpudp_service_grp", + "type": "tcp-udp", + "description": "", + "members": [ + { + "port": "discard" + }, + { + "port": "nfs" + } + ] + }, + "test_tcp_grp": { + "name": "test_tcp_grp", + "type": "tcp", + "description": "TCP group description", + "members": [ + { + "port": "aol" + }, + { + "port": "citrix-ica" + } + ] + }, + "udp_test_service_group": { + "name": "udp_test_service_group", + "type": "udp", + "description": "", + "members": [ + { + "port": "biff" + }, + { + "port": "www" + } + ] + }, + "UDP_grp_test": { + "name": "UDP_grp_test", + "type": "udp", + "description": "Description", + "members": [ + { + "group_name": "tcpudp_service_grp" + }, + { + "port": "23" + }, + { + "port_range_start": "23", + "port_range_finish": "bootps" + }, + { + "port": "www" + } + ] + }, + "TCP_GROUP_all": { + "name": "TCP_GROUP_all", + "type": "tcp", + "description": "description", + "members": [ + { + "port_range_start": "1", + "port_range_finish": "65535" + }, + { + "port": "5" + }, + { + "port_range_start": "5", + "port_range_finish": "255" + }, + { + "port": "aol" + }, + { + "port": "bgp" + }, + { + "port": "chargen" + }, + { + "port": "cifs" + }, + { + "port": "citrix-ica" + }, + { + "port": "ctiqbe" + }, + { + "port": "daytime" + }, + { + "port": "discard" + }, + { + "port": "domain" + }, + { + "port": "echo" + }, + { + "port": "exec" + }, + { + "port": "finger" + }, + { + "port": "ftp" + }, + { + "port": "ftp-data" + }, + { + "port": "gopher" + }, + { + "port": "h323" + }, + { + "port": "hostname" + }, + { + "port": "www" + }, + { + "port": "https" + }, + { + "port": "ident" + }, + { + "port": "imap4" + }, + { + "port": "irc" + }, + { + "port": "kerberos" + }, + { + "port": "klogin" + }, + { + "port": "kshell" + }, + { + "port": "ldap" + }, + { + "port": "ldaps" + }, + { + "port": "login" + }, + { + "port": "lotusnotes" + }, + { + "port": "lpd" + }, + { + "port": "netbios-ssn" + }, + { + "port": "nfs" + }, + { + "port": "nntp" + }, + { + "port": "pcanywhere-data" + }, + { + "port": "pim-auto-rp" + }, + { + "port": "pop2" + }, + { + "port": "pop3" + }, + { + "port": "pptp" + }, + { + "port": "rsh" + }, + { + "port": "rtsp" + }, + { + "port": "sip" + }, + { + "port": "smtp" + }, + { + "port": "sqlnet" + }, + { + "port": "ssh" + }, + { + "port": "sunrpc" + }, + { + "port": "tacacs" + }, + { + "port": "talk" + }, + { + "port": "telnet" + }, + { + "port": "uucp" + }, + { + "port": "whois" + }, + { + "group_name": "tcpudp_service_grp" + }, + { + "group_name": "test_tcp_grp" + } + ] + }, + "TCP_GROUP1": { + "name": "TCP_GROUP1", + "type": "tcp", + "description": "description", + "members": [ + { + "group_name": "TCP_GROUP_all" + }, + { + "group_name": "tcpudp_service_grp" + } + ] + }, + "TCP_GROUP2": { + "name": "TCP_GROUP2", + "type": "tcp", + "description": "", + "members": [ + { + "port": "54" + }, + { + "port_range_start": "54", + "port_range_finish": "255" + }, + { + "port": "aol" + }, + { + "port": "bgp" + } + ] + }, + "UDP_GROUP1": { + "name": "UDP_GROUP1", + "type": "udp", + "description": "description", + "members": [ + { + "group_name": "tcpudp_service_grp" + }, + { + "group_name": "udp_test_service_group" + } + ] + }, + "UDP_GROUP2": { + "name": "UDP_GROUP2", + "type": "udp", + "description": "", + "members": [ + { + "port": "356" + }, + { + "port": "bootps" + }, + { + "port": "cifs" + }, + { + "port": "discard" + } + ] + }, + "UDP_GROUP3": { + "name": "UDP_GROUP3", + "type": "udp", + "description": "description", + "members": [ + { + "port": "305" + }, + { + "port": "45" + }, + { + "port": "47" + } + ] + }, + "UDP_GROUP4": { + "name": "UDP_GROUP4", + "type": "udp", + "description": "", + "members": [ + { + "port_range_start": "5", + "port_range_finish": "35" + }, + { + "port_range_start": "78", + "port_range_finish": "6557" + } + ] + }, + "UDP_GROUP_all": { + "name": "UDP_GROUP_all", + "type": "udp", + "description": "description", + "members": [ + { + "group_name": "UDP_grp_test" + }, + { + "group_name": "tcpudp_service_grp" + }, + { + "port": "0" + }, + { + "port_range_start": "0", + "port_range_finish": "2" + }, + { + "port_range_start": "54", + "port_range_finish": "2456" + }, + { + "port": "56" + }, + { + "port": "biff" + }, + { + "port": "bootpc" + }, + { + "port": "bootps" + }, + { + "port": "cifs" + }, + { + "port": "discard" + }, + { + "port": "dnsix" + }, + { + "port": "domain" + }, + { + "port": "echo" + }, + { + "port": "www" + }, + { + "port": "isakmp" + }, + { + "port": "kerberos" + }, + { + "port": "mobile-ip" + }, + { + "port": "nameserver" + }, + { + "port": "netbios-dgm" + }, + { + "port": "netbios-ns" + }, + { + "port": "nfs" + }, + { + "port": "ntp" + }, + { + "port": "pcanywhere-status" + }, + { + "port": "pim-auto-rp" + }, + { + "port": "radius" + }, + { + "port": "radius-acct" + }, + { + "port": "rip" + }, + { + "port": "secureid-udp" + }, + { + "port": "sip" + }, + { + "port": "snmp" + }, + { + "port": "snmptrap" + }, + { + "port": "sunrpc" + }, + { + "port": "syslog" + }, + { + "port": "tacacs" + }, + { + "port": "talk" + }, + { + "port": "tftp" + }, + { + "port": "time" + }, + { + "port": "who" + }, + { + "port": "xdmcp" + }, + { + "group_name": "udp_test_service_group" + } + ] + }, + "TCP_GROUP": { + "name": "TCP_GROUP", + "type": "tcp", + "description": "long descriptiooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooon", + "members": [ + { + "port": "aol" + }, + { + "port": "bgp" + }, + { + "port": "chargen" + } + ] + }, + "TCP-UDP_GROUP1": { + "name": "TCP-UDP_GROUP1", + "type": "tcp-udp", + "description": "", + "members": [ + { + "group_name": "tcpudp_service_grp" + } + ] + }, + "TCP-UDP_GROUP2": { + "name": "TCP-UDP_GROUP2", + "type": "tcp-udp", + "description": "", + "members": [ + { + "port": "cifs" + }, + { + "port": "discard" + }, + { + "port": "domain" + }, + { + "port": "echo" + }, + { + "port": "www" + }, + { + "port": "kerberos" + }, + { + "port": "nfs" + } + ] + }, + "TCP-UDP_GROUP3": { + "name": "TCP-UDP_GROUP3", + "type": "tcp-udp", + "description": "description", + "members": [ + { + "port": "2030" + }, + { + "port": "45" + } + ] + }, + "TCP-UDP_GROUP4": { + "name": "TCP-UDP_GROUP4", + "type": "tcp-udp", + "description": "", + "members": [ + { + "port_range_start": "43", + "port_range_finish": "654" + }, + { + "port_range_start": "687", + "port_range_finish": "6554" + } + ] + }, + "TCP-UDP_GROUP_all": { + "name": "TCP-UDP_GROUP_all", + "type": "tcp-udp", + "description": "description", + "members": [ + { + "port_range_start": "2000", + "port_range_finish": "2100" + }, + { + "port": "56" + }, + { + "port_range_start": "56", + "port_range_finish": "6574" + }, + { + "port": "cifs" + }, + { + "port": "discard" + }, + { + "port": "domain" + }, + { + "port": "echo" + }, + { + "port": "www" + }, + { + "port": "kerberos" + }, + { + "port": "nfs" + }, + { + "port": "pim-auto-rp" + }, + { + "port": "sip" + }, + { + "port": "sunrpc" + }, + { + "port": "tacacs" + }, + { + "port": "talk" + }, + { + "group_name": "tcpudp_service_grp" + } + ] + }, + "SERVICE_GROUP1": { + "name": "SERVICE_GROUP1", + "type": "", + "description": "description", + "members": [ + { + "group_name": "test_service_group" + } + ] + }, + "SERVICE_GROUP2": { + "name": "SERVICE_GROUP2", + "type": "", + "description": "description", + "members": [ + { + "service_object_name": "service_icmp6_all" + }, + { + "service_object_name": "service_icmp_all" + }, + { + "service_object_name": "service_protocol_23" + }, + { + "service_object_name": "service_protocol_name" + }, + { + "service_object_name": "service_tcp_all" + }, + { + "service_object_name": "service_tcp_destination" + }, + { + "service_object_name": "service_tcp_source" + }, + { + "service_object_name": "service_udp_all" + }, + { + "service_object_name": "service_udp_destination" + }, + { + "service_object_name": "service_udp_source" + } + ] + }, + "SERVICE_GROUP3": { + "name": "SERVICE_GROUP3", + "type": "", + "description": "", + "members": [ + { + "protocol": "ip" + }, + { + "protocol": "icmp" + }, + { + "protocol": "snp" + }, + { + "protocol": "udp" + }, + { + "protocol": "igmp" + }, + { + "protocol": "ipinip" + }, + { + "protocol": "gre" + }, + { + "protocol": "esp" + }, + { + "protocol": "icmp6" + }, + { + "protocol": "tcp" + }, + { + "protocol": "igrp" + }, + { + "protocol": "icmp", + "icmp_type": "echo" + }, + { + "protocol": "icmp", + "icmp_type": "echo-reply" + }, + { + "protocol": "icmp", + "icmp_type": "information-reply" + }, + { + "protocol": "icmp", + "icmp_type": "information-request" + }, + { + "protocol": "icmp", + "icmp_type": "mask-reply" + }, + { + "protocol": "tcp-udp", + "destination_port": "www" + }, + { + "protocol": "tcp-udp", + "destination_port": "kerberos" + }, + { + "protocol": "tcp-udp", + "destination_port": "sip" + }, + { + "protocol": "tcp-udp", + "destination_port": "sunrpc" + }, + { + "protocol": "tcp", + "destination_port": "bgp" + }, + { + "protocol": "tcp", + "destination_port": "chargen" + }, + { + "protocol": "tcp", + "destination_port": "cifs" + }, + { + "protocol": "tcp", + "destination_port": "citrix-ica" + }, + { + "protocol": "tcp", + "destination_port": "ctiqbe" + }, + { + "protocol": "tcp", + "destination_port": "daytime" + }, + { + "protocol": "tcp", + "destination_port": "discard" + }, + { + "protocol": "tcp", + "destination_port": "domain" + }, + { + "protocol": "tcp", + "destination_port": "echo" + }, + { + "protocol": "udp", + "destination_port": "isakmp" + }, + { + "protocol": "udp", + "destination_port": "kerberos" + }, + { + "protocol": "udp", + "destination_port": "mobile-ip" + }, + { + "protocol": "udp", + "destination_port": "nameserver" + } + ] + }, + "SERVICE_GROUP4": { + "name": "SERVICE_GROUP4", + "type": "", + "description": "description", + "members": [ + { + "service_object_name": "icmp6_obj" + }, + { + "service_object_name": "icmp_obj" + }, + { + "service_object_name": "protocol_obj" + }, + { + "protocol": "tcp-udp", + "destination_port": "456" + }, + { + "service_object_name": "tcp_obj" + }, + { + "service_object_name": "udp_obj" + } + ] + }, + "SERVICE_GROUP_all": { + "name": "SERVICE_GROUP_all", + "type": "", + "description": "description", + "members": [ + { + "protocol": "ip" + }, + { + "protocol": "udp" + }, + { + "protocol": "ah" + }, + { + "protocol": "tcp" + }, + { + "protocol": "icmp", + "icmp_type": "echo" + }, + { + "protocol": "icmp6", + "icmp_type": "router-solicitation" + }, + { + "service_object_name": "icmp6_obj" + }, + { + "service_object_name": "protocol_obj" + }, + { + "service_object_name": "service_icmp_all" + }, + { + "service_object_name": "service_tcp_destination" + }, + { + "protocol": "tcp-udp", + "destination_port": "kerberos" + }, + { + "protocol": "tcp", + "destination_port": "chargen" + }, + { + "protocol": "tcp", + "destination_port": "cifs" + }, + { + "group_name": "test_service_group" + }, + { + "protocol": "udp", + "destination_port": "nfs" + }, + { + "service_object_name": "udp_obj" + } + ] + }, + "ip_serv_group_1": { + "name": "ip_serv_group_1", + "type": "", + "description": "", + "members": [ + { + "group_name": "SERVICE_GROUP1" + }, + { + "group_name": "SERVICE_GROUP2" + }, + { + "service_object_name": "service_icmp_all" + }, + { + "service_object_name": "udp_obj" + } + ] + }, + "ip_serv_group2": { + "name": "ip_serv_group2", + "type": "", + "description": "", + "members": [ + { + "group_name": "SERVICE_GROUP3" + }, + { + "service_object_name": "icmp_obj" + }, + { + "group_name": "ip_serv_group_1" + } + ] + }, + "ip_serv_group3": { + "name": "ip_serv_group3", + "type": "", + "description": "", + "members": [ + { + "group_name": "ip_serv_group2" + }, + { + "service_object_name": "tcp_obj" + }, + { + "group_name": "test_service_group" + } + ] + }, + "tcp_serv_group1": { + "name": "tcp_serv_group1", + "type": "tcp", + "description": "", + "members": [ + { + "group_name": "TCP_GROUP" + }, + { + "group_name": "TCP_GROUP1" + } + ] + }, + "tcp_serv_group2": { + "name": "tcp_serv_group2", + "type": "tcp", + "description": "", + "members": [ + { + "port": "bgp" + }, + { + "port": "chargen" + }, + { + "group_name": "tcp_serv_group1" + } + ] + }, + "tcp_serv_group3": { + "name": "tcp_serv_group3", + "type": "tcp", + "description": "", + "members": [ + { + "group_name": "tcp_serv_group1" + }, + { + "group_name": "tcp_serv_group2" + } + ] + }, + "tcpudp_serv_group1": { + "name": "tcpudp_serv_group1", + "type": "tcp-udp", + "description": "", + "members": [ + { + "group_name": "TCP-UDP_GROUP2" + } + ] + }, + "tcpudp_serv_group2": { + "name": "tcpudp_serv_group2", + "type": "tcp-udp", + "description": "", + "members": [ + { + "group_name": "TCP-UDP_GROUP3" + }, + { + "port": "kerberos" + }, + { + "port": "nfs" + }, + { + "group_name": "tcpudp_serv_group1" + } + ] + }, + "tcpudp_serv_group3": { + "name": "tcpudp_serv_group3", + "type": "tcp-udp", + "description": "", + "members": [ + { + "group_name": "tcpudp_serv_group1" + }, + { + "group_name": "tcpudp_serv_group2" + } + ] + } +} + +icmp_service_groups = { + "icmp_test_grp": { + "name": "icmp_test_grp", + "type": "icmp", + "description": "", + "members": [ + { + "icmp_object_name": "mobile-redirect" + }, + { + "icmp_object_name": "router-advertisement" + } + ] + }, + "ICMP_GROUP1": { + "name": "ICMP_GROUP1", + "type": "icmp", + "description": "", + "members": [ + { + "group_name": "icmp_test_grp" + } + ] + }, + "ICMP_GROUP2": { + "name": "ICMP_GROUP2", + "type": "icmp", + "description": "description", + "members": [ + { + "icmp_object_name": "echo" + }, + { + "icmp_object_name": "echo-reply" + }, + { + "icmp_object_name": "information-reply" + }, + { + "icmp_object_name": "information-request" + }, + { + "icmp_object_name": "redirect" + } + ] + }, + "ICMP_GROUP3": { + "name": "ICMP_GROUP3", + "type": "icmp", + "description": "description", + "members": [ + { + "icmp_object_name": "146" + }, + { + "icmp_object_name": "33" + }, + { + "icmp_object_name": "43" + } + ] + }, + "ICMP_GROUP4_all": { + "name": "ICMP_GROUP4_all", + "type": "icmp", + "description": "description", + "members": [ + { + "group_name": "ICMP_GROUP1" + }, + { + "group_name": "ICMP_GROUP2" + }, + { + "group_name": "ICMP_GROUP3" + }, + { + "icmp_object_name": "74" + }, + { + "icmp_object_name": "alternate-address" + }, + { + "icmp_object_name": "conversion-error" + }, + { + "icmp_object_name": "echo" + }, + { + "icmp_object_name": "echo-reply" + }, + { + "icmp_object_name": "information-reply" + }, + { + "icmp_object_name": "information-request" + }, + { + "icmp_object_name": "mask-reply" + }, + { + "icmp_object_name": "mask-request" + }, + { + "icmp_object_name": "mobile-redirect" + }, + { + "icmp_object_name": "parameter-problem" + }, + { + "icmp_object_name": "redirect" + }, + { + "icmp_object_name": "router-advertisement" + }, + { + "icmp_object_name": "router-solicitation" + }, + { + "icmp_object_name": "source-quench" + }, + { + "icmp_object_name": "time-exceeded" + }, + { + "icmp_object_name": "timestamp-reply" + }, + { + "icmp_object_name": "timestamp-request" + }, + { + "icmp_object_name": "traceroute" + }, + { + "icmp_object_name": "unreachable" + }, + { + "group_name": "icmp_test_grp" + } + ] + }, + "icmp_serv_group1": { + "name": "icmp_serv_group1", + "type": "icmp", + "description": "", + "members": [ + { + "group_name": "ICMP_GROUP1" + }, + { + "group_name": "ICMP_GROUP2" + } + ] + }, + "icmp_serv_group2": { + "name": "icmp_serv_group2", + "type": "icmp", + "description": "descr", + "members": [ + { + "group_name": "ICMP_GROUP3" + }, + { + "icmp_object_name": "echo" + }, + { + "icmp_object_name": "echo-reply" + }, + { + "group_name": "icmp_serv_group1" + }, + { + "group_name": "icmp_test_grp" + } + ] + }, + "icmp_serv_group3": { + "name": "icmp_serv_group3", + "type": "icmp", + "description": "descr", + "members": [ + { + "group_name": "ICMP_GROUP3" + }, + { + "icmp_object_name": "mask-request" + }, + { + "icmp_object_name": "mobile-redirect" + }, + { + "group_name": "icmp_serv_group1" + }, + { + "group_name": "icmp_serv_group2" + } + ] + } +} + +protocol_service_groups = { + "TCPUDP": { + "name": "TCPUDP", + "type": "protocol", + "description": "", + "members": [ + { + "protocol_object": "udp" + }, + { + "protocol_object": "tcp" + } + ] + }, + "DM_INLINE_PROTOCOL_1": { + "name": "DM_INLINE_PROTOCOL_1", + "type": "protocol", + "description": "", + "members": [ + { + "protocol_object": "icmp" + }, + { + "protocol_object": "8" + } + ] + }, + "test_protocol_grp": { + "name": "test_protocol_grp", + "type": "protocol", + "description": "", + "members": [ + { + "protocol_object": "esp" + }, + { + "protocol_object": "igrp" + } + ] + }, + "PROTO_GROUP": { + "name": "PROTO_GROUP", + "type": "protocol", + "description": "description", + "members": [ + { + "protocol_object": "ip" + }, + { + "protocol_object": "udp" + }, + { + "protocol_object": "5" + }, + { + "protocol_object": "icmp6" + }, + { + "protocol_object": "78" + }, + { + "group_name": "TCPUDP" + } + ] + }, + "PROTO_GROUP2": { + "name": "PROTO_GROUP2", + "type": "protocol", + "description": "", + "members": [ + { + "group_name": "TCPUDP" + } + ] + }, + "PROTO_GROUP3": { + "name": "PROTO_GROUP3", + "type": "protocol", + "description": "description", + "members": [ + { + "protocol_object": "100" + }, + { + "protocol_object": "23" + }, + { + "protocol_object": "24" + } + ] + }, + "PROTO_GROUP4": { + "name": "PROTO_GROUP4", + "type": "protocol", + "description": "description", + "members": [ + { + "protocol_object": "ip" + }, + { + "protocol_object": "icmp" + }, + { + "protocol_object": "udp" + }, + { + "protocol_object": "gre" + }, + { + "protocol_object": "tcp" + } + ] + }, + "PROTO_GROUP5_all": { + "name": "PROTO_GROUP5_all", + "type": "protocol", + "description": "description", + "members": [ + { + "protocol_object": "ip" + }, + { + "protocol_object": "icmp" + }, + { + "protocol_object": "pim" + }, + { + "protocol_object": "pcp" + }, + { + "protocol_object": "snp" + }, + { + "protocol_object": "udp" + }, + { + "protocol_object": "igmp" + }, + { + "protocol_object": "255" + }, + { + "protocol_object": "ipinip" + }, + { + "protocol_object": "45" + }, + { + "protocol_object": "gre" + }, + { + "protocol_object": "esp" + }, + { + "protocol_object": "ah" + }, + { + "protocol_object": "icmp6" + }, + { + "protocol_object": "tcp" + }, + { + "protocol_object": "eigrp" + }, + { + "protocol_object": "ospf" + }, + { + "protocol_object": "igrp" + }, + { + "protocol_object": "nos" + }, + { + "group_name": "PROTO_GROUP" + }, + { + "group_name": "PROTO_GROUP2" + }, + { + "group_name": "PROTO_GROUP3" + }, + { + "group_name": "PROTO_GROUP4" + }, + { + "group_name": "TCPUDP" + }, + { + "group_name": "test_protocol_grp" + } + ] + }, + "proto_serv_group1": { + "name": "proto_serv_group1", + "type": "protocol", + "description": "descr", + "members": [ + { + "protocol_object": "ip" + }, + { + "protocol_object": "icmp" + }, + { + "protocol_object": "udp" + }, + { + "protocol_object": "gre" + }, + { + "protocol_object": "esp" + }, + { + "protocol_object": "icmp6" + }, + { + "protocol_object": "tcp" + }, + { + "group_name": "PROTO_GROUP" + }, + { + "group_name": "PROTO_GROUP2" + } + ] + }, + "proto_serv_group2": { + "name": "proto_serv_group2", + "type": "protocol", + "description": "descr", + "members": [ + { + "protocol_object": "ip" + }, + { + "protocol_object": "ipinip" + }, + { + "protocol_object": "igrp" + }, + { + "group_name": "PROTO_GROUP" + }, + { + "group_name": "TCPUDP" + }, + { + "group_name": "proto_serv_group1" + } + ] + } +} + +service_groups = base_service_groups.copy() +service_groups.update(icmp_service_groups) +service_groups.update(protocol_service_groups) + + +def parse_member(service_member, parsed_members): + """kek""" + service_object = service_member.get("service_object_name", None) + group_name = service_member.get("group_name", None) + if service_object: + parsed_members.append(service_objects[service_object]) + return parsed_members + if group_name: + group_to_reparse = service_groups[service_member["group_name"]] + inner_service_members = group_to_reparse["members"] + for in_member in inner_service_members: + parse_member(in_member, parsed_members) + else: + parsed_members.append(service_member) + return parsed_members + + +parsed_services = {} +for service_name, service_inners in service_groups.items(): + tmp_members = [] + for member in service_inners["members"]: + parse_member(member, tmp_members) + del service_inners["members"] + parsed_services[service_name] = service_inners + parsed_services[service_name]["members"] = tmp_members + +f = open("services_groups.json", "a") +json.dump(parsed_services, f) +f.close() diff --git a/asa/test.log b/asa/test.log new file mode 100644 index 0000000..df6e12b --- /dev/null +++ b/asa/test.log @@ -0,0 +1,511 @@ +DEBUG:paramiko.transport:starting thread (client mode): 0xc4c66320 +DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_3.4.0 +DEBUG:paramiko.transport:Remote version/idstring: SSH-2.0-Cisco-1.25 +INFO:paramiko.transport:Connected (version 2.0, client Cisco-1.25) +DEBUG:paramiko.transport:=== Key exchange possibilities === +DEBUG:paramiko.transport:kex algos: diffie-hellman-group1-sha1 +DEBUG:paramiko.transport:server key: ssh-rsa +DEBUG:paramiko.transport:client encrypt: aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr +DEBUG:paramiko.transport:server encrypt: aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr +DEBUG:paramiko.transport:client mac: hmac-sha1, hmac-sha1-96 +DEBUG:paramiko.transport:server mac: hmac-sha1, hmac-sha1-96 +DEBUG:paramiko.transport:client compress: none +DEBUG:paramiko.transport:server compress: none +DEBUG:paramiko.transport:client lang: +DEBUG:paramiko.transport:server lang: +DEBUG:paramiko.transport:kex follows: False +DEBUG:paramiko.transport:=== Key exchange agreements === +DEBUG:paramiko.transport:Kex: diffie-hellman-group1-sha1 +DEBUG:paramiko.transport:HostKey: ssh-rsa +DEBUG:paramiko.transport:Cipher: aes128-ctr +DEBUG:paramiko.transport:MAC: hmac-sha1 +DEBUG:paramiko.transport:Compression: none +DEBUG:paramiko.transport:=== End of kex handshake === +DEBUG:paramiko.transport:kex engine KexGroup1 specified hash_algo +DEBUG:paramiko.transport:Switch to new keys ... +DEBUG:paramiko.transport:Adding ssh-rsa host key for 172.31.142.14: b'cb9cd264fd6ee3861e726078c83a4600' +DEBUG:paramiko.transport:userauth is OK +INFO:paramiko.transport:Authentication (password) successful! +DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes +DEBUG:paramiko.transport:[chan 0] Max packet out: 4096 bytes +DEBUG:paramiko.transport:Secsh channel 0 opened. +DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok +DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:write_channel: b'show curpriv\n' +DEBUG:netmiko:read_channel: Type help or '?' for a list of available commands. +ciscoasa/admin> +ciscoasa/admin> +DEBUG:netmiko:read_channel: show curpriv +Username : user +Current privilege level : 1 +Current Mode/s : P_UNPR +ciscoasa/admin> +DEBUG:netmiko:Pattern found: (show\ curpriv) Type help or '?' for a list of available commands. +ciscoasa/admin> +ciscoasa/admin> show curpriv +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Clear buffer detects data in the channel +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin> +DEBUG:netmiko: +Parenthesis found in pattern. + +pattern: (\#|>) + + +This can be problemtic when used in read_until_pattern(). + +You should ensure that you use either non-capture groups i.e. '(?:' or that the +parenthesis completely wrap the pattern '(pattern)' +DEBUG:netmiko:Pattern found: (\#|>) +ciscoasa/admin> +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Clear buffer detects data in the channel +DEBUG:netmiko:read_channel: +DEBUG:netmiko:[find_prompt()]: prompt is ciscoasa/admin> +DEBUG:netmiko:write_channel: b'login\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: login +Username: +DEBUG:netmiko:Pattern found: (login) login +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'user\n' +DEBUG:netmiko:read_channel: user +Password: +DEBUG:netmiko:write_channel: b'********\n' +DEBUG:netmiko:read_channel: *********** +ciscoasa/admin# +DEBUG:netmiko:In disable_paging +DEBUG:netmiko:Command: terminal pager 0 + +DEBUG:netmiko:write_channel: b'terminal pager 0\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: terminal pager 0 + +DEBUG:netmiko:Pattern found: (terminal\ pager\ 0) terminal pager 0 +DEBUG:netmiko:terminal pager 0 +DEBUG:netmiko:Exiting disable_paging +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: ciscoasa/admin# +DEBUG:netmiko:Pattern found: ([>\#]) +ciscoasa/admin# +DEBUG:netmiko:write_channel: b'configure terminal\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin# +DEBUG:netmiko:read_channel: configure terminal +ciscoasa/admin(config)# +DEBUG:netmiko:Pattern found: (configure\ terminal) +ciscoasa/admin# configure terminal +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Pattern found: (ciscoasa/admin.*) +ciscoasa/admin(config)# +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin(config)# +DEBUG:netmiko:Pattern found: ([>\#]) +ciscoasa/admin(config)# +DEBUG:netmiko:write_channel: b'terminal width 511\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: terminal width +DEBUG:netmiko:read_channel: 511 +ciscoasa/admin(config)# +DEBUG:netmiko:Pattern found: (terminal\ width\ 511) terminal width 511 +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Pattern found: ((?:ciscoasa/admin.*$|#.*$)) +ciscoasa/admin(config)# +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin(config)# +DEBUG:netmiko:Pattern found: ([>\#]) +ciscoasa/admin(config)# +DEBUG:netmiko:write_channel: b'end\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: end +ciscoasa/admin# +DEBUG:netmiko:Pattern found: (end) end +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Pattern found: (#.*) +ciscoasa/admin# +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin# +DEBUG:netmiko:Pattern found: ([>\#]) +ciscoasa/admin# +DEBUG:netmiko:exit_config_mode: end +ciscoasa/admin# +DEBUG:netmiko: +ciscoasa/admin# configure terminal +ciscoasa/admin(config)# terminal width 511 +ciscoasa/admin(config)# end +ciscoasa/admin# +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Clear buffer detects data in the channel +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin# +DEBUG:netmiko: +Parenthesis found in pattern. + +pattern: (\#|>) + + +This can be problemtic when used in read_until_pattern(). + +You should ensure that you use either non-capture groups i.e. '(?:' or that the +parenthesis completely wrap the pattern '(pattern)' +DEBUG:netmiko:Pattern found: (\#|>) +ciscoasa/admin# +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Clear buffer detects data in the channel +DEBUG:netmiko:read_channel: +DEBUG:netmiko:[find_prompt()]: prompt is ciscoasa/admin# +DEBUG:netmiko:write_channel: b'login\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: login + ^ +ERROR: % Invalid input detected at '^' marker. +ciscoasa/admin# +DEBUG:netmiko:Pattern found: (login) login +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'login\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: login + ^ +ERROR: % Invalid input detected at '^' marker. +ciscoasa/admin# +DEBUG:netmiko:Pattern found: (login) login +DEBUG:netmiko:read_channel: +DEBUG:paramiko.transport:starting thread (client mode): 0x1fc6a3e0 +DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_3.4.0 +DEBUG:paramiko.transport:Remote version/idstring: SSH-2.0-Cisco-1.25 +INFO:paramiko.transport:Connected (version 2.0, client Cisco-1.25) +DEBUG:paramiko.transport:=== Key exchange possibilities === +DEBUG:paramiko.transport:kex algos: diffie-hellman-group1-sha1 +DEBUG:paramiko.transport:server key: ssh-rsa +DEBUG:paramiko.transport:client encrypt: aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr +DEBUG:paramiko.transport:server encrypt: aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr +DEBUG:paramiko.transport:client mac: hmac-sha1, hmac-sha1-96 +DEBUG:paramiko.transport:server mac: hmac-sha1, hmac-sha1-96 +DEBUG:paramiko.transport:client compress: none +DEBUG:paramiko.transport:server compress: none +DEBUG:paramiko.transport:client lang: +DEBUG:paramiko.transport:server lang: +DEBUG:paramiko.transport:kex follows: False +DEBUG:paramiko.transport:=== Key exchange agreements === +DEBUG:paramiko.transport:Kex: diffie-hellman-group1-sha1 +DEBUG:paramiko.transport:HostKey: ssh-rsa +DEBUG:paramiko.transport:Cipher: aes128-ctr +DEBUG:paramiko.transport:MAC: hmac-sha1 +DEBUG:paramiko.transport:Compression: none +DEBUG:paramiko.transport:=== End of kex handshake === +DEBUG:paramiko.transport:kex engine KexGroup1 specified hash_algo +DEBUG:paramiko.transport:Switch to new keys ... +DEBUG:paramiko.transport:Adding ssh-rsa host key for 172.31.142.14: b'cb9cd264fd6ee3861e726078c83a4600' +DEBUG:paramiko.transport:userauth is OK +INFO:paramiko.transport:Authentication (password) successful! +DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes +DEBUG:paramiko.transport:[chan 0] Max packet out: 4096 bytes +DEBUG:paramiko.transport:Secsh channel 0 opened. +DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok +DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:write_channel: b'show curpriv\n' +DEBUG:netmiko:read_channel: Type help or '?' for a list of available commands. +ciscoasa/admin> +ciscoasa/admin> +DEBUG:netmiko:read_channel: show curpriv +Username : user +Current privilege level : 1 +Current Mode/s : P_UNPR +ciscoasa/admin> +DEBUG:netmiko:Pattern found: (show\ curpriv) Type help or '?' for a list of available commands. +ciscoasa/admin> +ciscoasa/admin> show curpriv +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Clear buffer detects data in the channel +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin> +DEBUG:netmiko: +Parenthesis found in pattern. + +pattern: (\#|>) + + +This can be problemtic when used in read_until_pattern(). + +You should ensure that you use either non-capture groups i.e. '(?:' or that the +parenthesis completely wrap the pattern '(pattern)' +DEBUG:netmiko:Pattern found: (\#|>) +ciscoasa/admin> +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Clear buffer detects data in the channel +DEBUG:netmiko:read_channel: +DEBUG:netmiko:[find_prompt()]: prompt is ciscoasa/admin> +DEBUG:netmiko:write_channel: b'login\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: login +Username: +DEBUG:netmiko:Pattern found: (login) login +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'user\n' +DEBUG:netmiko:read_channel: user +Password: +DEBUG:netmiko:write_channel: b'********\n' +DEBUG:netmiko:read_channel: *********** +ciscoasa/admin# +DEBUG:netmiko:In disable_paging +DEBUG:netmiko:Command: terminal pager 0 + +DEBUG:netmiko:write_channel: b'terminal pager 0\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: terminal pager 0 +ciscoasa/admin# +DEBUG:netmiko:Pattern found: (terminal\ pager\ 0) terminal pager 0 +DEBUG:netmiko:terminal pager 0 +DEBUG:netmiko:Exiting disable_paging +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Pattern found: ([>\#]) +ciscoasa/admin# +DEBUG:netmiko:write_channel: b'configure terminal\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin# configure +DEBUG:netmiko:read_channel: terminal +ciscoasa/admin(config)# +DEBUG:netmiko:Pattern found: (configure\ terminal) +ciscoasa/admin# configure terminal +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Pattern found: (ciscoasa/admin.*) +ciscoasa/admin(config)# +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin(config)# +DEBUG:netmiko:Pattern found: ([>\#]) +ciscoasa/admin(config)# +DEBUG:netmiko:write_channel: b'terminal width 511\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: terminal width 511 +ciscoasa/admin(config)# +DEBUG:netmiko:Pattern found: (terminal\ width\ 511) terminal width 511 +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Pattern found: ((?:ciscoasa/admin.*$|#.*$)) +ciscoasa/admin(config)# +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin(config)# +DEBUG:netmiko:Pattern found: ([>\#]) +ciscoasa/admin(config)# +DEBUG:netmiko:write_channel: b'end\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: end +ciscoasa/admin# +DEBUG:netmiko:Pattern found: (end) end +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Pattern found: (#.*) +ciscoasa/admin# +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin# +DEBUG:netmiko:Pattern found: ([>\#]) +ciscoasa/admin# +DEBUG:netmiko:exit_config_mode: end +ciscoasa/admin# +DEBUG:netmiko: +ciscoasa/admin# configure terminal +ciscoasa/admin(config)# terminal width 511 +ciscoasa/admin(config)# end +ciscoasa/admin# +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Clear buffer detects data in the channel +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +ciscoasa/admin# +DEBUG:netmiko: +Parenthesis found in pattern. + +pattern: (\#|>) + + +This can be problemtic when used in read_until_pattern(). + +You should ensure that you use either non-capture groups i.e. '(?:' or that the +parenthesis completely wrap the pattern '(pattern)' +DEBUG:netmiko:Pattern found: (\#|>) +ciscoasa/admin# +DEBUG:netmiko:read_channel: +DEBUG:netmiko:Clear buffer detects data in the channel +DEBUG:netmiko:read_channel: +DEBUG:netmiko:[find_prompt()]: prompt is ciscoasa/admin# +DEBUG:netmiko:write_channel: b'login\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: login + ^ +ERROR: % Invalid input detected at '^' marker. +ciscoasa/admin# +DEBUG:netmiko:Pattern found: (login) login +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'login\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: login + ^ +ERROR: % Invalid input detected at '^' marker. +ciscoasa/admin# +DEBUG:netmiko:Pattern found: (login) login +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:write_channel: b'\n' +DEBUG:netmiko:read_channel: +ciscoasa/admin# +DEBUG:netmiko:read_channel: +DEBUG:netmiko:[find_prompt()]: prompt is ciscoasa/admin# +DEBUG:netmiko:write_channel: b'show version\n' +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: show version + +Cisco Adaptive Security Appliance Software Version 9.1(7)32 +Device Manager Version 7.12(2) + +Compiled on Tue 04-Sep-18 08:37 by builders + +ciscoasa up 51 days 6 hours + + +DEBUG:netmiko:Pattern found: (show\ version) show version +DEBUG:netmiko:read_channel: Hardware: ASA5510, 1024 MB RAM, CPU Pentium 4 Celeron 1600 MHz, +Internal ATA Compact Flash, 256MB +BIOS Flash M50FW016 @ 0xfff00000, 2048KB + +Encryption hardware device : Cisco ASA-55xx on-board accelerator (revision 0x0) + Boot microcode : CN1000-MC-BOOT-2.00 + SSL/IKE microcode : CNlite-MC-SSLm-PLUS-2.08 + IPSec microcode : CNlite-MC-IPSECm-MAIN-2.09 + Number of accelerators: 1 + + 0: Ext: Ethernet0/0 : address is 4403.a70f.e0d4, irq 9 + 1: Ext: Ethernet0/1 : address is 4403.a70f.e0d5, irq 9 + 2: Ext: Ethernet0/2 : address is 4403.a70f.e0d6, irq 9 + 3: Ext: Ethernet0/3 : address is 4403.a70f.e0d7, irq 9 + 4: Ext: Management0/0 : address is 4403.a70f.e0d8, irq 11 + 5: Int: Not used : irq 11 + 6: Int: Not used : irq 5 + +Licensed features for this platform: +Maximum Physical Interfaces : Unlimited perpetual +Maximum VLANs : 100 perpetual +Inside Hosts : Unlimited perpetual +Failover : Active/Active perpetual +Encryption-DES : Enabled perpetual +Encryption-3DES-AES : Enabled perpetual +Security Contexts : 2 perpetual +GTP/GPRS : Disabled perpetual +AnyConnect Premium Peers : 2 perpetual +AnyConnect Essentials : 250 perpetual +Other VPN Peers : 250 perpetual +Total VPN Peers : 250 perpetual +Shared License : Disabled perpetual +AnyConnect for Mobile : Enabled perpetual +AnyConnect for Cisco VPN Phone : Disabled perpetual +Advanced Endpoint Assessment : Disabled perpetual +UC Phone Proxy Sessions : 2 perpetual +Total UC Proxy Sessions : 2 perpetual +Botnet Traffic Filter : Disabled perpetual +Intercompany Media Engine : Disabled perpetual +Cluster : Disabled perpetual + +This platform has an ASA 5510 Security Plus license. + +Serial Number: JMX172180D3 +Running Permanent Activation Key: 0x9717ed4f 0x98ed5681 0x19a08924 0xd3d0bc64 0x0037cba8 + +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: +DEBUG:netmiko:read_channel: Configuration register is 0x1 +Configuration last modified by user at 17:22:40.250 GMT Wed Jul 3 2024 +ciscoasa/admin# diff --git a/astraLdap/.idea/.gitignore b/astraLdap/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/astraLdap/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/astraLdap/.idea/astraLdap.iml b/astraLdap/.idea/astraLdap.iml new file mode 100644 index 0000000..e3dbde4 --- /dev/null +++ b/astraLdap/.idea/astraLdap.iml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/astraLdap/.idea/deployment.xml b/astraLdap/.idea/deployment.xml new file mode 100644 index 0000000..3ae5c45 --- /dev/null +++ b/astraLdap/.idea/deployment.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/astraLdap/.idea/inspectionProfiles/Project_Default.xml b/astraLdap/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..ac21435 --- /dev/null +++ b/astraLdap/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/astraLdap/.idea/inspectionProfiles/profiles_settings.xml b/astraLdap/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/astraLdap/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/astraLdap/.idea/misc.xml b/astraLdap/.idea/misc.xml new file mode 100644 index 0000000..3653691 --- /dev/null +++ b/astraLdap/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/astraLdap/.idea/modules.xml b/astraLdap/.idea/modules.xml new file mode 100644 index 0000000..dc4593f --- /dev/null +++ b/astraLdap/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/astraLdap/astraLdap/__init__.py b/astraLdap/astraLdap/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/astraLdap/astraLdap/asgi.py b/astraLdap/astraLdap/asgi.py new file mode 100644 index 0000000..f158a24 --- /dev/null +++ b/astraLdap/astraLdap/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for astraLdap project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'astraLdap.settings') + +application = get_asgi_application() diff --git a/astraLdap/astraLdap/settings.py b/astraLdap/astraLdap/settings.py new file mode 100644 index 0000000..6973287 --- /dev/null +++ b/astraLdap/astraLdap/settings.py @@ -0,0 +1,126 @@ +""" +Django settings for astraLdap project. + +Generated by 'django-admin startproject' using Django 3.2. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.2/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-kyvycdk5z&4-j3%(0h$6(a36ji0dmei9teg)tw)cocg8-=v2vu' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'ldapauth' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'astraLdap.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'astraLdap.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.2/howto/static-files/ + +STATIC_URL = '/static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/astraLdap/astraLdap/urls.py b/astraLdap/astraLdap/urls.py new file mode 100644 index 0000000..b1afeae --- /dev/null +++ b/astraLdap/astraLdap/urls.py @@ -0,0 +1,22 @@ +"""astraLdap URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.2/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path("ldap/", include('ldapauth.urls')) +] diff --git a/astraLdap/astraLdap/wsgi.py b/astraLdap/astraLdap/wsgi.py new file mode 100644 index 0000000..ce3ac06 --- /dev/null +++ b/astraLdap/astraLdap/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for astraLdap project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'astraLdap.settings') + +application = get_wsgi_application() diff --git a/astraLdap/db.sqlite3 b/astraLdap/db.sqlite3 new file mode 100644 index 0000000..f382810 Binary files /dev/null and b/astraLdap/db.sqlite3 differ diff --git a/astraLdap/ldapauth/__init__.py b/astraLdap/ldapauth/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/astraLdap/ldapauth/admin.py b/astraLdap/ldapauth/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/astraLdap/ldapauth/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/astraLdap/ldapauth/apps.py b/astraLdap/ldapauth/apps.py new file mode 100644 index 0000000..e688556 --- /dev/null +++ b/astraLdap/ldapauth/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class LdapauthConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'ldapauth' diff --git a/astraLdap/ldapauth/migrations/__init__.py b/astraLdap/ldapauth/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/astraLdap/ldapauth/models.py b/astraLdap/ldapauth/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/astraLdap/ldapauth/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/astraLdap/ldapauth/services.py b/astraLdap/ldapauth/services.py new file mode 100644 index 0000000..abc0a67 --- /dev/null +++ b/astraLdap/ldapauth/services.py @@ -0,0 +1,28 @@ +import ldap + +class LdapConnectManager: + def __init__(self, ldap_ip: str, ldap_domain: str): + self.ldap_ip = ldap_ip + self.ldap_domain = ldap_domain + + def establish_ldap_connection(self): + try: + ldap_connection = ldap.initialize(f"ldap://{self.ldap_ip}") + print(ldap_connection) + return "All good" + except ldap.SERVER_DOWN: + print("Cannot connect to LDAP server") + return "Cannot connect to LDAP server" + + def user_authentication(self, username: str, password: str): + ldap_connector = ldap.initialize(f"ldap://{self.ldap_ip}") + try: + ldap_connector.bind_s(f"dc=EPP,dc=RU,cn=vasya", password) + ldap_result = ldap_connector.search("dc=EPP,dc=RU", ldap.SCOPE_SUBTREE, "(&(objectClass=Person)(cn=vasya))", None) + res_type, data = ldap_connector.result(ldap_result, 0) + print(f"\n\n\n\n\n\n\n\n\n\n{data}") + return data + except ldap.SERVER_DOWN: + return "Server is offline" + except ldap.INVALID_CREDENTIALS: + return "Password is incorrect" \ No newline at end of file diff --git a/astraLdap/ldapauth/tests.py b/astraLdap/ldapauth/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/astraLdap/ldapauth/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/astraLdap/ldapauth/urls.py b/astraLdap/ldapauth/urls.py new file mode 100644 index 0000000..6cbae0f --- /dev/null +++ b/astraLdap/ldapauth/urls.py @@ -0,0 +1,10 @@ +from django.urls import path +from rest_framework.urlpatterns import format_suffix_patterns +from . import views + +urlpatterns = [ + path('test_ldap_conncetion/', views.LdapTestConnection.as_view()), + path('test_ldap_auth//', views.LdapTestAuth.as_view()), +] + +urlpatterns = format_suffix_patterns(urlpatterns) \ No newline at end of file diff --git a/astraLdap/ldapauth/views.py b/astraLdap/ldapauth/views.py new file mode 100644 index 0000000..9f7e346 --- /dev/null +++ b/astraLdap/ldapauth/views.py @@ -0,0 +1,15 @@ +from rest_framework.views import APIView +from rest_framework.response import Response +from django.http import JsonResponse +from .services import LdapConnectManager + +class LdapTestConnection(APIView): + def get(self, request): + ldap_connector = LdapConnectManager("astra.epp.ru", "wscusers.local") + return JsonResponse({"ldap_status": ldap_connector.establish_ldap_connection()}) + + +class LdapTestAuth(APIView): + def get(self, request, username, password): + ldap_connector = LdapConnectManager("astra.epp.ru", "wscusers") + return JsonResponse({"ldap_status": ldap_connector.user_authentication(username, password)}) diff --git a/astraLdap/manage.py b/astraLdap/manage.py new file mode 100755 index 0000000..cb6f0ac --- /dev/null +++ b/astraLdap/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'astraLdap.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/classes/cls_playground.py b/classes/cls_playground.py new file mode 100644 index 0000000..fff7a38 --- /dev/null +++ b/classes/cls_playground.py @@ -0,0 +1,26 @@ +class BPerms: + pass + + +class DManage(BPerms): + pass + + +class DRead(BPerms): + pass + + +class SMCPerms: + dt = DManage + dr = DRead + + @classmethod + def get_perms_names(cls): + perms_names = [attr_name for attr_name, attr_type in cls.__dict__.items() if isinstance(attr_type, type)] + # for attr_name, attr_type in cls.__dict__.items(): + # if isinstance(attr_type, type): + # perms_names.append(attr_name) + return perms_names + + +print(SMCPerms.get_perms_names()) diff --git a/console.env b/console.env new file mode 100644 index 0000000..d4cd573 --- /dev/null +++ b/console.env @@ -0,0 +1,12 @@ +SECRET_KEY='django-insecure-hzdxy#u441-_&!jhfmxi0%w9r9xoa*oowy9aix*44f4q896ww8' +DEBUG=1 +LOG_LEVEL=INFO +DB_HOST=127.0.0.1 +DB_PORT=5432 +DB_NAME=console_db +DB_USER=console_user +DB_PASSWORD=console_user_password +REDIS_HOST=127.0.0.1 +REDIS_PORT=6379 +SMC_LICENSE_KEY='6087bee1-85b6-416e-8dce-cf5609ecc77f' +LICENSE_SERVER_ADDRESS='http://10.10.14.28:8000' \ No newline at end of file diff --git a/dashboard.drawio b/dashboard.drawio new file mode 100644 index 0000000..26c8949 --- /dev/null +++ b/dashboard.drawio @@ -0,0 +1,573 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/db_dropper_backend.py b/db_dropper_backend.py new file mode 100644 index 0000000..384b141 --- /dev/null +++ b/db_dropper_backend.py @@ -0,0 +1,35 @@ +import psycopg2 +import subprocess +import os + +# Clean all untracked migrations +os.system("git clean -xf */migrations/") + +# establishing the connection +conn = psycopg2.connect( + database="postgres", user='console_user', password='console_user_password', host='127.0.0.1', port='5432' +) +conn.autocommit = True + +# Creating a cursor object using the cursor() method +cursor = conn.cursor() + +# Preparing query to create a database +sql = '''DROP DATABASE console_db;''' +# Creating a database +try: + cursor.execute(sql) + print("Database dropped successfully ->") +except psycopg2.ProgrammingError: + print("Database license does not exists") +sql = '''CREATE database console_db;''' +cursor.execute(sql) +print("-> Database created successfully") +sql = '''grant all privileges on database console_db to console_user;''' +cursor.execute(sql) +print("Database user license_user has all rights to database license") +# Closing the connection +conn.close() + +subprocess.run(['python3', 'manage.py', 'makemigrations']) +subprocess.run(['python3', 'manage.py', 'migrate']) diff --git a/db_dropper_license.py b/db_dropper_license.py new file mode 100644 index 0000000..900284e --- /dev/null +++ b/db_dropper_license.py @@ -0,0 +1,31 @@ +import psycopg2 +import subprocess + +# establishing the connection +conn = psycopg2.connect( + database="postgres", user='license_user', password='license_user_password', host='127.0.0.1', port='5432' +) +conn.autocommit = True + +# Creating a cursor object using the cursor() method +cursor = conn.cursor() + +# Preparing query to create a database +sql = '''DROP DATABASE license;''' +# Creating a database +try: + cursor.execute(sql) + print("Database dropped successfully ->") +except psycopg2.ProgrammingError: + print("Database license does not exists") +sql = '''CREATE database license;''' +cursor.execute(sql) +print("-> Database created successfully") +sql = '''grant all privileges on database license to license_user;''' +cursor.execute(sql) +print("Database user license_user has all rights to database license") +# Closing the connection +conn.close() + +subprocess.run(['python3', 'manage.py', 'makemigrations']) +subprocess.run(['python3', 'manage.py', 'migrate']) diff --git a/db_waiter.py b/db_waiter.py new file mode 100644 index 0000000..325567a --- /dev/null +++ b/db_waiter.py @@ -0,0 +1,15 @@ +def wait_for_db_object(database_model_to_wait, model_field_to_get, model_value_to_get, timeout): + counter = 0 + while counter < timeout: + try: + if model_field_to_get == "id": + database_model_to_wait.objects.get(pk=model_value_to_get) + elif model_field_to_get == "name": + database_model_to_wait.objects.get(name=model_value_to_get) + else: + return False + return True + except database_model_to_wait.DoesNotExist: + time.sleep(1) + counter += 1 + return False \ No newline at end of file diff --git a/docker_training_bd.session.sql b/docker_training_bd.session.sql new file mode 100644 index 0000000..e69de29 diff --git a/dome_front/Dockerfile b/dome_front/Dockerfile new file mode 100644 index 0000000..8894f7b --- /dev/null +++ b/dome_front/Dockerfile @@ -0,0 +1,41 @@ +# Use Node.js LTS image as base +FROM node:lts + +# Set working directory +WORKDIR /app + +# Copy repository into container +COPY . . + +# Install Node Version Manager +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash + +# Install Node.js v18.14.0 +RUN /bin/bash -c "source ~/.bashrc && nvm install v18.14.0" + +# Export path to installed Node.js +RUN echo 'export PATH="/home/astra/.nvm/versions/node/v18.14.0/bin:${PATH}"' >> ~/.bashrc + +# Activate NVM +SHELL ["/bin/bash", "--login", "-c"] + +# Configure npm registry +RUN npm config --global set 'registry=https://nexuswatchman.t1-consulting.ru/repository/npm-group/' +RUN npm config --global set 'fund=false' + +# Install npm dependencies +RUN npm install + +# Create environment file +RUN touch .env.local + +# Populate environment file with backend URL +RUN echo 'API_URL="http://172.31.142.195:8080"' >> .env.local + +# Expose port 3000 +EXPOSE 3000 + +# Command to run the development server +CMD ["npm", "run", "dev"] + + diff --git a/drawings/test.rnote b/drawings/test.rnote new file mode 100644 index 0000000..57a941a Binary files /dev/null and b/drawings/test.rnote differ diff --git a/enums/__init__.py b/enums/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/enums/main.py b/enums/main.py new file mode 100644 index 0000000..5e4be9f --- /dev/null +++ b/enums/main.py @@ -0,0 +1,10 @@ +from enum import Enum +from typing import Any + + +class CronSettings(Enum): + MINUTE_1 = 1 + + + +print(CronSettings["MINUTE_1"].value) diff --git a/golang/go.mod b/golang/go.mod new file mode 100644 index 0000000..bc73083 --- /dev/null +++ b/golang/go.mod @@ -0,0 +1,3 @@ +module tour_of_go/exercises + +go 1.21.3 diff --git a/golang/tour_of_go/sqrt_exercise.go b/golang/tour_of_go/sqrt_exercise.go new file mode 100644 index 0000000..2bb426e --- /dev/null +++ b/golang/tour_of_go/sqrt_exercise.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" +) + +func Sqrt(x float64) float64 { + z := float64(1) + for i:=0; i<10; i++ { + z -= (z*z-x)/(2*z) + } + return z +} + +func main() { + fmt.Println(Sqrt(2)) + fmt.Println(Sqrt(4)) + fmt.Println(Sqrt(122)) +} diff --git a/ldap_test/adsearch.py b/ldap_test/adsearch.py new file mode 100644 index 0000000..3878441 --- /dev/null +++ b/ldap_test/adsearch.py @@ -0,0 +1,112 @@ +"""" +import ldap +from ldap.controls import SimplePagedResultsControl + +ldap.set_option(ldap.OPT_REFERRALS, 0) +ldap.set_option(ldap.OPT_PROTOCOL_VERSION, 3) +connection = ldap.initialize(f"ldap://10.10.14.103") +# connection.simple_bind_s("admin", "password") +base = "dc=EPP,dc=RU" +scope = ldap.SCOPE_SUBTREE +filter = "(&(objectClass=person)(description=vasya@EPP.RU))" +attrs = ['*'] +req_ctrl = SimplePagedResultsControl(criticality=True, size=1000, cookie='') +pagination_settings = SimplePagedResultsControl(criticality=True, size=1000, cookie='') +ldap_search_query = connection.search_ext( + base, ldap.SCOPE_SUBTREE, filter, attrlist=attrs, serverctrls=[pagination_settings] +) +known_ldap_resp_ctrls = { + SimplePagedResultsControl.controlType: SimplePagedResultsControl, +} +total_results = [] +pages = 0 +while True: + pages += 1 + rtype, rdata, rmsgid, serverctrls = connection.result3(ldap_search_query, + resp_ctrl_classes=known_ldap_resp_ctrls) + print(rdata) + page_controls = [ + c + for c in serverctrls + if c.controlType == SimplePagedResultsControl.controlType + ] + if page_controls: + if page_controls[0].cookie: + # Copy cookie from response control to request control + pagination_settings.cookie = page_controls[0].cookie + ldap_search_query = connection.search_ext( + base, + ldap.SCOPE_SUBTREE, + filter, + attrlist=attrs, + serverctrls=[pagination_settings] + ) + else: + break + else: + print("Warning: Server ignores RFC 2696 control.") + break + """ + +""" +import ldap +import gssapi + +user = "vasya" +password = "1234qwertY*" +mech = gssapi.Mechanism.from_name('krb5') +name = gssapi.Name(user, gssapi.NameType.user_principal_name) +creds = mech.acquire_cred_with_password(name, password) + +target = "ldap/astra.epp.ru@EPP.RU" +ctx = gssapi.SecurityContext(creds, mech) +ctx_flags = gssapi.RequirementFlag.mutual_authentication | gssapi.RequirementFlag.confidentiality +ctx.initiate_security_context(target_name=target, flags=ctx_flags) + +query = "(uid=user1)" +ldap_connection = ldap.initialize(f"ldap://epp.ru") +result = ctx.init_sec_context(lambda data: ldap_connection.sasl_interactive_bind_s("", gssapi.raw(data)), query) + + + +krb = gssapi.Name('kerberos', gssapi.NameType.krb5_nt_principal_name) +""" +""" +import ldap, ldap.sasl, urllib + +ldap_conn = ldap.initialize("ldap://epp.ru") + +auth = ldap.sasl.gssapi() + +# Bind to the LDAP server using GSSAPI authentication +ldap_conn.sasl_gssapi_bind_s('', auth) + +# Check if the bind was successful +print(ldap_conn.whoami_s()) +""" + +""" +import logging +from abc import ABC, abstractmethod +from typing import Any, Optional, Tuple, Type + +from gssapi import Name, NameType +from gssapi.exceptions import GSSError +from gssapi.raw import acquire_cred_with_password + +_log = logging.getLogger(__name__) + +""" + + +import ldap, ldap.sasl + +l = ldap.initialize("ldap://epp.ru") +auth = ldap.sasl.gssapi("") +l.sasl_bind_s("", auth, cred="") + + +res = l.search_s("dc=nil,dc=b17",ldap.SCOPE_BASE,"(objectClass=*)") +print(res) + +l.unbind() diff --git a/ldap_test/main.py b/ldap_test/main.py new file mode 100644 index 0000000..1962b8a --- /dev/null +++ b/ldap_test/main.py @@ -0,0 +1,17 @@ +#! /usr/bin/python3 + +import ldap +import ldap.sasl + +HOST = "172.31.142.142" +PORT = 636 +user_name = "wscusers\JohnDoe" +pwd = "T1Rules@123" + +if __name__ == '__main__': + ldap_conn = ldap.initialize("ldap://[%s]" % (HOST)) + ldap_conn.simple_bind_s(user_name, pwd) + try: + print(ldap_conn.whoami_s()) + except ldap.INVALID_CREDENTIALS as e: + print(e) diff --git a/ldap_test/testai.py b/ldap_test/testai.py new file mode 100644 index 0000000..7bdccbb --- /dev/null +++ b/ldap_test/testai.py @@ -0,0 +1,25 @@ +import ldap + +ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER) +conn = ldap.initialize('ldap://10.10.14.103') +# conn.simple_bind_s('admin@admin', '3pro01003ton') + + +groups = [] +results = conn.search_s('dc=EPP,dc=RU', ldap.SCOPE_SUBTREE, 'objectClass=posixGroup', ["cn", "memberUid"]) +for result in results: + print(result[1]) + groups.append(result[1]['cn'][0].decode('utf-8')) + +print(groups) + +# for group in groups: +# group_name = group +# group_users = conn.search_s('dc=EPP,dc=RU', ldap.SCOPE_BASE, "(objectClass=posixGroup)", ["*"]) +# print(group_users) +# user_list = [] +# for user in group_users[0][1]["memberUid"]: +# user_dn = "uid={},ou=users,dc=EPP,dc=RU".format(user.decode()) +# user_data = conn.search_s(user_dn, ldap.SCOPE_BASE) +# user_list.append(user_data[0][1]["cn"][0]) +# print("Group {} contains users: {}".format(group_name, ", ".join(user_list))) \ No newline at end of file diff --git a/leetcode.py b/leetcode.py new file mode 100644 index 0000000..7890a15 --- /dev/null +++ b/leetcode.py @@ -0,0 +1,25 @@ +from typing import List + + +class Solution: + def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None: + """ + Do not return anything, modify nums1 in-place instead. + """ + iterator = 0 + nums1 = nums1[:m] + nums2 = nums2[:n] + while nums2: + try: + if nums1[iterator] >= nums2[0]: + nums1.insert(iterator, nums2[0]) + nums2.pop(0) + iterator += 1 + except IndexError: + nums1 += nums2 + break + print(nums1) + + +sl = Solution() +sl.merge([1, 2, 3, 0, 0, 0], 3, [2, 5, 6], 3) diff --git a/license_generator.py b/license_generator.py new file mode 100644 index 0000000..e69de29 diff --git a/license_server/license_server/__init__.py b/license_server/license_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/license_server/license_server/asgi.py b/license_server/license_server/asgi.py new file mode 100644 index 0000000..dc5e89d --- /dev/null +++ b/license_server/license_server/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for license_server project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'license_server.settings') + +application = get_asgi_application() diff --git a/license_server/license_server/settings.py b/license_server/license_server/settings.py new file mode 100644 index 0000000..3b24915 --- /dev/null +++ b/license_server/license_server/settings.py @@ -0,0 +1,125 @@ +""" +Django settings for license_server project. + +Generated by 'django-admin startproject' using Django 3.2.7. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.2/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-$)x2z=0+8j8n#kp3+%+f!hayts2fxee2k5h)^2x^pc*gc#y&jp' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'license_server.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'license_server.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.2/howto/static-files/ + +STATIC_URL = '/static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/license_server/license_server/urls.py b/license_server/license_server/urls.py new file mode 100644 index 0000000..1bacbca --- /dev/null +++ b/license_server/license_server/urls.py @@ -0,0 +1,21 @@ +"""license_server URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.2/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/license_server/license_server/wsgi.py b/license_server/license_server/wsgi.py new file mode 100644 index 0000000..75993d1 --- /dev/null +++ b/license_server/license_server/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for license_server project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'license_server.settings') + +application = get_wsgi_application() diff --git a/license_server/manage.py b/license_server/manage.py new file mode 100755 index 0000000..ff981f3 --- /dev/null +++ b/license_server/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'license_server.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/ndr/__init__.py b/ndr/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ndr/connection/__init__.py b/ndr/connection/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ndr/connection/add_trusted_device.py b/ndr/connection/add_trusted_device.py new file mode 100644 index 0000000..f8ac8de --- /dev/null +++ b/ndr/connection/add_trusted_device.py @@ -0,0 +1,79 @@ +import requests +import base64 +import subprocess +import json +from dh_tests import DiffieHellmanConsoleManager + +SMC_LICENSE_KEY = "6087bee1-85b6-416e-8dce-cf5609ecc77f" +NDR_LICENSE_KEY = "7eea457f-5069-452d-b623-122bfe22b75e" +NDR_IP_ADDRESS = "192.168.56.10" +REGISTER_DEVICE_API_URL = f"https://{NDR_IP_ADDRESS}:8000/api/v1/auth/session/add-trusted-device" + +# Forming base64 wsmc code +smc_base64_license_key = base64.b64encode(SMC_LICENSE_KEY.encode('utf-8')).decode('utf-8') + +# Forming base64 ndr code +ndr_base64_license_key = base64.b64encode(NDR_LICENSE_KEY.encode('utf-8')).decode('utf-8') + +# Declaring DH manager + +dh_manager = DiffieHellmanConsoleManager() + + +# Генерируем параметры Diffie-Hellman +# dhparam_command = ['openssl', 'dhparam', '-out', 'dhp.pem', '2048'] +# subprocess.run(dhparam_command, check=True) + +dh_manager.dh_params = dh_manager.generate_dh_params() + +# Генерируем закрытый ключ DH +# genpkey_command = ['openssl', 'genpkey', '-paramfile', 'dhp.pem', '-out', 'dhkeyA.pem'] +# subprocess.run(genpkey_command, check=True) + +dh_manager.host_private_key = dh_manager.generate_host_private_key(dh_params=dh_manager.dh_params) + +# Извлекаем открытый ключ DH из закрытого ключа +# pkey_command = ['openssl', 'pkey', '-in', 'dhkeyA.pem', '-pubout', '-out', 'dhpubA.pem'] +# subprocess.run(pkey_command, check=True) + +dh_manager.host_public_key = dh_manager.generate_host_public_key(dh_manager.host_private_key) + +# Получаем ключ из файла +# f = open("dhpubA.pem", "r") +global_key_A = dh_manager.host_public_key +smc_global_key = base64.b64encode(global_key_A.encode('utf-8')).decode('utf-8') + +print("-"*60) +print(smc_base64_license_key) +print("-"*60) +print(ndr_base64_license_key) +print("-"*60) +print(smc_global_key) + +# Делаем запрос на регистрацию устройства +request_data = { + "lic_key_ndr": ndr_base64_license_key, + "lic_key_smc": smc_base64_license_key, + "public_key": smc_global_key +} + +response = requests.post(REGISTER_DEVICE_API_URL, json=request_data, verify=False) + +print("Status code:", response.status_code) +print("Headers:", response.headers) +response_body = json.loads(response.text) +print("Response body:", response_body['data']['public_key']) + +dh_manager.remote_public_key = dh_manager.decode_remote_public_key(response_body['data']['public_key']) + +print('-'*10 + "Add trusted device result" + '-'*10) +print(dh_manager.dh_params) +print(dh_manager.host_public_key) +print(dh_manager.host_private_key) +print(dh_manager.remote_public_key) +print('-'*30) + +dh_manager.shared_key = dh_manager.generate_shared_key( + dh_manager.host_private_key, + dh_manager.remote_public_key +) diff --git a/ndr/connection/constants.py b/ndr/connection/constants.py new file mode 100644 index 0000000..1c7a922 --- /dev/null +++ b/ndr/connection/constants.py @@ -0,0 +1,2 @@ +SMC_LICENSE_KEY = "6087bee1-85b6-416e-8dce-cf5609ecc77f" +NDR_LICENSE_KEY = "7eea457f-5069-452d-b623-122bfe22b75e" \ No newline at end of file diff --git a/ndr/connection/decoder.py b/ndr/connection/decoder.py new file mode 100644 index 0000000..f4207ac --- /dev/null +++ b/ndr/connection/decoder.py @@ -0,0 +1,18 @@ +import base64 + +# Закодированная строка +encoded_string = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0pEQ0NBUmNHQ1NxR1NJYjNEUUVEQVRDQ0FRZ0NnZ0VCQU52bmxsWklOOTFZWXRZY1gxdmxvNG5hanZHVQp5R20wQ0srTlNLODNtM2R2TEVoM0xRMFRxSTJ1YjVqT2pxWmgyOFlGMDZMSEtQQkpJQ2xGWXNFbFk0SHI5R1FRCm8zb2dqVFJ2dmExUHFkS2d5UnNQK3JpZ2lHdmJRNHZZNm1ubGU2UWtFcGJCSnBOSXV6ZmhRWU1PM0xwT2kvbSsKamttOW1jU1FYYVhaYU5CcjVsMERuZ2c4YkFtd1Fzb1gyM2xvV2VwSDF1NmlMQzlrV0VFdTV1VDdJMWhFOTdNaApuRTRDTzRzY01LSXNFT2hyanQ3U3ZGdmxobWFta1dQQ2VOUlBIWlFwdGk2QXlSWkcyUmNNbWd5NlI3dklaQU9YClBJNml5aTZ2ayttSStWczNBQTROekY0RU5RZDlmdjJvNEdaNGt3UWJSNHV3RktndG9waWx4NmNubkhjQ0FRSUQKZ2dFRkFBS0NBUUFSdWp1UGZKTGdlQmR5UVM2K0d2RmhkUFZuMlBJZjhQR2FUWnZSeFpjQWtBbHliVjlldjljeAozenlUaVNsT2xhbU03a09kUzFYNWt3LzVRenJTalEwaVVsMUNOTWVxY3BZOHNKT0tobFNDOFlIMEF4QjY3UmcwCkRZWThQejEzYkY4elV5UGNudUFEdDNUNHVETFBYekd2ZUdwYW54a3BldUtlZ1dva0VRYWJQV21LcmkzTkNTYVAKZDREUkF1bVE1VE5KNXRxMXdTSHlUbzUvSXU1RkZGWWpqVSt6WTVTYVdsZHBwVmNnQURQRFVqOFlzczdBeEVaaQp6UlIvZWdmc1ZoL25pZTRrMTRUMjFTNzB1aDJSam8zNlUwZ0J1aFVLV2RXZTVGL1ZSTWJxaXc1NW5MNXRLYzRyCjdHSzBCQUtuVm1GQmQ5dDMvTUJyTnhxN1A5bjJFYkhpCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=" + +# Декодирование строки +decoded_bytes = base64.b64decode(encoded_string) +print(decoded_bytes) + + +decoded_string = decoded_bytes.decode("utf-8") + +# Вывод результата +print(decoded_string) + +f = open("dhpubB.pem", "w") +f.write(decoded_string) +f.close() diff --git a/ndr/connection/dh_tests.py b/ndr/connection/dh_tests.py new file mode 100644 index 0000000..1220319 --- /dev/null +++ b/ndr/connection/dh_tests.py @@ -0,0 +1,154 @@ +import subprocess +import tempfile +import base64 +import os + + +class DiffieHellmanConsoleManager(): + """Class for managing diffie-hellman crypto operations""" + host_private_key = None + host_public_key = None + remote_public_key = None + shared_key = None + dh_params = None + + def generate_dh_params(self) -> str: + """Method for generating Diffie-Hellman (DH) parameters""" + + # Generating DH parameters + dhparam_command = ['openssl', 'dhparam', '2048'] + + # Capturing result of generator command to string + completed_process = subprocess.run(dhparam_command, check=True, capture_output=True, text=True) + dhparam_output = completed_process.stdout + + # Returning DH parameters + return dhparam_output + + def generate_host_private_key(self, dh_params: str) -> str: + """Method for generating console private key for further usage in DH algorithms + + Args: + dh_params (str): DH paramters, that are generated earlier + + Returns: + str: console private key + """ + + # Creating temporary file with DH params + with tempfile.NamedTemporaryFile(mode='w', delete=False) as temp_file: + temp_file.write(dh_params) + temp_filename = temp_file.name + + # Generating console private key + generate_private_console_key_command = ['openssl', 'genpkey', '-paramfile', temp_filename] + + # Capturing result of generator command to string + generator_command_invoker = subprocess.run(generate_private_console_key_command, + check=True, + capture_output=True, + text=True) + command_result_output = generator_command_invoker.stdout + + # Closing and deleting temporary file + temp_file.close() + + # Returning console private key + return command_result_output + + def generate_host_public_key(self, host_private_key: str) -> str: + """Method for generating console public key + + Args: + host_private_key (str): console private key, that is used to create public key + + Returns: + str: Console public key + """ + # Creating temporary file with console private key + with tempfile.NamedTemporaryFile(mode='w', delete=False) as temp_file: + temp_file.write(host_private_key) + temp_filename = temp_file.name + + # Generating console public key + generate_private_console_key_command = ['openssl', 'pkey', '-in', temp_filename, '-pubout'] + + # Capturing result of generator command to string + generator_command_invoker = subprocess.run(generate_private_console_key_command, + check=True, + capture_output=True, + text=True) + command_result_output = generator_command_invoker.stdout + + # Closing and deleting temporary file + temp_file.close() + + # Returning console private key + return command_result_output + + def decode_remote_public_key(self, encoded_public_key: str) -> str: + """Method for decoding publice key, received from remote + + Args: + encoded_public_key (str): encoded remote public key + + Returns: + str: decoded remote public key + """ + # TODO: Add exception handler if key could not be decoded + decoded_public_key = base64.b64decode(encoded_public_key).decode('utf-8') + return decoded_public_key + + def generate_shared_key(self, host_private_key: str, remote_public_key: str) -> str: + """Method for creation shared key, that will be used to encrypt data between host and remote + + Args: + host_private_key (str): console private key + remote_public_key (str): remote public key + + Returns: + str: shared key for encryption + """ + + # Creating temporary file with console private key + with tempfile.NamedTemporaryFile(mode='w', delete=False) as host_private_key_file: + host_private_key_file.write(host_private_key) + host_private_key_filename = host_private_key_file.name + + # Creating temportaty file with remote public key + with tempfile.NamedTemporaryFile(mode='w', delete=False) as remote_public_key_file: + remote_public_key_file.write(remote_public_key) + remote_public_key_filename = remote_public_key_file.name + + command = [ + "openssl", "pkeyutl", "-derive", "-inkey", host_private_key_filename, + '-peerkey', remote_public_key_filename, "-out", "secretSharedClass.bin" + ] + + subprocess.run( + command, + check=True, + ) + # command_result_output = generator_command_invoker.stdout + + file_name = "secretSharedClass.bin" # Specify the name of the file you want to delete + + with open(file_name, "rb") as shared_file: + shared_secret = shared_file.read().hex() + self.shared_key = shared_secret + + + if os.path.exists(file_name): + os.remove(file_name) + print(f"File '{file_name}' deleted successfully.") + else: + print(f"File '{file_name}' does not exist.") + + # Closing and deleting temporary files + host_private_key_file.close() + remote_public_key_file.close() + print("|"*60) + print(self.shared_key) + print("|"*60) + + return self.shared_key diff --git a/ndr/connection/dhkeyA.pem b/ndr/connection/dhkeyA.pem new file mode 100644 index 0000000..0ac39dc --- /dev/null +++ b/ndr/connection/dhkeyA.pem @@ -0,0 +1,14 @@ +-----BEGIN PRIVATE KEY----- +MIICJgIBADCCARcGCSqGSIb3DQEDATCCAQgCggEBANHsh3vTs6z/NFlvkX2enUrV +OdUoCr5ovgVqVh1+euL1jai+Bm+iTvIWtyzbTkdk/o5j/0z4NuYVWGM0DQnQcPft +zGYL6YQu+FDopRa4W5+V0xkszpMiGkjXCA+vQuu5yil7ydLyFU+WqRmkhPLIOFea +UuMKPmYPeZ/9D//t3yBIn08C9W/v1vo+57Uz8V1iwHgDduXSnmRjAFi0gs99rQGA +RK8wx+9OydG/SX9+CowuWY1BGPnMgZvhLQqhH7cA7AlOtw2WIrldNRpsVke+Fwx7 +BEkZCDMJqpNHZl08iD6g4/HSj5/d+NDdrlTcEitfMcwU+SdDZ5/0k1G8l9HLMU8C +AQIEggEEAoIBAECVEhtMoDotoZRyFzN4LQ7zmZM77lSYY+DvR6Z/rb8woNTOAUb4 +ZaGebTfbdok4e2nE+trjacL6brYui6siWRZUouWCZzPfoBnPexNtnI3k8WNwF7SW +BoPP34lpXZZFOWix0B6UhXOpYC+OB/6/ntlP+bhuEOh7LD7iCoepvqc+LLFewnaL +rtQaNwvdP5nPF2AojmDkRI4Ngp/2+7w1trvDTP9DckomIPeTJmfAFmGSlAXNiPBV +6MsBo0kJrJF3HXJfeYkUt/jp3C7RkVU3kcwLBTUJsbo6sh8GtzdWV+SEJWEJvSLv +YrWKoOw2FANtV0A50D6HcDe7xjQN5tl3lns= +-----END PRIVATE KEY----- diff --git a/ndr/connection/dhp.pem b/ndr/connection/dhp.pem new file mode 100644 index 0000000..2f8adf2 --- /dev/null +++ b/ndr/connection/dhp.pem @@ -0,0 +1,8 @@ +-----BEGIN DH PARAMETERS----- +MIIBCAKCAQEA0eyHe9OzrP80WW+RfZ6dStU51SgKvmi+BWpWHX564vWNqL4Gb6JO +8ha3LNtOR2T+jmP/TPg25hVYYzQNCdBw9+3MZgvphC74UOilFrhbn5XTGSzOkyIa +SNcID69C67nKKXvJ0vIVT5apGaSE8sg4V5pS4wo+Zg95n/0P/+3fIEifTwL1b+/W ++j7ntTPxXWLAeAN25dKeZGMAWLSCz32tAYBErzDH707J0b9Jf34KjC5ZjUEY+cyB +m+EtCqEftwDsCU63DZYiuV01GmxWR74XDHsESRkIMwmqk0dmXTyIPqDj8dKPn934 +0N2uVNwSK18xzBT5J0Nnn/STUbyX0csxTwIBAg== +-----END DH PARAMETERS----- diff --git a/ndr/connection/dhpubA.pem b/ndr/connection/dhpubA.pem new file mode 100644 index 0000000..5fc59e0 --- /dev/null +++ b/ndr/connection/dhpubA.pem @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICJDCCARcGCSqGSIb3DQEDATCCAQgCggEBANHsh3vTs6z/NFlvkX2enUrVOdUo +Cr5ovgVqVh1+euL1jai+Bm+iTvIWtyzbTkdk/o5j/0z4NuYVWGM0DQnQcPftzGYL +6YQu+FDopRa4W5+V0xkszpMiGkjXCA+vQuu5yil7ydLyFU+WqRmkhPLIOFeaUuMK +PmYPeZ/9D//t3yBIn08C9W/v1vo+57Uz8V1iwHgDduXSnmRjAFi0gs99rQGARK8w +x+9OydG/SX9+CowuWY1BGPnMgZvhLQqhH7cA7AlOtw2WIrldNRpsVke+Fwx7BEkZ +CDMJqpNHZl08iD6g4/HSj5/d+NDdrlTcEitfMcwU+SdDZ5/0k1G8l9HLMU8CAQID +ggEFAAKCAQBAlRQiFuaZIt+3yCgX0b8mogYd6fQkYpweQ0oFrQzIRTn0fv8gTLqV +20wjC6NDOQEe/OtckifXfkr75aC5G0reRu09DQf9RZermRnrcIi1UiZ0BIgoIqoI +kcU0PslI6shopR0cnVYXQ1ol6qJBNEo3Fl4GATiacjvTobGY9Vu9Plwsll/D6BgC +ro6oR5o9mxz8dLPMwtryTrd/qbYTz9mRuquhO+WEvy4cvIroTuCXKZfCEUdxBvk8 +/nnKlVfoemo3XTVrOLy5o8sCeTOY29K8tdxfMijUWL4llFRTQCxESOoKZyWDpXN1 +g7AGXAVzQ0TGA21kkvyI5D3zilMBgMrp +-----END PUBLIC KEY----- diff --git a/ndr/connection/dhpubB.pem b/ndr/connection/dhpubB.pem new file mode 100644 index 0000000..1ffd4ce --- /dev/null +++ b/ndr/connection/dhpubB.pem @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICJDCCARcGCSqGSIb3DQEDATCCAQgCggEBANvnllZIN91YYtYcX1vlo4najvGU +yGm0CK+NSK83m3dvLEh3LQ0TqI2ub5jOjqZh28YF06LHKPBJIClFYsElY4Hr9GQQ +o3ogjTRvva1PqdKgyRsP+rigiGvbQ4vY6mnle6QkEpbBJpNIuzfhQYMO3LpOi/m+ +jkm9mcSQXaXZaNBr5l0Dngg8bAmwQsoX23loWepH1u6iLC9kWEEu5uT7I1hE97Mh +nE4CO4scMKIsEOhrjt7SvFvlhmamkWPCeNRPHZQpti6AyRZG2RcMmgy6R7vIZAOX +PI6iyi6vk+mI+Vs3AA4NzF4ENQd9fv2o4GZ4kwQbR4uwFKgtopilx6cnnHcCAQID +ggEFAAKCAQARujuPfJLgeBdyQS6+GvFhdPVn2PIf8PGaTZvRxZcAkAlybV9ev9cx +3zyTiSlOlamM7kOdS1X5kw/5QzrSjQ0iUl1CNMeqcpY8sJOKhlSC8YH0AxB67Rg0 +DYY8Pz13bF8zUyPcnuADt3T4uDLPXzGveGpanxkpeuKegWokEQabPWmKri3NCSaP +d4DRAumQ5TNJ5tq1wSHyTo5/Iu5FFFYjjU+zY5SaWldppVcgADPDUj8Yss7AxEZi +zRR/egfsVh/nie4k14T21S70uh2Rjo36U0gBuhUKWdWe5F/VRMbqiw55nL5tKc4r +7GK0BAKnVmFBd9t3/MBrNxq7P9n2EbHi +-----END PUBLIC KEY----- diff --git a/ndr/connection/login_to_ndr.py b/ndr/connection/login_to_ndr.py new file mode 100644 index 0000000..c0911a7 --- /dev/null +++ b/ndr/connection/login_to_ndr.py @@ -0,0 +1,103 @@ +import requests +import base64 +import hashlib + +from Cryptodome.Cipher import AES +from Cryptodome.Util.Padding import pad + +from constants import SMC_LICENSE_KEY, NDR_LICENSE_KEY + +USER_NAME = "root" +USER_ROLE = "admin" +FRONT_IP = "192.168.0.1" + +# Функция считывания общего ключа +def shared_key_reader(): + # Считываем общий секрет + with open("secretShared.bin", "rb") as shared_file: + # Считываем содержимое файла и преобразуем его в шестнадцатиричное представление с помощью + # функции hex() + shared_secret = shared_file.read().hex() + + return shared_secret + +SHARED_KEY = shared_key_reader() +# Константы для запроса + +# Authorization-key +# Данные, которе требуется зашифровать +# data = (SMC_LICENSE_KEY + NDR_LICENSE_KEY).encode("utf-8") + +# POSTMAN +pre_data = base64.b64encode((SMC_LICENSE_KEY + NDR_LICENSE_KEY).encode('utf-8')) + +# Преобразуем SHARED_KEY в байтовую строку с использованием кодировки UTF-8 +key = SHARED_KEY + +# Создаем инвертированный закодированный ключ +encoded_reversed_key = key[::-1].encode("utf-8") + +# Вычисление вектора инициализации следующим образом: +# Берется hash-сумма MD5 от инвертированного общего ключа +# C помощью функции hexdigest() получаем строкове представление хэш суммы в виде 16ричных чисел +# Обрезаем полученое строковое представление до 16 символов +# Кодируем получившуюся строку в UTF-8 +iv = hashlib.md5(encoded_reversed_key).hexdigest()[:16].encode('utf-8') + +# Вычисляем хэш-сумму MD5 и представляем ее в 16ричном виде, а затем кодируем в UTF-8 +key_hash = hashlib.md5(key.encode('utf-8')).hexdigest() + +# Создаем объект cipher от класса AES с использованием ключа key, режима AES.MODE_CBS +# (Cipher Block Chaining) и вектора инициализации iv +cipher = AES.new(key_hash.encode('utf-8'), AES.MODE_CBC, iv) + +# Получаем шифр путем: +# С помощью функции pad() данные data дополняются до размера блока AES и шифруются объектом cipher +encrypted = cipher.encrypt(pad(pre_data, AES.block_size)) + +# Полученное преобразуем в base64 +encrypted_base64_authorization_key = base64.b64encode(encrypted).decode('utf-8') +authorization_key_header_data = "x-ndr-key " + encrypted_base64_authorization_key + +# Authorization user +user_data = base64.b64encode(USER_NAME.encode('utf-8')) +cipher_user = AES.new(key_hash.encode('utf-8'), AES.MODE_CBC, iv) +encrypted_user = cipher_user.encrypt(pad(user_data, AES.block_size)) +encrypted_base64_authorization_user = base64.b64encode(encrypted_user).decode('utf-8') + +authorization_user_header_data = "x-ndr-user " + encrypted_base64_authorization_user + + +# Authorization role +user_role_data = base64.b64encode(USER_ROLE.encode('utf-8')) +cipher_role = AES.new(key_hash.encode('utf-8'), AES.MODE_CBC, iv) +encrypted_user_role = cipher_role.encrypt(pad(user_role_data, AES.block_size)) +encrypted_base64_authorization_role = base64.b64encode(encrypted_user_role).decode('utf-8') + +authorization_role_header_data = "x-ndr-role " + encrypted_base64_authorization_role + +# Authorization ip +ip_data = base64.b64encode(FRONT_IP.encode('utf-8')) +cipher_ip = AES.new(key_hash.encode('utf-8'), AES.MODE_CBC, iv) +encrypted_ip = cipher_ip.encrypt(pad(ip_data, AES.block_size)) +encrypted_base64_authorization_ip = base64.b64encode(encrypted_ip).decode('utf-8') + +authorization_ip_header_data = "x-ndr-ip " + encrypted_base64_authorization_ip + +# print("\n\n\n") +# print("key = " + encrypted_base64_authorization_key) +# print("user = " + encrypted_base64_authorization_user) +# print("role = " + encrypted_base64_authorization_role) +# print("ip = " + encrypted_base64_authorization_ip) +# print("\n\n\n") + +# Запрос +request_url = "https://192.168.56.10:8000/api/v1/auth/session/login" +headers = { + "Authorization-key": authorization_key_header_data, + "Authorization-user": authorization_user_header_data, + "Authorization-role": authorization_role_header_data, + "Authorization-ip": authorization_ip_header_data, +} + +response = requests.post(request_url, headers=headers, verify=False) \ No newline at end of file diff --git a/ndr/connection/ndr_login.js b/ndr/connection/ndr_login.js new file mode 100644 index 0000000..e69de29 diff --git a/ndr/notes.md b/ndr/notes.md new file mode 100644 index 0000000..a89a6dd --- /dev/null +++ b/ndr/notes.md @@ -0,0 +1,40 @@ +# Вопросы +Правильно ли я понимаю, что команды: + +openssl dhparam -out dhp.pem 2048 +openssl genpkey -paramfile dhp.pem -out dhkeyA.pem +openssl pkey -in dhkeyA.pem -pubout -out dhpubA.pem + +Работают следующим образом: + +1. Генерируем параметры Диффи-Хеллмана и записываем их в файл `dhp.pem`. Параметры используются для обмена ключами между клиентом и сервером при использовании протокола TLS/SSL. Длина ключа = 2048 битам; +2. Генерируем закрытый ключ DH и записываем его в файл `dhkeyA.pem`; +3. Извлекаем открытый ключ DH из закрытого ключа и записываем его в файл `dhpubA.pem`. + +Затем в запрос уже кладем ключ из файла `dhpubA.pem`? + +# Заметки +## Пример корректного ответа на регистрацию нового устройства +```json +{ + "public_key": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0pEQ0NBUmNHQ1NxR1NJYjNEUUVEQVRDQ0FRZ0NnZ0VCQU52bmxsWklOOTFZWXRZY1gxdmxvNG5hanZHVQp5R20wQ0srTlNLODNtM2R2TEVoM0xRMFRxSTJ1YjVqT2pxWmgyOFlGMDZMSEtQQkpJQ2xGWXNFbFk0SHI5R1FRCm8zb2dqVFJ2dmExUHFkS2d5UnNQK3JpZ2lHdmJRNHZZNm1ubGU2UWtFcGJCSnBOSXV6ZmhRWU1PM0xwT2kvbSsKamttOW1jU1FYYVhaYU5CcjVsMERuZ2c4YkFtd1Fzb1gyM2xvV2VwSDF1NmlMQzlrV0VFdTV1VDdJMWhFOTdNaApuRTRDTzRzY01LSXNFT2hyanQ3U3ZGdmxobWFta1dQQ2VOUlBIWlFwdGk2QXlSWkcyUmNNbWd5NlI3dklaQU9YClBJNml5aTZ2ayttSStWczNBQTROekY0RU5RZDlmdjJvNEdaNGt3UWJSNHV3RktndG9waWx4NmNubkhjQ0FRSUQKZ2dFRkFBS0NBUUFSdWp1UGZKTGdlQmR5UVM2K0d2RmhkUFZuMlBJZjhQR2FUWnZSeFpjQWtBbHliVjlldjljeAozenlUaVNsT2xhbU03a09kUzFYNWt3LzVRenJTalEwaVVsMUNOTWVxY3BZOHNKT0tobFNDOFlIMEF4QjY3UmcwCkRZWThQejEzYkY4elV5UGNudUFEdDNUNHVETFBYekd2ZUdwYW54a3BldUtlZ1dva0VRYWJQV21LcmkzTkNTYVAKZDREUkF1bVE1VE5KNXRxMXdTSHlUbzUvSXU1RkZGWWpqVSt6WTVTYVdsZHBwVmNnQURQRFVqOFlzczdBeEVaaQp6UlIvZWdmc1ZoL25pZTRrMTRUMjFTNzB1aDJSam8zNlUwZ0J1aFVLV2RXZTVGL1ZSTWJxaXc1NW5MNXRLYzRyCjdHSzBCQUtuVm1GQmQ5dDMvTUJyTnhxN1A5bjJFYkhpCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=", + "shared_key": "d8750acfb7f535c62b05a1b7e0fd19fa800bea21dc6647827f47b753edad4edb06f4953ce92448045c696bd836e8c0fbd8b13732dedff0daf1aeb7072e58325cf0c9819c28b619ca215819c37a76ebc750d97747c0ba59cc981854012f07149f92904e222059dbc0f8b6b3bbf1091c9c9526e768ddd404ecaad88bb6ca0793b3e989022d1d799d02a43efb8e7ce3b51dd19bff0e833575c317080bd72d74a466b5107641a0408d1524a2bbcee94b0018ebbdd3c3720f32909430b26bc5d07402d3821010e9b78bfeb2cb7c60d41afc4e753d02bf468bca0817bd050471586b1d36f7d532081d45ee28747ad64c764fec9a94d135c51f8732ba3f4ac8179ae030" + } +``` + +## dhpubB.pem +Данный ключ формируется из <тут будет ответ на вопрос из confluence> + + +## Пример ответа, если токен протух + +```json +{ + "request_id": "92cc3d29147930a6d3ba-0000", + "name": "yii\web\UnauthorizedHttpException", + "message": "Token is expired!", + "data": {}, + "status": 401, + "type": "yii\web\UnauthorizedHttpException" +} +``` \ No newline at end of file diff --git a/ndr/options/options_types.md b/ndr/options/options_types.md new file mode 100644 index 0000000..6264dcf --- /dev/null +++ b/ndr/options/options_types.md @@ -0,0 +1,129 @@ +# Общие поля +* `type` +* `required` - по дефолту `false` +* `primary_key` - только одно поле в объекте имеет статус `true`, остальные по дефолту `false` + +# Primary key +```json +"if": { + "primaryKey": true, + "type": "range", + "multiple": false, + "range": { + "em2": "em2 (aa:bb:cc:dd:ff:aa)", + "em3": "em3 (aa:bb:cc:dd:ff:aa)" + }, + "allowCustomValue": false +}, +``` + +# Bool +```json +"enable": { + "type": "bool" +}, +``` + +# Regexp +```json +"descr": { + "type": "regexp", + "pattern": "/^[A-Za-z]{1}[A-Za-z0-9_]{2,15}$/", + "not": false +}, +``` + +# Range +## Not required +```json +"type": { + "type": "range", + "multiple": false, + "range": { + "none": "None", + "staticv4": "Static IPv4", + "dhcp": "DHCP" + }, + "allowCustomValue": false +}, +``` +## Required +```json +"gateway": { + "required": true, + "type": "range", + "multiple": false, + "range": { + "none": "Auto-detect" + }, + "allowCustomValue": false +}, +``` + +# Number +## Not required +```json +"mtu": { + "type": "number", + "allowArray": false, + "integerOnly": false, + "min": 576, + "max": 65535 +}, +``` +## Required +```json +"subnet": { + "required": true, + "type": "number", + "allowArray": false, + "integerOnly": false, + "min": 1, + "max": 32 +}, +``` + +# IP +## Required +```json +"ipaddr": { + "required": true, + "type": "ip", + "networks": false, + "ipv6": false, + "ipv4": true, + "subnet": false, + "expandIPv6": false +}, +``` +## Not required +```json +"alias_address": { + "type": "ip", + "networks": false, + "ipv6": false, + "ipv4": true, + "subnet": false, + "expandIPv6": false +}, +``` + +# Unknown +```json +"system_name": { + "required": true +}, +``` +```json +"spoofmac": { + "type": "mac" +}, +``` +```json +"dhcphostname": { + "type": "hostname" +}, +``` + +# Вопросы +1. Что означает `integer_only` в option'ах `number`? То что можно отослать число с плавающей точкой? \ No newline at end of file diff --git a/ndr/shared_key_creator.py b/ndr/shared_key_creator.py new file mode 100644 index 0000000..c0542ba --- /dev/null +++ b/ndr/shared_key_creator.py @@ -0,0 +1,24 @@ +import base64 +import subprocess + +# Открываем закрытый ключ DH +with open("dhkeyA.pem", "rb") as key_file: + key_data = key_file.read() + +# Открываем открытый ключ DH +with open("dhpubB.pem", "rb") as peerkey_file: + peerkey_data = peerkey_file.read() + +pkeyutl_command = ["openssl", "pkeyutl", "-derive", "-inkey", "dhkeyA.pem", "-peerkey", "dhpubB.pem", "-out", "secretShared.bin"] +subprocess.run(pkeyutl_command, input=key_data, check=True) + +def shared_key_reader(): + # Считываем общий секрет + with open("secretShared.bin", "rb") as shared_file: + shared_secret = shared_file.read().hex() + + return shared_secret + +print(shared_key_reader()) + + diff --git a/none_val/__init__.py b/none_val/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/none_val/playground.py b/none_val/playground.py new file mode 100644 index 0000000..977b5a9 --- /dev/null +++ b/none_val/playground.py @@ -0,0 +1,26 @@ +class Test: + def __init__(self, val) -> None: + self.val = val + + def p(self): + print(self.val) + print(type(self.val)) + print(str(self.val)) + print(f"Hello from {self.val}") + + +t = Test(val=None) +t.p() + +class TestTwo: + def __init__(self, val) -> None: + if not isinstance(val, int): + raise OSError + self.val = val + + def p(self): + print(self.val) + print(type(self.val)) + +t_two = TestTwo(val=True) +t_two.p() diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..8fbf002 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,920 @@ +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. + +[[package]] +name = "bcrypt" +version = "4.1.3" +description = "Modern password hashing for your software and your servers" +category = "main" +optional = false +python-versions = ">=3.7" +files = [ + {file = "bcrypt-4.1.3-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:48429c83292b57bf4af6ab75809f8f4daf52aa5d480632e53707805cc1ce9b74"}, + {file = "bcrypt-4.1.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a8bea4c152b91fd8319fef4c6a790da5c07840421c2b785084989bf8bbb7455"}, + {file = "bcrypt-4.1.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d3b317050a9a711a5c7214bf04e28333cf528e0ed0ec9a4e55ba628d0f07c1a"}, + {file = "bcrypt-4.1.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:094fd31e08c2b102a14880ee5b3d09913ecf334cd604af27e1013c76831f7b05"}, + {file = "bcrypt-4.1.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:4fb253d65da30d9269e0a6f4b0de32bd657a0208a6f4e43d3e645774fb5457f3"}, + {file = "bcrypt-4.1.3-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:193bb49eeeb9c1e2db9ba65d09dc6384edd5608d9d672b4125e9320af9153a15"}, + {file = "bcrypt-4.1.3-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:8cbb119267068c2581ae38790e0d1fbae65d0725247a930fc9900c285d95725d"}, + {file = "bcrypt-4.1.3-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6cac78a8d42f9d120b3987f82252bdbeb7e6e900a5e1ba37f6be6fe4e3848286"}, + {file = "bcrypt-4.1.3-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:01746eb2c4299dd0ae1670234bf77704f581dd72cc180f444bfe74eb80495b64"}, + {file = "bcrypt-4.1.3-cp37-abi3-win32.whl", hash = "sha256:037c5bf7c196a63dcce75545c8874610c600809d5d82c305dd327cd4969995bf"}, + {file = "bcrypt-4.1.3-cp37-abi3-win_amd64.whl", hash = "sha256:8a893d192dfb7c8e883c4576813bf18bb9d59e2cfd88b68b725990f033f1b978"}, + {file = "bcrypt-4.1.3-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:0d4cf6ef1525f79255ef048b3489602868c47aea61f375377f0d00514fe4a78c"}, + {file = "bcrypt-4.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f5698ce5292a4e4b9e5861f7e53b1d89242ad39d54c3da451a93cac17b61921a"}, + {file = "bcrypt-4.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec3c2e1ca3e5c4b9edb94290b356d082b721f3f50758bce7cce11d8a7c89ce84"}, + {file = "bcrypt-4.1.3-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3a5be252fef513363fe281bafc596c31b552cf81d04c5085bc5dac29670faa08"}, + {file = "bcrypt-4.1.3-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:5f7cd3399fbc4ec290378b541b0cf3d4398e4737a65d0f938c7c0f9d5e686611"}, + {file = "bcrypt-4.1.3-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:c4c8d9b3e97209dd7111bf726e79f638ad9224b4691d1c7cfefa571a09b1b2d6"}, + {file = "bcrypt-4.1.3-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:31adb9cbb8737a581a843e13df22ffb7c84638342de3708a98d5c986770f2834"}, + {file = "bcrypt-4.1.3-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:551b320396e1d05e49cc18dd77d970accd52b322441628aca04801bbd1d52a73"}, + {file = "bcrypt-4.1.3-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6717543d2c110a155e6821ce5670c1f512f602eabb77dba95717ca76af79867d"}, + {file = "bcrypt-4.1.3-cp39-abi3-win32.whl", hash = "sha256:6004f5229b50f8493c49232b8e75726b568535fd300e5039e255d919fc3a07f2"}, + {file = "bcrypt-4.1.3-cp39-abi3-win_amd64.whl", hash = "sha256:2505b54afb074627111b5a8dc9b6ae69d0f01fea65c2fcaea403448c503d3991"}, + {file = "bcrypt-4.1.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:cb9c707c10bddaf9e5ba7cdb769f3e889e60b7d4fea22834b261f51ca2b89fed"}, + {file = "bcrypt-4.1.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9f8ea645eb94fb6e7bea0cf4ba121c07a3a182ac52876493870033141aa687bc"}, + {file = "bcrypt-4.1.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:f44a97780677e7ac0ca393bd7982b19dbbd8d7228c1afe10b128fd9550eef5f1"}, + {file = "bcrypt-4.1.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:d84702adb8f2798d813b17d8187d27076cca3cd52fe3686bb07a9083930ce650"}, + {file = "bcrypt-4.1.3.tar.gz", hash = "sha256:2ee15dd749f5952fe3f0430d0ff6b74082e159c50332a1413d51b5689cf06623"}, +] + +[package.extras] +tests = ["pytest (>=3.2.1,!=3.3.0)"] +typecheck = ["mypy"] + +[[package]] +name = "certifi" +version = "2023.5.7" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2023.5.7-py3-none-any.whl", hash = "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"}, + {file = "certifi-2023.5.7.tar.gz", hash = "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7"}, +] + +[[package]] +name = "cffi" +version = "1.16.0" +description = "Foreign Function Interface for Python calling C code." +category = "main" +optional = false +python-versions = ">=3.8" +files = [ + {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, + {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614"}, + {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743"}, + {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d"}, + {file = "cffi-1.16.0-cp310-cp310-win32.whl", hash = "sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a"}, + {file = "cffi-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1"}, + {file = "cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404"}, + {file = "cffi-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e"}, + {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc"}, + {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb"}, + {file = "cffi-1.16.0-cp311-cp311-win32.whl", hash = "sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab"}, + {file = "cffi-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba"}, + {file = "cffi-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956"}, + {file = "cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969"}, + {file = "cffi-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520"}, + {file = "cffi-1.16.0-cp312-cp312-win32.whl", hash = "sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b"}, + {file = "cffi-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235"}, + {file = "cffi-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324"}, + {file = "cffi-1.16.0-cp38-cp38-win32.whl", hash = "sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a"}, + {file = "cffi-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36"}, + {file = "cffi-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed"}, + {file = "cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098"}, + {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000"}, + {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe"}, + {file = "cffi-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4"}, + {file = "cffi-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8"}, + {file = "cffi-1.16.0.tar.gz", hash = "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"}, +] + +[package.dependencies] +pycparser = "*" + +[[package]] +name = "charset-normalizer" +version = "3.1.0" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.1.0.tar.gz", hash = "sha256:34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e0ac8959c929593fee38da1c2b64ee9778733cdf03c482c9ff1d508b6b593b2b"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d7fc3fca01da18fbabe4625d64bb612b533533ed10045a2ac3dd194bfa656b60"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:04eefcee095f58eaabe6dc3cc2262f3bcd776d2c67005880894f447b3f2cb9c1"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20064ead0717cf9a73a6d1e779b23d149b53daf971169289ed2ed43a71e8d3b0"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1435ae15108b1cb6fffbcea2af3d468683b7afed0169ad718451f8db5d1aff6f"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c84132a54c750fda57729d1e2599bb598f5fa0344085dbde5003ba429a4798c0"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75f2568b4189dda1c567339b48cba4ac7384accb9c2a7ed655cd86b04055c795"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11d3bcb7be35e7b1bba2c23beedac81ee893ac9871d0ba79effc7fc01167db6c"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:891cf9b48776b5c61c700b55a598621fdb7b1e301a550365571e9624f270c203"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:5f008525e02908b20e04707a4f704cd286d94718f48bb33edddc7d7b584dddc1"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:b06f0d3bf045158d2fb8837c5785fe9ff9b8c93358be64461a1089f5da983137"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:49919f8400b5e49e961f320c735388ee686a62327e773fa5b3ce6721f7e785ce"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:22908891a380d50738e1f978667536f6c6b526a2064156203d418f4856d6e86a"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-win32.whl", hash = "sha256:12d1a39aa6b8c6f6248bb54550efcc1c38ce0d8096a146638fd4738e42284448"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:65ed923f84a6844de5fd29726b888e58c62820e0769b76565480e1fdc3d062f8"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9a3267620866c9d17b959a84dd0bd2d45719b817245e49371ead79ed4f710d19"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6734e606355834f13445b6adc38b53c0fd45f1a56a9ba06c2058f86893ae8017"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aaf53a6cebad0eae578f062c7d462155eada9c172bd8c4d250b8c1d8eb7f916a"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3dc5b6a8ecfdc5748a7e429782598e4f17ef378e3e272eeb1340ea57c9109f41"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e1b25e3ad6c909f398df8921780d6a3d120d8c09466720226fc621605b6f92b1"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca564606d2caafb0abe6d1b5311c2649e8071eb241b2d64e75a0d0065107e62"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b82fab78e0b1329e183a65260581de4375f619167478dddab510c6c6fb04d9b6"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bd7163182133c0c7701b25e604cf1611c0d87712e56e88e7ee5d72deab3e76b5"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:11d117e6c63e8f495412d37e7dc2e2fff09c34b2d09dbe2bee3c6229577818be"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:cf6511efa4801b9b38dc5546d7547d5b5c6ef4b081c60b23e4d941d0eba9cbeb"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:abc1185d79f47c0a7aaf7e2412a0eb2c03b724581139193d2d82b3ad8cbb00ac"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cb7b2ab0188829593b9de646545175547a70d9a6e2b63bf2cd87a0a391599324"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-win32.whl", hash = "sha256:c36bcbc0d5174a80d6cccf43a0ecaca44e81d25be4b7f90f0ed7bcfbb5a00909"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:cca4def576f47a09a943666b8f829606bcb17e2bc2d5911a46c8f8da45f56755"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c95f12b74681e9ae127728f7e5409cbbef9cd914d5896ef238cc779b8152373"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac0aa6cd53ab9a31d397f8303f92c42f534693528fafbdb997c82bae6e477ad9"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3af8e0f07399d3176b179f2e2634c3ce9c1301379a6b8c9c9aeecd481da494f"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a5fc78f9e3f501a1614a98f7c54d3969f3ad9bba8ba3d9b438c3bc5d047dd28"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:628c985afb2c7d27a4800bfb609e03985aaecb42f955049957814e0491d4006d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:74db0052d985cf37fa111828d0dd230776ac99c740e1a758ad99094be4f1803d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:1e8fcdd8f672a1c4fc8d0bd3a2b576b152d2a349782d1eb0f6b8e52e9954731d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:04afa6387e2b282cf78ff3dbce20f0cc071c12dc8f685bd40960cc68644cfea6"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:dd5653e67b149503c68c4018bf07e42eeed6b4e956b24c00ccdf93ac79cdff84"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d2686f91611f9e17f4548dbf050e75b079bbc2a82be565832bc8ea9047b61c8c"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:4155b51ae05ed47199dc5b2a4e62abccb274cee6b01da5b895099b61b1982974"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:322102cdf1ab682ecc7d9b1c5eed4ec59657a65e1c146a0da342b78f4112db23"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e633940f28c1e913615fd624fcdd72fdba807bf53ea6925d6a588e84e1151531"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3a06f32c9634a8705f4ca9946d667609f52cf130d5548881401f1eb2c39b1e2c"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7381c66e0561c5757ffe616af869b916c8b4e42b367ab29fedc98481d1e74e14"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3573d376454d956553c356df45bb824262c397c6e26ce43e8203c4c540ee0acb"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e89df2958e5159b811af9ff0f92614dabf4ff617c03a4c1c6ff53bf1c399e0e1"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78cacd03e79d009d95635e7d6ff12c21eb89b894c354bd2b2ed0b4763373693b"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de5695a6f1d8340b12a5d6d4484290ee74d61e467c39ff03b39e30df62cf83a0"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c60b9c202d00052183c9be85e5eaf18a4ada0a47d188a83c8f5c5b23252f649"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f645caaf0008bacf349875a974220f1f1da349c5dbe7c4ec93048cdc785a3326"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ea9f9c6034ea2d93d9147818f17c2a0860d41b71c38b9ce4d55f21b6f9165a11"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:80d1543d58bd3d6c271b66abf454d437a438dff01c3e62fdbcd68f2a11310d4b"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:73dc03a6a7e30b7edc5b01b601e53e7fc924b04e1835e8e407c12c037e81adbd"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6f5c2e7bc8a4bf7c426599765b1bd33217ec84023033672c1e9a8b35eaeaaaf8"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-win32.whl", hash = "sha256:12a2b561af122e3d94cdb97fe6fb2bb2b82cef0cdca131646fdb940a1eda04f0"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3160a0fd9754aab7d47f95a6b63ab355388d890163eb03b2d2b87ab0a30cfa59"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:38e812a197bf8e71a59fe55b757a84c1f946d0ac114acafaafaf21667a7e169e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6baf0baf0d5d265fa7944feb9f7451cc316bfe30e8df1a61b1bb08577c554f31"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8f25e17ab3039b05f762b0a55ae0b3632b2e073d9c8fc88e89aca31a6198e88f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3747443b6a904001473370d7810aa19c3a180ccd52a7157aacc264a5ac79265e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b116502087ce8a6b7a5f1814568ccbd0e9f6cfd99948aa59b0e241dc57cf739f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d16fd5252f883eb074ca55cb622bc0bee49b979ae4e8639fff6ca3ff44f9f854"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fa558996782fc226b529fdd2ed7866c2c6ec91cee82735c98a197fae39f706"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6f6c7a8a57e9405cad7485f4c9d3172ae486cfef1344b5ddd8e5239582d7355e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ac3775e3311661d4adace3697a52ac0bab17edd166087d493b52d4f4f553f9f0"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:10c93628d7497c81686e8e5e557aafa78f230cd9e77dd0c40032ef90c18f2230"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:6f4f4668e1831850ebcc2fd0b1cd11721947b6dc7c00bf1c6bd3c929ae14f2c7"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0be65ccf618c1e7ac9b849c315cc2e8a8751d9cfdaa43027d4f6624bd587ab7e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:53d0a3fa5f8af98a1e261de6a3943ca631c526635eb5817a87a59d9a57ebf48f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-win32.whl", hash = "sha256:a04f86f41a8916fe45ac5024ec477f41f886b3c435da2d4e3d2709b22ab02af1"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:830d2948a5ec37c386d3170c483063798d7879037492540f10a475e3fd6f244b"}, + {file = "charset_normalizer-3.1.0-py3-none-any.whl", hash = "sha256:3d9098b479e78c85080c98e1e35ff40b4a31d8953102bb0fd7d1b6f8a2111a3d"}, +] + +[[package]] +name = "cryptography" +version = "42.0.8" +description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +category = "main" +optional = false +python-versions = ">=3.7" +files = [ + {file = "cryptography-42.0.8-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:81d8a521705787afe7a18d5bfb47ea9d9cc068206270aad0b96a725022e18d2e"}, + {file = "cryptography-42.0.8-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:961e61cefdcb06e0c6d7e3a1b22ebe8b996eb2bf50614e89384be54c48c6b63d"}, + {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e3ec3672626e1b9e55afd0df6d774ff0e953452886e06e0f1eb7eb0c832e8902"}, + {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e599b53fd95357d92304510fb7bda8523ed1f79ca98dce2f43c115950aa78801"}, + {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:5226d5d21ab681f432a9c1cf8b658c0cb02533eece706b155e5fbd8a0cdd3949"}, + {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:6b7c4f03ce01afd3b76cf69a5455caa9cfa3de8c8f493e0d3ab7d20611c8dae9"}, + {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:2346b911eb349ab547076f47f2e035fc8ff2c02380a7cbbf8d87114fa0f1c583"}, + {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ad803773e9df0b92e0a817d22fd8a3675493f690b96130a5e24f1b8fabbea9c7"}, + {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2f66d9cd9147ee495a8374a45ca445819f8929a3efcd2e3df6428e46c3cbb10b"}, + {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d45b940883a03e19e944456a558b67a41160e367a719833c53de6911cabba2b7"}, + {file = "cryptography-42.0.8-cp37-abi3-win32.whl", hash = "sha256:a0c5b2b0585b6af82d7e385f55a8bc568abff8923af147ee3c07bd8b42cda8b2"}, + {file = "cryptography-42.0.8-cp37-abi3-win_amd64.whl", hash = "sha256:57080dee41209e556a9a4ce60d229244f7a66ef52750f813bfbe18959770cfba"}, + {file = "cryptography-42.0.8-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:dea567d1b0e8bc5764b9443858b673b734100c2871dc93163f58c46a97a83d28"}, + {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4783183f7cb757b73b2ae9aed6599b96338eb957233c58ca8f49a49cc32fd5e"}, + {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0608251135d0e03111152e41f0cc2392d1e74e35703960d4190b2e0f4ca9c70"}, + {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:dc0fdf6787f37b1c6b08e6dfc892d9d068b5bdb671198c72072828b80bd5fe4c"}, + {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:9c0c1716c8447ee7dbf08d6db2e5c41c688544c61074b54fc4564196f55c25a7"}, + {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:fff12c88a672ab9c9c1cf7b0c80e3ad9e2ebd9d828d955c126be4fd3e5578c9e"}, + {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:cafb92b2bc622cd1aa6a1dce4b93307792633f4c5fe1f46c6b97cf67073ec961"}, + {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:31f721658a29331f895a5a54e7e82075554ccfb8b163a18719d342f5ffe5ecb1"}, + {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b297f90c5723d04bcc8265fc2a0f86d4ea2e0f7ab4b6994459548d3a6b992a14"}, + {file = "cryptography-42.0.8-cp39-abi3-win32.whl", hash = "sha256:2f88d197e66c65be5e42cd72e5c18afbfae3f741742070e3019ac8f4ac57262c"}, + {file = "cryptography-42.0.8-cp39-abi3-win_amd64.whl", hash = "sha256:fa76fbb7596cc5839320000cdd5d0955313696d9511debab7ee7278fc8b5c84a"}, + {file = "cryptography-42.0.8-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ba4f0a211697362e89ad822e667d8d340b4d8d55fae72cdd619389fb5912eefe"}, + {file = "cryptography-42.0.8-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:81884c4d096c272f00aeb1f11cf62ccd39763581645b0812e99a91505fa48e0c"}, + {file = "cryptography-42.0.8-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c9bb2ae11bfbab395bdd072985abde58ea9860ed84e59dbc0463a5d0159f5b71"}, + {file = "cryptography-42.0.8-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7016f837e15b0a1c119d27ecd89b3515f01f90a8615ed5e9427e30d9cdbfed3d"}, + {file = "cryptography-42.0.8-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5a94eccb2a81a309806027e1670a358b99b8fe8bfe9f8d329f27d72c094dde8c"}, + {file = "cryptography-42.0.8-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:dec9b018df185f08483f294cae6ccac29e7a6e0678996587363dc352dc65c842"}, + {file = "cryptography-42.0.8-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:343728aac38decfdeecf55ecab3264b015be68fc2816ca800db649607aeee648"}, + {file = "cryptography-42.0.8-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:013629ae70b40af70c9a7a5db40abe5d9054e6f4380e50ce769947b73bf3caad"}, + {file = "cryptography-42.0.8.tar.gz", hash = "sha256:8d09d05439ce7baa8e9e95b07ec5b6c886f548deb7e0f69ef25f64b3bce842f2"}, +] + +[package.dependencies] +cffi = {version = ">=1.12", markers = "platform_python_implementation != \"PyPy\""} + +[package.extras] +docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] +docstest = ["pyenchant (>=1.6.11)", "readme-renderer", "sphinxcontrib-spelling (>=4.0.1)"] +nox = ["nox"] +pep8test = ["check-sdist", "click", "mypy", "ruff"] +sdist = ["build"] +ssh = ["bcrypt (>=3.1.5)"] +test = ["certifi", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test-randomorder = ["pytest-randomly"] + +[[package]] +name = "decorator" +version = "5.1.1" +description = "Decorators for Humans" +category = "main" +optional = false +python-versions = ">=3.5" +files = [ + {file = "decorator-5.1.1-py3-none-any.whl", hash = "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"}, + {file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"}, +] + +[[package]] +name = "future" +version = "0.18.3" +description = "Clean single-source support for Python 3 and 2" +category = "main" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "future-0.18.3.tar.gz", hash = "sha256:34a17436ed1e96697a86f9de3d15a3b0be01d8bc8de9c1dffd59fb8234ed5307"}, +] + +[[package]] +name = "greenlet" +version = "2.0.2" +description = "Lightweight in-process concurrent programming" +category = "main" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +files = [ + {file = "greenlet-2.0.2-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:bdfea8c661e80d3c1c99ad7c3ff74e6e87184895bbaca6ee8cc61209f8b9b85d"}, + {file = "greenlet-2.0.2-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:9d14b83fab60d5e8abe587d51c75b252bcc21683f24699ada8fb275d7712f5a9"}, + {file = "greenlet-2.0.2-cp27-cp27m-win32.whl", hash = "sha256:6c3acb79b0bfd4fe733dff8bc62695283b57949ebcca05ae5c129eb606ff2d74"}, + {file = "greenlet-2.0.2-cp27-cp27m-win_amd64.whl", hash = "sha256:283737e0da3f08bd637b5ad058507e578dd462db259f7f6e4c5c365ba4ee9343"}, + {file = "greenlet-2.0.2-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:d27ec7509b9c18b6d73f2f5ede2622441de812e7b1a80bbd446cb0633bd3d5ae"}, + {file = "greenlet-2.0.2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:30bcf80dda7f15ac77ba5af2b961bdd9dbc77fd4ac6105cee85b0d0a5fcf74df"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:26fbfce90728d82bc9e6c38ea4d038cba20b7faf8a0ca53a9c07b67318d46088"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9190f09060ea4debddd24665d6804b995a9c122ef5917ab26e1566dcc712ceeb"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d75209eed723105f9596807495d58d10b3470fa6732dd6756595e89925ce2470"}, + {file = "greenlet-2.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3a51c9751078733d88e013587b108f1b7a1fb106d402fb390740f002b6f6551a"}, + {file = "greenlet-2.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:76ae285c8104046b3a7f06b42f29c7b73f77683df18c49ab5af7983994c2dd91"}, + {file = "greenlet-2.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:2d4686f195e32d36b4d7cf2d166857dbd0ee9f3d20ae349b6bf8afc8485b3645"}, + {file = "greenlet-2.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c4302695ad8027363e96311df24ee28978162cdcdd2006476c43970b384a244c"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c48f54ef8e05f04d6eff74b8233f6063cb1ed960243eacc474ee73a2ea8573ca"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a1846f1b999e78e13837c93c778dcfc3365902cfb8d1bdb7dd73ead37059f0d0"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a06ad5312349fec0ab944664b01d26f8d1f05009566339ac6f63f56589bc1a2"}, + {file = "greenlet-2.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:eff4eb9b7eb3e4d0cae3d28c283dc16d9bed6b193c2e1ace3ed86ce48ea8df19"}, + {file = "greenlet-2.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5454276c07d27a740c5892f4907c86327b632127dd9abec42ee62e12427ff7e3"}, + {file = "greenlet-2.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:7cafd1208fdbe93b67c7086876f061f660cfddc44f404279c1585bbf3cdc64c5"}, + {file = "greenlet-2.0.2-cp35-cp35m-macosx_10_14_x86_64.whl", hash = "sha256:910841381caba4f744a44bf81bfd573c94e10b3045ee00de0cbf436fe50673a6"}, + {file = "greenlet-2.0.2-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:18a7f18b82b52ee85322d7a7874e676f34ab319b9f8cce5de06067384aa8ff43"}, + {file = "greenlet-2.0.2-cp35-cp35m-win32.whl", hash = "sha256:03a8f4f3430c3b3ff8d10a2a86028c660355ab637cee9333d63d66b56f09d52a"}, + {file = "greenlet-2.0.2-cp35-cp35m-win_amd64.whl", hash = "sha256:4b58adb399c4d61d912c4c331984d60eb66565175cdf4a34792cd9600f21b394"}, + {file = "greenlet-2.0.2-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:703f18f3fda276b9a916f0934d2fb6d989bf0b4fb5a64825260eb9bfd52d78f0"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:32e5b64b148966d9cccc2c8d35a671409e45f195864560829f395a54226408d3"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2dd11f291565a81d71dab10b7033395b7a3a5456e637cf997a6f33ebdf06f8db"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0f72c9ddb8cd28532185f54cc1453f2c16fb417a08b53a855c4e6a418edd099"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cd021c754b162c0fb55ad5d6b9d960db667faad0fa2ff25bb6e1301b0b6e6a75"}, + {file = "greenlet-2.0.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:3c9b12575734155d0c09d6c3e10dbd81665d5c18e1a7c6597df72fd05990c8cf"}, + {file = "greenlet-2.0.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:b9ec052b06a0524f0e35bd8790686a1da006bd911dd1ef7d50b77bfbad74e292"}, + {file = "greenlet-2.0.2-cp36-cp36m-win32.whl", hash = "sha256:dbfcfc0218093a19c252ca8eb9aee3d29cfdcb586df21049b9d777fd32c14fd9"}, + {file = "greenlet-2.0.2-cp36-cp36m-win_amd64.whl", hash = "sha256:9f35ec95538f50292f6d8f2c9c9f8a3c6540bbfec21c9e5b4b751e0a7c20864f"}, + {file = "greenlet-2.0.2-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:d5508f0b173e6aa47273bdc0a0b5ba055b59662ba7c7ee5119528f466585526b"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:f82d4d717d8ef19188687aa32b8363e96062911e63ba22a0cff7802a8e58e5f1"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9c59a2120b55788e800d82dfa99b9e156ff8f2227f07c5e3012a45a399620b7"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2780572ec463d44c1d3ae850239508dbeb9fed38e294c68d19a24d925d9223ca"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:937e9020b514ceedb9c830c55d5c9872abc90f4b5862f89c0887033ae33c6f73"}, + {file = "greenlet-2.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:36abbf031e1c0f79dd5d596bfaf8e921c41df2bdf54ee1eed921ce1f52999a86"}, + {file = "greenlet-2.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:18e98fb3de7dba1c0a852731c3070cf022d14f0d68b4c87a19cc1016f3bb8b33"}, + {file = "greenlet-2.0.2-cp37-cp37m-win32.whl", hash = "sha256:3f6ea9bd35eb450837a3d80e77b517ea5bc56b4647f5502cd28de13675ee12f7"}, + {file = "greenlet-2.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:7492e2b7bd7c9b9916388d9df23fa49d9b88ac0640db0a5b4ecc2b653bf451e3"}, + {file = "greenlet-2.0.2-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:b864ba53912b6c3ab6bcb2beb19f19edd01a6bfcbdfe1f37ddd1778abfe75a30"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:ba2956617f1c42598a308a84c6cf021a90ff3862eddafd20c3333d50f0edb45b"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc3a569657468b6f3fb60587e48356fe512c1754ca05a564f11366ac9e306526"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8eab883b3b2a38cc1e050819ef06a7e6344d4a990d24d45bc6f2cf959045a45b"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acd2162a36d3de67ee896c43effcd5ee3de247eb00354db411feb025aa319857"}, + {file = "greenlet-2.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:0bf60faf0bc2468089bdc5edd10555bab6e85152191df713e2ab1fcc86382b5a"}, + {file = "greenlet-2.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b0ef99cdbe2b682b9ccbb964743a6aca37905fda5e0452e5ee239b1654d37f2a"}, + {file = "greenlet-2.0.2-cp38-cp38-win32.whl", hash = "sha256:b80f600eddddce72320dbbc8e3784d16bd3fb7b517e82476d8da921f27d4b249"}, + {file = "greenlet-2.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:4d2e11331fc0c02b6e84b0d28ece3a36e0548ee1a1ce9ddde03752d9b79bba40"}, + {file = "greenlet-2.0.2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:88d9ab96491d38a5ab7c56dd7a3cc37d83336ecc564e4e8816dbed12e5aaefc8"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:561091a7be172ab497a3527602d467e2b3fbe75f9e783d8b8ce403fa414f71a6"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:971ce5e14dc5e73715755d0ca2975ac88cfdaefcaab078a284fea6cfabf866df"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be4ed120b52ae4d974aa40215fcdfde9194d63541c7ded40ee12eb4dda57b76b"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94c817e84245513926588caf1152e3b559ff794d505555211ca041f032abbb6b"}, + {file = "greenlet-2.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1a819eef4b0e0b96bb0d98d797bef17dc1b4a10e8d7446be32d1da33e095dbb8"}, + {file = "greenlet-2.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7efde645ca1cc441d6dc4b48c0f7101e8d86b54c8530141b09fd31cef5149ec9"}, + {file = "greenlet-2.0.2-cp39-cp39-win32.whl", hash = "sha256:ea9872c80c132f4663822dd2a08d404073a5a9b5ba6155bea72fb2a79d1093b5"}, + {file = "greenlet-2.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:db1a39669102a1d8d12b57de2bb7e2ec9066a6f2b3da35ae511ff93b01b5d564"}, + {file = "greenlet-2.0.2.tar.gz", hash = "sha256:e7c8dc13af7db097bed64a051d2dd49e9f0af495c26995c00a9ee842690d34c0"}, +] + +[package.extras] +docs = ["Sphinx", "docutils (<0.18)"] +test = ["objgraph", "psutil"] + +[[package]] +name = "gssapi" +version = "1.8.2" +description = "Python GSSAPI Wrapper" +category = "main" +optional = false +python-versions = ">=3.7" +files = [ + {file = "gssapi-1.8.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c14cf97d61073d8211abfded77066af791356868022acda10224a8212639cf5"}, + {file = "gssapi-1.8.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a36bc089036196aa03c3c312ea1639677065b3d7e8f37edbba731f61f5e56dd6"}, + {file = "gssapi-1.8.2-cp310-cp310-win32.whl", hash = "sha256:cdd6bff2cf7f3a5a5a24cddde137b6e117fe53aad81f240dee2e8e383c0b289b"}, + {file = "gssapi-1.8.2-cp310-cp310-win_amd64.whl", hash = "sha256:f75b094913a1757e5e634b70b03e808cab0eb02c802ec50b760636b23b0aa50c"}, + {file = "gssapi-1.8.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:47d69b1fd3bd0764d7a14500c6cbd8fd08198ee6e1737048a01ad7024d57f67d"}, + {file = "gssapi-1.8.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:67c85758a6b40042509c96bb00d0873a501491453ad5b0da88dbfa9343c8ffea"}, + {file = "gssapi-1.8.2-cp311-cp311-win32.whl", hash = "sha256:4aaed04439aed8eba525ea44dd7219ecd97d520254320e66ac53d9ae4acb8fe5"}, + {file = "gssapi-1.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:8b4c1c664635153b0055a08bf30ec1552c8aa064a76f565d7905057500f334b3"}, + {file = "gssapi-1.8.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:02e0a8f35e1f5b1c0eada646e3da1af3022c25e8df26ded3fd18ee78abb155ea"}, + {file = "gssapi-1.8.2-cp37-cp37m-win32.whl", hash = "sha256:84bfd1b3954a5a608302884a36586eed6f623f6f38fcd331ad55937eca1ea89f"}, + {file = "gssapi-1.8.2-cp37-cp37m-win_amd64.whl", hash = "sha256:85e7e623dfe51fef3f613acb965c4fa1866e7a7ee2c2558cbe2f203798171510"}, + {file = "gssapi-1.8.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:512a2bd98e8003f48d98908bf54d1ed94c5388764e0a09fdc24cc691422a4162"}, + {file = "gssapi-1.8.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:13aba9a947994f5f5f1fb6f425b397a359b191cee2983fa33911cf5e212d6cfb"}, + {file = "gssapi-1.8.2-cp38-cp38-win32.whl", hash = "sha256:43c8b1acb8efa1f881ff7f7e912ccdc611689484190b7cc83f538b44f8992cbd"}, + {file = "gssapi-1.8.2-cp38-cp38-win_amd64.whl", hash = "sha256:787262e0db124d302c972d30e6f4b7c81423e696d08ee6e07047194a9bce2664"}, + {file = "gssapi-1.8.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d6be1d8e07cc151e217f8a0ccf7c28ca5a1bb0ae00c8512586642c9f876a7298"}, + {file = "gssapi-1.8.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:75763c49b3e18da60e160d76e8ac9a27b0bbd637c6e88513150fbb7158ae15d7"}, + {file = "gssapi-1.8.2-cp39-cp39-win32.whl", hash = "sha256:dcd2be270bf490b6007eb3734795aaeddf92848f79b69d6a23f6204ccaa9b6c7"}, + {file = "gssapi-1.8.2-cp39-cp39-win_amd64.whl", hash = "sha256:fac7d1f4b14383bd29d3996cf5f6f23d0dc50ffd7965d2bc35bcc0849da24152"}, + {file = "gssapi-1.8.2.tar.gz", hash = "sha256:b78e0a021cc91158660e4c5cc9263e07c719346c35a9c0f66725e914b235c89a"}, +] + +[package.dependencies] +decorator = "*" + +[[package]] +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] + +[[package]] +name = "netmiko" +version = "4.3.0" +description = "Multi-vendor library to simplify legacy CLI connections to network devices" +category = "main" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "netmiko-4.3.0-py3-none-any.whl", hash = "sha256:a873b186e0b61be4a2100eda51e996d917ceddce195b734346b686757e61d324"}, + {file = "netmiko-4.3.0.tar.gz", hash = "sha256:da90f6efdf33b4140eb6cd7f2272773c2ce144fa74ac34d5ecac1b4d4607f1fb"}, +] + +[package.dependencies] +ntc-templates = ">=2.0.0" +paramiko = ">=2.9.5" +pyserial = ">=3.3" +pyyaml = ">=5.3" +scp = ">=0.13.6" +textfsm = ">=1.1.3" + +[[package]] +name = "ntc-templates" +version = "5.1.0" +description = "TextFSM Templates for Network Devices, and Python wrapper for TextFSM's CliTable." +category = "main" +optional = false +python-versions = "<4.0,>=3.8" +files = [ + {file = "ntc_templates-5.1.0-py3-none-any.whl", hash = "sha256:8784bbf790a814789910c04148ee84726183228f173a118b80e0c7420290b4dd"}, + {file = "ntc_templates-5.1.0.tar.gz", hash = "sha256:820583f35a8d7411c86b70635a6acd65ce357b8bc19e1f408ce836eac30a6371"}, +] + +[package.dependencies] +textfsm = ">=1.1.0,<2.0.0" + +[[package]] +name = "paramiko" +version = "3.4.0" +description = "SSH2 protocol library" +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "paramiko-3.4.0-py3-none-any.whl", hash = "sha256:43f0b51115a896f9c00f59618023484cb3a14b98bbceab43394a39c6739b7ee7"}, + {file = "paramiko-3.4.0.tar.gz", hash = "sha256:aac08f26a31dc4dffd92821527d1682d99d52f9ef6851968114a8728f3c274d3"}, +] + +[package.dependencies] +bcrypt = ">=3.2" +cryptography = ">=3.3" +pynacl = ">=1.5" + +[package.extras] +all = ["gssapi (>=1.4.1)", "invoke (>=2.0)", "pyasn1 (>=0.1.7)", "pywin32 (>=2.1.8)"] +gssapi = ["gssapi (>=1.4.1)", "pyasn1 (>=0.1.7)", "pywin32 (>=2.1.8)"] +invoke = ["invoke (>=2.0)"] + +[[package]] +name = "psycopg2-binary" +version = "2.9.7" +description = "psycopg2 - Python-PostgreSQL Database Adapter" +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "psycopg2-binary-2.9.7.tar.gz", hash = "sha256:1b918f64a51ffe19cd2e230b3240ba481330ce1d4b7875ae67305bd1d37b041c"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ea5f8ee87f1eddc818fc04649d952c526db4426d26bab16efbe5a0c52b27d6ab"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2993ccb2b7e80844d534e55e0f12534c2871952f78e0da33c35e648bf002bbff"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dbbc3c5d15ed76b0d9db7753c0db40899136ecfe97d50cbde918f630c5eb857a"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:692df8763b71d42eb8343f54091368f6f6c9cfc56dc391858cdb3c3ef1e3e584"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9dcfd5d37e027ec393a303cc0a216be564b96c80ba532f3d1e0d2b5e5e4b1e6e"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17cc17a70dfb295a240db7f65b6d8153c3d81efb145d76da1e4a096e9c5c0e63"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e5666632ba2b0d9757b38fc17337d84bdf932d38563c5234f5f8c54fd01349c9"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7db7b9b701974c96a88997d458b38ccb110eba8f805d4b4f74944aac48639b42"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:c82986635a16fb1fa15cd5436035c88bc65c3d5ced1cfaac7f357ee9e9deddd4"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4fe13712357d802080cfccbf8c6266a3121dc0e27e2144819029095ccf708372"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-win32.whl", hash = "sha256:122641b7fab18ef76b18860dd0c772290566b6fb30cc08e923ad73d17461dc63"}, + {file = "psycopg2_binary-2.9.7-cp310-cp310-win_amd64.whl", hash = "sha256:f8651cf1f144f9ee0fa7d1a1df61a9184ab72962531ca99f077bbdcba3947c58"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4ecc15666f16f97709106d87284c136cdc82647e1c3f8392a672616aed3c7151"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3fbb1184c7e9d28d67671992970718c05af5f77fc88e26fd7136613c4ece1f89"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8a7968fd20bd550431837656872c19575b687f3f6f98120046228e451e4064df"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:094af2e77a1976efd4956a031028774b827029729725e136514aae3cdf49b87b"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:26484e913d472ecb6b45937ea55ce29c57c662066d222fb0fbdc1fab457f18c5"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f309b77a7c716e6ed9891b9b42953c3ff7d533dc548c1e33fddc73d2f5e21f9"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6d92e139ca388ccfe8c04aacc163756e55ba4c623c6ba13d5d1595ed97523e4b"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:2df562bb2e4e00ee064779902d721223cfa9f8f58e7e52318c97d139cf7f012d"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:4eec5d36dbcfc076caab61a2114c12094c0b7027d57e9e4387b634e8ab36fd44"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1011eeb0c51e5b9ea1016f0f45fa23aca63966a4c0afcf0340ccabe85a9f65bd"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-win32.whl", hash = "sha256:ded8e15f7550db9e75c60b3d9fcbc7737fea258a0f10032cdb7edc26c2a671fd"}, + {file = "psycopg2_binary-2.9.7-cp311-cp311-win_amd64.whl", hash = "sha256:8a136c8aaf6615653450817a7abe0fc01e4ea720ae41dfb2823eccae4b9062a3"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2dec5a75a3a5d42b120e88e6ed3e3b37b46459202bb8e36cd67591b6e5feebc1"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc10da7e7df3380426521e8c1ed975d22df678639da2ed0ec3244c3dc2ab54c8"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee919b676da28f78f91b464fb3e12238bd7474483352a59c8a16c39dfc59f0c5"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eb1c0e682138f9067a58fc3c9a9bf1c83d8e08cfbee380d858e63196466d5c86"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00d8db270afb76f48a499f7bb8fa70297e66da67288471ca873db88382850bf4"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:9b0c2b466b2f4d89ccc33784c4ebb1627989bd84a39b79092e560e937a11d4ac"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:51d1b42d44f4ffb93188f9b39e6d1c82aa758fdb8d9de65e1ddfe7a7d250d7ad"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:11abdbfc6f7f7dea4a524b5f4117369b0d757725798f1593796be6ece20266cb"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:f02f4a72cc3ab2565c6d9720f0343cb840fb2dc01a2e9ecb8bc58ccf95dc5c06"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-win32.whl", hash = "sha256:81d5dd2dd9ab78d31a451e357315f201d976c131ca7d43870a0e8063b6b7a1ec"}, + {file = "psycopg2_binary-2.9.7-cp37-cp37m-win_amd64.whl", hash = "sha256:62cb6de84d7767164a87ca97e22e5e0a134856ebcb08f21b621c6125baf61f16"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:59f7e9109a59dfa31efa022e94a244736ae401526682de504e87bd11ce870c22"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:95a7a747bdc3b010bb6a980f053233e7610276d55f3ca506afff4ad7749ab58a"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c721ee464e45ecf609ff8c0a555018764974114f671815a0a7152aedb9f3343"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f4f37bbc6588d402980ffbd1f3338c871368fb4b1cfa091debe13c68bb3852b3"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac83ab05e25354dad798401babaa6daa9577462136ba215694865394840e31f8"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:024eaeb2a08c9a65cd5f94b31ace1ee3bb3f978cd4d079406aef85169ba01f08"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:1c31c2606ac500dbd26381145684d87730a2fac9a62ebcfbaa2b119f8d6c19f4"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:42a62ef0e5abb55bf6ffb050eb2b0fcd767261fa3faf943a4267539168807522"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:7952807f95c8eba6a8ccb14e00bf170bb700cafcec3924d565235dffc7dc4ae8"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e02bc4f2966475a7393bd0f098e1165d470d3fa816264054359ed4f10f6914ea"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-win32.whl", hash = "sha256:fdca0511458d26cf39b827a663d7d87db6f32b93efc22442a742035728603d5f"}, + {file = "psycopg2_binary-2.9.7-cp38-cp38-win_amd64.whl", hash = "sha256:d0b16e5bb0ab78583f0ed7ab16378a0f8a89a27256bb5560402749dbe8a164d7"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6822c9c63308d650db201ba22fe6648bd6786ca6d14fdaf273b17e15608d0852"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8f94cb12150d57ea433e3e02aabd072205648e86f1d5a0a692d60242f7809b15"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5ee89587696d808c9a00876065d725d4ae606f5f7853b961cdbc348b0f7c9a1"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ad5ec10b53cbb57e9a2e77b67e4e4368df56b54d6b00cc86398578f1c635f329"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:642df77484b2dcaf87d4237792246d8068653f9e0f5c025e2c692fc56b0dda70"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a6a8b575ac45af1eaccbbcdcf710ab984fd50af048fe130672377f78aaff6fc1"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f955aa50d7d5220fcb6e38f69ea126eafecd812d96aeed5d5f3597f33fad43bb"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ad26d4eeaa0d722b25814cce97335ecf1b707630258f14ac4d2ed3d1d8415265"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:ced63c054bdaf0298f62681d5dcae3afe60cbae332390bfb1acf0e23dcd25fc8"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2b04da24cbde33292ad34a40db9832a80ad12de26486ffeda883413c9e1b1d5e"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-win32.whl", hash = "sha256:18f12632ab516c47c1ac4841a78fddea6508a8284c7cf0f292cb1a523f2e2379"}, + {file = "psycopg2_binary-2.9.7-cp39-cp39-win_amd64.whl", hash = "sha256:eb3b8d55924a6058a26db69fb1d3e7e32695ff8b491835ba9f479537e14dcf9f"}, +] + +[[package]] +name = "pyasn1" +version = "0.4.8" +description = "ASN.1 types and codecs" +category = "main" +optional = false +python-versions = "*" +files = [ + {file = "pyasn1-0.4.8-py2.py3-none-any.whl", hash = "sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d"}, + {file = "pyasn1-0.4.8.tar.gz", hash = "sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba"}, +] + +[[package]] +name = "pyasn1-modules" +version = "0.2.8" +description = "A collection of ASN.1-based protocols modules." +category = "main" +optional = false +python-versions = "*" +files = [ + {file = "pyasn1-modules-0.2.8.tar.gz", hash = "sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e"}, + {file = "pyasn1_modules-0.2.8-py2.py3-none-any.whl", hash = "sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74"}, +] + +[package.dependencies] +pyasn1 = ">=0.4.6,<0.5.0" + +[[package]] +name = "pycparser" +version = "2.22" +description = "C parser in Python" +category = "main" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, + {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, +] + +[[package]] +name = "pycryptodomex" +version = "3.18.0" +description = "Cryptographic library for Python" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "pycryptodomex-3.18.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:160a39a708c36fa0b168ab79386dede588e62aec06eb505add870739329aecc6"}, + {file = "pycryptodomex-3.18.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:c2953afebf282a444c51bf4effe751706b4d0d63d7ca2cc51db21f902aa5b84e"}, + {file = "pycryptodomex-3.18.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:ba95abd563b0d1b88401658665a260852a8e6c647026ee6a0a65589287681df8"}, + {file = "pycryptodomex-3.18.0-cp27-cp27m-manylinux2014_aarch64.whl", hash = "sha256:192306cf881fe3467dda0e174a4f47bb3a8bb24b90c9cdfbdc248eec5fc0578c"}, + {file = "pycryptodomex-3.18.0-cp27-cp27m-musllinux_1_1_aarch64.whl", hash = "sha256:f9ab5ef0718f6a8716695dea16d83b671b22c45e9c0c78fd807c32c0192e54b5"}, + {file = "pycryptodomex-3.18.0-cp27-cp27m-win32.whl", hash = "sha256:50308fcdbf8345e5ec224a5502b4215178bdb5e95456ead8ab1a69ffd94779cb"}, + {file = "pycryptodomex-3.18.0-cp27-cp27m-win_amd64.whl", hash = "sha256:4d9379c684efea80fdab02a3eb0169372bca7db13f9332cb67483b8dc8b67c37"}, + {file = "pycryptodomex-3.18.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:5594a125dae30d60e94f37797fc67ce3c744522de7992c7c360d02fdb34918f8"}, + {file = "pycryptodomex-3.18.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:8ff129a5a0eb5ff16e45ca4fa70a6051da7f3de303c33b259063c19be0c43d35"}, + {file = "pycryptodomex-3.18.0-cp27-cp27mu-manylinux2014_aarch64.whl", hash = "sha256:3d9314ac785a5b75d5aaf924c5f21d6ca7e8df442e5cf4f0fefad4f6e284d422"}, + {file = "pycryptodomex-3.18.0-cp27-cp27mu-musllinux_1_1_aarch64.whl", hash = "sha256:f237278836dda412a325e9340ba2e6a84cb0f56b9244781e5b61f10b3905de88"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-macosx_10_9_universal2.whl", hash = "sha256:ac614363a86cc53d8ba44b6c469831d1555947e69ab3276ae8d6edc219f570f7"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-macosx_10_9_x86_64.whl", hash = "sha256:302a8f37c224e7b5d72017d462a2be058e28f7be627bdd854066e16722d0fc0c"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-manylinux2014_aarch64.whl", hash = "sha256:6421d23d6a648e83ba2670a352bcd978542dad86829209f59d17a3f087f4afef"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d84e105787f5e5d36ec6a581ff37a1048d12e638688074b2a00bcf402f9aa1c2"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6875eb8666f68ddbd39097867325bd22771f595b4e2b0149739b5623c8bf899b"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:27072a494ce621cc7a9096bbf60ed66826bb94db24b49b7359509e7951033e74"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-musllinux_1_1_i686.whl", hash = "sha256:1949e09ea49b09c36d11a951b16ff2a05a0ffe969dda1846e4686ee342fe8646"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:6ed3606832987018615f68e8ed716a7065c09a0fe94afd7c9ca1b6777f0ac6eb"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-win32.whl", hash = "sha256:d56c9ec41258fd3734db9f5e4d2faeabe48644ba9ca23b18e1839b3bdf093222"}, + {file = "pycryptodomex-3.18.0-cp35-abi3-win_amd64.whl", hash = "sha256:e00a4bacb83a2627e8210cb353a2e31f04befc1155db2976e5e239dd66482278"}, + {file = "pycryptodomex-3.18.0-pp27-pypy_73-manylinux2010_x86_64.whl", hash = "sha256:2dc4eab20f4f04a2d00220fdc9258717b82d31913552e766d5f00282c031b70a"}, + {file = "pycryptodomex-3.18.0-pp27-pypy_73-win32.whl", hash = "sha256:75672205148bdea34669173366df005dbd52be05115e919551ee97171083423d"}, + {file = "pycryptodomex-3.18.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:bec6c80994d4e7a38312072f89458903b65ec99bed2d65aa4de96d997a53ea7a"}, + {file = "pycryptodomex-3.18.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d35a8ffdc8b05e4b353ba281217c8437f02c57d7233363824e9d794cf753c419"}, + {file = "pycryptodomex-3.18.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:76f0a46bee539dae4b3dfe37216f678769349576b0080fdbe431d19a02da42ff"}, + {file = "pycryptodomex-3.18.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:71687eed47df7e965f6e0bf3cadef98f368d5221f0fb89d2132effe1a3e6a194"}, + {file = "pycryptodomex-3.18.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:73d64b32d84cf48d9ec62106aa277dbe99ab5fbfd38c5100bc7bddd3beb569f7"}, + {file = "pycryptodomex-3.18.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbdcce0a226d9205560a5936b05208c709b01d493ed8307792075dedfaaffa5f"}, + {file = "pycryptodomex-3.18.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:58fc0aceb9c961b9897facec9da24c6a94c5db04597ec832060f53d4d6a07196"}, + {file = "pycryptodomex-3.18.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:215be2980a6b70704c10796dd7003eb4390e7be138ac6fb8344bf47e71a8d470"}, + {file = "pycryptodomex-3.18.0.tar.gz", hash = "sha256:3e3ecb5fe979e7c1bb0027e518340acf7ee60415d79295e5251d13c68dde576e"}, +] + +[[package]] +name = "pynacl" +version = "1.5.0" +description = "Python binding to the Networking and Cryptography (NaCl) library" +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "PyNaCl-1.5.0-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:401002a4aaa07c9414132aaed7f6836ff98f59277a234704ff66878c2ee4a0d1"}, + {file = "PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:52cb72a79269189d4e0dc537556f4740f7f0a9ec41c1322598799b0bdad4ef92"}, + {file = "PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a36d4a9dda1f19ce6e03c9a784a2921a4b726b02e1c736600ca9c22029474394"}, + {file = "PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:0c84947a22519e013607c9be43706dd42513f9e6ae5d39d3613ca1e142fba44d"}, + {file = "PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06b8f6fa7f5de8d5d2f7573fe8c863c051225a27b61e6860fd047b1775807858"}, + {file = "PyNaCl-1.5.0-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:a422368fc821589c228f4c49438a368831cb5bbc0eab5ebe1d7fac9dded6567b"}, + {file = "PyNaCl-1.5.0-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:61f642bf2378713e2c2e1de73444a3778e5f0a38be6fee0fe532fe30060282ff"}, + {file = "PyNaCl-1.5.0-cp36-abi3-win32.whl", hash = "sha256:e46dae94e34b085175f8abb3b0aaa7da40767865ac82c928eeb9e57e1ea8a543"}, + {file = "PyNaCl-1.5.0-cp36-abi3-win_amd64.whl", hash = "sha256:20f42270d27e1b6a29f54032090b972d97f0a1b0948cc52392041ef7831fee93"}, + {file = "PyNaCl-1.5.0.tar.gz", hash = "sha256:8ac7448f09ab85811607bdd21ec2464495ac8b7c66d146bf545b0f08fb9220ba"}, +] + +[package.dependencies] +cffi = ">=1.4.1" + +[package.extras] +docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"] +tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] + +[[package]] +name = "pyserial" +version = "3.5" +description = "Python Serial Port Extension" +category = "main" +optional = false +python-versions = "*" +files = [ + {file = "pyserial-3.5-py2.py3-none-any.whl", hash = "sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0"}, + {file = "pyserial-3.5.tar.gz", hash = "sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb"}, +] + +[package.extras] +cp2110 = ["hidapi"] + +[[package]] +name = "python-dotenv" +version = "1.0.0" +description = "Read key-value pairs from a .env file and set them as environment variables" +category = "main" +optional = false +python-versions = ">=3.8" +files = [ + {file = "python-dotenv-1.0.0.tar.gz", hash = "sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba"}, + {file = "python_dotenv-1.0.0-py3-none-any.whl", hash = "sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + +[[package]] +name = "python-ldap" +version = "3.4.3" +description = "Python modules for implementing LDAP clients" +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "python-ldap-3.4.3.tar.gz", hash = "sha256:ab26c519a0ef2a443a2a10391fa3c5cb52d7871323399db949ebfaa9f25ee2a0"}, +] + +[package.dependencies] +pyasn1 = ">=0.3.7" +pyasn1_modules = ">=0.1.5" + +[[package]] +name = "pyyaml" +version = "6.0.1" +description = "YAML parser and emitter for Python" +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, + {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, + {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, + {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, +] + +[[package]] +name = "requests" +version = "2.30.0" +description = "Python HTTP for Humans." +category = "main" +optional = false +python-versions = ">=3.7" +files = [ + {file = "requests-2.30.0-py3-none-any.whl", hash = "sha256:10e94cc4f3121ee6da529d358cdaeaff2f1c409cd377dbc72b825852f2f7e294"}, + {file = "requests-2.30.0.tar.gz", hash = "sha256:239d7d4458afcb28a692cdd298d87542235f4ca8d36d03a15bfc128a6559a2f4"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "scp" +version = "0.15.0" +description = "scp module for paramiko" +category = "main" +optional = false +python-versions = "*" +files = [ + {file = "scp-0.15.0-py2.py3-none-any.whl", hash = "sha256:9e7f721e5ac563c33eb0831d0f949c6342f1c28c3bdc3b02f39d77b5ea20df7e"}, + {file = "scp-0.15.0.tar.gz", hash = "sha256:f1b22e9932123ccf17eebf19e0953c6e9148f589f93d91b872941a696305c83f"}, +] + +[package.dependencies] +paramiko = "*" + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "sqlalchemy" +version = "2.0.20" +description = "Database Abstraction Library" +category = "main" +optional = false +python-versions = ">=3.7" +files = [ + {file = "SQLAlchemy-2.0.20-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:759b51346aa388c2e606ee206c0bc6f15a5299f6174d1e10cadbe4530d3c7a98"}, + {file = "SQLAlchemy-2.0.20-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1506e988ebeaaf316f183da601f24eedd7452e163010ea63dbe52dc91c7fc70e"}, + {file = "SQLAlchemy-2.0.20-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5768c268df78bacbde166b48be788b83dddaa2a5974b8810af422ddfe68a9bc8"}, + {file = "SQLAlchemy-2.0.20-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a3f0dd6d15b6dc8b28a838a5c48ced7455c3e1fb47b89da9c79cc2090b072a50"}, + {file = "SQLAlchemy-2.0.20-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:243d0fb261f80a26774829bc2cee71df3222587ac789b7eaf6555c5b15651eed"}, + {file = "SQLAlchemy-2.0.20-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6eb6d77c31e1bf4268b4d61b549c341cbff9842f8e115ba6904249c20cb78a61"}, + {file = "SQLAlchemy-2.0.20-cp310-cp310-win32.whl", hash = "sha256:bcb04441f370cbe6e37c2b8d79e4af9e4789f626c595899d94abebe8b38f9a4d"}, + {file = "SQLAlchemy-2.0.20-cp310-cp310-win_amd64.whl", hash = "sha256:d32b5ffef6c5bcb452723a496bad2d4c52b346240c59b3e6dba279f6dcc06c14"}, + {file = "SQLAlchemy-2.0.20-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:dd81466bdbc82b060c3c110b2937ab65ace41dfa7b18681fdfad2f37f27acdd7"}, + {file = "SQLAlchemy-2.0.20-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6fe7d61dc71119e21ddb0094ee994418c12f68c61b3d263ebaae50ea8399c4d4"}, + {file = "SQLAlchemy-2.0.20-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4e571af672e1bb710b3cc1a9794b55bce1eae5aed41a608c0401885e3491179"}, + {file = "SQLAlchemy-2.0.20-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3364b7066b3c7f4437dd345d47271f1251e0cfb0aba67e785343cdbdb0fff08c"}, + {file = "SQLAlchemy-2.0.20-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1be86ccea0c965a1e8cd6ccf6884b924c319fcc85765f16c69f1ae7148eba64b"}, + {file = "SQLAlchemy-2.0.20-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1d35d49a972649b5080557c603110620a86aa11db350d7a7cb0f0a3f611948a0"}, + {file = "SQLAlchemy-2.0.20-cp311-cp311-win32.whl", hash = "sha256:27d554ef5d12501898d88d255c54eef8414576f34672e02fe96d75908993cf53"}, + {file = "SQLAlchemy-2.0.20-cp311-cp311-win_amd64.whl", hash = "sha256:411e7f140200c02c4b953b3dbd08351c9f9818d2bd591b56d0fa0716bd014f1e"}, + {file = "SQLAlchemy-2.0.20-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3c6aceebbc47db04f2d779db03afeaa2c73ea3f8dcd3987eb9efdb987ffa09a3"}, + {file = "SQLAlchemy-2.0.20-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7d3f175410a6db0ad96b10bfbb0a5530ecd4fcf1e2b5d83d968dd64791f810ed"}, + {file = "SQLAlchemy-2.0.20-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea8186be85da6587456c9ddc7bf480ebad1a0e6dcbad3967c4821233a4d4df57"}, + {file = "SQLAlchemy-2.0.20-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c3d99ba99007dab8233f635c32b5cd24fb1df8d64e17bc7df136cedbea427897"}, + {file = "SQLAlchemy-2.0.20-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:76fdfc0f6f5341987474ff48e7a66c3cd2b8a71ddda01fa82fedb180b961630a"}, + {file = "SQLAlchemy-2.0.20-cp37-cp37m-win32.whl", hash = "sha256:d3793dcf5bc4d74ae1e9db15121250c2da476e1af8e45a1d9a52b1513a393459"}, + {file = "SQLAlchemy-2.0.20-cp37-cp37m-win_amd64.whl", hash = "sha256:79fde625a0a55220d3624e64101ed68a059c1c1f126c74f08a42097a72ff66a9"}, + {file = "SQLAlchemy-2.0.20-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:599ccd23a7146e126be1c7632d1d47847fa9f333104d03325c4e15440fc7d927"}, + {file = "SQLAlchemy-2.0.20-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1a58052b5a93425f656675673ef1f7e005a3b72e3f2c91b8acca1b27ccadf5f4"}, + {file = "SQLAlchemy-2.0.20-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79543f945be7a5ada9943d555cf9b1531cfea49241809dd1183701f94a748624"}, + {file = "SQLAlchemy-2.0.20-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63e73da7fb030ae0a46a9ffbeef7e892f5def4baf8064786d040d45c1d6d1dc5"}, + {file = "SQLAlchemy-2.0.20-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:3ce5e81b800a8afc870bb8e0a275d81957e16f8c4b62415a7b386f29a0cb9763"}, + {file = "SQLAlchemy-2.0.20-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:cb0d3e94c2a84215532d9bcf10229476ffd3b08f481c53754113b794afb62d14"}, + {file = "SQLAlchemy-2.0.20-cp38-cp38-win32.whl", hash = "sha256:8dd77fd6648b677d7742d2c3cc105a66e2681cc5e5fb247b88c7a7b78351cf74"}, + {file = "SQLAlchemy-2.0.20-cp38-cp38-win_amd64.whl", hash = "sha256:6f8a934f9dfdf762c844e5164046a9cea25fabbc9ec865c023fe7f300f11ca4a"}, + {file = "SQLAlchemy-2.0.20-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:26a3399eaf65e9ab2690c07bd5cf898b639e76903e0abad096cd609233ce5208"}, + {file = "SQLAlchemy-2.0.20-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4cde2e1096cbb3e62002efdb7050113aa5f01718035ba9f29f9d89c3758e7e4e"}, + {file = "SQLAlchemy-2.0.20-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1b09ba72e4e6d341bb5bdd3564f1cea6095d4c3632e45dc69375a1dbe4e26ec"}, + {file = "SQLAlchemy-2.0.20-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1b74eeafaa11372627ce94e4dc88a6751b2b4d263015b3523e2b1e57291102f0"}, + {file = "SQLAlchemy-2.0.20-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:77d37c1b4e64c926fa3de23e8244b964aab92963d0f74d98cbc0783a9e04f501"}, + {file = "SQLAlchemy-2.0.20-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:eefebcc5c555803065128401a1e224a64607259b5eb907021bf9b175f315d2a6"}, + {file = "SQLAlchemy-2.0.20-cp39-cp39-win32.whl", hash = "sha256:3423dc2a3b94125094897118b52bdf4d37daf142cbcf26d48af284b763ab90e9"}, + {file = "SQLAlchemy-2.0.20-cp39-cp39-win_amd64.whl", hash = "sha256:5ed61e3463021763b853628aef8bc5d469fe12d95f82c74ef605049d810f3267"}, + {file = "SQLAlchemy-2.0.20-py3-none-any.whl", hash = "sha256:63a368231c53c93e2b67d0c5556a9836fdcd383f7e3026a39602aad775b14acf"}, + {file = "SQLAlchemy-2.0.20.tar.gz", hash = "sha256:ca8a5ff2aa7f3ade6c498aaafce25b1eaeabe4e42b73e25519183e4566a16fc6"}, +] + +[package.dependencies] +greenlet = {version = "!=0.4.17", markers = "platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\""} +typing-extensions = ">=4.2.0" + +[package.extras] +aiomysql = ["aiomysql (>=0.2.0)", "greenlet (!=0.4.17)"] +aiosqlite = ["aiosqlite", "greenlet (!=0.4.17)", "typing-extensions (!=3.10.0.1)"] +asyncio = ["greenlet (!=0.4.17)"] +asyncmy = ["asyncmy (>=0.2.3,!=0.2.4,!=0.2.6)", "greenlet (!=0.4.17)"] +mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2,!=1.1.5)"] +mssql = ["pyodbc"] +mssql-pymssql = ["pymssql"] +mssql-pyodbc = ["pyodbc"] +mypy = ["mypy (>=0.910)"] +mysql = ["mysqlclient (>=1.4.0)"] +mysql-connector = ["mysql-connector-python"] +oracle = ["cx-oracle (>=7)"] +oracle-oracledb = ["oracledb (>=1.0.1)"] +postgresql = ["psycopg2 (>=2.7)"] +postgresql-asyncpg = ["asyncpg", "greenlet (!=0.4.17)"] +postgresql-pg8000 = ["pg8000 (>=1.29.1)"] +postgresql-psycopg = ["psycopg (>=3.0.7)"] +postgresql-psycopg2binary = ["psycopg2-binary"] +postgresql-psycopg2cffi = ["psycopg2cffi"] +postgresql-psycopgbinary = ["psycopg[binary] (>=3.0.7)"] +pymysql = ["pymysql"] +sqlcipher = ["sqlcipher3-binary"] + +[[package]] +name = "textfsm" +version = "1.1.3" +description = "Python module for parsing semi-structured text into python tables." +category = "main" +optional = false +python-versions = "*" +files = [ + {file = "textfsm-1.1.3-py2.py3-none-any.whl", hash = "sha256:dcbeebc6a6137bed561c71a56344d752e6dbc04ae5ea309252cb70fb97ccc9cd"}, + {file = "textfsm-1.1.3.tar.gz", hash = "sha256:577ef278a9237f5341ae9b682947cefa4a2c1b24dbe486f94f2c95addc6504b5"}, +] + +[package.dependencies] +future = "*" +six = "*" + +[[package]] +name = "typing-extensions" +version = "4.7.1" +description = "Backported and Experimental Type Hints for Python 3.7+" +category = "main" +optional = false +python-versions = ">=3.7" +files = [ + {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, + {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, +] + +[[package]] +name = "urllib3" +version = "2.0.2" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" +optional = false +python-versions = ">=3.7" +files = [ + {file = "urllib3-2.0.2-py3-none-any.whl", hash = "sha256:d055c2f9d38dc53c808f6fdc8eab7360b6fdbbde02340ed25cfbcd817c62469e"}, + {file = "urllib3-2.0.2.tar.gz", hash = "sha256:61717a1095d7e155cdb737ac7bb2f4324a858a1e2e6466f6d03ff630ca68d3cc"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.10" +content-hash = "a2ec9d9ef582a657d66141c0675915f9ed7e3edab18296f73953f5c97004d02f" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9b75833 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[tool.poetry] +name = "t0xa-sanbox" +version = "0.1.0" +description = "" +authors = ["ashalimov "] +readme = "README.md" +packages = [{include = "t0xa_sanbox"}] + +[tool.poetry.dependencies] +python = "^3.10" +certifi = "2023.5.7" +charset-normalizer = "3.1.0" +decorator = "5.1.1" +gssapi = "1.8.2" +idna = "3.4" +pyasn1 = "0.4.8" +pyasn1-modules = "0.2.8" +python-ldap = "3.4.3" +requests = "2.30.0" +urllib3 = "2.0.2" +pycryptodomex = "^3.17" +sqlalchemy = "^2.0.20" +psycopg2-binary = "^2.9.7" +python-dotenv = "^1.0.0" +textfsm = "^1.1.3" +netmiko = "^4.3.0" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/pyrightconfig.json b/pyrightconfig.json new file mode 100644 index 0000000..9e9a1a8 --- /dev/null +++ b/pyrightconfig.json @@ -0,0 +1,4 @@ +{ + "venv": ".venv", + "venvPath": "/home/pro100ton/Documents/development/sandbox" +} diff --git a/regex/basic.py b/regex/basic.py new file mode 100644 index 0000000..d6e1c40 --- /dev/null +++ b/regex/basic.py @@ -0,0 +1,64 @@ +import re + +# Input text +input_text = """ +object-group service service_group_proto_3 + service-object object proto_3 +object-group user DM_INLINE_USER_3 + group-object user_group2 + group-object test_user_group +object-group user DM_INLINE_USER_4 + group-object user_group_all + user LOCAL\\ussss +object-group user DM_INLINE_USER_5 + group-object test_user_group + group-object user_group2 +object-group protocol nda + group-object TCPUDP +object-group service tcpudp tcp-udp + group-object tcpudp_serv_group1 +object-group network DM_INLINE_NETWORK_1 + group-object net_group3 + network-object object tetetet +object-group protocol ip_proto_group + protocol-object ip +object-group protocol TTCCPPUUDDPP + protocol-object udp + protocol-object tcp +object-group protocol DM_INLINE_PROTOCOL_2 + protocol-object icmp + protocol-object icmp6 +object-group network U_NETWORK + network-object host 10.1.46.10 + network-object host 12.16.10.61 + network-object host 100.60.4.2 +object-group network ds_group_2 + network-object ::/1 + network-object host fc::ee + network-object 1.2.3.0 255.255.255.0 + network-object host 1.2.3.4 +access-list OUTSIDE_access_in remark Test new description one +""" + + +def filter_necessary_data(text: str): + result = [] + lines = text.splitlines() + + i = 0 + while i < len(lines): + if lines[i].startswith("object-group network"): + result.append(lines[i]) + i += 1 + while i < len(lines) and lines[i].startswith(" "): + result.append(lines[i]) + i += 1 + else: + i += 1 + + return result + + +print(filter_necessary_data(input_text)) + + diff --git a/secretShared.bin b/secretShared.bin new file mode 100644 index 0000000..e55865e Binary files /dev/null and b/secretShared.bin differ diff --git a/services_groups.json b/services_groups.json new file mode 100644 index 0000000..25f554d --- /dev/null +++ b/services_groups.json @@ -0,0 +1,3375 @@ +{ + "test_service_group":{ + "name":"test_service_group", + "type":"", + "description":"", + "members":[ + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + } + ] + }, + "tcpudp_service_grp":{ + "name":"tcpudp_service_grp", + "type":"tcp-udp", + "description":"", + "members":[ + { + "port":"discard" + }, + { + "port":"nfs" + } + ] + }, + "test_tcp_grp":{ + "name":"test_tcp_grp", + "type":"tcp", + "description":"TCP group description", + "members":[ + { + "port":"aol" + }, + { + "port":"citrix-ica" + } + ] + }, + "udp_test_service_group":{ + "name":"udp_test_service_group", + "type":"udp", + "description":"", + "members":[ + { + "port":"biff" + }, + { + "port":"www" + } + ] + }, + "UDP_grp_test":{ + "name":"UDP_grp_test", + "type":"udp", + "description":"Description", + "members":[ + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"23" + }, + { + "port_range_start":"23", + "port_range_finish":"bootps" + }, + { + "port":"www" + } + ] + }, + "TCP_GROUP_all":{ + "name":"TCP_GROUP_all", + "type":"tcp", + "description":"description", + "members":[ + { + "port_range_start":"1", + "port_range_finish":"65535" + }, + { + "port":"5" + }, + { + "port_range_start":"5", + "port_range_finish":"255" + }, + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port":"cifs" + }, + { + "port":"citrix-ica" + }, + { + "port":"ctiqbe" + }, + { + "port":"daytime" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"exec" + }, + { + "port":"finger" + }, + { + "port":"ftp" + }, + { + "port":"ftp-data" + }, + { + "port":"gopher" + }, + { + "port":"h323" + }, + { + "port":"hostname" + }, + { + "port":"www" + }, + { + "port":"https" + }, + { + "port":"ident" + }, + { + "port":"imap4" + }, + { + "port":"irc" + }, + { + "port":"kerberos" + }, + { + "port":"klogin" + }, + { + "port":"kshell" + }, + { + "port":"ldap" + }, + { + "port":"ldaps" + }, + { + "port":"login" + }, + { + "port":"lotusnotes" + }, + { + "port":"lpd" + }, + { + "port":"netbios-ssn" + }, + { + "port":"nfs" + }, + { + "port":"nntp" + }, + { + "port":"pcanywhere-data" + }, + { + "port":"pim-auto-rp" + }, + { + "port":"pop2" + }, + { + "port":"pop3" + }, + { + "port":"pptp" + }, + { + "port":"rsh" + }, + { + "port":"rtsp" + }, + { + "port":"sip" + }, + { + "port":"smtp" + }, + { + "port":"sqlnet" + }, + { + "port":"ssh" + }, + { + "port":"sunrpc" + }, + { + "port":"tacacs" + }, + { + "port":"talk" + }, + { + "port":"telnet" + }, + { + "port":"uucp" + }, + { + "port":"whois" + }, + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"aol" + }, + { + "port":"citrix-ica" + } + ] + }, + "TCP_GROUP1":{ + "name":"TCP_GROUP1", + "type":"tcp", + "description":"description", + "members":[ + { + "port_range_start":"1", + "port_range_finish":"65535" + }, + { + "port":"5" + }, + { + "port_range_start":"5", + "port_range_finish":"255" + }, + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port":"cifs" + }, + { + "port":"citrix-ica" + }, + { + "port":"ctiqbe" + }, + { + "port":"daytime" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"exec" + }, + { + "port":"finger" + }, + { + "port":"ftp" + }, + { + "port":"ftp-data" + }, + { + "port":"gopher" + }, + { + "port":"h323" + }, + { + "port":"hostname" + }, + { + "port":"www" + }, + { + "port":"https" + }, + { + "port":"ident" + }, + { + "port":"imap4" + }, + { + "port":"irc" + }, + { + "port":"kerberos" + }, + { + "port":"klogin" + }, + { + "port":"kshell" + }, + { + "port":"ldap" + }, + { + "port":"ldaps" + }, + { + "port":"login" + }, + { + "port":"lotusnotes" + }, + { + "port":"lpd" + }, + { + "port":"netbios-ssn" + }, + { + "port":"nfs" + }, + { + "port":"nntp" + }, + { + "port":"pcanywhere-data" + }, + { + "port":"pim-auto-rp" + }, + { + "port":"pop2" + }, + { + "port":"pop3" + }, + { + "port":"pptp" + }, + { + "port":"rsh" + }, + { + "port":"rtsp" + }, + { + "port":"sip" + }, + { + "port":"smtp" + }, + { + "port":"sqlnet" + }, + { + "port":"ssh" + }, + { + "port":"sunrpc" + }, + { + "port":"tacacs" + }, + { + "port":"talk" + }, + { + "port":"telnet" + }, + { + "port":"uucp" + }, + { + "port":"whois" + }, + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"aol" + }, + { + "port":"citrix-ica" + }, + { + "port":"discard" + }, + { + "port":"nfs" + } + ] + }, + "TCP_GROUP2":{ + "name":"TCP_GROUP2", + "type":"tcp", + "description":"", + "members":[ + { + "port":"54" + }, + { + "port_range_start":"54", + "port_range_finish":"255" + }, + { + "port":"aol" + }, + { + "port":"bgp" + } + ] + }, + "UDP_GROUP1":{ + "name":"UDP_GROUP1", + "type":"udp", + "description":"description", + "members":[ + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"biff" + }, + { + "port":"www" + } + ] + }, + "UDP_GROUP2":{ + "name":"UDP_GROUP2", + "type":"udp", + "description":"", + "members":[ + { + "port":"356" + }, + { + "port":"bootps" + }, + { + "port":"cifs" + }, + { + "port":"discard" + } + ] + }, + "UDP_GROUP3":{ + "name":"UDP_GROUP3", + "type":"udp", + "description":"description", + "members":[ + { + "port":"305" + }, + { + "port":"45" + }, + { + "port":"47" + } + ] + }, + "UDP_GROUP4":{ + "name":"UDP_GROUP4", + "type":"udp", + "description":"", + "members":[ + { + "port_range_start":"5", + "port_range_finish":"35" + }, + { + "port_range_start":"78", + "port_range_finish":"6557" + } + ] + }, + "UDP_GROUP_all":{ + "name":"UDP_GROUP_all", + "type":"udp", + "description":"description", + "members":[ + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"23" + }, + { + "port_range_start":"23", + "port_range_finish":"bootps" + }, + { + "port":"www" + }, + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"0" + }, + { + "port_range_start":"0", + "port_range_finish":"2" + }, + { + "port_range_start":"54", + "port_range_finish":"2456" + }, + { + "port":"56" + }, + { + "port":"biff" + }, + { + "port":"bootpc" + }, + { + "port":"bootps" + }, + { + "port":"cifs" + }, + { + "port":"discard" + }, + { + "port":"dnsix" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"www" + }, + { + "port":"isakmp" + }, + { + "port":"kerberos" + }, + { + "port":"mobile-ip" + }, + { + "port":"nameserver" + }, + { + "port":"netbios-dgm" + }, + { + "port":"netbios-ns" + }, + { + "port":"nfs" + }, + { + "port":"ntp" + }, + { + "port":"pcanywhere-status" + }, + { + "port":"pim-auto-rp" + }, + { + "port":"radius" + }, + { + "port":"radius-acct" + }, + { + "port":"rip" + }, + { + "port":"secureid-udp" + }, + { + "port":"sip" + }, + { + "port":"snmp" + }, + { + "port":"snmptrap" + }, + { + "port":"sunrpc" + }, + { + "port":"syslog" + }, + { + "port":"tacacs" + }, + { + "port":"talk" + }, + { + "port":"tftp" + }, + { + "port":"time" + }, + { + "port":"who" + }, + { + "port":"xdmcp" + }, + { + "port":"biff" + }, + { + "port":"www" + } + ] + }, + "TCP_GROUP":{ + "name":"TCP_GROUP", + "type":"tcp", + "description":"long descriptiooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooon", + "members":[ + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + } + ] + }, + "TCP-UDP_GROUP1":{ + "name":"TCP-UDP_GROUP1", + "type":"tcp-udp", + "description":"", + "members":[ + { + "port":"discard" + }, + { + "port":"nfs" + } + ] + }, + "TCP-UDP_GROUP2":{ + "name":"TCP-UDP_GROUP2", + "type":"tcp-udp", + "description":"", + "members":[ + { + "port":"cifs" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"www" + }, + { + "port":"kerberos" + }, + { + "port":"nfs" + } + ] + }, + "TCP-UDP_GROUP3":{ + "name":"TCP-UDP_GROUP3", + "type":"tcp-udp", + "description":"description", + "members":[ + { + "port":"2030" + }, + { + "port":"45" + } + ] + }, + "TCP-UDP_GROUP4":{ + "name":"TCP-UDP_GROUP4", + "type":"tcp-udp", + "description":"", + "members":[ + { + "port_range_start":"43", + "port_range_finish":"654" + }, + { + "port_range_start":"687", + "port_range_finish":"6554" + } + ] + }, + "TCP-UDP_GROUP_all":{ + "name":"TCP-UDP_GROUP_all", + "type":"tcp-udp", + "description":"description", + "members":[ + { + "port_range_start":"2000", + "port_range_finish":"2100" + }, + { + "port":"56" + }, + { + "port_range_start":"56", + "port_range_finish":"6574" + }, + { + "port":"cifs" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"www" + }, + { + "port":"kerberos" + }, + { + "port":"nfs" + }, + { + "port":"pim-auto-rp" + }, + { + "port":"sip" + }, + { + "port":"sunrpc" + }, + { + "port":"tacacs" + }, + { + "port":"talk" + }, + { + "port":"discard" + }, + { + "port":"nfs" + } + ] + }, + "SERVICE_GROUP1":{ + "name":"SERVICE_GROUP1", + "type":"", + "description":"description", + "members":[ + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + } + ] + }, + "SERVICE_GROUP2":{ + "name":"SERVICE_GROUP2", + "type":"", + "description":"description", + "members":[ + { + "name":"service_icmp6_all", + "description":"ICMP6: type + code", + "type":"icmp", + "icmp_type":"254", + "icmp_code":"0" + }, + { + "name":"service_icmp_all", + "description":"ICMP: type + code", + "type":"icmp", + "icmp_type":"1", + "icmp_code":"2" + }, + { + "name":"service_protocol_23", + "description":"Protocol: 23", + "protocol":"23" + }, + { + "name":"service_protocol_name", + "description":"Protocol: Name \"ip\"", + "protocol":"ip" + }, + { + "name":"service_tcp_all", + "description":"TCP: destination and source", + "type":"tcp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "name":"service_tcp_source", + "description":"TCP: Only source", + "type":"tcp", + "source":"123" + }, + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_udp_destination", + "description":"UDP: only destination", + "type":"udp", + "destination":"1" + }, + { + "name":"service_udp_source", + "description":"UDP: Only source", + "type":"udp", + "source":"1" + } + ] + }, + "SERVICE_GROUP3":{ + "name":"SERVICE_GROUP3", + "type":"", + "description":"", + "members":[ + { + "protocol":"ip" + }, + { + "protocol":"icmp" + }, + { + "protocol":"snp" + }, + { + "protocol":"udp" + }, + { + "protocol":"igmp" + }, + { + "protocol":"ipinip" + }, + { + "protocol":"gre" + }, + { + "protocol":"esp" + }, + { + "protocol":"icmp6" + }, + { + "protocol":"tcp" + }, + { + "protocol":"igrp" + }, + { + "protocol":"icmp", + "icmp_type":"echo" + }, + { + "protocol":"icmp", + "icmp_type":"echo-reply" + }, + { + "protocol":"icmp", + "icmp_type":"information-reply" + }, + { + "protocol":"icmp", + "icmp_type":"information-request" + }, + { + "protocol":"icmp", + "icmp_type":"mask-reply" + }, + { + "protocol":"tcp-udp", + "destination_port":"www" + }, + { + "protocol":"tcp-udp", + "destination_port":"kerberos" + }, + { + "protocol":"tcp-udp", + "destination_port":"sip" + }, + { + "protocol":"tcp-udp", + "destination_port":"sunrpc" + }, + { + "protocol":"tcp", + "destination_port":"bgp" + }, + { + "protocol":"tcp", + "destination_port":"chargen" + }, + { + "protocol":"tcp", + "destination_port":"cifs" + }, + { + "protocol":"tcp", + "destination_port":"citrix-ica" + }, + { + "protocol":"tcp", + "destination_port":"ctiqbe" + }, + { + "protocol":"tcp", + "destination_port":"daytime" + }, + { + "protocol":"tcp", + "destination_port":"discard" + }, + { + "protocol":"tcp", + "destination_port":"domain" + }, + { + "protocol":"tcp", + "destination_port":"echo" + }, + { + "protocol":"udp", + "destination_port":"isakmp" + }, + { + "protocol":"udp", + "destination_port":"kerberos" + }, + { + "protocol":"udp", + "destination_port":"mobile-ip" + }, + { + "protocol":"udp", + "destination_port":"nameserver" + } + ] + }, + "SERVICE_GROUP4":{ + "name":"SERVICE_GROUP4", + "type":"", + "description":"description", + "members":[ + { + "name":"icmp6_obj", + "description":"descr", + "type":"icmp", + "icmp_type":"250", + "icmp_code":"5" + }, + { + "name":"icmp_obj", + "description":"descr", + "type":"icmp", + "icmp_type":"250", + "icmp_code":"5" + }, + { + "name":"protocol_obj", + "description":"descr", + "protocol":"252" + }, + { + "protocol":"tcp-udp", + "destination_port":"456" + }, + { + "name":"tcp_obj", + "description":"descr", + "type":"tcp", + "destination":"455" + }, + { + "name":"udp_obj", + "description":"descr", + "type":"udp", + "destination":"456" + } + ] + }, + "SERVICE_GROUP_all":{ + "name":"SERVICE_GROUP_all", + "type":"", + "description":"description", + "members":[ + { + "protocol":"ip" + }, + { + "protocol":"udp" + }, + { + "protocol":"ah" + }, + { + "protocol":"tcp" + }, + { + "protocol":"icmp", + "icmp_type":"echo" + }, + { + "protocol":"icmp6", + "icmp_type":"router-solicitation" + }, + { + "name":"icmp6_obj", + "description":"descr", + "type":"icmp", + "icmp_type":"250", + "icmp_code":"5" + }, + { + "name":"protocol_obj", + "description":"descr", + "protocol":"252" + }, + { + "name":"service_icmp_all", + "description":"ICMP: type + code", + "type":"icmp", + "icmp_type":"1", + "icmp_code":"2" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "protocol":"tcp-udp", + "destination_port":"kerberos" + }, + { + "protocol":"tcp", + "destination_port":"chargen" + }, + { + "protocol":"tcp", + "destination_port":"cifs" + }, + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "protocol":"udp", + "destination_port":"nfs" + }, + { + "name":"udp_obj", + "description":"descr", + "type":"udp", + "destination":"456" + } + ] + }, + "ip_serv_group_1":{ + "name":"ip_serv_group_1", + "type":"", + "description":"", + "members":[ + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "name":"service_icmp6_all", + "description":"ICMP6: type + code", + "type":"icmp", + "icmp_type":"254", + "icmp_code":"0" + }, + { + "name":"service_icmp_all", + "description":"ICMP: type + code", + "type":"icmp", + "icmp_type":"1", + "icmp_code":"2" + }, + { + "name":"service_protocol_23", + "description":"Protocol: 23", + "protocol":"23" + }, + { + "name":"service_protocol_name", + "description":"Protocol: Name \"ip\"", + "protocol":"ip" + }, + { + "name":"service_tcp_all", + "description":"TCP: destination and source", + "type":"tcp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "name":"service_tcp_source", + "description":"TCP: Only source", + "type":"tcp", + "source":"123" + }, + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_udp_destination", + "description":"UDP: only destination", + "type":"udp", + "destination":"1" + }, + { + "name":"service_udp_source", + "description":"UDP: Only source", + "type":"udp", + "source":"1" + }, + { + "name":"service_icmp_all", + "description":"ICMP: type + code", + "type":"icmp", + "icmp_type":"1", + "icmp_code":"2" + }, + { + "name":"udp_obj", + "description":"descr", + "type":"udp", + "destination":"456" + } + ] + }, + "ip_serv_group2":{ + "name":"ip_serv_group2", + "type":"", + "description":"", + "members":[ + { + "protocol":"ip" + }, + { + "protocol":"icmp" + }, + { + "protocol":"snp" + }, + { + "protocol":"udp" + }, + { + "protocol":"igmp" + }, + { + "protocol":"ipinip" + }, + { + "protocol":"gre" + }, + { + "protocol":"esp" + }, + { + "protocol":"icmp6" + }, + { + "protocol":"tcp" + }, + { + "protocol":"igrp" + }, + { + "protocol":"icmp", + "icmp_type":"echo" + }, + { + "protocol":"icmp", + "icmp_type":"echo-reply" + }, + { + "protocol":"icmp", + "icmp_type":"information-reply" + }, + { + "protocol":"icmp", + "icmp_type":"information-request" + }, + { + "protocol":"icmp", + "icmp_type":"mask-reply" + }, + { + "protocol":"tcp-udp", + "destination_port":"www" + }, + { + "protocol":"tcp-udp", + "destination_port":"kerberos" + }, + { + "protocol":"tcp-udp", + "destination_port":"sip" + }, + { + "protocol":"tcp-udp", + "destination_port":"sunrpc" + }, + { + "protocol":"tcp", + "destination_port":"bgp" + }, + { + "protocol":"tcp", + "destination_port":"chargen" + }, + { + "protocol":"tcp", + "destination_port":"cifs" + }, + { + "protocol":"tcp", + "destination_port":"citrix-ica" + }, + { + "protocol":"tcp", + "destination_port":"ctiqbe" + }, + { + "protocol":"tcp", + "destination_port":"daytime" + }, + { + "protocol":"tcp", + "destination_port":"discard" + }, + { + "protocol":"tcp", + "destination_port":"domain" + }, + { + "protocol":"tcp", + "destination_port":"echo" + }, + { + "protocol":"udp", + "destination_port":"isakmp" + }, + { + "protocol":"udp", + "destination_port":"kerberos" + }, + { + "protocol":"udp", + "destination_port":"mobile-ip" + }, + { + "protocol":"udp", + "destination_port":"nameserver" + }, + { + "name":"icmp_obj", + "description":"descr", + "type":"icmp", + "icmp_type":"250", + "icmp_code":"5" + }, + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "name":"service_icmp6_all", + "description":"ICMP6: type + code", + "type":"icmp", + "icmp_type":"254", + "icmp_code":"0" + }, + { + "name":"service_icmp_all", + "description":"ICMP: type + code", + "type":"icmp", + "icmp_type":"1", + "icmp_code":"2" + }, + { + "name":"service_protocol_23", + "description":"Protocol: 23", + "protocol":"23" + }, + { + "name":"service_protocol_name", + "description":"Protocol: Name \"ip\"", + "protocol":"ip" + }, + { + "name":"service_tcp_all", + "description":"TCP: destination and source", + "type":"tcp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "name":"service_tcp_source", + "description":"TCP: Only source", + "type":"tcp", + "source":"123" + }, + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_udp_destination", + "description":"UDP: only destination", + "type":"udp", + "destination":"1" + }, + { + "name":"service_udp_source", + "description":"UDP: Only source", + "type":"udp", + "source":"1" + }, + { + "name":"service_icmp_all", + "description":"ICMP: type + code", + "type":"icmp", + "icmp_type":"1", + "icmp_code":"2" + }, + { + "name":"udp_obj", + "description":"descr", + "type":"udp", + "destination":"456" + } + ] + }, + "ip_serv_group3":{ + "name":"ip_serv_group3", + "type":"", + "description":"", + "members":[ + { + "protocol":"ip" + }, + { + "protocol":"icmp" + }, + { + "protocol":"snp" + }, + { + "protocol":"udp" + }, + { + "protocol":"igmp" + }, + { + "protocol":"ipinip" + }, + { + "protocol":"gre" + }, + { + "protocol":"esp" + }, + { + "protocol":"icmp6" + }, + { + "protocol":"tcp" + }, + { + "protocol":"igrp" + }, + { + "protocol":"icmp", + "icmp_type":"echo" + }, + { + "protocol":"icmp", + "icmp_type":"echo-reply" + }, + { + "protocol":"icmp", + "icmp_type":"information-reply" + }, + { + "protocol":"icmp", + "icmp_type":"information-request" + }, + { + "protocol":"icmp", + "icmp_type":"mask-reply" + }, + { + "protocol":"tcp-udp", + "destination_port":"www" + }, + { + "protocol":"tcp-udp", + "destination_port":"kerberos" + }, + { + "protocol":"tcp-udp", + "destination_port":"sip" + }, + { + "protocol":"tcp-udp", + "destination_port":"sunrpc" + }, + { + "protocol":"tcp", + "destination_port":"bgp" + }, + { + "protocol":"tcp", + "destination_port":"chargen" + }, + { + "protocol":"tcp", + "destination_port":"cifs" + }, + { + "protocol":"tcp", + "destination_port":"citrix-ica" + }, + { + "protocol":"tcp", + "destination_port":"ctiqbe" + }, + { + "protocol":"tcp", + "destination_port":"daytime" + }, + { + "protocol":"tcp", + "destination_port":"discard" + }, + { + "protocol":"tcp", + "destination_port":"domain" + }, + { + "protocol":"tcp", + "destination_port":"echo" + }, + { + "protocol":"udp", + "destination_port":"isakmp" + }, + { + "protocol":"udp", + "destination_port":"kerberos" + }, + { + "protocol":"udp", + "destination_port":"mobile-ip" + }, + { + "protocol":"udp", + "destination_port":"nameserver" + }, + { + "name":"icmp_obj", + "description":"descr", + "type":"icmp", + "icmp_type":"250", + "icmp_code":"5" + }, + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "name":"service_icmp6_all", + "description":"ICMP6: type + code", + "type":"icmp", + "icmp_type":"254", + "icmp_code":"0" + }, + { + "name":"service_icmp_all", + "description":"ICMP: type + code", + "type":"icmp", + "icmp_type":"1", + "icmp_code":"2" + }, + { + "name":"service_protocol_23", + "description":"Protocol: 23", + "protocol":"23" + }, + { + "name":"service_protocol_name", + "description":"Protocol: Name \"ip\"", + "protocol":"ip" + }, + { + "name":"service_tcp_all", + "description":"TCP: destination and source", + "type":"tcp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + }, + { + "name":"service_tcp_source", + "description":"TCP: Only source", + "type":"tcp", + "source":"123" + }, + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_udp_destination", + "description":"UDP: only destination", + "type":"udp", + "destination":"1" + }, + { + "name":"service_udp_source", + "description":"UDP: Only source", + "type":"udp", + "source":"1" + }, + { + "name":"service_icmp_all", + "description":"ICMP: type + code", + "type":"icmp", + "icmp_type":"1", + "icmp_code":"2" + }, + { + "name":"udp_obj", + "description":"descr", + "type":"udp", + "destination":"456" + }, + { + "name":"tcp_obj", + "description":"descr", + "type":"tcp", + "destination":"455" + }, + { + "name":"service_udp_all", + "description":"UDP: source and destination", + "type":"udp", + "source":"2", + "destination":"1" + }, + { + "name":"service_tcp_destination", + "description":"TCP: Only destination", + "type":"tcp", + "destination":"1" + } + ] + }, + "tcp_serv_group1":{ + "name":"tcp_serv_group1", + "type":"tcp", + "description":"", + "members":[ + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port_range_start":"1", + "port_range_finish":"65535" + }, + { + "port":"5" + }, + { + "port_range_start":"5", + "port_range_finish":"255" + }, + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port":"cifs" + }, + { + "port":"citrix-ica" + }, + { + "port":"ctiqbe" + }, + { + "port":"daytime" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"exec" + }, + { + "port":"finger" + }, + { + "port":"ftp" + }, + { + "port":"ftp-data" + }, + { + "port":"gopher" + }, + { + "port":"h323" + }, + { + "port":"hostname" + }, + { + "port":"www" + }, + { + "port":"https" + }, + { + "port":"ident" + }, + { + "port":"imap4" + }, + { + "port":"irc" + }, + { + "port":"kerberos" + }, + { + "port":"klogin" + }, + { + "port":"kshell" + }, + { + "port":"ldap" + }, + { + "port":"ldaps" + }, + { + "port":"login" + }, + { + "port":"lotusnotes" + }, + { + "port":"lpd" + }, + { + "port":"netbios-ssn" + }, + { + "port":"nfs" + }, + { + "port":"nntp" + }, + { + "port":"pcanywhere-data" + }, + { + "port":"pim-auto-rp" + }, + { + "port":"pop2" + }, + { + "port":"pop3" + }, + { + "port":"pptp" + }, + { + "port":"rsh" + }, + { + "port":"rtsp" + }, + { + "port":"sip" + }, + { + "port":"smtp" + }, + { + "port":"sqlnet" + }, + { + "port":"ssh" + }, + { + "port":"sunrpc" + }, + { + "port":"tacacs" + }, + { + "port":"talk" + }, + { + "port":"telnet" + }, + { + "port":"uucp" + }, + { + "port":"whois" + }, + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"aol" + }, + { + "port":"citrix-ica" + }, + { + "port":"discard" + }, + { + "port":"nfs" + } + ] + }, + "tcp_serv_group2":{ + "name":"tcp_serv_group2", + "type":"tcp", + "description":"", + "members":[ + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port_range_start":"1", + "port_range_finish":"65535" + }, + { + "port":"5" + }, + { + "port_range_start":"5", + "port_range_finish":"255" + }, + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port":"cifs" + }, + { + "port":"citrix-ica" + }, + { + "port":"ctiqbe" + }, + { + "port":"daytime" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"exec" + }, + { + "port":"finger" + }, + { + "port":"ftp" + }, + { + "port":"ftp-data" + }, + { + "port":"gopher" + }, + { + "port":"h323" + }, + { + "port":"hostname" + }, + { + "port":"www" + }, + { + "port":"https" + }, + { + "port":"ident" + }, + { + "port":"imap4" + }, + { + "port":"irc" + }, + { + "port":"kerberos" + }, + { + "port":"klogin" + }, + { + "port":"kshell" + }, + { + "port":"ldap" + }, + { + "port":"ldaps" + }, + { + "port":"login" + }, + { + "port":"lotusnotes" + }, + { + "port":"lpd" + }, + { + "port":"netbios-ssn" + }, + { + "port":"nfs" + }, + { + "port":"nntp" + }, + { + "port":"pcanywhere-data" + }, + { + "port":"pim-auto-rp" + }, + { + "port":"pop2" + }, + { + "port":"pop3" + }, + { + "port":"pptp" + }, + { + "port":"rsh" + }, + { + "port":"rtsp" + }, + { + "port":"sip" + }, + { + "port":"smtp" + }, + { + "port":"sqlnet" + }, + { + "port":"ssh" + }, + { + "port":"sunrpc" + }, + { + "port":"tacacs" + }, + { + "port":"talk" + }, + { + "port":"telnet" + }, + { + "port":"uucp" + }, + { + "port":"whois" + }, + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"aol" + }, + { + "port":"citrix-ica" + }, + { + "port":"discard" + }, + { + "port":"nfs" + } + ] + }, + "tcp_serv_group3":{ + "name":"tcp_serv_group3", + "type":"tcp", + "description":"", + "members":[ + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port_range_start":"1", + "port_range_finish":"65535" + }, + { + "port":"5" + }, + { + "port_range_start":"5", + "port_range_finish":"255" + }, + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port":"cifs" + }, + { + "port":"citrix-ica" + }, + { + "port":"ctiqbe" + }, + { + "port":"daytime" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"exec" + }, + { + "port":"finger" + }, + { + "port":"ftp" + }, + { + "port":"ftp-data" + }, + { + "port":"gopher" + }, + { + "port":"h323" + }, + { + "port":"hostname" + }, + { + "port":"www" + }, + { + "port":"https" + }, + { + "port":"ident" + }, + { + "port":"imap4" + }, + { + "port":"irc" + }, + { + "port":"kerberos" + }, + { + "port":"klogin" + }, + { + "port":"kshell" + }, + { + "port":"ldap" + }, + { + "port":"ldaps" + }, + { + "port":"login" + }, + { + "port":"lotusnotes" + }, + { + "port":"lpd" + }, + { + "port":"netbios-ssn" + }, + { + "port":"nfs" + }, + { + "port":"nntp" + }, + { + "port":"pcanywhere-data" + }, + { + "port":"pim-auto-rp" + }, + { + "port":"pop2" + }, + { + "port":"pop3" + }, + { + "port":"pptp" + }, + { + "port":"rsh" + }, + { + "port":"rtsp" + }, + { + "port":"sip" + }, + { + "port":"smtp" + }, + { + "port":"sqlnet" + }, + { + "port":"ssh" + }, + { + "port":"sunrpc" + }, + { + "port":"tacacs" + }, + { + "port":"talk" + }, + { + "port":"telnet" + }, + { + "port":"uucp" + }, + { + "port":"whois" + }, + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"aol" + }, + { + "port":"citrix-ica" + }, + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port_range_start":"1", + "port_range_finish":"65535" + }, + { + "port":"5" + }, + { + "port_range_start":"5", + "port_range_finish":"255" + }, + { + "port":"aol" + }, + { + "port":"bgp" + }, + { + "port":"chargen" + }, + { + "port":"cifs" + }, + { + "port":"citrix-ica" + }, + { + "port":"ctiqbe" + }, + { + "port":"daytime" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"exec" + }, + { + "port":"finger" + }, + { + "port":"ftp" + }, + { + "port":"ftp-data" + }, + { + "port":"gopher" + }, + { + "port":"h323" + }, + { + "port":"hostname" + }, + { + "port":"www" + }, + { + "port":"https" + }, + { + "port":"ident" + }, + { + "port":"imap4" + }, + { + "port":"irc" + }, + { + "port":"kerberos" + }, + { + "port":"klogin" + }, + { + "port":"kshell" + }, + { + "port":"ldap" + }, + { + "port":"ldaps" + }, + { + "port":"login" + }, + { + "port":"lotusnotes" + }, + { + "port":"lpd" + }, + { + "port":"netbios-ssn" + }, + { + "port":"nfs" + }, + { + "port":"nntp" + }, + { + "port":"pcanywhere-data" + }, + { + "port":"pim-auto-rp" + }, + { + "port":"pop2" + }, + { + "port":"pop3" + }, + { + "port":"pptp" + }, + { + "port":"rsh" + }, + { + "port":"rtsp" + }, + { + "port":"sip" + }, + { + "port":"smtp" + }, + { + "port":"sqlnet" + }, + { + "port":"ssh" + }, + { + "port":"sunrpc" + }, + { + "port":"tacacs" + }, + { + "port":"talk" + }, + { + "port":"telnet" + }, + { + "port":"uucp" + }, + { + "port":"whois" + }, + { + "port":"discard" + }, + { + "port":"nfs" + }, + { + "port":"aol" + }, + { + "port":"citrix-ica" + }, + { + "port":"discard" + }, + { + "port":"nfs" + } + ] + }, + "tcpudp_serv_group1":{ + "name":"tcpudp_serv_group1", + "type":"tcp-udp", + "description":"", + "members":[ + { + "port":"cifs" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"www" + }, + { + "port":"kerberos" + }, + { + "port":"nfs" + } + ] + }, + "tcpudp_serv_group2":{ + "name":"tcpudp_serv_group2", + "type":"tcp-udp", + "description":"", + "members":[ + { + "port":"2030" + }, + { + "port":"45" + }, + { + "port":"kerberos" + }, + { + "port":"nfs" + }, + { + "port":"cifs" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"www" + }, + { + "port":"kerberos" + }, + { + "port":"nfs" + } + ] + }, + "tcpudp_serv_group3":{ + "name":"tcpudp_serv_group3", + "type":"tcp-udp", + "description":"", + "members":[ + { + "port":"cifs" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"www" + }, + { + "port":"kerberos" + }, + { + "port":"nfs" + }, + { + "port":"2030" + }, + { + "port":"45" + }, + { + "port":"kerberos" + }, + { + "port":"nfs" + }, + { + "port":"cifs" + }, + { + "port":"discard" + }, + { + "port":"domain" + }, + { + "port":"echo" + }, + { + "port":"www" + }, + { + "port":"kerberos" + }, + { + "port":"nfs" + } + ] + }, + "icmp_test_grp":{ + "name":"icmp_test_grp", + "type":"icmp", + "description":"", + "members":[ + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + } + ] + }, + "ICMP_GROUP1":{ + "name":"ICMP_GROUP1", + "type":"icmp", + "description":"", + "members":[ + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + } + ] + }, + "ICMP_GROUP2":{ + "name":"ICMP_GROUP2", + "type":"icmp", + "description":"description", + "members":[ + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"information-reply" + }, + { + "icmp_object_name":"information-request" + }, + { + "icmp_object_name":"redirect" + } + ] + }, + "ICMP_GROUP3":{ + "name":"ICMP_GROUP3", + "type":"icmp", + "description":"description", + "members":[ + { + "icmp_object_name":"146" + }, + { + "icmp_object_name":"33" + }, + { + "icmp_object_name":"43" + } + ] + }, + "ICMP_GROUP4_all":{ + "name":"ICMP_GROUP4_all", + "type":"icmp", + "description":"description", + "members":[ + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + }, + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"information-reply" + }, + { + "icmp_object_name":"information-request" + }, + { + "icmp_object_name":"redirect" + }, + { + "icmp_object_name":"146" + }, + { + "icmp_object_name":"33" + }, + { + "icmp_object_name":"43" + }, + { + "icmp_object_name":"74" + }, + { + "icmp_object_name":"alternate-address" + }, + { + "icmp_object_name":"conversion-error" + }, + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"information-reply" + }, + { + "icmp_object_name":"information-request" + }, + { + "icmp_object_name":"mask-reply" + }, + { + "icmp_object_name":"mask-request" + }, + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"parameter-problem" + }, + { + "icmp_object_name":"redirect" + }, + { + "icmp_object_name":"router-advertisement" + }, + { + "icmp_object_name":"router-solicitation" + }, + { + "icmp_object_name":"source-quench" + }, + { + "icmp_object_name":"time-exceeded" + }, + { + "icmp_object_name":"timestamp-reply" + }, + { + "icmp_object_name":"timestamp-request" + }, + { + "icmp_object_name":"traceroute" + }, + { + "icmp_object_name":"unreachable" + }, + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + } + ] + }, + "icmp_serv_group1":{ + "name":"icmp_serv_group1", + "type":"icmp", + "description":"", + "members":[ + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + }, + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"information-reply" + }, + { + "icmp_object_name":"information-request" + }, + { + "icmp_object_name":"redirect" + } + ] + }, + "icmp_serv_group2":{ + "name":"icmp_serv_group2", + "type":"icmp", + "description":"descr", + "members":[ + { + "icmp_object_name":"146" + }, + { + "icmp_object_name":"33" + }, + { + "icmp_object_name":"43" + }, + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + }, + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"information-reply" + }, + { + "icmp_object_name":"information-request" + }, + { + "icmp_object_name":"redirect" + }, + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + } + ] + }, + "icmp_serv_group3":{ + "name":"icmp_serv_group3", + "type":"icmp", + "description":"descr", + "members":[ + { + "icmp_object_name":"146" + }, + { + "icmp_object_name":"33" + }, + { + "icmp_object_name":"43" + }, + { + "icmp_object_name":"mask-request" + }, + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + }, + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"information-reply" + }, + { + "icmp_object_name":"information-request" + }, + { + "icmp_object_name":"redirect" + }, + { + "icmp_object_name":"146" + }, + { + "icmp_object_name":"33" + }, + { + "icmp_object_name":"43" + }, + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + }, + { + "icmp_object_name":"echo" + }, + { + "icmp_object_name":"echo-reply" + }, + { + "icmp_object_name":"information-reply" + }, + { + "icmp_object_name":"information-request" + }, + { + "icmp_object_name":"redirect" + }, + { + "icmp_object_name":"mobile-redirect" + }, + { + "icmp_object_name":"router-advertisement" + } + ] + }, + "TCPUDP":{ + "name":"TCPUDP", + "type":"protocol", + "description":"", + "members":[ + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + } + ] + }, + "DM_INLINE_PROTOCOL_1":{ + "name":"DM_INLINE_PROTOCOL_1", + "type":"protocol", + "description":"", + "members":[ + { + "protocol_object":"icmp" + }, + { + "protocol_object":"8" + } + ] + }, + "test_protocol_grp":{ + "name":"test_protocol_grp", + "type":"protocol", + "description":"", + "members":[ + { + "protocol_object":"esp" + }, + { + "protocol_object":"igrp" + } + ] + }, + "PROTO_GROUP":{ + "name":"PROTO_GROUP", + "type":"protocol", + "description":"description", + "members":[ + { + "protocol_object":"ip" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"6" + }, + { + "protocol_object":"icmp6" + }, + { + "protocol_object":"78" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + } + ] + }, + "PROTO_GROUP2":{ + "name":"PROTO_GROUP2", + "type":"protocol", + "description":"", + "members":[ + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + } + ] + }, + "PROTO_GROUP3":{ + "name":"PROTO_GROUP3", + "type":"protocol", + "description":"description", + "members":[ + { + "protocol_object":"100" + }, + { + "protocol_object":"23" + }, + { + "protocol_object":"24" + } + ] + }, + "PROTO_GROUP4":{ + "name":"PROTO_GROUP4", + "type":"protocol", + "description":"description", + "members":[ + { + "protocol_object":"ip" + }, + { + "protocol_object":"icmp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"gre" + }, + { + "protocol_object":"tcp" + } + ] + }, + "PROTO_GROUP5_all":{ + "name":"PROTO_GROUP5_all", + "type":"protocol", + "description":"description", + "members":[ + { + "protocol_object":"ip" + }, + { + "protocol_object":"icmp" + }, + { + "protocol_object":"pim" + }, + { + "protocol_object":"pcp" + }, + { + "protocol_object":"snp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"igmp" + }, + { + "protocol_object":"255" + }, + { + "protocol_object":"ipinip" + }, + { + "protocol_object":"45" + }, + { + "protocol_object":"gre" + }, + { + "protocol_object":"esp" + }, + { + "protocol_object":"ah" + }, + { + "protocol_object":"icmp6" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"eigrp" + }, + { + "protocol_object":"ospf" + }, + { + "protocol_object":"igrp" + }, + { + "protocol_object":"nos" + }, + { + "protocol_object":"ip" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"5" + }, + { + "protocol_object":"icmp6" + }, + { + "protocol_object":"78" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"100" + }, + { + "protocol_object":"23" + }, + { + "protocol_object":"24" + }, + { + "protocol_object":"ip" + }, + { + "protocol_object":"icmp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"gre" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"esp" + }, + { + "protocol_object":"igrp" + } + ] + }, + "proto_serv_group1":{ + "name":"proto_serv_group1", + "type":"protocol", + "description":"descr", + "members":[ + { + "protocol_object":"ip" + }, + { + "protocol_object":"icmp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"gre" + }, + { + "protocol_object":"esp" + }, + { + "protocol_object":"icmp6" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"ip" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"5" + }, + { + "protocol_object":"icmp6" + }, + { + "protocol_object":"78" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + } + ] + }, + "proto_serv_group2":{ + "name":"proto_serv_group2", + "type":"protocol", + "description":"descr", + "members":[ + { + "protocol_object":"ip" + }, + { + "protocol_object":"ipinip" + }, + { + "protocol_object":"igrp" + }, + { + "protocol_object":"ip" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"5" + }, + { + "protocol_object":"icmp6" + }, + { + "protocol_object":"78" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"ip" + }, + { + "protocol_object":"icmp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"gre" + }, + { + "protocol_object":"esp" + }, + { + "protocol_object":"icmp6" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"ip" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"5" + }, + { + "protocol_object":"icmp6" + }, + { + "protocol_object":"78" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + }, + { + "protocol_object":"udp" + }, + { + "protocol_object":"tcp" + } + ] + } + } \ No newline at end of file diff --git a/sqlalchemy_sandbox/.$test_scheme.drawio.bkp b/sqlalchemy_sandbox/.$test_scheme.drawio.bkp new file mode 100644 index 0000000..1bf60c9 --- /dev/null +++ b/sqlalchemy_sandbox/.$test_scheme.drawio.bkp @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sqlalchemy_sandbox/__init__.py b/sqlalchemy_sandbox/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sqlalchemy_sandbox/alchemy_utils.py b/sqlalchemy_sandbox/alchemy_utils.py new file mode 100644 index 0000000..0a089b1 --- /dev/null +++ b/sqlalchemy_sandbox/alchemy_utils.py @@ -0,0 +1,36 @@ +import os +from typing import List, Optional + +from dotenv import load_dotenv +from sqlalchemy import (Boolean, Column, ForeignKey, Integer, MetaData, String, + Table, create_engine, text, insert, select) +from sqlalchemy.orm import (DeclarativeBase, Mapped, Session, mapped_column, + relationship) + +load_dotenv() + +DB_PASS = os.getenv("DOCKER_POSTGRES_PASS") + +# Create engine for connecting to postgres test db +DB_ENGINE = create_engine( + f'postgresql+psycopg2://postgres:{DB_PASS}@localhost:5432/postgres') + +METADATA_OBJECT = MetaData() + +# Declaring user table +CORE_USER_TABLE = Table( + "user_account", + METADATA_OBJECT, + Column("id", Integer, primary_key=True), + Column("name", String(30)), + Column("fullname", String), +) + +# Declaring address table +CORE_ADDRESS_TABLE = Table( + "address", + METADATA_OBJECT, + Column("id", Integer, primary_key=True), + Column("user_id", ForeignKey("user_account.id"), nullable=False), + Column("email_address", String, nullable=False) +) diff --git a/sqlalchemy_sandbox/declarative_orm.py b/sqlalchemy_sandbox/declarative_orm.py new file mode 100644 index 0000000..e4a0ed7 --- /dev/null +++ b/sqlalchemy_sandbox/declarative_orm.py @@ -0,0 +1,51 @@ +import os +from typing import List, Optional + +from dotenv import load_dotenv +from sqlalchemy import ForeignKey, String, create_engine, Table +from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship, Session +from sqlalchemy import MetaData + +metadata_obj = MetaData() + +load_dotenv() + +DB_PASS = os.getenv("DOCKER_POSTGRES_PASS") + +# Create engine for connecting to postgres test db +engine = create_engine( + f'postgresql+psycopg2://postgres:{DB_PASS}@localhost:5432/postgres') + + +class Base(DeclarativeBase): + pass + +class User(Base): + __tablename__ = "user_account" + id: Mapped[int] = mapped_column(primary_key=True) + name: Mapped[str] = mapped_column(String(30)) + fullname: Mapped[Optional[str]] + addresses: Mapped[List["Address"]] = relationship(back_populates="user") + def __repr__(self) -> str: + return f"User(id={self.id!r}, name={self.name!r}, fullname={self.fullname!r})" + +class Address(Base): + __tablename__ = "address" + id: Mapped[int] = mapped_column(primary_key=True) + email_address: Mapped[str] + user_id = mapped_column(ForeignKey("user_account.id")) + user: Mapped[User] = relationship(back_populates="addresses") + def __repr__(self) -> str: + return f"Address(id={self.id!r}, email_address={self.email_address!r})" + +# Base.metadata.create_all(engine) +# user_table = Table("user_account", metadata_obj, autoload_with=engine) +# address_table = Table("address", metadata_obj, autoload_with=engine) +# user_table + +krabs = User(name="ehkrabs", fullname="Mister krabs") + +session = Session(engine) +session.add(krabs) +print(session.new) +session.flush() \ No newline at end of file diff --git a/sqlalchemy_sandbox/insert_data.py b/sqlalchemy_sandbox/insert_data.py new file mode 100644 index 0000000..8a8d8d0 --- /dev/null +++ b/sqlalchemy_sandbox/insert_data.py @@ -0,0 +1,25 @@ +from sqlalchemy.orm import Session +from sqlalchemy import create_engine +from sqlalchemy_sandbox.training_core import User +# Create engine for connecting to postgres test db +engine = create_engine( + 'postgresql+psycopg2://postgres:pgpwd4habr@localhost:5432/postgres') + +engine.connect() + + +with Session(engine) as session: + toxa = User( + username="pro100ton", + first_name="Anton", + last_name="Shalimov", + is_coach = False + ) + pan_stepan = User( + username="Panstepan", + first_name="Pan", + last_name="Stepan", + is_coach = True + ) + session.add_all([toxa, pan_stepan]) + session.commit() \ No newline at end of file diff --git a/sqlalchemy_sandbox/metadata_core.py b/sqlalchemy_sandbox/metadata_core.py new file mode 100644 index 0000000..d3fbd26 --- /dev/null +++ b/sqlalchemy_sandbox/metadata_core.py @@ -0,0 +1,70 @@ +import os +from typing import List, Optional + +from dotenv import load_dotenv +from sqlalchemy import (Boolean, Column, ForeignKey, Integer, MetaData, String, + Table, create_engine, text, insert, select) +from sqlalchemy.orm import (DeclarativeBase, Mapped, Session, mapped_column, + relationship) + +load_dotenv() + +DB_PASS = os.getenv("DOCKER_POSTGRES_PASS") + +# Create engine for connecting to postgres test db +engine = create_engine( + f'postgresql+psycopg2://postgres:{DB_PASS}@localhost:5432/postgres') + +metadata_object = MetaData() + +# Declaring user table +user_table = Table( + "user_account", + metadata_object, + Column("id", Integer, primary_key=True), + Column("name", String(30)), + Column("fullname", String), +) + +# Declaring address table +address_table = Table( + "address", + metadata_object, + Column("id", Integer, primary_key=True), + Column("user_id", ForeignKey("user_account.id"), nullable=False), + Column("email_address", String, nullable=False) +) + +# metadata_object.create_all(engine) + +# stmt = insert(user_table).values(name="spongebob", fullname="Spongebob squarepants").returning(user_table.c.id, user_table.c.name) +# select_statement = select(user_table.c.id, user_table.c.name + "@google.com") +# insert_statement = insert(address_table).from_select( +# ["user_id", "email_address"], select_statement +# ).returning(address_table.c.id, address_table.c.email_address) + +# with engine.connect() as conn: +# result = conn.execute(insert_statement) +# conn.commit() +# for row in result: +# print(row) + +# with engine.connect() as conn: +# result = conn.execute( +# insert(user_table), +# [ +# {"name": "sandy", "fullname": "Sandy Cheeks"}, +# {"name": "patrick", "fullname": "Patrick Star"}, +# ], +# ) +# conn.commit() + +# insert_stmt = insert(address_table).returning( +# address_table.c.id, address_table.c.email_address +# ) +# print(insert_stmt) + +# with engine.connect() as conn: +# result = conn.execute(stmt) +# conn.commit() +# print(result) diff --git a/sqlalchemy_sandbox/select.py b/sqlalchemy_sandbox/select.py new file mode 100644 index 0000000..475ca63 --- /dev/null +++ b/sqlalchemy_sandbox/select.py @@ -0,0 +1,100 @@ +from alchemy_utils import CORE_ADDRESS_TABLE, CORE_USER_TABLE, DB_ENGINE +from declarative_orm import Address, User +from sqlalchemy import literal_column, select, text +from sqlalchemy.orm import Session + +# stmt = select(CORE_USER_TABLE).where(CORE_USER_TABLE.c.name == "sandy") + +# with DB_ENGINE.connect() as conn: +# for row in conn.execute(stmt): +# print(row) + +# stmt = select(User).where(User.name=="sandy") + +# with Session(DB_ENGINE) as session: +# for row in session.execute(statement=stmt): +# print(row) + +# print(select(CORE_USER_TABLE.c.name, CORE_USER_TABLE.c.fullname)) +# print(select(CORE_USER_TABLE.c["name", "fullname"])) + +# print(select(User)) + + +# with Session(DB_ENGINE) as session: +# row = session.execute(select(User)).first() +# print(row) +# rows = session.execute(select(User)) +# print("-"*60) +# for row in rows: +# print(row) + +# with Session(DB_ENGINE) as session: +# row = session.scalars(select(User)).first() +# print(row) +# rows = session.scalars(select(User)) +# print("-"*60) +# for row in rows: +# print(row) + +# with Session(DB_ENGINE) as session: +# row = session.execute(select(User.name, User.fullname)) +# for r in row: +# print(r) + + +# with Session(DB_ENGINE) as session: +# result = session.execute( +# select(User.name, Address).where(User.id == Address.user_id).order_by(Address.id) +# ).all() +# print(result) + +# stmt = select( +# ("Username: " + CORE_USER_TABLE.c.name).label("username") +# ).order_by(CORE_USER_TABLE.c.name) +# with DB_ENGINE.connect() as conn: +# for row in conn.execute(stmt): +# print(f"{row.username}") + +# stmt = select(text("'some phrase'"), CORE_USER_TABLE.c.name).order_by(CORE_USER_TABLE.c.name) +# with DB_ENGINE.connect() as conn: +# print(conn.execute(stmt).all()) + +# stmt = select(literal_column("'some phrase'").label("p"), CORE_USER_TABLE.c.name).order_by( +# CORE_USER_TABLE.c.name +# ) +# with DB_ENGINE.connect() as conn: +# for row in conn.execute(stmt): +# print(f"{row.p}, {row.name}") + +# print(select(CORE_USER_TABLE).where(CORE_USER_TABLE.c.name=="patrick")) + +# print( +# select(CORE_ADDRESS_TABLE.c.email_address) +# .where(CORE_USER_TABLE.c.name == "patrick") +# .where(CORE_ADDRESS_TABLE.c.user_id == CORE_USER_TABLE.c.id) +# ) + +# from sqlalchemy import and_, or_ +# print( +# select(Address.email_address).where( +# and_( +# or_(User.name == "patrick", User.name == "sandy"), +# Address.user_id == User.id, +# ) +# ) +# ) + +# print(select(CORE_USER_TABLE.c.name)) + +# print( +# select(CORE_USER_TABLE.c.name, CORE_ADDRESS_TABLE.c.email_address).join_from( +# CORE_USER_TABLE, CORE_ADDRESS_TABLE +# ) +# ) + +print( + select(CORE_ADDRESS_TABLE.c.email_address) + .select_from(CORE_USER_TABLE) + .join(CORE_ADDRESS_TABLE, CORE_USER_TABLE.c.id == CORE_ADDRESS_TABLE.c.user_id) +) \ No newline at end of file diff --git a/sqlalchemy_sandbox/session.py b/sqlalchemy_sandbox/session.py new file mode 100644 index 0000000..98e7f4f --- /dev/null +++ b/sqlalchemy_sandbox/session.py @@ -0,0 +1,20 @@ +from typing import List, Optional +from dotenv import load_dotenv + +from sqlalchemy import String, create_engine, Boolean, text +from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship, Session +import os + +load_dotenv() + +DB_PASS = os.getenv("DOCKER_POSTGRES_PASS") + +# Create engine for connecting to postgres test db +engine = create_engine( + f'postgresql+psycopg2://postgres:{DB_PASS}@localhost:5432/postgres') + +stmt = text("SELECT x, y FROM some_table WHERE y > :y ORDER BY x, y") +with Session(engine) as session: + result = session.execute(stmt, {"y": 6}) + for row in result: + print(f"x: {row.x} y: {row.y}") \ No newline at end of file diff --git a/sqlalchemy_sandbox/test_scheme.drawio b/sqlalchemy_sandbox/test_scheme.drawio new file mode 100644 index 0000000..0e5f9be --- /dev/null +++ b/sqlalchemy_sandbox/test_scheme.drawio @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sqlalchemy_sandbox/training_core.py b/sqlalchemy_sandbox/training_core.py new file mode 100644 index 0000000..3ae221a --- /dev/null +++ b/sqlalchemy_sandbox/training_core.py @@ -0,0 +1,83 @@ +from typing import List, Optional +from dotenv import load_dotenv + +from sqlalchemy import String, create_engine, Boolean, text +from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship +import os + +load_dotenv() + +DB_PASS = os.getenv("DOCKER_POSTGRES_PASS") + +# Create engine for connecting to postgres test db +engine = create_engine( + f'postgresql+psycopg2://postgres:{DB_PASS}@localhost:5432/postgres') + +# engine.connect() + + +# class Base(DeclarativeBase): +# pass + + +# class User(Base): +# __tablename__ = "user_account" +# id: Mapped[int] = mapped_column(primary_key=True) +# username: Mapped[str] = mapped_column(String(30)) +# first_name: Mapped[str] = mapped_column(String(50)) +# last_name: Mapped[Optional[str]] = mapped_column(String(50)) +# is_coach: Mapped[bool] = mapped_column(Boolean()) + +# def __repr__(self) -> str: +# return f"User(id={self.id!r}, name={self.name!r}, first_name={self.first_name!r}, is_coach={self.is_coach})" + +# Base.metadata.create_all(engine) + +# with engine.connect() as conn: +# result = conn.execute(text("select 'hello world'")) +# print(result.all()) + +# Commiting style one + +# with engine.connect() as conn: +# conn.execute(text("CREATE TABLE some_table (x int, y int)")) +# conn.execute( +# text("INSERT INTO some_table (x,y) VALUES (:x, :y)"), +# [{"x": 1, "y": 1}, {"x": 2, "y": 4}] +# ) +# conn.commit() + +# Commiting style two + +# with engine.begin() as conn: +# conn.execute( +# text("INSERT INTO some_table (x,y) VALUES (:x, :y)"), +# [{"x": 6, "y": 8}, {"x": 9, "y": 10}] +# ) + +# Managing Result object +# with engine.connect() as conn: +# result = conn.execute(text("SELECT x, y FROM some_table")) +# for row in result: +# print(f"x: {row.x} y: {row.y}") + +# Sending parameters +# with engine.connect() as conn: +# result = conn.execute(text("SELECT x, y FROM some_table where y > :y"), {"y": 20}) +# for row in result: +# print(f"x: {row.x} y: {row.y}") + +# Sending multiple params + +# with engine.connect() as conn: +# conn.execute( +# text("INSERT INTO some_table (x, y) VALUES (:x, :y)"), +# [{"x": 11, "y": 12}, {"x": 13, "y": 14}], +# ) +# conn.commit() + +with engine.connect() as conn: + conn.execute( + text("DROP TABLE some_table") + ) + conn.commit() diff --git a/ssh_connection_builder.py b/ssh_connection_builder.py new file mode 100644 index 0000000..c073c52 --- /dev/null +++ b/ssh_connection_builder.py @@ -0,0 +1,302 @@ +import logging +from abc import ABC, abstractmethod +from typing import Any, Dict, List, Optional, Tuple, Union + +from netmiko import BaseConnection, ConnectHandler, NetmikoBaseException +from netmiko.cisco import CiscoAsaSSH + +_log = logging.getLogger(__name__) + + +# TODO: Move to separate file +class SSHConnectionError(Exception): + def __init__(self, *args: object, **kwargs: object) -> None: + _log.error( + "During performing operation with continent following error occurred: " + "{exc_name}".format(exc_name=self.__class__.__name__) + ) + super().__init__(*args) + + +class GenericSSHSession: + def __init__(self) -> None: + self.device_type: str = "generic" + self.ip: str = "" + self.username: str = "" + self.password: str = "" + self.port: int = 22 + self.verbose: bool = False + self.session: Optional[BaseConnection] = None + self.command_read_timeout: int = 30 + self.excpected_end_of_command_string: Optional[str] = "" + self.additional_connect_data: Optional[dict] = dict() + + def __del__(self): + _log.info(f"Destroying connection to SSH on {self.ip}:{self.port}") + if self.session: + self.session.disconnect() + + def __str__(self) -> str: + return ( + f"Current SSH Session type: {self.__class__.__name__}; " + f"Current SSH Session params: Device type: {self.device_type}; " + f"IP: {self.ip}; Username: {self.username}; Password: {self.password}; " + f"Port: {self.port}; Verbose level: {self.verbose}; " + f"Commands timeout: {self.command_read_timeout} " + f"Expected EOL template: {self.excpected_end_of_command_string} " + f"Additional connect data: {self.additional_connect_data} " + ) + + def send_command( + self, command: str, command_type: Optional[str] + ) -> Union[str, List[Any], Dict[str, Any]]: + if not self.session: + _log.error("Cannot send command without session") + raise SSHConnectionError() + try: + result = self.session.send_command( + command, + read_timeout=self.command_read_timeout, + expect_string=self.excpected_end_of_command_string, + ) + except NetmikoBaseException: + raise SSHConnectionError() + return result + + +class CiscoAsaSSHSession(GenericSSHSession): + def __init__(self) -> None: + super().__init__() + self.device_type: str = "cisco_asa" + + def send_command( + self, command: str, command_type: Optional[str] + ) -> Union[str, List[Any], Dict[str, Any]]: + if not self.session: + _log.error("Cannot send command without session") + raise SSHConnectionError() + try: + result = self.session.send_command(command) + except NetmikoBaseException: + raise SSHConnectionError() + return result + + +class SSHSessionBuilderABC(ABC): + @abstractmethod + def ssh_session(self) -> GenericSSHSession: + pass + + @abstractmethod + def set_device_type(self, device_type: str) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def set_ip(self, ip: str) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def set_username(self, username: str) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def set_password(self, password: str) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def set_port(self, port: int) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def set_verbose_level(self, verbose_level: bool) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def set_command_timeout(self, timeout: int) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def set_eol_template_symbol(self, symbol: str) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def set_additional_connect_data( + self, additional_connect_data: dict + ) -> "SSHSessionBuilderABC": + pass + + @abstractmethod + def create_session(self) -> "SSHSessionBuilderABC": + pass + + +class GenericSSHSessionBuilder(SSHSessionBuilderABC): + def __init__(self) -> None: + self.reset() + + def reset(self) -> None: + self._product = GenericSSHSession() + + def ssh_session(self) -> GenericSSHSession: + new_session = self._product + self.reset() + return new_session + + def set_device_type(self, device_type: str) -> "SSHSessionBuilderABC": + self._product.device_type = device_type + return self + + def set_ip(self, ip: str) -> "SSHSessionBuilderABC": + self._product.ip = ip + return self + + def set_username(self, username: str) -> "SSHSessionBuilderABC": + self._product.username = username + return self + + def set_password(self, password: str) -> "SSHSessionBuilderABC": + self._product.password = password + return self + + def set_port(self, port: int) -> "SSHSessionBuilderABC": + self._product.port = port + return self + + def set_verbose_level(self, verbose_level: bool) -> "SSHSessionBuilderABC": + self._product.verbose = verbose_level + return self + + def set_command_timeout(self, timeout: int) -> "SSHSessionBuilderABC": + self._product.command_read_timeout = timeout + return self + + def set_eol_template_symbol(self, symbol: str) -> "SSHSessionBuilderABC": + self._product.excpected_end_of_command_string = symbol + return self + + def set_additional_connect_data( + self, additional_connect_data: dict + ) -> "SSHSessionBuilderABC": + self._product.additional_connect_data = additional_connect_data + return self + + def create_session(self) -> "SSHSessionBuilderABC": + # Preparing data for connection + connection_data = { + "device_type": self._product.device_type, + "host": self._product.ip, + "username": self._product.username, + "password": self._product.password, + "port": self._product.port, + "verbose": self._product.verbose, + } + # If additional connect data present - concat it with basic settings + if self._product.additional_connect_data: + connection_data.update(self._product.additional_connect_data) + # Createing session + try: + self._product.session = ConnectHandler(**connection_data) + except NetmikoBaseException: + raise SSHConnectionError() + return self + + +class CiscoAsaSSHSessionBuilder(GenericSSHSessionBuilder): + def __init__(self) -> None: + self.reset() + + def reset(self) -> None: + self._product = CiscoAsaSSHSession() + + def create_session(self) -> "SSHSessionBuilderABC": + # Preparing data for connection + connection_data = { + "device_type": self._product.device_type, + "host": self._product.ip, + "username": self._product.username, + "password": self._product.password, + "port": self._product.port, + "verbose": self._product.verbose, + } + # If additional connect data present - concat it with basic settings + if self._product.additional_connect_data: + connection_data.update(self._product.additional_connect_data) + # Createing session + try: + self._product.session = CiscoAsaSSH(**connection_data) + self._product.session.asa_login() + except NetmikoBaseException: + raise SSHConnectionError() + return self + + +class SSHSessionManager: + def __init__(self) -> None: + self._builder = None + + @property + def builder(self) -> SSHSessionBuilderABC: + return self._builder + + @builder.setter + def builder(self, builder: SSHSessionBuilderABC): + self._builder = builder + + def build_default_session( + self, + ip: str, + username: str, + password: str, + port: int = 22, + ) -> GenericSSHSession: + if not self._builder: + raise SSHConnectionError() + self._builder.set_ip(ip).set_username(username).set_password(password).set_port( + port + ).create_session() + return self._builder.ssh_session() + + def build_configured_session( + self, + device_type: str, + ip: str, + username: str, + password: str, + port: int = 22, + verbose_level: bool = False, + command_timeout: int = 10, + eol_template_symbol: str = "#", + additional_connect_data: dict = dict(), + ) -> GenericSSHSession: + if not self._builder: + raise SSHConnectionError() + self._builder.set_device_type(device_type).set_ip(ip).set_username( + username + ).set_password(password).set_port(port).set_verbose_level( + verbose_level + ).set_command_timeout( + command_timeout + ).set_eol_template_symbol( + eol_template_symbol + ).set_additional_connect_data( + additional_connect_data + ) + self._builder.create_session() + return self._builder.ssh_session() + + def build_enabled_cisco_asa_session( + self, + ip: str, + username: str, + password: str, + enable_password: str, + port: int = 22, + ) -> GenericSSHSession: + if not self._builder: + raise SSHConnectionError() + if not isinstance(self._builder, CiscoAsaSSHSessionBuilder): + raise SSHConnectionError() + self._builder.set_ip(ip).set_username(username).set_password(password).set_port( + port + ).set_additional_connect_data({"secret": enable_password}).create_session() + return self._builder.ssh_session() diff --git a/template b/template new file mode 100644 index 0000000..81c972c --- /dev/null +++ b/template @@ -0,0 +1,68 @@ +Value Required ACL_NAME (\S+) +Value ACL_TOT_ELEM (\d+) +Value ACL_NAME_HASH (0x\w+) +Value USER (\S+) +Value REMARK (.+?) +Value USER_GROUP (\S+) +Value SRC_SERVICE (\S+) +Value TYPE (standard|extended) +Value LINE_NUM (\d+) +Value ACTION (permit|deny) +Value PROTOCOL ([a-z0-9]+) +Value SOURCE (\S+) +Value ACE_STATE (inactive) +Value SVC_OBJECT_GRP (\S+) +Value SVC_OBJECT (\S+) +Value SRC_INTFC (\S+) +Value SRC_OBJECT_GRP (\S+) +Value SRC_OBJECT (\S+) +Value SRC_HOST (\d+\.\d+\.\d+\.\d+) +Value SRC_V6HOST ([0-9a-f:]+) +Value SRC_NETWORK (\d+\.\d+\.\d+\.\d+) +Value SRC_V6NETWORK ([0-9a-f:]+) +Value SRC_MASK (\d+\.\d+\.\d+\.\d+) +Value SRC_V6MASK (\d{1,3}) +Value SRC_ANY (any[46]{0,1}) +Value DST_INTFC (\S+) +Value DST_OBJECT_GRP (\S+) +Value DST_OBJECT (\S+) +Value DST_HOST (\d+\.\d+\.\d+\.\d+) +Value DST_V6HOST ([0-9a-f:]+) +Value DST_NETWORK (\d+\.\d+\.\d+\.\d+) +Value DST_V6NETWORK ([0-9a-f:]+) +Value DST_MASK (\d+\.\d+\.\d+\.\d+) +Value DST_V6MASK (\d{1,3}) +Value DST_ANY (any[46]{0,1}) +Value DST_PORT (\S+) +Value DST_PORT_LESS_THAN (\S+) +Value DST_PORT_GREATER_THAN (\S+) +Value DST_PORT_RANGE_START (\S+) +Value DST_PORT_RANGE_END (\S+) +Value DST_PORT_GRP (\S+) +Value DST_PORT_OBJECT (\S+) +Value DST_ICMP_TYPE ((?!log|time|inactive)\S+) +Value SRC_SECURITY_GROUP_NAME (\S+) +Value DST_SECURITY_GROUP_NAME (\S+) +Value SRC_SECURITY_GROUP_TAG (\S+) +Value DST_SECURITY_GROUP_TAG (\S+) +Value HIT_COUNT (\d+) +Value LINE_HASH (0x\w+) +Value DST_SERVICE (\S+) +Value LOG_LEVEL ([a-z0-9]+) +Value LOG_INTERVAL (\d+) +Value TIME_RANGE (\S+) +Value ENTRY_PORT ([a-z\-]+\s+\d+|[\w\-]+) +Value ENTRY_PORT_LESS_THAN ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_GREATER_THAN ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_RANGE_START ([a-z\-]+\s+\d+|\w+) +Value ENTRY_PORT_RANGE_END ([a-z\-]+\s+\d+|\w+) + + +Start + ^access\-list\s+cached\s+ACL* -> NoRecord + ^\s+alert\-interval* -> NoRecord + ^access\-list\s+${ACL_NAME};\s+${ACL_TOT_ELEM}\s+elements;\s+name\s+hash:\s+${ACL_NAME_HASH}\s* -> Record + ^access\-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+${TYPE}\s+${ACTION}\s+(${PROTOCOL}|object\-group\s+${SVC_OBJECT_GRP}+)\s+(user\s+${USER}\s+|object\-group\-user\s+${USER_GROUP}\s+){0,1}(object\-group\-security\s+${SRC_OBJECT_GRP}\s+){0,1}(${SRC_ANY}|interface\s+${SRC_INTFC}|${SRC_HOST})\s+(eq\s+${SRC_SERVICE}\s+){0,1}(object\-group\-security\s+${DST_OBJECT_GRP}\s+){0,1}(${DST_ANY}|interface\s+${DST_INTFC}|${DST_HOST}|${DST_NETWORK}\s+${DST_MASK})\s+((log\s+(${LOG_LEVEL}\s+interval\s+${LOG_INTERVAL}|disable|default))\s+){0,1}(eq\s+${DST_SERVICE}\s+){0,1}(object\-group\s+${DST_PORT_GRP}\s+){0,1}((eq\s+${ENTRY_PORT}|lt\s+${ENTRY_PORT_LESS_THAN}|gt\s+${ENTRY_PORT_GREATER_THAN}|range\s+${ENTRY_PORT_RANGE_START}\s+${ENTRY_PORT_RANGE_END})\s+){0,1}(time\-range\s+${TIME_RANGE}\s+){0,1}(${ACE_STATE}\s+){0,1}\(hitcnt=${HIT_COUNT}\)\s+(\(inactive\)\s+){0,1}${LINE_HASH}\s* -> Record + ^\s+access\-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+${TYPE}\s+${ACTION}\s+(${PROTOCOL}|object\-group\s+${SVC_OBJECT_GRP})\s+(user\s+${USER}\s+|object\-group\-user\s+${USER_GROUP}\s+){0,1}(security\-group\s+name\s+${SRC_SECURITY_GROUP_NAME}\s+|security\-group\s+tag\s+${SRC_SECURITY_GROUP_TAG}\s+){0,1}(${SRC_ANY}|interface\s+${SRC_INTFC}|${SRC_HOST})\s+(eq\s+${SRC_SERVICE}\s+){0,1}(security\-group\s+name\s+${DST_SECURITY_GROUP_NAME}\s+|security\-group\s+tag\s+${DST_SECURITY_GROUP_TAG}\s+){0,1}(${DST_ANY}|interface\s+${DST_INTFC}|${DST_NETWORK}\s+${DST_MASK}|${DST_HOST})\s+((log\s+(${LOG_LEVEL}\s+interval\s+${LOG_INTERVAL}|disable|default))\s+){0,1}(eq\s+${DST_SERVICE}\s+){0,1}(object\-group\s+${DST_PORT_GRP}\s+){0,1}((eq\s+${ENTRY_PORT}|lt\s+${ENTRY_PORT_LESS_THAN}|gt\s+${ENTRY_PORT_GREATER_THAN}|range\s+${ENTRY_PORT_RANGE_START}\s+${ENTRY_PORT_RANGE_END})\s+){0,1}(time\-range\s+${TIME_RANGE}\s+){0,1}(${ACE_STATE}\s+){0,1}\(hitcnt=${HIT_COUNT}\)\s+(\(inactive\)\s+){0,1}${LINE_HASH}\s* -> Record + ^access-list\s+${ACL_NAME}\s+line\s+${LINE_NUM}\s+remark\s+${REMARK}\s*$$ -> Record + ^.* -> Error "Did not match any rules" diff --git a/test.html b/test.html new file mode 100644 index 0000000..771b7fc --- /dev/null +++ b/test.html @@ -0,0 +1,88 @@ + + + + + + diff --git a/tmp.json b/tmp.json new file mode 100644 index 0000000..0d3db36 --- /dev/null +++ b/tmp.json @@ -0,0 +1,33 @@ +[ + { + "group_name": "test_user_group", + "description": "descr_user_group", + "members": [ + "LOCAL\test_user1", + "LOCAL\test_user2" + ], + "groups": [] + }, + { + "group_name": "DM_INLINE_USER_1", + "description": "", + "members": [ + "LOCAL\test_user1", + "LOCAL\test_user2" + ], + "groups": [ + "test_user_group" + ] + }, + { + "group_name": "DM_INLINE_USER_2", + "description": "", + "members": [ + "LOCAL\test_user1", + "LOCAL\test_user2" + ], + "groups": [ + "test_user_group" + ] + } +] diff --git a/tmp.py b/tmp.py new file mode 100644 index 0000000..45e10e7 --- /dev/null +++ b/tmp.py @@ -0,0 +1,12 @@ +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(",")] + + total = result + result6 + total = set(total) + return "|".join(total) + + +print(main()) diff --git a/widgets.drawio b/widgets.drawio new file mode 100644 index 0000000..32f8bac --- /dev/null +++ b/widgets.drawio @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +