{"id":15296013,"url":"https://github.com/sjinks/express-ip-filter-middleware","last_synced_at":"2025-10-06T00:55:03.205Z","repository":{"id":36968700,"uuid":"267116618","full_name":"sjinks/express-ip-filter-middleware","owner":"sjinks","description":"Express middleware for access control using IP / CIDR lists","archived":false,"fork":false,"pushed_at":"2025-10-02T16:37:46.000Z","size":3106,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-02T18:30:17.139Z","etag":null,"topics":["access","access-control","express","express-js","express-middleware","expressjs","filter","ip","ip-address","middleware"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/express-ip-filter-middleware","language":"TypeScript","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/sjinks.png","metadata":{"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"]},"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-26T18:08:36.000Z","updated_at":"2025-10-02T16:37:49.000Z","dependencies_parsed_at":"2023-12-28T03:06:09.467Z","dependency_job_id":"a4ee1e2b-f8b4-4049-9b9a-a973eb2f4194","html_url":"https://github.com/sjinks/express-ip-filter-middleware","commit_stats":{"total_commits":426,"total_committers":9,"mean_commits":"47.333333333333336","dds":0.619718309859155,"last_synced_commit":"80fce60522b81b2e449fe423fb604db8f77c9885"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/sjinks/express-ip-filter-middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fexpress-ip-filter-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fexpress-ip-filter-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fexpress-ip-filter-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fexpress-ip-filter-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/express-ip-filter-middleware/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fexpress-ip-filter-middleware/sbom","scorecard":{"id":346694,"data":{"date":"2025-08-11","repo":{"name":"github.com/sjinks/express-ip-filter-middleware","commit":"dcd8768c486171b4448e8a2288f02821a936be57"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.5,"checks":[{"name":"Maintained","score":10,"reason":"30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","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":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","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":"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":"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":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:  19 out of  19 GitHub-owned GitHubAction dependencies pinned","Info:   3 out of   3 third-party GitHubAction dependencies pinned","Info:   5 out of   5 npmCommand 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":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/build-test.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/build-test.yml:37","Info: jobLevel 'contents' permission set to 'read': .github/workflows/build-test.yml:58","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:18","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:19","Info: jobLevel 'contents' permission set to 'read': .github/workflows/npm-publish.yml:46","Warn: jobLevel 'statuses' permission set to 'write': .github/workflows/npm-publish.yml:47","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/push-tag.yml:41","Info: topLevel 'contents' permission set to 'read': .github/workflows/build-test.yml:10","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/npm-publish.yml:10","Info: topLevel 'contents' permission set to 'read': .github/workflows/package-audit.yml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/push-tag.yml:9"],"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":2,"reason":"badge detected: InProgress","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":"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: MIT License: 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 'master'"],"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":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":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (27) 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-18T07:12:57.281Z","repository_id":36968700,"created_at":"2025-08-18T07:12:57.281Z","updated_at":"2025-08-18T07:12:57.281Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278542671,"owners_count":26004061,"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-05T02:00:06.059Z","response_time":54,"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":["access","access-control","express","express-js","express-middleware","expressjs","filter","ip","ip-address","middleware"],"created_at":"2024-09-30T18:08:57.783Z","updated_at":"2025-10-06T00:55:03.199Z","avatar_url":"https://github.com/sjinks.png","language":"TypeScript","readme":"# express-ip-filter-middleware\n\n[![Build \u0026 Test](https://github.com/sjinks/express-ip-filter-middleware/actions/workflows/build-test.yml/badge.svg)](https://github.com/sjinks/express-ip-filter-middleware/actions/workflows/build-test.yml)\n[![CodeQL](https://github.com/sjinks/express-ip-filter-middleware/actions/workflows/codeql.yml/badge.svg)](https://github.com/sjinks/express-ip-filter-middleware/actions/workflows/codeql.yml)\n\nExpress middleware for access control using IP / CIDR lists.\n\n## Installation\n\n```bash\nnpm install express-ip-filter-middleware \n```\n\n## Usage\n\n```typescript\nimport { BlockList } from 'node:net';\nimport express from 'express';\nimport { ipFilterMiddleware } from 'express-ip-filter-middleware';\n\nconst allow = new BlockList();\nallow.addSubnet('192.168.0.0', 16);\n\nconst deny = new BlockList();\ndeny.addAddress('192.168.0.1');\n\nconst options = {\n    mode: 'whitelist',\n    allow,\n    deny,\n};\n\nconst app = express();\napp.use(ipFilterMiddleware(options))\n```\n\n`express-ip-filter-middleware` generates a middleware that allows or blocks access per the specified options.\n\nOptions is an object with the following fields:\n  * `mode: 'whitelist' | 'blacklist'` (**required**): operation mode. In `blacklist` mode, everything is allowed except for the explicitly blacklisted items (specified in `deny`), unless overridden by `allow`. In `whitelist` mode, everything is forbidden except for explicitly allowed items (specified in `allow`), unless overridden by `deny`;\n  * `allow: net.BlockList`: optional list of the allowed addresses;\n  * `deny: net.BlockList`: optional list of the denied addresses;\n  * `ipOverride: (req: express.Request) =\u003e string | undefined`: optional function to retrieve the IP address to check. If this function is not specified, `req.ip` is used. If this function returns an invalid IP address, the middleware bails out with an error.\n\nThe mode of operation is similar to Apache's `mod_access` `Order` directive: `whitelist` works like `Order Allow,Deny`: to allow access, the IP address must match the `allow` list, and must not be listed in the `deny` list. Consequently, empty `allow` and `deny` in `allow` mode will result in denied access.\n\n`blacklist` mode works like `Order Deny,Allow`: the request is allowed if the IP address is listed in the `allow` list *or* not listed in the `deny` list.\n","funding_links":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fexpress-ip-filter-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fexpress-ip-filter-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fexpress-ip-filter-middleware/lists"}