{"id":31778709,"url":"https://github.com/mweinelt/nft-prefix-import","last_synced_at":"2025-10-10T06:56:14.402Z","repository":{"id":311705091,"uuid":"1044658445","full_name":"mweinelt/nft-prefix-import","owner":"mweinelt","description":"Populate nftables sets with prefixes for selected autonomous systems","archived":false,"fork":false,"pushed_at":"2025-08-27T23:50:07.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-14T18:09:04.846Z","etag":null,"topics":["abuse","bgp","network","nftables"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mweinelt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"zenodo":null}},"created_at":"2025-08-26T02:55:11.000Z","updated_at":"2025-08-27T23:50:10.000Z","dependencies_parsed_at":"2025-08-26T05:26:45.094Z","dependency_job_id":"792c5fd8-6c34-459d-b059-3e30ab087112","html_url":"https://github.com/mweinelt/nft-prefix-import","commit_stats":null,"previous_names":["mweinelt/nft-prefix-import"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mweinelt/nft-prefix-import","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweinelt%2Fnft-prefix-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweinelt%2Fnft-prefix-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweinelt%2Fnft-prefix-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweinelt%2Fnft-prefix-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mweinelt","download_url":"https://codeload.github.com/mweinelt/nft-prefix-import/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mweinelt%2Fnft-prefix-import/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002975,"owners_count":26083491,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["abuse","bgp","network","nftables"],"created_at":"2025-10-10T06:56:09.724Z","updated_at":"2025-10-10T06:56:14.393Z","avatar_url":"https://github.com/mweinelt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nft-prefix-import\n\nTool to import prefixes for whole autonomous systems into nftables sets for\nefficient matching in subsequent firewalling decisions.\n\n## Usage\n\nTo use `nft-prefix-import` we source routing information from\n\u003chttps://bgp.tools\u003e. The terms say to not request data more often than every\ntwo hours and to provide a useful user-agent where you can be contacted.\n\nTo that end the tool caches the downloaded routing information and reuses\nthe information for up to two hours before requesting new data.\n\n```shell\n$ nft-prefix-import --help\nUsage: nft-prefix-import [OPTIONS] AUTNUMS...\n\nArguments:\n  AUTNUMS...  List of autonomous systems (AS) numbers  [required]\n\nOptions:\n  --user-agent TEXT  [env var: USER_AGENT; required]\n  --table TEXT       Table in nftables to target  [default: filter]\n  --ipv4set TEXT     Set for IPv4 prefixes  [default: ipv4prefixes]\n  --ipv6set TEXT     Set for IPv6 prefixes  [default: ipv6prefixes]\n  --help             Show this message and exit.\n```\n\n## Example\n\nThe following example shows a possible nftables structure, that works with the default settings.\n\n```nft\ntable inet filter {\n  set ipv4prefixes {\n    type ipv4_addr;\n    flags interval, timeout;\n    auto-merge;\n    timeout 12h;\n  }\n  set ipv6prefixes {\n    type ipv6_addr;\n    auto-merge;\n    flags interval, timeout;\n    timeout 12h;\n  }\n  chain input {\n    type filter hook input priority filter;\n\n    # other rules here\n\n    # block access to https for selected autnums\n    ip saddr @ipv4prefixes tcp dport 443 counter drop;\n    ip6 saddr @ipv6prefixes tcp dport 443 counter drop;\n\n    # other rules here\n  }\n}\n\n```\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmweinelt%2Fnft-prefix-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmweinelt%2Fnft-prefix-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmweinelt%2Fnft-prefix-import/lists"}