{ "info": { "author": "Ricky Cook", "author_email": "ricky.cook@bluebike.com.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet", "Topic :: Security", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Check external net\n==================\n\nCheck domains, IPs, and hosts to ensure they are \"external\"\n\nThis is intended to be used to check user-entered host names to ensure that\nthey only contain IP addresses, or domain names that are considered to be\nexternal to your system. No IP addresses that are reserved (eg\n``127.0.0.0/8``, ``192.168.0.0/16``, ``fc00::/7``) and no domains that aren't\nchildren of a public suffix (eg ``*.com`` is okay, ``*.local`` is not).\n\nInternal IP addresses (``is_external_address``)\n-----------------------------------------------\n\nIf we are able to discern an `IPv4 mapped`_ address, that is passed through\nas the address to check rather than the original.\n\nFrom there, all `IPv4 reserved networks`_, and `IPv6 reserved networks`_ are\nconsidered \"internal\" (see is_global_)\n\nInternal domains (``is_external_domain``)\n-----------------------------------------\n\nA domain is considered internal if it is not external.\n\nA domain is considered external if the last suffix (the final part of a domain\nafter the last ``.`` character) exists in the\n`Mozilla public suffix registry`_.\n\nInternal hosts (``is_external_host``)\n-------------------------------------\n\nHosts are parsed as IP addresses via the `ipaddress.ip_address`_ function. If\nthis succeeds, it's treated to the rules of an internal IP address. Otherwise,\nit's treated as a domain.\n\n*Usage*\n\n::\n\n >>> check_external_net.is_external_host('127.0.0.1')\n False\n >>> check_external_net.is_external_host('::0')\n False\n >>> check_external_net.is_external_host('8.8.8.8')\n True\n >>> check_external_net.is_external_host('::ffff:8.8.8.8')\n True\n >>> check_external_net.is_external_host('localhost')\n False\n >>> check_external_net.is_external_host('cluster.local')\n False\n >>> check_external_net.is_external_host('google.com')\n True\n >>> check_external_net.is_external_host('dutyof.care')\n True\n\n.. _`IPv4 mapped`: https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Address.ipv4_mapped\n.. _`IPv4 reserved networks`: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml\n.. _`IPv6 reserved networks`: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml\n.. _is_global: https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address.is_global\n.. _`Mozilla public suffix registry`: https://publicsuffix.org\n.. _`ipaddress.ip_address`: https://docs.python.org/3/library/ipaddress.html#ipaddress.ip_address", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bluebikesolutions/py-check-external-net", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "check-external-net", "package_url": "https://pypi.org/project/check-external-net/", "platform": "", "project_url": "https://pypi.org/project/check-external-net/", "project_urls": { "Homepage": "https://github.com/bluebikesolutions/py-check-external-net" }, "release_url": "https://pypi.org/project/check-external-net/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "Check domains, IPs, and hosts to ensure they are \"external\"", "version": "1.0.1" }, "last_serial": 4480293, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "594d027dcc0c117582186e2f3d71beab", "sha256": "bfca45039f90912708eeb28bdb8c974a5ad647a3c180fa83def06605ee65c965" }, "downloads": -1, "filename": "check_external_net-1.0.0.macosx-10.13-x86_64.tar.gz", "has_sig": false, "md5_digest": "594d027dcc0c117582186e2f3d71beab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1974, "upload_time": "2018-11-13T02:30:45", "url": "https://files.pythonhosted.org/packages/de/57/9c4afda05c0b7f72865bfd11c823e05b74d1a44f60ac3f495b5bc26ff18e/check_external_net-1.0.0.macosx-10.13-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "7b191e4a929cafc801f06c3a59aaccf8", "sha256": "3696f9f093116163fdc99c851d70b3df378a39a61b93afb81ca2615eaef2e9c4" }, "downloads": -1, "filename": "check_external_net-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7b191e4a929cafc801f06c3a59aaccf8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2245, "upload_time": "2018-11-13T02:30:43", "url": "https://files.pythonhosted.org/packages/c2/5d/d0dfed810b5abafc5ebb6712d0e91088ade42dc35ad95f45d434a6d58706/check_external_net-1.0.0-py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "afbe733c0cb99eff7fcd7e51889460a9", "sha256": "dac581f50dad10346b30ba66fe6c5897f61d81a1d4e36e5f20f6b3f66fa5c71e" }, "downloads": -1, "filename": "check_external_net-1.0.1.tar.gz", "has_sig": false, "md5_digest": "afbe733c0cb99eff7fcd7e51889460a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3208, "upload_time": "2018-11-13T04:15:32", "url": "https://files.pythonhosted.org/packages/ef/d7/0405ffe734f7c42cd5dfa95bca36396ac66b5d785976c22ce4df3f2d0862/check_external_net-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "afbe733c0cb99eff7fcd7e51889460a9", "sha256": "dac581f50dad10346b30ba66fe6c5897f61d81a1d4e36e5f20f6b3f66fa5c71e" }, "downloads": -1, "filename": "check_external_net-1.0.1.tar.gz", "has_sig": false, "md5_digest": "afbe733c0cb99eff7fcd7e51889460a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3208, "upload_time": "2018-11-13T04:15:32", "url": "https://files.pythonhosted.org/packages/ef/d7/0405ffe734f7c42cd5dfa95bca36396ac66b5d785976c22ce4df3f2d0862/check_external_net-1.0.1.tar.gz" } ] }