{"id":24856698,"url":"https://github.com/secondtruth/gatekeeper","last_synced_at":"2025-09-14T19:21:17.476Z","repository":{"id":30271474,"uuid":"33822927","full_name":"secondtruth/gatekeeper","owner":"secondtruth","description":"🛡️ Protect websites from spam and other attacks","archived":false,"fork":false,"pushed_at":"2024-05-18T00:46:02.000Z","size":278,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-06T20:58:00.282Z","etag":null,"topics":["access-control","composer","firewall","php","protect-websites","protection","spam-prevention","web"],"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/secondtruth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-12T15:48:29.000Z","updated_at":"2025-08-16T21:52:51.000Z","dependencies_parsed_at":"2023-01-14T16:39:42.415Z","dependency_job_id":null,"html_url":"https://github.com/secondtruth/gatekeeper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/secondtruth/gatekeeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgatekeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgatekeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgatekeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgatekeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secondtruth","download_url":"https://codeload.github.com/secondtruth/gatekeeper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgatekeeper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275153474,"owners_count":25414635,"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-14T02:00:10.474Z","response_time":75,"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-control","composer","firewall","php","protect-websites","protection","spam-prevention","web"],"created_at":"2025-01-31T16:45:51.533Z","updated_at":"2025-09-14T19:21:17.405Z","avatar_url":"https://github.com/secondtruth.png","language":"PHP","readme":"# Gatekeeper\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/secondtruth/gatekeeper/tests.yml.svg)](https://github.com/secondtruth/gatekeeper/actions/workflows/tests.yml)\n[![Quality](https://img.shields.io/codeclimate/maintainability/secondtruth/gatekeeper.svg)](https://codeclimate.com/github/secondtruth/gatekeeper)\n[![Coverage](https://img.shields.io/codecov/c/gh/secondtruth/gatekeeper.svg?token=pmX6z4UHDJ)](https://codecov.io/gh/secondtruth/gatekeeper)\n[![License](https://img.shields.io/github/license/secondtruth/gatekeeper.svg?color=blue)](https://packagist.org/packages/secondtruth/gatekeeper)\n\nThe Gatekeeper library protects websites from spam and other attacks. It prevents bad bots from delivering their junk, and in many cases,\nfrom ever reading your site in the first place.\n\n## Description\n\nWelcome to a whole new way of keeping your service, forum, wiki or content management system free of spam and other attacks.\nGatekeeper is a PHP-based solution for blocking spam and the robots which deliver it. This keeps your site's load down,\nmakes your site logs cleaner, and can help prevent denial of service conditions caused by spammers.\n\nGatekeeper also transcends other anti-spam solutions by working in a completely different, unique way. Instead of merely\nlooking at the content of potential spam, Gatekeeper analyzes the delivery method as well as the software the spammer\nis using. In this way, Gatekeeper can stop spam attacks even when nobody has ever seen the particular spam before.\n\nGatekeeper is designed to work alongside existing spam prevention services to increase their effectiveness and efficiency.\nWhenever possible, you should run it in combination with a more traditional spam prevention service.\n\nThe library is inspired by the **Bad Behavior** anti-spam system by **Michael Hampton**.\n\n## Usage\n\nInclude the vendor autoloader and use the classes:\n\n```php\nnamespace Acme\\MyApplication;\n\nuse Secondtruth\\Gatekeeper\\Screener;\nuse Secondtruth\\Gatekeeper\\Gatekeeper;\nuse Secondtruth\\Gatekeeper\\ACL\\IPAddressACL;\nuse Secondtruth\\Gatekeeper\\Check\\UrlCheck;\nuse Secondtruth\\Gatekeeper\\Listing\\IPList;\nuse Laminas\\Diactoros\\ServerRequestFactory; // or any other PSR-7 ServerRequest factory\n\nrequire 'vendor/autoload.php';\n```\n\nCreate a `Screener` object and add the `Check` object(s) you want to use:\n\n```php\n$screener = new Screener();\n\n$check = new UrlCheck();\n$screener-\u003eaddCheck($check);\n```\n\nCreate a `Gatekeeper` object and run it using the screener:\n\n```php\n$request = ServerRequestFactory::fromGlobals(); // or a PSR-7 ServerRequest object you already have\n\n$gatekeeper = new Gatekeeper();\n\n$allowed = new IPList('127.0.0.1');\n$denied = new IPList(['127.0.0.2', '127.0.0.3/32']);\n$gatekeeper-\u003eaddACL(new IPAddressACL($allowed, $denied));\n\n$gatekeeper-\u003erun($request, $screener);\n```\n\n## Installation\n\n### Install via Composer\n\n[Install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) if you don't already have it present on your system.\n\nTo install the library, run the following command and you will get the latest development version:\n\n```bash\ncomposer require secondtruth/gatekeeper:dev-master\n```\n\n## Requirements\n\n- You must have at least PHP version 8.1 installed on your system.\n\n## Author, Credits and License\n\nThis project was created by [Christian Neff](https://www.secondtruth.de) ([@secondtruth](https://github.com/secondtruth))\nand is licensed under the [MIT License](LICENSE.md).\n\nBased on the work of:\n\n* Michael Hampton\n\nThanks to [all other contributors](https://github.com/secondtruth/wumbo/graphs/contributors)!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondtruth%2Fgatekeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecondtruth%2Fgatekeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondtruth%2Fgatekeeper/lists"}