{"id":18464291,"url":"https://github.com/projectdiscovery/networkpolicy","last_synced_at":"2026-05-17T02:20:54.688Z","repository":{"id":38012393,"uuid":"356228139","full_name":"projectdiscovery/networkpolicy","owner":"projectdiscovery","description":"Network Policy Helper","archived":false,"fork":false,"pushed_at":"2026-03-19T12:34:57.000Z","size":191,"stargazers_count":30,"open_issues_count":1,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-03-20T05:31:50.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectdiscovery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-09T10:18:25.000Z","updated_at":"2026-03-19T12:35:02.000Z","dependencies_parsed_at":"2024-01-07T21:30:39.747Z","dependency_job_id":"15f3202b-a697-44eb-a6fc-4e9232ea46ce","html_url":"https://github.com/projectdiscovery/networkpolicy","commit_stats":{"total_commits":51,"total_committers":6,"mean_commits":8.5,"dds":0.5294117647058824,"last_synced_commit":"5a7657e52430166c5cd16fefb23c57e8799df936"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/projectdiscovery/networkpolicy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fnetworkpolicy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fnetworkpolicy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fnetworkpolicy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fnetworkpolicy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectdiscovery","download_url":"https://codeload.github.com/projectdiscovery/networkpolicy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fnetworkpolicy/sbom","scorecard":{"id":746573,"data":{"date":"2025-08-11","repo":{"name":"github.com/projectdiscovery/networkpolicy","commit":"e9e31d77871867a960093205a3afc21baf240620"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.5,"checks":[{"name":"Code-Review","score":-1,"reason":"Found no human activity in the last 19 changesets","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":"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":"Maintained","score":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:14","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:15","Warn: no topLevel permission defined: .github/workflows/autorelease-gh.yml:1","Warn: no topLevel permission defined: .github/workflows/build-test.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/lint-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":"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":"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/autorelease-gh.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/autorelease-gh.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/autorelease-gh.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/autorelease-gh.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autorelease-gh.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/autorelease-gh.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/build-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/build-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dep-auto-merge.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/dep-auto-merge.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/dep-auto-merge.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/dep-auto-merge.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/lint-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/lint-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint-test.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/networkpolicy/lint-test.yml/main?enable=pin","Info:   0 out of  11 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":"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.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md: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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/projectdiscovery/.github/SECURITY.md:1","Info: Found linked content: github.com/projectdiscovery/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/projectdiscovery/.github/SECURITY.md:1","Info: Found text in security policy: github.com/projectdiscovery/.github/SECURITY.md:1"],"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":"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"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 30 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"}}]},"last_synced_at":"2025-08-22T18:56:58.075Z","repository_id":38012393,"created_at":"2025-08-22T18:56:58.075Z","updated_at":"2025-08-22T18:56:58.075Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: 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":[],"created_at":"2024-11-06T09:09:22.255Z","updated_at":"2026-04-01T22:31:50.114Z","avatar_url":"https://github.com/projectdiscovery.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# networkpolicy\n\n[![License](https://img.shields.io/github/license/projectdiscovery/networkpolicy)](LICENSE.md)\n![Go version](https://img.shields.io/github/go-mod/go-version/projectdiscovery/networkpolicy?filename=go.mod)\n[![Release](https://img.shields.io/github/release/projectdiscovery/networkpolicy)](https://github.com/projectdiscovery/networkpolicy/releases/)\n[![Checks](https://github.com/projectdiscovery/networkpolicy/actions/workflows/build-test.yml/badge.svg)](https://github.com/projectdiscovery/networkpolicy/actions/workflows/build-test.yml)\n[![GoDoc](https://pkg.go.dev/badge/projectdiscovery/networkpolicy)](https://pkg.go.dev/github.com/projectdiscovery/networkpolicy)\n\n\n\nThe package acts as an embeddable configurable container handling allow/deny verdicts over a series of conditions including\n- IPs\n- CIDRs\n- Ports\n- Schemes (eg `https, http, ftp`)\n\n## General usage as allow/deny\nThe following program prevents the http client to follow targets belonging to the deny list:\n\nExample - General allow/deny list\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/projectdiscovery/networkpolicy\"\n)\n\nfunc main() {\n\tvar npOptions networkpolicy.Options\n\t// deny connections to localhost\n\tnpOptions.DenyList = append(npOptions.DenyList, \"127.0.0.0/8\")\n\n\tnp, err := networkpolicy.New(npOptions)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tcustomRedirectHandler := func(req *http.Request, via []*http.Request) error {\n\t\t// if at least one address is valid we follow the redirect\n\t\tif _, ok := np.ValidateHost(req.Host); ok {\n\t\t\treturn nil\n\t\t}\n\t\treturn errors.New(\"redirected to a forbidden target\")\n\t}\n\n\tclient := \u0026http.Client{\n\t\tCheckRedirect: customRedirectHandler,\n\t}\n\treq, err := http.NewRequest(http.MethodGet, \"http://yourtarget\", nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(resp)\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fnetworkpolicy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectdiscovery%2Fnetworkpolicy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fnetworkpolicy/lists"}