[Bug 38365] Add Content-Security-Policy HTTP header to HTML responses
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38365 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193952|0 |1 is obsolete| | --- Comment #288 from David Cook <dcook@prosentient.com.au> --- Created attachment 194580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194580&action=edit Bug 38365: Add CSP violation reporting API endpoint 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> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org