Add /api/v1/public/csp-reports endpoint to receive and log Content-Security-Policy violation reports from browsers. When CSP is configured with a report-uri directive pointing to this endpoint, browsers will POST violation reports whenever a CSP rule is violated. These reports are logged using Koha's logging system for administrator review. Features: - Public endpoint (no authentication required, as browsers send these reports automatically) - Logs violations at WARN level with key details (violated directive, blocked URI, document URI, source location) - Logs full report at DEBUG level for detailed analysis - Accepts both application/csp-report and application/json content types Configuration example (in koha-conf.xml csp_header_value): ...; report-uri /api/v1/public/csp-reports Log4perl configuration to capture CSP violations: log4perl.logger.api.csp = WARN, CSP log4perl.appender.CSP = Log::Log4perl::Appender::File log4perl.appender.CSP.filename = /var/log/koha/csp-violations.log log4perl.appender.CSP.layout = PatternLayout log4perl.appender.CSP.layout.ConversionPattern = [%d] %m%n Also updates koha-conf.xml documentation with CSP configuration guidance. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> |
||
|---|---|---|
| .. | ||
| z3950 | ||
| zebradb | ||
| README.txt | ||
| SIPconfig.xml | ||
| apache.conf | ||
| koha-conf.xml | ||
| koha-httpd.conf | ||
| koha-worker.service | ||
| log4perl.conf | ||
| nginx.conf | ||
README.txt
Koha Configuration Files: The following files specify the base configuration for Koha ZOOM: * koha-httpd.conf In a debian system, this apache configuration file will be symlinked from /etc/apache2/sites-enabled Specify Koha's IP address with NameVirtualHost Set ServerName, etc * koha-production.xml * koha-testing.xml These are the production and testing configurations for zebrasrv and for Koha. The first part of each file specifies Zebra server names, indexing configuration files, and query language configurations. Koha configuration directives follow. * zebra-authorities.cfg * zebra-biblios.cfg