fortilib


Namefortilib JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/telekom-mms/fortilib
Summaryfortilib - a Python Library to interact with Fortigate Firewalls
upload_time2024-01-17 07:48:09
maintainer
docs_urlNone
authorDaniel Zinke
requires_python>=3.8,<4.0
licenseGPL-3.0-only
keywords firewall fortinet fortigate
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # fortilib - a Python Library to interact with Fortigate Firewalls

This Python module contains the ability to get and configure following object on [Fortigate Firewalls](https://www.fortinet.com/products/next-generation-firewall):
* Addresses
* Address Groups
* Interfaces
* IPPools
* Policies
* Proxy Addresses
* Proxy Address Groups
* Proxy Policies
* Routes
* Services
* Service Groups
* Vips
* Vip Groups

## Installation
Python >= 3.8 is required.

Dependencies:
* [httpx](https://www.python-httpx.org/)

Simply install fortilib via pip:
```
> pip install fortilib
```

## Quickstart

```python
import ipaddress

from fortilib.firewall import FortigateFirewall
from fortilib.fortigateapi import FortigateFirewallApi
from fortilib.address import FortigateIpMask


api = FortigateFirewallApi(
    "127.0.0.1", # firewall ip
    "username",
    "password",
    "vdom", # use "root" if you dont have vdoms activated
)
firewall = FortigateFirewall("fw01", api)
firewall.login()

# load all objects from fortigate
firewall.get_all_objects()

# create an firewall address
address = FortigateIpMask()
address.name = "Test Address"
address.subnet = ipaddress.ip_network("127.0.0.1/32")

# add object to firewall
firewall.create_firewall_address(address)

# print all addresses on firewall
for address in firewall.addresses:
    print(address.name)
```

## Contributing

See [Contributing](CONTRIBUTING.md).

## License

GPLv3

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/telekom-mms/fortilib",
    "name": "fortilib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "firewall,fortinet,fortigate",
    "author": "Daniel Zinke",
    "author_email": "Daniel.Zinke@telekom.de",
    "download_url": "https://files.pythonhosted.org/packages/35/56/dbd59d13bfdae58624f2990ebc7abc7ff24a2507777f092f634b80d2f806/fortilib-1.0.2.tar.gz",
    "platform": null,
    "description": "# fortilib - a Python Library to interact with Fortigate Firewalls\n\nThis Python module contains the ability to get and configure following object on [Fortigate Firewalls](https://www.fortinet.com/products/next-generation-firewall):\n* Addresses\n* Address Groups\n* Interfaces\n* IPPools\n* Policies\n* Proxy Addresses\n* Proxy Address Groups\n* Proxy Policies\n* Routes\n* Services\n* Service Groups\n* Vips\n* Vip Groups\n\n## Installation\nPython >= 3.8 is required.\n\nDependencies:\n* [httpx](https://www.python-httpx.org/)\n\nSimply install fortilib via pip:\n```\n> pip install fortilib\n```\n\n## Quickstart\n\n```python\nimport ipaddress\n\nfrom fortilib.firewall import FortigateFirewall\nfrom fortilib.fortigateapi import FortigateFirewallApi\nfrom fortilib.address import FortigateIpMask\n\n\napi = FortigateFirewallApi(\n    \"127.0.0.1\", # firewall ip\n    \"username\",\n    \"password\",\n    \"vdom\", # use \"root\" if you dont have vdoms activated\n)\nfirewall = FortigateFirewall(\"fw01\", api)\nfirewall.login()\n\n# load all objects from fortigate\nfirewall.get_all_objects()\n\n# create an firewall address\naddress = FortigateIpMask()\naddress.name = \"Test Address\"\naddress.subnet = ipaddress.ip_network(\"127.0.0.1/32\")\n\n# add object to firewall\nfirewall.create_firewall_address(address)\n\n# print all addresses on firewall\nfor address in firewall.addresses:\n    print(address.name)\n```\n\n## Contributing\n\nSee [Contributing](CONTRIBUTING.md).\n\n## License\n\nGPLv3\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-only",
    "summary": "fortilib - a Python Library to interact with Fortigate Firewalls",
    "version": "1.0.2",
    "project_urls": {
        "Changelog": "https://github.com/telekom-mms/fortilib/blob/master/CHANGELOG.md",
        "Documentation": "https://github.com/telekom-mms/fortilib",
        "Homepage": "https://github.com/telekom-mms/fortilib",
        "Repository": "https://github.com/telekom-mms/fortilib"
    },
    "split_keywords": [
        "firewall",
        "fortinet",
        "fortigate"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ccb01823078868177f18ce5755a82f2b584200bd2eae8892944dc76cd830bcf",
                "md5": "5d8d2528a9b092e89d147f5a147502ec",
                "sha256": "6e430306053e73cbcbf036d747d3d6d9f74f3ca151242a7ef6d4ef2addf473b7"
            },
            "downloads": -1,
            "filename": "fortilib-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d8d2528a9b092e89d147f5a147502ec",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 40154,
            "upload_time": "2024-01-17T07:48:08",
            "upload_time_iso_8601": "2024-01-17T07:48:08.227426Z",
            "url": "https://files.pythonhosted.org/packages/9c/cb/01823078868177f18ce5755a82f2b584200bd2eae8892944dc76cd830bcf/fortilib-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3556dbd59d13bfdae58624f2990ebc7abc7ff24a2507777f092f634b80d2f806",
                "md5": "863a4e810b76ecb6083d62a7ec918677",
                "sha256": "5ae3ee4632925dd099e83df481583f9e3f1955c4b27c21ec894f3e82bb2f0f91"
            },
            "downloads": -1,
            "filename": "fortilib-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "863a4e810b76ecb6083d62a7ec918677",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 31929,
            "upload_time": "2024-01-17T07:48:09",
            "upload_time_iso_8601": "2024-01-17T07:48:09.984720Z",
            "url": "https://files.pythonhosted.org/packages/35/56/dbd59d13bfdae58624f2990ebc7abc7ff24a2507777f092f634b80d2f806/fortilib-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 07:48:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "telekom-mms",
    "github_project": "fortilib",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "fortilib"
}
        
Elapsed time: 0.16779s