{ "info": { "author": "Sebastian Rieger", "author_email": "sebastian@riegers.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: No Input/Output (Daemon)", "Environment :: Web Environment", "Intended Audience :: Education", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: MacOS", "Operating System :: MacOS :: MacOS 9", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Operating System :: Unix", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Topic :: Internet :: Proxy Servers", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Networking :: Monitoring", "Topic :: Utilities" ], "description": "gns3-proxy\n==========\n\nProof-of-concept for a Proxy Server for GNS3. The proxy is configured as a \nregular remote server in the GNS3-GUI, as the GNS3-GUI client does not yet \nsupport proxies [gns3-gui issue #2696](https://github.com/GNS3/gns3-gui/issues/2696). Basic idea \nis to allow the use of central GNS3 server backends for classroom / lab setups,\nas used, e.g., in the [Network Laboratory of Fulda University of Applied \nSciences](https://www.hs-fulda.de/en/studies/departments/applied-computer-science/about-us/laboratories/netlab/). Students can connect to the proxy and requests will be authenticated,\nfiltered and forwarded to appropriate backend servers. Proxy authentication\nalso circumvents the current lack of multi-user support in GNS3. Without the\nproxy, due to the single user limitation (see \"MULTIPLE USERS ENVIRONMENT\"\nin [GNS3 Security](https://docs.gns3.com/1ON9JBXSeR7Nt2-Qum2o3ZX0GU86BZwlmNSUgvmqNWGY/index.html)),\nusers will have to use the same admin credentials for GNS3 to access the \nbackend. Also, requests cannot be filtered and authorized (e.g., to deny\ndeletion/creation of projects etc.). As GNS3 does not support proxies, several\ntweaks were necessary to the forked proxy.py project to allow transparent\nREST and WebSocket passthrough.\n\n![alt text](https://travis-ci.org/srieger1/gns3-proxy.svg?branch=develop \"Build Status\")\n\nFeatures\n--------\n\nInherited from proxy.py:\n- Distributed as a single file module\n- No external dependency other than standard Python library\n- Support for `http`, `https` and `websockets` request proxy\n- Optimized for large file uploads and downloads\n- IPv4 and IPv6 support\n\nChanges/enhancements to proxy.py:\n- Redirect requests to backend servers (fixed proxying independent from request URL)\n- Definition of users (username and password used in GNS3-GUI) for authentication and authorization at the proxy, proxy replaces credentials for backend servers\n- Selection (mapping) of GNS3 backend server and possibility of load-balancing based on username (using regexp)\n- Filtering of denied requests to server backends (based on username, REST/HTTP method/URL path/headers/body (using regexp)\n- Configuration file to allow basic proxy configuration as well as GNS3 backend server, users, mappings and request filters\n- Support for REST calls (GET requests with body etc., not handled by proxy.py)\n- Fixes and tweaks to allow the connection to GNS3 backends, especially keeping connections alive and leaving HTTP headers to support direct passthrough of WebSocket connections\n- Basic access logging/status monitoring support\n\nFurther utilities provided to use the proxy:\n- [gns3_proxy_manage_projects.py](https://github.com/srieger1/gns3-proxy/blob/develop/gns3_proxy_manage_projects.py) allows management of projects on backend servers, e.g., bulk import, export,\n start, stop, delete projects on all or certain backend servers based on regexp.\n- [gns3_proxy_replicate_projects.py](https://github.com/srieger1/gns3-proxy/blob/develop/gns3_proxy_replicate_projects.py) supports replication of projects across backend servers.\n\ngns3_proxy_manage_project.py and gns3_proxy_replicate_projects.py be combined with [cron entry](https://github.com/srieger1/gns3-proxy/blob/develop/gns3_proxy_crontab) to run tasks periodically. \n\nConcept\n-------\n\nIn our Network Laboratory we use several network emulators (besides GNS3 esp., mininet, VIRL and EVE-NG) and simulators\nfor courses and lab sessions as well as individual research or students' projects. As GNS3 is focusing on single user\ninstallations, several changes were necessary to provide lab session in class as well as to students working from\nat home. The following figure describes our setup:\n\n![gns3 proxy setup figure including external clients, backend servers and the proxy in the middle as well as its functions](https://raw.githubusercontent.com/srieger1/gns3-proxy/develop/gns3-proxy-concept.png \"GNS3 proxy setup in the NetLab of Fulda University of Applied Sciences\")\n\nUsing gns3-proxy, we can use separate credentials for users accessing the proxy without needing to share the single\nadmin user provided by the standard gns3 server. However, no modifications are necessary to the standard GNS3 server\nused in our backends and for the GNS3 client GUI. Users defined in the proxy, e.g., a group of students working\ntogether in a group or on individual projects from at home, will be mapped to an individual backend server allowing\nload balancing and failover, since GNS3 compared to other network emulation environments does not offer a cluster setup\nto spread running projects and contained resources. The proxy also allows to filter and hence deny requests that\ncontain modifications to projects. Prepared projects are periodically synced to all server backends using cron and the\nreplication utility [gns3_proxy_replicate_projects.py](https://github.com/srieger1/gns3-proxy/blob/develop/gns3_proxy_replicate_projects.py).\n\nInstallation\n------------\n\nYou can clone this repository or simply copy gns3_proxy.py and gns3_proxy_config.ini to a host that has Python >=3.4\ninstalled. \n\nEven easier is the installation using a Docker container. Simply install and run the latest version of the [gns3-proxy\ncontainer image](https://cloud.docker.com/u/flex/repository/docker/flex/gns3-proxy)\nfrom Docker Hub, e.g., using\n\n`$ docker pull flex/gns3-proxy`\n\n`$ docker run -p 0.0.0.0:14080:14080/tcp flex/gns3-proxy`\n\nYou can find [sample scripts](https://github.com/srieger1/gns3-proxy/tree/develop/scripts/docker-container-example) to run and manage\nthe container in the scripts directory of this repository.\n\nAlso, you can install the gns3-proxy from [PyPI](https://pypi.org/project/gns3-proxy/) using\n\n`$ pip install gns3-proxy`\n\nPreparing GNS3 server backends\n------------------------------\n\nThe only change necessary in the GNS3 server backends, is to edit the regular\ngns3_server.conf (available in the appliance terminal and, e.g., used to\nchange username password etc., see also\n[GNS3 server configuration file](https://docs.gns3.com/1f6uXq05vukccKdMCHhdki5MXFhV8vcwuGwiRvXMQvM0/index.html))\nand change the hostname from 0.0.0.0 to the IP address the server should\nlisten on, e.g.:\n\n`host = 192.168.1.100`\n\nAfter you changed the config of the GNS3 backend servers and restarted them, configure gns3_proxy_config.ini based\non your needs and run gns3_proxy.py. You can then, configure GNS3-GUI to use the proxy as a remote GNS3 server. \nBy default, the proxy listens on 0.0.0.0 and TCP port 14080.\n\nConfiguration\n-------------\n\nSettings of the proxy are stored in [gns3_proxy_config.ini](https://github.com/srieger1/gns3-proxy/tree/develop/gns3_proxy_config.ini).\nThe `[proxy]` section contains following parameters for gns3-proxy:\n\n- **hostname:** IP address or corresponding hostname the proxy should bind to, listening for incoming requests (default: 0.0.0.0)\n- **port** TCP port the proxy will listen on (default: 14080)\n- **backend_user** Username to use to connect to GNS3 server backend (default: admin, standard GNS3 server user)\n- **backend_password** Password to use to connect to GNS3 server backend (default: password)\n- **backend_port** TCP port the backend servers listen on (default: 3080, standard GNS3 server port)\n- **default_server** Default server backend to use if no individual mapping for the user was found. Can be omitted to use explicit mapping (default: gns3-1)\n- **backlog** Backlog of the proxy. Increase to allow the processing of more concurrent requests (default: 1000)\n- **server-recvbuf-size** Server receive buffer size (TCP socket) of the proxy in bytes. Increase this value for better performance of large responses from backend servers (default: 8192, recommended for production: 1048576)\n- **client-recvbuf-size** Client receive buffer size (TCP socket) of the proxy in bytes. Increase this value for better performance of large requests from clients (default: 8192, recommended for production: 1048576)\n- **open-file-limit** Maximum number of parallel open files (socket fds) of the proxy (default: 1024)\n- **log-level** Log level. Increase to DEBUG for debugging output. (default: INFO)\n\nThe `[servers]` section contains the defined backend servers (server_name=ip_address), e.g.:\n\n```\ngns3-1=192.168.76.205\ngns3-2=192.168.76.206\n```\n\nThe `[users]` section defines the users allowed to access the proxy and their passwords (username=password), e.g.:\n\n```\nuser1=pass1\nuser2=pass2\n```\n\nThe `[mapping]` section maps users to the backend servers (mapping_id=\"user regexp\":\"server_name\"), e.g.: \n\n```\nmapping1=\"user2\":\"gns3-2\"\nmapping2=\"user(.*)\":\"gns3-1\"\n```\n\nThe `[deny]` section defines requests that should be filtered and hence denied by the proxy (rule_id=\"user regexp\":\"http_request_method\":\"url regexp\":\"header regexp\":\"body regexp\"), e.g. to deny modification to existing projects as well as deletion and creation of projects:\n\n```\nrule1=\"user(.*)\":\"POST\":\"(.*)/projects$\":\"\":\"\"\nrule2=\"user(.*)\":\"POST\":\"(.*)/nodes$\":\"\":\"\"\nrule3=\"user(.*)\":\"POST\":\"(.*)/links$\":\"\":\"\"\nrule4=\"user(.*)\":\"POST\":\"(.*)/drawings$\":\"\":\"\"\nrule5=\"user(.*)\":\"POST\":\"(.*)/appliances/(.*)\":\"\":\"\"\nrule6=\"user(.*)\":\"DELETE\":\"\":\"\":\"\"\n```\n\nDeploying and managing projects on gns3-proxy backends\n------------------------------------------------------\n\n[gns3_proxy_replicate_projects.py](https://github.com/srieger1/gns3-proxy/blob/develop/gns3_proxy_replicate_projects.py) facilitates the replication of projects across backend servers.\nCommand syntax is:\n\n```\nusage: gns3_proxy_replicate_projects.py [-h] [--config-file CONFIG_FILE]\n [--delete-target-project] [--force]\n [--inject-replication-note]\n [--log-level LOG_LEVEL]\n (--project-id PROJECT_ID | --project-name PROJECT_NAME)\n [--regenerate-mac-address REGENERATE_MAC_ADDRESS]\n --source-server SOURCE_SERVER\n --target-server TARGET_SERVER\n```\n\nThe provided example [crontab](https://github.com/srieger1/gns3-proxy/blob/develop/gns3_proxy_crontab) contains examples to \nuse gns3_proxy_replicate_projects.py. For example:\n\n```\ngns3_proxy_replicate_projects.py --source gns3-master --target \"gns3-(.*)\" --project-name \"KommProt(.*)\" --regenerate-mac-address \"02:01:00:(.*)\" --force \n```\n\nwill replicate all GNS3 project names beginning with \"KommProt\" from the backend server gns3-master as the source to\nall backend servers matching the regular expression \"gns3-.(.*)\". The option --force tells the utility to overwrite existing\nprojects with the same name on the targets without further notice. The option --regenerate-mac-address searches for the\ngiven MAC address in the projects and creates a new locally administered MAC address. This is especially necessary for\nlinks to cloud node types in the project. Otherwise all projects will use the same address leading to duplicate MAC and\nconsequently duplicated IP addresses. \n\n[gns3_proxy_manage_projects.py](https://github.com/srieger1/gns3-proxy/blob/develop/gns3_proxy_manage_projects.py) facilitates the management of projects on backend servers.\nCommand syntax is:\n\n```\nusage: gns3_proxy_manage_projects.py [-h] [--config-file CONFIG_FILE]\n [--force] [--log-level LOG_LEVEL]\n (--project-id PROJECT_ID | --project-name PROJECT_NAME)\n (--export-to-dir EXPORT_TO_DIR | --import-from-file IMPORT_FROM_FILE | --show | --delete | --start | --stop)\n --target-server TARGET_SERVER\n```\n\nThe provided example [crontab](https://github.com/srieger1/gns3-proxy/blob/develop/gns3_proxy_crontab) contains examples to \nuse gns3_proxy_manage_projects.py. For example:\n\n```\ngns3_proxy_manage_projects.py --show --project-name \"(.*)\" --target \"(.*)\" \n```\n\nwill show the status of all projects on all backend server.\n\n```\ngns3_proxy_manage_projects.py --start --project-name TestProject --target gns3-1 \n```\n\nwill start the project with the name TestProject on the server gns3-1 defined as a backend in gns3_proxy_config.ini.\nCan be used, e.g., together with cron to start the project ahead of time for lab sessions or courses, avoiding\nwaiting for projects to be ready for use when students take the lab.\n\n```\ngns3_proxy_manage_projects.py --export-to-dir . --project-name TestProject --target gns3-1 \n```\n\nwill export the project TestProject from gns3-1 to a ZIP file that can be used as a backup, e.g. to import later using\nGNS3 GUI, or --import-from-file option, like:\n\n```\ngns3_proxy_manage_projects.py --import-from-file project.zip --project-id f1d1e2b8-c41f-42cf-97d4-513f3fd01cd2 --target gns3-1 \n```\n\nwill import GNS3 project exported in file project.zip to backend server gns3-1. The specified project-id (must be a valid UUID v4\nin GNS3) will be used for the import.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/srieger1/gns3-proxy/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/srieger1/gns3-proxy", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "gns3-proxy", "package_url": "https://pypi.org/project/gns3-proxy/", "platform": "", "project_url": "https://pypi.org/project/gns3-proxy/", "project_urls": { "Download": "https://github.com/srieger1/gns3-proxy/archive/master.zip", "Homepage": "https://github.com/srieger1/gns3-proxy" }, "release_url": "https://pypi.org/project/gns3-proxy/0.5/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "GNS3 Proxy based on proxy.py by Abhinav Singh (https://github.com/abhinavsingh/proxy.py)", "version": "0.5" }, "last_serial": 5734966, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a8082e9ed0eb9bbb0076c65affb138b1", "sha256": "48291788c4b7ca9e048cffb9c8c0c84570ae07994e5a5700b6de6fa456a3b9c8" }, "downloads": -1, "filename": "gns3_proxy-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a8082e9ed0eb9bbb0076c65affb138b1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24821, "upload_time": "2019-06-14T21:40:38", "url": "https://files.pythonhosted.org/packages/43/f2/44a96358810a37afb8acc95dfafd6661d1aa2078c4657035f3247c15a6ce/gns3_proxy-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "51ba4b4770a45cfc8e8894907314b489", "sha256": "1891fe2cc752feee94ae12c01839b5517bdaf55d8816bf4d2072e0338d35ebab" }, "downloads": -1, "filename": "gns3-proxy-0.1.tar.gz", "has_sig": false, "md5_digest": "51ba4b4770a45cfc8e8894907314b489", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14352, "upload_time": "2019-06-14T21:40:40", "url": "https://files.pythonhosted.org/packages/48/f8/797b1ea7b95d913364ced487947fface5f7a86c339ccb035935591ce1b13/gns3-proxy-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "de85d4ade62c0021dfbfb693e2978ff0", "sha256": "1404c9f44b00e652fa227b1ecc6067c2bc49f7d2e96cf12dfd59797b86c69c50" }, "downloads": -1, "filename": "gns3_proxy-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "de85d4ade62c0021dfbfb693e2978ff0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23858, "upload_time": "2019-06-16T13:20:18", "url": "https://files.pythonhosted.org/packages/dd/8d/eeacb15ab314322baa730beb61804127f231bf94275124c8fed30d67d417/gns3_proxy-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8996449734b636077addcddbd6ce6f4", "sha256": "549d88da0012244c9da72b12e748a3bfd3e5fee02e61a7f4bc4c6a6813f770eb" }, "downloads": -1, "filename": "gns3-proxy-0.2.tar.gz", "has_sig": false, "md5_digest": "c8996449734b636077addcddbd6ce6f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13854, "upload_time": "2019-06-16T13:20:19", "url": "https://files.pythonhosted.org/packages/b4/ee/65a09637c3372d676ed2ff77035f8be0b40409bf7bb8d32cd670d53b10f9/gns3-proxy-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "1628f1d6f760a1d62c60b05467ce0da4", "sha256": "8595ecfc86183729509f6f37ce2be2b07b4d2dea1b38c50b7979561024fc5b89" }, "downloads": -1, "filename": "gns3_proxy-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1628f1d6f760a1d62c60b05467ce0da4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25663, "upload_time": "2019-06-16T22:21:49", "url": "https://files.pythonhosted.org/packages/1b/01/d9854a4372b641d879ab01102104ca27be7b47ec898538a990890682a3b3/gns3_proxy-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de0b39c98ab00cc45569587c847f013f", "sha256": "ef6f6c3d06e3c606c2bb65d4b3343501cf4edb69b6549fead8f7dd2fcf447c2e" }, "downloads": -1, "filename": "gns3-proxy-0.3.tar.gz", "has_sig": false, "md5_digest": "de0b39c98ab00cc45569587c847f013f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15992, "upload_time": "2019-06-16T22:21:51", "url": "https://files.pythonhosted.org/packages/b4/f9/9c175995923a668ccf044a2db8d95ea24f27943b9193ec056d35c80ccef0/gns3-proxy-0.3.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "ebce8283993565afc52723e2e6cb5a63", "sha256": "a4aa289c6e55d3657d2c57527e33254fd29708f8db843ac59c20de8643dc4f0d" }, "downloads": -1, "filename": "gns3_proxy-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "ebce8283993565afc52723e2e6cb5a63", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28886, "upload_time": "2019-08-27T06:46:27", "url": "https://files.pythonhosted.org/packages/89/42/f7d4ec2f6d03cc38870d19baa270f890cdc9181168e16d48aba8c3c9e060/gns3_proxy-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b91d1b7a459ecb457b06dad33d0af7ab", "sha256": "0d5b8f1fa2ac62ca02e964052ee9b53371aceb05458904914cf79ce982b83008" }, "downloads": -1, "filename": "gns3-proxy-0.5.tar.gz", "has_sig": false, "md5_digest": "b91d1b7a459ecb457b06dad33d0af7ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18483, "upload_time": "2019-08-27T06:46:29", "url": "https://files.pythonhosted.org/packages/7f/24/99ad7cc3eeec9902e0adaa2599fb3e67dbd0464486d68722adfb0befd99e/gns3-proxy-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ebce8283993565afc52723e2e6cb5a63", "sha256": "a4aa289c6e55d3657d2c57527e33254fd29708f8db843ac59c20de8643dc4f0d" }, "downloads": -1, "filename": "gns3_proxy-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "ebce8283993565afc52723e2e6cb5a63", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28886, "upload_time": "2019-08-27T06:46:27", "url": "https://files.pythonhosted.org/packages/89/42/f7d4ec2f6d03cc38870d19baa270f890cdc9181168e16d48aba8c3c9e060/gns3_proxy-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b91d1b7a459ecb457b06dad33d0af7ab", "sha256": "0d5b8f1fa2ac62ca02e964052ee9b53371aceb05458904914cf79ce982b83008" }, "downloads": -1, "filename": "gns3-proxy-0.5.tar.gz", "has_sig": false, "md5_digest": "b91d1b7a459ecb457b06dad33d0af7ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18483, "upload_time": "2019-08-27T06:46:29", "url": "https://files.pythonhosted.org/packages/7f/24/99ad7cc3eeec9902e0adaa2599fb3e67dbd0464486d68722adfb0befd99e/gns3-proxy-0.5.tar.gz" } ] }