{ "info": { "author": "vbs", "author_email": "vbs@springrts.de", "bugtrack_url": null, "classifiers": [], "description": "# Overview\n\nPeriodically gathers stats about iptables rules and sends them to different sinks (while currently only MQTT is supported). It is possible to count rules in chains, count number of packets/bytes processed by a rule and to count unique IPs in a ipset.\n\n# Usage\nStart `iptables_stat` and it will run constantly, generate readings periodically and publish them to configured sinks.\n\n## Configuration\nThe program is configured using a configuration file in YAML format. Default location is `/etc/iptable_stats.yml` but a different location can be configured using the command line parameter `--config`.\n\nThe config file consists of the section `general` and a variable number of configuration sections for input modules and output sinks.\n\n*Example:*\n```\ngeneral:\n interval: 120\n\nmqtt:\n host: myHost\n topic_root: home/myHost/iptables_stats\n\niptables_pkg_count:\n firehol_level1:\n chain: FIREHOL_BLACKLIST\n rule_regex: .*match-set.firehol_level3.src.*\n\n firehol_level2:\n chain: FIREHOL_BLACKLIST\n rule_regex: .*match-set.firehol_level2.src.*\n\n firehol_level3:\n chain: FIREHOL_BLACKLIST\n rule_regex: .*match-set.firehol_level3.src.*\n\nipset_count:\n firehol_level1:\n setname: firehol_level1\n\n firehol_level2:\n setname: firehol_level2\n\n firehol_level3:\n setname: firehol_level3\n\niptables_rule_count:\n f2b-traefik-auth:\n chain: f2b-traefik-auth\n offset: -1\n\n f2b-traefik-botsearch:\n chain: f2b-traefik-botsearch\n offset: -1\n```\n\nThis configuration contains three `iptables_pkg_count` objects that will report iptables counters for the rules matching the given regular expressions. Also three `ipset_count` objects that count the number of unique IPs in the ipsets `firehol_level1`, `firehol_level2` and `firehol_level3`.\nLast but not least two `iptables_rule_count` objects that count the rules in the chains `f2b-traefik-auth` and `f2b-traefik-botsearch`. `fail2ban` injects rules into these chains in case of a IP ban. Each rule represents a single IP. Both objects use an `offset` of `-1` cause both chains contain a fixed `DROP` rule that should not be counted.\n\n# Output Sinks\nCurrntly only one sink is implemented\n\n## MQTT\n\n*Example:*\n```\nmqtt:\n host: myHost\n port: 1883\n topic_root: home/myhost/iptables_stats\n```\n\n* *host*\n* *port* (optional) - defaults to 1883\n* *topic_root* - string that defines the root topic that is used for publishing readings\n\n# Reading Modules\nEvery module has a section in the configuration. In each of these sections object configurations can be defined using a user-defined object name. Every object configuration can override the gobal `interval` parameter so it is possible to configure `interval` for objects individually.\n\n## iptable_pkt_count\nReads counter statistics for a given rule and chain from `iptables` and generates the readings `packet_count` and `byte_count`. Those represent the number of blocked packets and bytes.\n\nConfiguration:\n* *chain* - Name of the chain\n* *rule_regex* - Regex that matches the rule in question. It is matched against a string as the rule appears in the output of `iptables-save`. The regex is not allowed to match more than one rule.\n\n## iptables_rule_count\nCounts the number of rules in a given chain and generates the reading `rule_count`.\n\nConfiguration:\n* *chain* - Name of the chain\n* *offset* (optional) - An integer that is added to the value before publishing. This is useful to account for rules that should be ignored. E.g. there might be a drop rule which should not account towards the value. Set `offset` to `-1` to adjust to that.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/verybadsoldier/iptables_stats", "keywords": "mqtt iptables ipset", "license": "", "maintainer": "", "maintainer_email": "", "name": "iptables-stats", "package_url": "https://pypi.org/project/iptables-stats/", "platform": "", "project_url": "https://pypi.org/project/iptables-stats/", "project_urls": { "Homepage": "https://github.com/verybadsoldier/iptables_stats" }, "release_url": "https://pypi.org/project/iptables-stats/0.9.11/", "requires_dist": [ "ipsetpy", "paho-mqtt", "python-iptables", "pyptables", "schedule", "pyyaml" ], "requires_python": ">=3.6", "summary": "Periodically gathers and publishes statistics about iptables", "version": "0.9.11" }, "last_serial": 4924063, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "1d3076819cade6390690aeaa39e5f0fe", "sha256": "17d9caf8fdd75dc074f3c754e5e59b9b4dbf7052d5db5aef80d0342dbf695b33" }, "downloads": -1, "filename": "iptables_stats-0.9.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1d3076819cade6390690aeaa39e5f0fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7186, "upload_time": "2019-03-02T14:49:56", "url": "https://files.pythonhosted.org/packages/bd/1b/1ff69526dd1c3d0d4613b6af3c973c2874fa5c897bdb1114230da9a854bb/iptables_stats-0.9.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f4da4cb031e0bbc8c2c44d063f01ee9", "sha256": "081a27e061d95c43a22c4145ec5a7fb0cd0972d60bb933390fe6d9be9f09eac3" }, "downloads": -1, "filename": "iptables_stats-0.9.0.tar.gz", "has_sig": false, "md5_digest": "9f4da4cb031e0bbc8c2c44d063f01ee9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4160, "upload_time": "2019-03-02T14:49:58", "url": "https://files.pythonhosted.org/packages/56/fb/4883e4c07a9651f432f4aa0e0fd47d0ad67ac2ba6f6c5fa0c002d8478ac0/iptables_stats-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "2b5ce268d390cdbf7b4de5683dfabbdb", "sha256": "3c315baf7e5feee72221c8a77451dc58df263e99b33c62649606b2b0b043ce14" }, "downloads": -1, "filename": "iptables_stats-0.9.1-py2-none-any.whl", "has_sig": false, "md5_digest": "2b5ce268d390cdbf7b4de5683dfabbdb", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=3.6", "size": 7192, "upload_time": "2019-03-02T15:05:41", "url": "https://files.pythonhosted.org/packages/8b/7c/db6165e9958b7f3474cd633768a84ab7cef1c5afa5211f23b1c839d12ddb/iptables_stats-0.9.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "573b88fe945455055d39c818588bcd20", "sha256": "18879c5924066022281609917c75cac7484b829094230171f27d06b44e44847d" }, "downloads": -1, "filename": "iptables_stats-0.9.1-py3-none-any.whl", "has_sig": false, "md5_digest": "573b88fe945455055d39c818588bcd20", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7191, "upload_time": "2019-03-02T15:00:56", "url": "https://files.pythonhosted.org/packages/bf/90/60f1a91be9f9a1e6d446447d379db0e27d3998c1b5ca71195949cbed9450/iptables_stats-0.9.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df4768b7c94a6a463bba25ebac725496", "sha256": "c1707001c0a7bba198866cc8a2b053fb6a489a1ccadffcedb4e91992ede3cf8a" }, "downloads": -1, "filename": "iptables_stats-0.9.1.tar.gz", "has_sig": false, "md5_digest": "df4768b7c94a6a463bba25ebac725496", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4169, "upload_time": "2019-03-02T15:00:58", "url": "https://files.pythonhosted.org/packages/75/8d/d0bc781726667aa0a4fa45022380a647081622b6e003a02aaf3c51ebcbbf/iptables_stats-0.9.1.tar.gz" } ], "0.9.10": [ { "comment_text": "", "digests": { "md5": "6abfaef0796ecf1734ef644ce5c08323", "sha256": "55a567c3fa1ce6c31bfcf7a4c14c26a49ea841d3de822d71699a10254f5dbd0c" }, "downloads": -1, "filename": "iptables_stats-0.9.10-py3-none-any.whl", "has_sig": false, "md5_digest": "6abfaef0796ecf1734ef644ce5c08323", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8047, "upload_time": "2019-03-08T13:03:56", "url": "https://files.pythonhosted.org/packages/65/dd/04dcc5e0be31cb011d4c7ff56d7a70465df491ccb9aa991dd930fdf046c2/iptables_stats-0.9.10-py3-none-any.whl" } ], "0.9.11": [ { "comment_text": "", "digests": { "md5": "958f3b448767b9d855b7397302eb6504", "sha256": "9bb4bdd5cd8c8730e0fa5dc28fcae937f1af88d6ddaf98cb231e06bc80234cd7" }, "downloads": -1, "filename": "iptables_stats-0.9.11-py3-none-any.whl", "has_sig": false, "md5_digest": "958f3b448767b9d855b7397302eb6504", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8096, "upload_time": "2019-03-11T08:58:09", "url": "https://files.pythonhosted.org/packages/ec/4f/14d5de39ead9fb696f73a491bf8f7aa6dc68b52a1c3c050a9ef31a538baa/iptables_stats-0.9.11-py3-none-any.whl" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "d10aac96e90f0c643039bd8d1beb83db", "sha256": "fecbf00f095649c0dd5789075bcad73fc017721a0052b5e3e8d0efa710c54721" }, "downloads": -1, "filename": "iptables_stats-0.9.2-py2-none-any.whl", "has_sig": false, "md5_digest": "d10aac96e90f0c643039bd8d1beb83db", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=3.6", "size": 7196, "upload_time": "2019-03-02T15:06:39", "url": "https://files.pythonhosted.org/packages/c1/4d/e46933cc7cf6a92d4feabae654b3b5187a6fbbe894dec257fff54646ec25/iptables_stats-0.9.2-py2-none-any.whl" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "030ac6a5bbf7c37c90093c806bb77cf7", "sha256": "d576d9e4188473f081ddf43053bcaa8fd498d5b2c7ee5c571fcd4911456c62aa" }, "downloads": -1, "filename": "iptables_stats-0.9.3-py2-none-any.whl", "has_sig": false, "md5_digest": "030ac6a5bbf7c37c90093c806bb77cf7", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=3.6", "size": 7194, "upload_time": "2019-03-02T15:25:54", "url": "https://files.pythonhosted.org/packages/e2/bb/8ff35a5412d57298e79cc50f3aba8bff41e774d5441695488758287d5496/iptables_stats-0.9.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bf9d10e42d679e2e6cdce8bab838a9a6", "sha256": "bf0c4afa6bc2b1fdb220c1168ccf80c392da029972dbf2f10d2b07a264a367bd" }, "downloads": -1, "filename": "iptables_stats-0.9.3.tar.gz", "has_sig": false, "md5_digest": "bf9d10e42d679e2e6cdce8bab838a9a6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4172, "upload_time": "2019-03-02T15:25:55", "url": "https://files.pythonhosted.org/packages/e6/a2/498ae50dfa02a488b1204334bcbdcd9c3814790e09049db5b7d516864c7e/iptables_stats-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "38724bf05a80f8186337298472e653b9", "sha256": "b83fe87020e9d56c07eadf3d9850ec9d73c0bf48c8e6b9ad0e8591da67d14bf4" }, "downloads": -1, "filename": "iptables_stats-0.9.4-py2-none-any.whl", "has_sig": false, "md5_digest": "38724bf05a80f8186337298472e653b9", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=3.6", "size": 7191, "upload_time": "2019-03-02T20:07:42", "url": "https://files.pythonhosted.org/packages/f3/57/042ed722087719671d586c95c5a28ff0d9b3580cb26d86db0b5971c75640/iptables_stats-0.9.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5a0cd9bf78fdce05de830d2df88d18b3", "sha256": "654035a94fb301d4024a9d1a833eb452cbc3e8195d3fe39a68c999668d4e4812" }, "downloads": -1, "filename": "iptables_stats-0.9.4.tar.gz", "has_sig": false, "md5_digest": "5a0cd9bf78fdce05de830d2df88d18b3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4175, "upload_time": "2019-03-02T20:07:44", "url": "https://files.pythonhosted.org/packages/55/c8/ee1859fd71b876e6186ea90ff20720c23b2ca84a1597bbd8542c778f364c/iptables_stats-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "f8e318b131c46561fd60b09feadb4a58", "sha256": "597a2eb0c83c648044f1a667c3aa0c57adf2d215f49d1bd88fd7bb933edaf369" }, "downloads": -1, "filename": "iptables_stats-0.9.5-py2-none-any.whl", "has_sig": false, "md5_digest": "f8e318b131c46561fd60b09feadb4a58", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=3.6", "size": 7287, "upload_time": "2019-03-02T23:07:40", "url": "https://files.pythonhosted.org/packages/26/f2/71df0a542c33cac69bf21671d631b2c9f83de0289d25a363eb762c85a9d3/iptables_stats-0.9.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b856ef13c1468ccb7922d0aaa820b40", "sha256": "c7e49fad8ea21978dbd4ff5bafba207bfa528b9c628cb4c316a3bd64d57c1682" }, "downloads": -1, "filename": "iptables_stats-0.9.5.tar.gz", "has_sig": false, "md5_digest": "6b856ef13c1468ccb7922d0aaa820b40", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4225, "upload_time": "2019-03-02T23:07:43", "url": "https://files.pythonhosted.org/packages/14/56/77790476638bc96976b67db62502ac7ba613f1ea94b346c5fa5f7d05f5d2/iptables_stats-0.9.5.tar.gz" } ], "0.9.6": [ { "comment_text": "", "digests": { "md5": "838c01ddf6ffed86fb816f2af52231a4", "sha256": "6f2a89ee2fe1424046a8c26fb8e385966df204a14ce0c7b0e24f3c72274b3c0b" }, "downloads": -1, "filename": "iptables_stats-0.9.6-py2-none-any.whl", "has_sig": false, "md5_digest": "838c01ddf6ffed86fb816f2af52231a4", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=3.6", "size": 10092, "upload_time": "2019-03-02T23:15:31", "url": "https://files.pythonhosted.org/packages/64/b3/ad4cac9b2cd69498df5666bf7aab124933c67830ce7ce63cc3d7195ea30d/iptables_stats-0.9.6-py2-none-any.whl" } ], "0.9.9": [ { "comment_text": "", "digests": { "md5": "09a85811d0304e6e4f0d06e343e9efb0", "sha256": "209915f7c1f60844e5b14c98b33315f8ddadaa8f03d71d9a5230f70c0b908ec2" }, "downloads": -1, "filename": "iptables_stats-0.9.9-py3-none-any.whl", "has_sig": false, "md5_digest": "09a85811d0304e6e4f0d06e343e9efb0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 7795, "upload_time": "2019-03-02T23:47:33", "url": "https://files.pythonhosted.org/packages/25/65/44558917fed37caebea01c725ebd0258c270d78f26a43b6ab0a8b8b8ddd5/iptables_stats-0.9.9-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "958f3b448767b9d855b7397302eb6504", "sha256": "9bb4bdd5cd8c8730e0fa5dc28fcae937f1af88d6ddaf98cb231e06bc80234cd7" }, "downloads": -1, "filename": "iptables_stats-0.9.11-py3-none-any.whl", "has_sig": false, "md5_digest": "958f3b448767b9d855b7397302eb6504", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8096, "upload_time": "2019-03-11T08:58:09", "url": "https://files.pythonhosted.org/packages/ec/4f/14d5de39ead9fb696f73a491bf8f7aa6dc68b52a1c3c050a9ef31a538baa/iptables_stats-0.9.11-py3-none-any.whl" } ] }