Content Security Policy is a security mechanism which is used to help prevent XSS (cross-site scripting) attacks for web pages loaded by your browser. The mechanism defines the header Content-Security-Policy and is provided in the response packet by the server. It contains several directives which indicate what origins specific content can be loaded from.
If this header is presented by the server and we redirect content to a virtual URL (origin-*-redirect auth mode), the browser will generate Content Security Violation errors and some content will not load on the page since our virtual URL is not defined in the CSP directives of the header.
More information on CSP directives can be found https://www.w3.org/TR/CSP/#csp-directives
A similar issue is presented when trying to authenticate CORS requests. Please see TECH246208 for a solution to CORS violation errors.
CSP does not provide security over-the-wire, the header can be modified or removed entirely without issue. The solutions below are provided as CPL code and can be added in a CPL Layer in the Visual Policy Manager.
The simplest solution is to remove the header from response packets. Please note that this downgrades security while accessing web pages in the sense that client side XSS may be possible.
In order to not remove the header entirely, it is possible to use CPL code to add a virtual url to CSP directives. The below CPL code uses an example URL of https://virtual.url:4433. Replace this string with thje custom URL
Note: Only a few common CSP directives have been included here. If errors for additional directives are seen, they can be added to the CPL code by adding additional blocks in the format: