{"id":24178801,"url":"https://github.com/reloadly/http-firewall","last_synced_at":"2025-09-21T00:31:17.721Z","repository":{"id":65414352,"uuid":"591834627","full_name":"Reloadly/http-firewall","owner":"Reloadly","description":"Lightweight Http Firewall to protect against common threats","archived":false,"fork":false,"pushed_at":"2023-02-16T09:18:13.000Z","size":69,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-07T02:20:48.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Reloadly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-01-22T02:35:46.000Z","updated_at":"2023-01-31T23:51:20.000Z","dependencies_parsed_at":"2025-05-29T03:37:48.048Z","dependency_job_id":"dcd8bed0-5c40-441a-965b-d524bb89bc7e","html_url":"https://github.com/Reloadly/http-firewall","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Reloadly/http-firewall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloadly%2Fhttp-firewall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloadly%2Fhttp-firewall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloadly%2Fhttp-firewall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloadly%2Fhttp-firewall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Reloadly","download_url":"https://codeload.github.com/Reloadly/http-firewall/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reloadly%2Fhttp-firewall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276179271,"owners_count":25598565,"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-09-20T02:00:10.207Z","response_time":63,"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":[],"created_at":"2025-01-13T05:13:42.987Z","updated_at":"2025-09-21T00:31:17.435Z","avatar_url":"https://github.com/Reloadly.png","language":"TypeScript","readme":"[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Build Status](https://github.com/Reloadly/http-firewall/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/Reloadly/http-firewall/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/Reloadly/http-firewall/branch/main/graph/badge.svg?token=E605JYZ763)](https://codecov.io/gh/Reloadly/http-firewall)\n[![Issues](https://img.shields.io/github/issues/Reloadly/http-firewall.svg)](https://github.com/Reloadly/http-firewall/issues)\n[![Latest Release](https://img.shields.io/github/v/release/Reloadly/http-firewall?include_prereleases\u0026sort=semver)](https://github.com/Reloadly/http-firewall/releases)\n\n# http-firewall\n\nLightweight Http Firewall to protect against common threats.\n\nThis is a direct port of\nthe [Spring Security HttpFirewall](https://docs.spring.io/spring-security/reference/servlet/exploits/firewall.html).\n\n- This library is a middleware for Express Server.\n- Its highly recommended not to disable firewall rules, since its extremely risky to do so. You can however provided\n  your own overrides that gives you the options of disable rules or provide your own constraints.\n- If a threat is detected, a HTTP status code 403 is returned to the caller, and no further processing happens.\n- Calls which pass the firewall rules, will process as normal.\n\n## Examples ##\n\nThe firewall can be configured as shown below:\n\n### TypeScript Usage ###\n\n```typescript\nimport express, { Request, Response } from 'express';\nimport { HttpFirewallOptions, Predicate, httpFirewall } from '@prizemates/http-firewall';\n\nconst app = express();\nconst port = 3000;\n\n// This middleware must be added before adding any other routes\napp.use(httpFirewall())\n// Or, you can customize the behaviour by providing options. See HttpFirewallOptions\n// app.use(httpFirewall({logToConsole : true}));\n\napp.get('/', (req: Request, res: Response) =\u003e {\n  res.send('Http Firewall Demo running');\n});\n\napp.listen(port, () =\u003e {\n  console.log(`⚡️[server]: Server is running at http://localhost:${port}`);\n});\n```\n\n### Javascript Usage ###\n\n```javascript\nconst express = require(\"express\");\nconst { httpFirewall } = require(\"@prizemates/http-firewall\");\n\nconst app = express();\nconst port = 3000;\n\napp.use(httpFirewall())\n// Or, you can customize the behaviour by providing options. See HttpFirewallOptions\n// app.use(httpFirewall({logToConsole : true}));\n\napp.get('/', (req: Request, res: Response) =\u003e {\n  res.send('Http Firewall Demo running');\n});\n\napp.listen(port, () =\u003e {\n  console.log(`⚡️[server]: Server is running at http://localhost:${port}`);\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freloadly%2Fhttp-firewall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freloadly%2Fhttp-firewall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freloadly%2Fhttp-firewall/lists"}