{"id":18840229,"url":"https://github.com/maxim2266/ufw-stats","last_synced_at":"2025-04-14T07:07:10.170Z","repository":{"id":37410097,"uuid":"335624283","full_name":"maxim2266/ufw-stats","owner":"maxim2266","description":"ufw-stats: Show ufw actions since boot, with ip address information from RIPE database.","archived":false,"fork":false,"pushed_at":"2022-06-21T08:51:27.000Z","size":49,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T07:07:07.903Z","etag":null,"topics":["firewall","linux","network-analysis","python3","ripe","scripting","ufw","ufw-firewall","ufw-log"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxim2266.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-03T12:55:14.000Z","updated_at":"2025-01-28T02:09:02.000Z","dependencies_parsed_at":"2022-08-18T03:10:11.614Z","dependency_job_id":null,"html_url":"https://github.com/maxim2266/ufw-stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Fufw-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Fufw-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Fufw-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Fufw-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxim2266","download_url":"https://codeload.github.com/maxim2266/ufw-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837278,"owners_count":21169374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firewall","linux","network-analysis","python3","ripe","scripting","ufw","ufw-firewall","ufw-log"],"created_at":"2024-11-08T02:46:55.627Z","updated_at":"2025-04-14T07:07:10.122Z","avatar_url":"https://github.com/maxim2266.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ufw-stats\n\n[![License: BSD 3 Clause](https://img.shields.io/badge/License-BSD_3--Clause-yellow.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\nShow [ufw](https://wiki.archlinux.org/index.php/Uncomplicated_Firewall) actions since boot,\nwith ip address information from RIPE database. Firewall actions are sourced from `journalctl`.\n\n#### Usage:\n```\n▶ ufw-stats --help\nUsage: ufw-stats [OPTION]...\n  Show ufw actions since boot, with ip address information from RIPE database.\n\nOptions:\n  -j, --json          produce JSON optput instead of plain text\n  -o, --output=FILE   direct output to the FILE\n  -f, --follow        tail the log (continuously print new entries)\n  -n, --num-actions=N show N most recent firewall actions\n  -h, --help          show this message and exit\n```\n\n_Installation_: Just copy the `ufw-stats` file to a directory included in the `$PATH` environment variable.\n\n#### Output\n\nIn the default text mode the program produces one record per each firewall action, for example:\n```\nTS:     2021-02-02 11:01:53.494073+0000\nACTION: BLOCK\nPROTO:  UDP\nSRC:\n  SCOPE:   global\n  IF:      n/a\n  IP:      213.230.86.36\n  PORT:    29960\n  HOST:    36.64.uzpak.uz\n  NET:     213.230.86.0/24\n  NAME:    UZTELECOM-DYNAMIC-CUSTOMERS-CGN\n  DESCR:   n/a\n  COUNTRY: UZ\nDEST:\n  SCOPE:   private\n  IF:      wlp2s0\n  IP:      192.168.0.6\n  PORT:    53233\n  HOST:    m-desktop\n  NET:     192.168.0.0/24\n  NAME:    n/a\n  DESCR:   n/a\n  COUNTRY: n/a\n```\n\nIn JSON mode the output is a JSON array of records each equivalent to the above, for example\n(pretty-printed for readability):\n```JSON\n{\n  \"SRC\": {\n    \"IP\": \"213.230.86.36\",\n    \"SCOPE\": [\n      \"global\"\n    ],\n    \"HOST\": \"36.64.uzpak.uz\",\n    \"NAME\": \"UZTELECOM-DYNAMIC-CUSTOMERS-CGN\",\n    \"NET\": \"213.230.86.0/24\",\n    \"COUNTRY\": \"UZ\",\n    \"PORT\": 29960\n  },\n  \"DST\": {\n    \"IP\": \"192.168.0.6\",\n    \"SCOPE\": [\n      \"private\"\n    ],\n    \"HOST\": \"m-desktop\",\n    \"NET\": \"192.168.0.0/24\",\n    \"IF\": \"wlp2s0\",\n    \"PORT\": 53233\n  },\n  \"PROTO\": \"UDP\",\n  \"TS\": \"2021-02-02T11:01:53.494073+0000\",\n  \"ACTION\": \"BLOCK\"\n}\n```\n\n#### Status\nTested on Linux Mint 20.1 with ufw v0.36 and Python 3.8.5.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxim2266%2Fufw-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxim2266%2Fufw-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxim2266%2Fufw-stats/lists"}