{"id":51104718,"url":"https://github.com/cruxstack/browser-reporting-api","last_synced_at":"2026-06-24T13:30:33.028Z","repository":{"id":351395455,"uuid":"1210820372","full_name":"cruxstack/browser-reporting-api","owner":"cruxstack","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-14T19:43:09.000Z","size":25,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T21:27:30.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cruxstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2026-04-14T19:40:17.000Z","updated_at":"2026-04-14T19:42:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cruxstack/browser-reporting-api","commit_stats":null,"previous_names":["cruxstack/browser-reporting-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cruxstack/browser-reporting-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fbrowser-reporting-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fbrowser-reporting-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fbrowser-reporting-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fbrowser-reporting-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cruxstack","download_url":"https://codeload.github.com/cruxstack/browser-reporting-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruxstack%2Fbrowser-reporting-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34735263,"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-24T02:00:07.484Z","response_time":106,"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":"2026-06-24T13:30:31.688Z","updated_at":"2026-06-24T13:30:33.021Z","avatar_url":"https://github.com/cruxstack.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# browser-reporting-api\n\nSimple, self-hosted Go service for browser Reporting API ingestion.\n\n## General\n\n### What\n\n`browser-reporting-api` is an HTTP service that receives browser reporting\npayloads (`application/reports+json` and legacy `application/csp-report` from\n`report-uri`), validates each report entry, and streams accepted entries to\nstdout as NDJSON (one JSON object per line).\n\nThe payload format and reporting behavior align with the browser Reporting API\ndocumented by\n[MDN](https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API) and\n[Chrome](https://developer.chrome.com/docs/capabilities/web-apis/reporting-api).\n\nEndpoints:\n\n- `POST /v1/reports` (or `{BASE_PATH}/v1/reports`)\n- `GET /v1/manage/healthz`\n- `GET /v1/manage/readyz`\n\n### Why\n\n- Simple to run and reason about\n- Safe enough for ingestion (size limits, content-type checks, per-entry\n  vetting)\n- Easy to self-host and observe (accepted reports stream to stdout)\n- Collected browser reports (including CSP report traffic) may support\n  client-side monitoring and script-governance such as those relevant to PCI DSS\n  payment-page security guidance for Requirements 6.4.3 and 11.6.1 from the\n  [PCI Security Standards Council](https://blog.pcisecuritystandards.org/new-information-supplement-payment-page-security-and-preventing-e-skimming)\n\n### How\n\nRun locally with Go:\n\n```bash\ngo run ./cmd/server\n```\n\nRun a local demo with Docker Compose:\n\n```bash\nmake demo\n```\n\nThis starts the API, sends a sample batched report payload, and prints API logs.\nTo keep watching streamed report lines:\n\n```bash\nmake logs\n```\n\nThe demo sender payload is stored at `demo/reports.json`.\n\nSend a manual sample report:\n\n```bash\nmake report\n```\n\n`make report` sends the same payload file used by the compose demo:\n`demo/reports.json`.\n\nHealth check:\n\n```bash\nmake health\n```\n\nStop containers:\n\n```bash\nmake down\n```\n\nEnvironment variables:\n\n- `LISTEN_ADDR` (default `:8080`)\n- `BASE_PATH` (default `/`)\n- `MAX_BODY_BYTES` (default `1048576`)\n- `REPORTS_ALLOWED_ORIGINS` (default `*`)\n\nAllowed origin examples:\n\n- `REPORTS_ALLOWED_ORIGINS=*`\n- `REPORTS_ALLOWED_ORIGINS=https://app.example.com,https://admin.example.com`\n- `REPORTS_ALLOWED_ORIGINS=https://*.example.com,http://localhost:*`\n\nIf `BASE_PATH=/collector`, endpoints become:\n\n- `POST /collector/v1/reports`\n- `GET /collector/v1/manage/healthz`\n- `GET /collector/v1/manage/readyz`\n\n## Development\n\nRun tests:\n\n```bash\ngo test ./...\n```\n\nMake targets used during development:\n\n```bash\nmake test\nmake run\nmake up\nmake demo-send\nmake demo\nmake logs\nmake report\nmake health\nmake down\n```\n\nImplementation notes:\n\n- Routes are mounted under configurable `BASE_PATH`.\n- Reporting ingestion accepts batched arrays and processes entries\n  independently.\n- Invalid entries are rejected while valid entries in the same batch are still\n  accepted.\n- Accepted entries are emitted to stdout in NDJSON format.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcruxstack%2Fbrowser-reporting-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcruxstack%2Fbrowser-reporting-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcruxstack%2Fbrowser-reporting-api/lists"}