https://github.com/hazcod/cspcollector
Collects CSP reports and builds an exemption database.
https://github.com/hazcod/cspcollector
Last synced: 2 months ago
JSON representation
Collects CSP reports and builds an exemption database.
- Host: GitHub
- URL: https://github.com/hazcod/cspcollector
- Owner: hazcod
- Created: 2021-03-29T14:39:56.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-29T14:43:25.000Z (about 5 years ago)
- Last Synced: 2025-03-17T13:58:05.031Z (over 1 year ago)
- Language: Go
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cspcollector
Collects CSP reports and builds an exemption database.
## Testing
```shell
# first run our reporting server
% go run ./...
# now test it out
% curl --data '{
"csp-report": {
"document-uri": "http://example.com/signup.html",
"referrer": "",
"blocked-uri": "http://example.com/css/style.css",
"violated-directive": "style-src cdn.example.com",
"original-policy": "default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports",
"disposition": "report"
}
}' -v http://localhost:8080
# should now be stored in csp.db
```