{"id":19529151,"url":"https://github.com/riverside/php-waf","last_synced_at":"2025-04-26T11:34:18.743Z","repository":{"id":62536066,"uuid":"194306473","full_name":"riverside/php-waf","owner":"riverside","description":":guardsman: PHP Web Application Firewall","archived":false,"fork":false,"pushed_at":"2024-09-07T20:13:40.000Z","size":80,"stargazers_count":30,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T09:40:56.309Z","etag":null,"topics":["firewall","php","php-firewall","waf","web-application-firewall","webapp-firewall"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/riverside.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.paypal.me/Dimitar81"}},"created_at":"2019-06-28T16:53:34.000Z","updated_at":"2024-12-19T21:33:29.000Z","dependencies_parsed_at":"2022-11-02T15:03:20.849Z","dependency_job_id":"b93968d2-e359-481b-b72f-78264714fb21","html_url":"https://github.com/riverside/php-waf","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"be68f7bd41403c651366ad621d27b94da360546a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riverside%2Fphp-waf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riverside%2Fphp-waf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riverside%2Fphp-waf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riverside%2Fphp-waf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riverside","download_url":"https://codeload.github.com/riverside/php-waf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250981462,"owners_count":21517851,"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","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":["firewall","php","php-firewall","waf","web-application-firewall","webapp-firewall"],"created_at":"2024-11-11T01:22:15.901Z","updated_at":"2025-04-26T11:34:17.891Z","avatar_url":"https://github.com/riverside.png","language":"PHP","funding_links":["https://www.paypal.me/Dimitar81"],"categories":[],"sub_categories":[],"readme":"# php-waf\nPHP Web Application Firewall\n\n| Build | Stable | License |\n| --- | --- | --- |\n| [![CI][x1]][y1] | [![Latest Stable Version][x2]][y2] | [![License][x3]][y3] |\n\n### Requirements\n- PHP \u003e= 7.0\n\n### Installation\nIf Composer is not installed on your system yet, you may go ahead and install it using this command line:\n```\n$ curl -sS https://getcomposer.org/installer | php\n```\nNext, add the following require entry to the \u003ccode\u003ecomposer.json\u003c/code\u003e file in the root of your project.\n```json\n{\n    \"require\" : {\n        \"riverside/php-waf\" : \"^2.0\"\n    }\n}\n```\nFinally, use Composer to install php-waf and its dependencies:\n```\n$ php composer.phar install \n```\n### How to use\n1. Configure your web server\n    - Apache\n    ```apacheconfig\n    php_value auto_prepend_file \"/path/to/waf.php\"\n    ```\n    - Nginx\n    ```\n    fastcgi_param PHP_VALUE \"auto_prepend_file=/path/to/waf.php\";\n    ```\n2. Create an Firewall instance \n    - waf.php\n    ```php\n    \u003c?php\n    $waf = new \\Riverside\\Waf\\Firewall();\n    $waf-\u003erun();\n    ```\n\n### Available filters\n| Filter             | Description           |\n| ------------------ | --------------------- |\n| Sql                | SQL Injection         |\n| Crlf               | CRLF Injection        |\n| Xss                | Cross-site Scripting  |\n| Xml                | XML Attacks           |\n\n### Migration Guide to Version 2.0.0\n##### What's changed\nIn version 2.0.0, I have made the following updates to improve consistency and adherence to PHP best practices:\n1. Namespace renamed\n    - Old namespace: `PhpWaf`\n    - New namespace: `Riverside\\Waf`\n2. Class names renamed\n    - Old names:\n      - `src/Filter/CRLF.php` (Class `CRLF`)\n      - `src/Filter/SQL.php` (Class `SQL`)\n      - `src/Filter/XML.php` (Class `XML`)\n      - `src/Filter/XSS.php` (Class `XSS`)\n      - `src/BaseFilter.php` (Class `BaseFilter`)\n    - New names:\n      - `src/Filter/Crlf.php` (Class `Crlf`)\n      - `src/Filter/Sql.php` (Class `Sql`)\n      - `src/Filter/Xml.php` (Class `Xml`)\n      - `src/Filter/Xss.php` (Class `Xss`)\n      - `src/AbstractFilter.php` (Class `AbstractFilter`)\n\n##### How to update your codebase\n1. Update class imports:\n    - Old way:\n      - `use PhpWaf\\Firewall;`\n      - `use PhpWaf\\Filter\\CRLF;`\n      - `use PhpWaf\\Filter\\SQL;`\n      - `use PhpWaf\\Filter\\XML;`\n      - `use PhpWaf\\Filter\\XSS;`\n    - New way:\n      - `use Riverside\\Waf\\Firewall;`\n      - `use Riverside\\Waf\\Filter\\Crlf;`\n      - `use Riverside\\Waf\\Filter\\Sql;`\n      - `use Riverside\\Waf\\Filter\\Xml;`\n      - `use Riverside\\Waf\\Filter\\Xss;`\n\n[x1]: https://github.com/riverside/php-waf/actions/workflows/test.yml/badge.svg\n[y1]: https://github.com/riverside/php-waf/actions/workflows/test.yml\n[x2]: https://poser.pugx.org/riverside/php-waf/v/stable\n[y2]: https://packagist.org/packages/riverside/php-waf\n[x3]: https://poser.pugx.org/riverside/php-waf/license\n[y3]: https://packagist.org/packages/riverside/php-waf","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friverside%2Fphp-waf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friverside%2Fphp-waf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friverside%2Fphp-waf/lists"}