|
před 8 měsíci | |
---|---|---|
configs | před 8 měsíci | |
init | před 8 měsíci | |
.gitignore | před 8 měsíci | |
LICENSE | před 1 rokem | |
Makefile | před 8 měsíci | |
README.md | před 8 měsíci | |
config.go | před 8 měsíci | |
csp-handler.go | před 8 měsíci | |
go.mod | před 8 měsíci | |
go.sum | před 8 měsíci | |
mail.go | před 8 měsíci | |
main.go | před 8 měsíci | |
rateLimit.go | před 8 měsíci |
A simple application to send CSP violation reports to an email address
CSP-Handler needs to be behind a reverse proxy which forwards either the X-Forwarded-For
or X-Real-IP
header, otherwise rate limiting won't work.
git clone https://git.bn4t.me/bn4t/csp-handler.git
make build
to build the csp-handler binarysudo make install
to install csp-handler on your system. This will create the directory /etc/csp-handler
(config directory). Additionally the user csp-handler
will be created.sudo make install-systemd
to install the systemd service. Run service csp-handler start
to start the csp-handler service. Csp-handler will automatically run as the csp-handler
user.Make sure you edit the config located at /etc/csp-handler/config.toml
before running the service.
-config <config file>
- The location of the config file to use. Defaults to config.toml
in the working directory.Run sudo make uninstall
to uninstall csp-handler. This will remove /etc/csp-handler
if the directory is empty.
Run sudo make uninstall-systemd
to remove the systemd service.
Include the report-uri
directive in your content security policy:
report-uri https://csp-report.example.com/report-uri/mydomain.com
Replace csp-report.example.com
with the domain on which csp-report is deployed and mydomain.com
with the domain on which the content security policy is deployed.
GPLv3