{"id":15051004,"url":"https://github.com/michel-leonard/fw-simple-go","last_synced_at":"2026-03-16T08:36:49.861Z","repository":{"id":249043403,"uuid":"830471239","full_name":"michel-leonard/fw-simple-go","owner":"michel-leonard","description":"This project monitors specified files for changes and processes IP addresses as a firewall according to configuration rules.","archived":false,"fork":false,"pushed_at":"2024-07-18T10:50:04.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T21:52:16.781Z","etag":null,"topics":["debian","firewall","golang","inotify","ipset","iptables","linux"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michel-leonard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-18T10:39:58.000Z","updated_at":"2024-07-18T10:50:07.000Z","dependencies_parsed_at":"2024-07-18T13:22:29.033Z","dependency_job_id":"f90dcb8d-e8f3-4db2-b809-7fc450262b28","html_url":"https://github.com/michel-leonard/fw-simple-go","commit_stats":null,"previous_names":["michel-leonard/fw-simple-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michel-leonard%2Ffw-simple-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michel-leonard%2Ffw-simple-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michel-leonard%2Ffw-simple-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michel-leonard%2Ffw-simple-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michel-leonard","download_url":"https://codeload.github.com/michel-leonard/fw-simple-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243511365,"owners_count":20302549,"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":["debian","firewall","golang","inotify","ipset","iptables","linux"],"created_at":"2024-09-24T21:30:14.788Z","updated_at":"2025-12-28T09:21:40.916Z","avatar_url":"https://github.com/michel-leonard.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# Simple Firewall\r\n\r\n[ChatGPT](https://chatgpt.com) helped me.\r\n  \r\n## Overview\r\n\r\nThis project monitors specified files for changes and processes IP addresses according to configuration rules. The software configures **ipset** and **iptables** if the configuration does not already exist. When a regular expression in the configuration file matches a new line in the log file, it captures the IP address and updates the ipset accordingly to :\r\n- **accept** an IP\r\n- **reject** an IP using, depending on the configuration, a bitmask and a timeout\r\n\r\nThe default configuration works with IPv4 on a Debian server, iptables, ipset, and **inotify** must be installed beforehand.\r\n\r\n## Configuration\r\n\r\nConfiguration is provided in a JSON file with the following structure:\r\n\r\n````json\r\n{\r\n  \"firewall-name\": \"fw-simple\",\r\n  \"path-iptables-ipset\": \"/sbin:/usr/sbin\",\r\n  \"reject-timeout\": 7200,\r\n  \"reject-bitmask-length\": 24,\r\n  \"files\": {\r\n    \"/var/log/log-file-1\": {\r\n      \"accept\": [ \"regex accepting (__IP__) in file 1\" ],\r\n      \"reject\": [  \"regex rejecting (__IP__) in file 1\"]\r\n    },\r\n    \"/var/log/log-file-2\": {\r\n      \"accept\": [ \"regex accepting (__IP__) in file 2\" ],\r\n      \"reject\": [  \"regex rejecting (__IP__) in file 2\"]\r\n    }\r\n  }\r\n}\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichel-leonard%2Ffw-simple-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichel-leonard%2Ffw-simple-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichel-leonard%2Ffw-simple-go/lists"}