{"id":50785527,"url":"https://github.com/hmlendea/api-scanner-logger","last_synced_at":"2026-06-12T07:30:30.352Z","repository":{"id":352488647,"uuid":"1215335793","full_name":"hmlendea/api-scanner-logger","owner":"hmlendea","description":"Fake API that logs all incoming requests, intended for catching scanners.","archived":false,"fork":false,"pushed_at":"2026-04-19T20:09:50.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-19T21:32:12.012Z","etag":null,"topics":["api","csharp","dotnet","honeypot","rest-api","scanner-detection"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmlendea.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":"hmlendea","open_collective":null,"ko_fi":"hmlendea","tidelift":null,"community_bridge":null,"liberapay":"HMlendea","issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"hmlendea","thanks_dev":null,"custom":"https://hmlendea.go.ro/fund.html"}},"created_at":"2026-04-19T19:30:35.000Z","updated_at":"2026-04-19T20:09:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hmlendea/api-scanner-logger","commit_stats":null,"previous_names":["hmlendea/api-scanner-logger"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hmlendea/api-scanner-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fapi-scanner-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fapi-scanner-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fapi-scanner-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fapi-scanner-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmlendea","download_url":"https://codeload.github.com/hmlendea/api-scanner-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fapi-scanner-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34234557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"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":["api","csharp","dotnet","honeypot","rest-api","scanner-detection"],"created_at":"2026-06-12T07:30:29.700Z","updated_at":"2026-06-12T07:30:30.347Z","avatar_url":"https://github.com/hmlendea.png","language":"C#","funding_links":["https://patreon.com/hmlendea","https://ko-fi.com/hmlendea","https://liberapay.com/HMlendea","https://buymeacoffee.com/hmlendea","https://hmlendea.go.ro/fund.html"],"categories":[],"sub_categories":[],"readme":"[![Donate](https://img.shields.io/badge/-%E2%99%A5%20Donate-%23ff69b4)](https://hmlendea.go.ro/fund.html) [![Latest Release](https://img.shields.io/github/v/release/hmlendea/api-scanner-logger)](https://github.com/hmlendea/api-scanner-logger/releases/latest) [![Build Status](https://github.com/hmlendea/api-scanner-logger/actions/workflows/dotnet.yml/badge.svg)](https://github.com/hmlendea/api-scanner-logger/actions/workflows/dotnet.yml)\n\n# api-scanner-logger\n\nA minimal ASP.NET Core service that records incoming HTTP requests and immediately rejects them.\n\nThis project is useful as a decoy endpoint for scanner traffic, allowing you to capture request metadata (including headers) without exposing real API behavior.\n\n## What it does\n\n- Logs every incoming request through `NuciLog`\n- Captures:\n\t- Client IP address\n\t- HTTP method\n\t- Request path\n\t- Query string\n\t- Request headers\n- Serializes headers in this format:\n\n\t`Key1:Val1;Key2:Val2;`\n\n- Returns `403 Forbidden` for every request\n\n## Tech stack\n\n- .NET (`net10.0`)\n- ASP.NET Core\n- [NuciLog](https://www.nuget.org/packages/NuciLog)\n- [NuciAPI.Middleware](https://www.nuget.org/packages/NuciAPI.Middleware)\n\n## Requirements\n\n- .NET SDK\n\nCheck installed version:\n\n```bash\ndotnet --version\n```\n\n## Getting started\n\n1. Clone the repository\n2. Restore dependencies\n3. Run the service\n\n```bash\ndotnet restore\ndotnet run\n```\n\nBy default, ASP.NET Core URLs depend on your local launch/profile setup. You can set an explicit URL if needed:\n\n```bash\nASPNETCORE_URLS=http://0.0.0.0:5000 dotnet run\n```\n\n## Build and test\n\n```bash\ndotnet build\ndotnet test\n```\n\n## Logging behavior\n\nEach request is logged under operation name `HttpRequest` with the following keys:\n\n- `IpAddress`\n- `Method`\n- `Path`\n- `QueryString`\n- `Headers`\n\nExample headers value:\n\n```text\nHost:example.com;User-Agent:curl/8.7.1;Accept:*/*;\n```\n\n## Configuration\n\nLogging is configured via `appsettings.json` under:\n\n```json\n{\n\t\"nuciLoggerSettings\": {\n\t\t\"logFilePath\": \"logfile.log\",\n\t\t\"isFileOutputEnabled\": true\n\t}\n}\n```\n\nCurrent default output file:\n\n- `logfile.log`\n\n## Project structure\n\n- `Program.cs` - Host bootstrap\n- `Startup.cs` - Service registration and middleware pipeline\n- `Middleware/RequestLoggingMiddleware.cs` - Request capture and `403` response\n- `Logging/MyOperation.cs` - Log operation names\n- `Logging/MyLogInfoKey.cs` - Log field keys\n- `ServiceCollectionExtensions.cs` - DI and logging settings wiring\n\n## Security notes\n\n- This service intentionally denies all requests.\n- Logged headers can contain sensitive data (for example authorization tokens). Consider redacting sensitive values before using logs in shared systems.\n\n## Development\n\n### Prerequisites\n\n- .NET SDK compatible with the target framework\n\n### Build\n\n```bash\ndotnet build\n```\n\n### Run\n\n```bash\ndotnet run\n```\n\n### Test\n\nThere is currently no test project in this repository.\n\nIf you add one later, run:\n\n```bash\ndotnet test\n```\n\n## Contributing\n\nContributions are welcome.\n\nWhen contributing:\n\n- keep the project cross-platform\n- preserve the existing public API unless a breaking change is intentional\n- keep changes focused and consistent with the current coding style\n- update documentation when behavior changes\n- include tests for new behavior when a test project is available\n\n## License\n\nLicensed under the GNU General Public License v3.0 or later.\nSee [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmlendea%2Fapi-scanner-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmlendea%2Fapi-scanner-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmlendea%2Fapi-scanner-logger/lists"}