Page Protect
Overview
Page Protect provides Content Security Policy (CSP) management, security headers, and script allowlisting for protecting web applications from client-side attacks like XSS, clickjacking, and data exfiltration.
CSP Management
Content Security Policy headers control which resources the browser is allowed to load. coreX Manager lets you configure CSP per listener with granular control over each directive.
CSP Directives
| Directive | Controls |
|---|---|
default-src | Fallback for all resource types |
script-src | JavaScript sources |
style-src | Stylesheet sources |
img-src | Image sources |
font-src | Font sources |
frame-src | Iframe sources |
connect-src | XHR, WebSocket, fetch destinations |
media-src | Audio/video sources |
object-src | Plugin/embed sources |
frame-ancestors | Who can embed this page (clickjacking protection) |
base-uri | Allowed <base> tag URIs |
form-action | Form submission destinations |
Each directive accepts:
self— same originnone— no sources- Specific URLs
- Nonces (per-request generated)
- Hashes
Security Headers
In addition to CSP, Page Protect manages standard security headers:
| Header | Description |
|---|---|
X-Content-Type-Options | Prevent MIME type sniffing (nosniff) |
X-Frame-Options | Clickjacking protection (DENY or SAMEORIGIN) |
Strict-Transport-Security | HSTS (also configurable in TLS settings) |
Referrer-Policy | Control referrer header leakage |
Permissions-Policy | Control browser feature access (camera, mic, geolocation, etc.) |
Script Allowlisting
Page Protect maintains an allowlist of permitted script sources. Scripts not on the allowlist are blocked by the CSP script-src directive.
Managing the Allowlist
- Navigate to Protection > Page Protect > Scripts
- Click Add Script Source
- Enter the script URL or hash
- Select the listener(s) it applies to
- Save
For inline scripts, use per-request nonces instead of hashes. coreX Manager can automatically generate and inject nonces into the CSP header and rewrite inline script tags to include the nonce attribute.
CSP Violation Reporting
When a browser detects a CSP violation, it can send a report to a configured endpoint. coreX Manager receives and logs these reports.
Enabling Violation Reports
- Navigate to Protection > Page Protect > CSP
- Set the
report-uriorreport-todirective to the coreX Manager violation endpoint - Enable Report Only mode initially to collect violations without blocking
Reviewing Violations
Navigate to Protection > Page Protect > Violations to see:
- Violated directive
- Blocked URI
- Source file and line number
- Client IP
- Timestamp
Start with Content-Security-Policy-Report-Only to collect violations without breaking your application. Once violations are resolved, switch to enforcement mode (Content-Security-Policy).
Step-by-Step: Configure CSP for a Listener
- Navigate to Protection > Page Protect > CSP
- Select the listener
- Set
default-srctoself - Set
script-srctoselfplus any allowed CDN URLs - Set
style-srctoselfplus any allowed CDN URLs - Set
img-srctoselfdata:(if using data URIs) - Set
frame-ancestorstonone(clickjacking protection) - Enable Report Only mode
- Save and Apply
Step-by-Step: Add Security Headers
- Navigate to Protection > Page Protect > Headers
- Enable X-Content-Type-Options (
nosniff) - Enable X-Frame-Options (
DENY) - Enable Referrer-Policy (
strict-origin-when-cross-origin) - Enable Permissions-Policy and disable unused features (camera, microphone, geolocation)
- Save and Apply
Step-by-Step: Review and Enforce
- After running in Report-Only mode for a period:
- Navigate to Protection > Page Protect > Violations
- Review reported violations
- Add missing sources to the CSP allowlist
- Once violations stop, switch from Report-Only to enforcement
- Apply Changes
Verification
-
Check CSP header:
curl -k -sI https://localhost/ | grep -i content-security-policy -
Check security headers:
curl -k -sI https://localhost/ | grep -iE 'x-content-type|x-frame|referrer|permissions' -
Test violation reporting:
- Open your site in a browser
- Open developer tools > Console
- Look for CSP violation reports
- Verify violations appear in the Page Protect > Violations page
-
Test enforcement:
- Once in enforcement mode, attempt to load a non-allowlisted script
- Verify the browser blocks it
Next Steps
- Certificates & TLS — Configure HSTS alongside CSP
- Security Rules — Layer access control
- Metrics & Logging — Monitor CSP violations