{"id":39838617,"url":"https://github.com/gonetx/ipset","last_synced_at":"2026-01-18T13:24:23.993Z","repository":{"id":38354292,"uuid":"329515697","full_name":"gonetx/ipset","owner":"gonetx","description":"Golang wrapper of ipset.","archived":false,"fork":false,"pushed_at":"2023-05-19T15:56:58.000Z","size":68,"stargazers_count":24,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T06:47:18.250Z","etag":null,"topics":["go","golang","gonetx","ipset","tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gonetx.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-14T05:23:10.000Z","updated_at":"2023-07-18T17:10:51.000Z","dependencies_parsed_at":"2024-06-19T06:11:28.095Z","dependency_job_id":"30c27da1-745a-419a-95d0-63d6802562fd","html_url":"https://github.com/gonetx/ipset","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gonetx/ipset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonetx%2Fipset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonetx%2Fipset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonetx%2Fipset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonetx%2Fipset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gonetx","download_url":"https://codeload.github.com/gonetx/ipset/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonetx%2Fipset/sbom","scorecard":{"id":435254,"data":{"date":"2025-08-11","repo":{"name":"github.com/gonetx/ipset","commit":"dfec198506afc06f4c1042da34f32f6bcebe425a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 2/12 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/linter.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/gonetx/ipset/linter.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/linter.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/gonetx/ipset/linter.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/security.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/gonetx/ipset/security.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/security.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/gonetx/ipset/security.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/gonetx/ipset/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/gonetx/ipset/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/gonetx/ipset/test.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/linter.yml:1","Warn: no topLevel permission defined: .github/workflows/security.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T04:28:15.414Z","repository_id":38354292,"created_at":"2025-08-19T04:28:15.414Z","updated_at":"2025-08-19T04:28:15.414Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T13:04:05.990Z","status":"ssl_error","status_checked_at":"2026-01-18T13:01:44.092Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","golang","gonetx","ipset","tools"],"created_at":"2026-01-18T13:24:23.548Z","updated_at":"2026-01-18T13:24:23.980Z","avatar_url":"https://github.com/gonetx.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gonetx/ipset\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/gonetx/ipset?tab=doc\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%F0%9F%93%9A%20godoc-pkg-00ACD7.svg?color=00ACD7\u0026style=flat\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/gonetx/ipset\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%F0%9F%93%9D%20goreport-A%2B-75C46B\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/gonetx/ipset\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/gonetx/ipset/branch/main/graph/badge.svg?token=05UN78X11O\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/gonetx/ipset/actions?query=workflow%3ASecurity\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/gonetx/ipset/Security?label=%F0%9F%94%91%20gosec\u0026style=flat\u0026color=75C46B\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/gonetx/ipset/actions?query=workflow%3ATest\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/gonetx/ipset/Test?label=%F0%9F%A7%AA%20tests\u0026style=flat\u0026color=75C46B\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/gonetx/ipset/blob/main/README_zh-CN.md\"\u003e\n      \u003cimg height=\"20px\" src=\"https://img.shields.io/badge/CN-flag.svg?color=555555\u0026style=flat\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjAwIDgwMCIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KPHBhdGggZmlsbD0iI2RlMjkxMCIgZD0ibTAsMGgxMjAwdjgwMGgtMTIwMHoiLz4NCjxwYXRoIGZpbGw9IiNmZmRlMDAiIGQ9Im0tMTYuNTc5Niw5OS42MDA3bDIuMzY4Ni04LjEwMzItNi45NTMtNC43ODgzIDguNDM4Ni0uMjUxNCAyLjQwNTMtOC4wOTI0IDIuODQ2Nyw3Ljk0NzkgOC40Mzk2LS4yMTMxLTYuNjc5Miw1LjE2MzQgMi44MTA2LDcuOTYwNy02Ljk3NDctNC43NTY3LTYuNzAyNSw1LjEzMzF6IiB0cmFuc2Zvcm09Im1hdHJpeCg5LjkzMzUyIC4yNzc0NyAtLjI3NzQ3IDkuOTMzNTIgM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ility. It allows `Golang` programs to easily manipulate `ipset`.\n\nVisit [http://ipset.netfilter.org/ipset.man.html](http://ipset.netfilter.org/ipset.man.html) for more `ipset` command details. And `ipset` requires version `v6.0+`.\n\n## Installation\nInstall `ipset` using the `go get` command:\n```bash\ngo get -u github.com/gonetx/ipset\n```\n\n## Quickstart\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/gonetx/ipset\"\n)\n\nfunc init() {\n\tif err := ipset.Check(); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\t// create test set even it's exist\n\tset, _ := ipset.New(\"test\", ipset.HashIp, ipset.Exist(true), ipset.Timeout(time.Hour))\n\t// output: test\n\tlog.Println(set.Name())\n\n\t_ = set.Flush()\n\n\t_ = set.Add(\"1.1.1.1\", ipset.Timeout(time.Hour))\n\n\tok, _ := set.Test(\"1.1.1.1\")\n\t// output: true\n\tlog.Println(ok)\n\n\tok, _ = set.Test(\"1.1.1.2\")\n\t// output: false\n\tlog.Println(ok)\n\n\tinfo, _ := set.List()\n\t// output: \u0026{test hash:ip 4 family inet hashsize 1024 maxelem 65536 timeout 3600 216 0 [1.1.1.1 timeout 3599]}\n\tlog.Println(info)\n\n\t_ = set.Del(\"1.1.1.1\")\n\n\t_ = set.Destroy()\n}\n```\n\n## Check\nBefore using this library, you should remember always to call `ipset.Check` first and handle the error. This method will check if `ipset` is in `OS PATH` and if its version is valid.\n\n```go\nfunc init() {\n\t// err will be ipset.ErrNotFound\n\t// or ipset.ErrVersionNotSupported\n\t// if check failed.\n\tif err := ipset.Check(); err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n## New\nUse `ipset.New` to create a set identified with setname and specified set type. If the `ipset.Exist` option is specified, `ipset` will ignore the error when the same set (setname and create parameters are identical) already exists.\n\n```go\nset, _ := ipset.New(\"test\", ipset.HashIp, ipset.Exist(true), ipset.Netmask(24))\n```\n\nEvery set type may has different create options, visit [SetType](https://pkg.go.dev/github.com/gonetx/ipset?tab=doc#SetType) and [Option](https://pkg.go.dev/github.com/gonetx/ipset?tab=doc#Option) for more details.\n\nOnce you created a set, you can use these methods:\n```go\n// IPSet is abstract of ipset\ntype IPSet interface {\n\t// List dumps header data and the entries for the set to an\n\t// *Info instance. The Resolve option can be used to force\n\t// action lookups(which may be slow).\n\tList(options ...Option) (*Info, error)\n\n\t// List dumps header data and the entries for the set to the\n\t// specific file. The Resolve option can be used to force\n\t// action lookups(which may be slow).\n\tListToFile(filename string, options ...Option) error\n\n\t// Name returns the set's name\n\tName() string\n\n\t// Rename the set's action and the new action must not exist.\n\tRename(newName string) error\n\n\t// Add adds a given entry to the set. If the Exist option is\n\t// specified, ipset ignores the error if the entry already\n\t// added to the set.\n\tAdd(entry string, options ...Option) error\n\n\t// Del deletes an entry from a set. If the Exist option is\n\t// specified and the entry is not in the set (maybe already\n\t// expired), then the command ignores the error.\n\tDel(entry string, options ...Option) error\n\n\t// Test tests whether an entry is in a set or not.\n\tTest(entry string) (bool, error)\n\n\t// Flush flushed all entries from the the set.\n\tFlush() error\n\n\t// Destroy removes the set from kernel.\n\tDestroy() error\n\n\t// Save dumps the set data to a io.Reader in a format that restore\n\t// can read.\n\tSave(options ...Option) (io.Reader, error)\n\n\t// SaveToFile dumps the set data to s specific file in a format\n\t// that restore can read.\n\tSaveToFile(filename string, options ...Option) error\n\n\t// Restore restores a saved session from io.Reader generated by\n\t// save. Set exist to true to ignore exist error.\n\tRestore(r io.Reader, exist ...bool) error\n\n\t// RestoreFromFile restores a saved session from a specific file\n\t// generated by save. Set exist to true to ignore exist error.\n\tRestoreFromFile(filename string, exist ...bool) error\n}\n```\n\n## Swap\nUse `ipset.Swap` to swap the content of two sets, or in another words, exchange the action of two sets. The referred sets must exist and compatible type of sets can be swapped only. \n\n```go\nipset.Swap(\"foo\", \"bar\")\n```\n## Flush\nUse `ipset.Flush` to flush all entries from the specified set or flush all sets if none is given.\n\n```go\n// Flush foo and bar set\nipset.Flush(\"foo\", \"bar\")\n\n// Flush all\nipset.Flush()\n```\n\n## Destroy\nUse `ipset.Destroy` to removes the specified set or all the sets if none is given. If the set has got reference(s), nothing is done and no set destroyed.\n\n```go\n// Destroy foo and bar set\nipset.Destroy(\"foo\", \"bar\")\n\n// Destroy all\nipset.Destroy()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgonetx%2Fipset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgonetx%2Fipset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgonetx%2Fipset/lists"}