A simple web application to send CSP violation reports to an email address
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
bn4t 7493df54ff Merge remote-tracking branch 'origin/master' 1 个月前
.drone.yml trigger ci build 1 个月前
.env.sample add ratelimit and other improvements 5 个月前
.gitignore Initial Commit 5 个月前
Dockerfile add docker support 5 个月前
LICENSE add license 5 个月前
README.md Update 'README.md' 5 个月前
cron.go add license 5 个月前
csp-handler.go Don't send mail in new goroutine 5 个月前
docker-compose.yml Add port mapping 5 个月前
go.mod Updated dependencies 1 个月前
go.sum Updated dependencies 1 个月前
mail.go add license 5 个月前
main.go add license 5 个月前
utils.go add license 5 个月前

README.md

CSP-Handler

A simple web application to send CSP violation reports to an email address

Important

CSP-Handler needs to be behind a reverse proxy which forwards either the X-Forwarded-For or X-Real-IP header, else ratelimiting won’t work.

Setup

  1. Clone the repository and enter the directory: git clone https://git.bn4t.me/bn4t/csp-handler.git && cd csp-handler
  2. Edit the environment variables in docker-compose.yml
  3. Build the image and start the container: docker-compose up --build -d

Usage

Include the report-uri directive in your content security policy:

report-uri https://csp-report.example.com/report-uri/mydomain.com

Replace mydomain.com with the domain on which this content security policy is deployed.

License

GPLv3