Skip to content

Content Security Policy

Brent Cordis edited this page Aug 14, 2026 · 3 revisions

Content Security Policy (CSP) Configuration for Proclaim

Proclaim integrates with several external services for video embedding, AI-powered content generation, Bible scripture lookup, and media platform analytics. If your site enforces a Content Security Policy, you'll need to whitelist these domains for Proclaim to function correctly.

This guide covers three common ways to configure CSP on a Joomla site:

  1. Proclaim's Built-in CSP — easiest, component-only
  2. .htaccess / Server-Level — site-wide
  3. Akeeba Admin Tools — popular Joomla security extension

Quick Reference: Required Domains

Below is the complete list of external domains Proclaim may connect to. You only need to whitelist the services you actually use.

frame-src (Embedded Players)

Domain Service When Needed
https://www.youtube.com YouTube embeds YouTube server addon
https://www.youtube-nocookie.com YouTube privacy-enhanced embeds YouTube server addon
https://player.vimeo.com Vimeo player Vimeo server addon
https://fast.wistia.net Wistia player Wistia server addon
https://www.facebook.com Facebook video embeds Facebook server addon
https://drive.google.com Google Drive document viewer Google Drive links

connect-src (API Calls)

Domain Service When Needed
https://www.googleapis.com YouTube Data API v3 YouTube chapters/captions sync
https://youtube.googleapis.com YouTube API YouTube integration
https://oauth2.googleapis.com Google OAuth2 YouTube OAuth connection
https://api.vimeo.com Vimeo API Vimeo metadata/stats sync
https://vimeo.com Vimeo oEmbed Vimeo metadata detection
https://fast.wistia.com Wistia oEmbed Wistia metadata detection
https://api.wistia.com Wistia Data API Wistia stats sync
https://query.getbible.net GetBible API Scripture popups
https://api.getbible.net GetBible API v2 Bible translation import
https://api.anthropic.com Anthropic Claude AI content generation
https://api.openai.com OpenAI ChatGPT AI content generation
https://generativelanguage.googleapis.com Google Gemini AI content generation

script-src (External Scripts)

Domain Service When Needed
https://www.youtube.com YouTube IFrame API YouTube player controls
https://player.vimeo.com Vimeo Player API Vimeo player controls
https://fast.wistia.com Wistia E-v1 script Wistia player enhancement

img-src (External Images)

Domain Service When Needed
https://img.youtube.com YouTube thumbnails YouTube video previews
data: Base64 inline images Various UI elements

style-src and font-src

Proclaim does not load external stylesheets or fonts. All CSS and icon fonts are bundled locally. You still need 'unsafe-inline' for style-src because Joomla and Proclaim use inline styles.

Notes on 'unsafe-inline'

style-src requires 'unsafe-inline': Joomla's core UI and Proclaim's dynamic styles use inline CSS.

script-src is more nuanced, and the answer changed in 10.5.8/10.5.9.

Proclaim's own controls no longer need it. Every javascript: link and inline onclick handler has been removed from both the site and the administrator. Behaviour is bound from external script files instead, which a strict policy allows.

Joomla core still emits inline script, in two forms:

  • Inline <script> blocks carrying configuration (Joomla.optionsStorage). These need either 'unsafe-inline' or a nonce — the HTTP Headers plugin can generate one for you (see below), which is the better option.
  • Inline onclick attributes, which a nonce does not cover. Joomla's own HTMLHelper::_('grid.checkall') renders the select-all checkbox in every admin list this way.

⚠️ So on a policy without 'unsafe-inline', Proclaim's admin controls work and the core select-all checkbox silently does not. Verified on Joomla 6.1.2 with script-src 'self' 'unsafe-eval': Proclaim's comment moderation buttons changed state correctly on the same page where core's select-all did nothing.

A blocked inline handler produces no visible error — the control simply does not respond. If you are tightening script-src, test the admin screens you use rather than assuming a clean page load means everything works.


1. Proclaim's Built-in CSP (Plugin Setting)

Proclaim includes a CSP header generator in its system plugin. This is the easiest approach — it only applies to frontend Proclaim pages and won't affect the rest of your site.

How to Enable

  1. Go to Components → Proclaim → Admin Center → Settings
  2. Find Enable CSP and set to Yes
  3. In the CSP Extra Sources textarea, add any additional domains your site needs (one per line)

What It Does

When enabled, Proclaim automatically sets these CSP headers on its frontend pages:

default-src 'self';
script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline';
frame-src 'self' https://www.youtube.com https://www.youtube-nocookie.com https://player.vimeo.com;
media-src 'self' blob: *;
img-src 'self' data: *;
font-src 'self' data:;
connect-src 'self';

Any domains you add in CSP Extra Sources are appended to default-src, script-src, style-src, frame-src, and connect-src.

Example Extra Sources

If you use Wistia, Facebook embeds, AI generation, and scripture popups, add:

https://fast.wistia.net
https://fast.wistia.com
https://api.wistia.com
https://www.facebook.com
https://api.anthropic.com
https://api.openai.com
https://generativelanguage.googleapis.com
https://query.getbible.net
https://api.getbible.net

2. .htaccess / Server-Level CSP

If your hosting provider or site-wide security requires CSP at the server level, add the following to your .htaccess file (Apache) or server configuration.

Full .htaccess Example

This example includes all Proclaim services. Remove lines for services you don't use.

<IfModule mod_headers.c>
    Header set Content-Security-Policy "\
default-src 'self'; \
script-src 'self' 'unsafe-inline' https://www.youtube.com https://player.vimeo.com https://fast.wistia.com; \
style-src 'self' 'unsafe-inline'; \
frame-src 'self' https://www.youtube.com https://www.youtube-nocookie.com https://player.vimeo.com https://fast.wistia.net https://www.facebook.com https://drive.google.com; \
connect-src 'self' https://www.googleapis.com https://youtube.googleapis.com https://oauth2.googleapis.com https://api.vimeo.com https://vimeo.com https://fast.wistia.com https://api.wistia.com https://query.getbible.net https://api.getbible.net https://api.anthropic.com https://api.openai.com https://generativelanguage.googleapis.com; \
img-src 'self' data: https://img.youtube.com; \
media-src 'self' blob:; \
font-src 'self' data:; \
"
</IfModule>

Minimal Example (YouTube + Scripture Only)

<IfModule mod_headers.c>
    Header set Content-Security-Policy "\
default-src 'self'; \
script-src 'self' 'unsafe-inline' https://www.youtube.com; \
style-src 'self' 'unsafe-inline'; \
frame-src 'self' https://www.youtube.com https://www.youtube-nocookie.com; \
connect-src 'self' https://query.getbible.net; \
img-src 'self' data: https://img.youtube.com; \
media-src 'self' blob:; \
font-src 'self' data:; \
"
</IfModule>

Nginx Example

add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' https://www.youtube.com https://player.vimeo.com https://fast.wistia.com; style-src 'self' 'unsafe-inline'; frame-src 'self' https://www.youtube.com https://www.youtube-nocookie.com https://player.vimeo.com https://fast.wistia.net https://www.facebook.com; connect-src 'self' https://www.googleapis.com https://youtube.googleapis.com https://oauth2.googleapis.com https://api.vimeo.com https://vimeo.com https://fast.wistia.com https://api.wistia.com https://query.getbible.net https://api.getbible.net https://api.anthropic.com https://api.openai.com https://generativelanguage.googleapis.com; img-src 'self' data: https://img.youtube.com; media-src 'self' blob:; font-src 'self' data:;";

3. Akeeba Admin Tools

Akeeba Admin Tools is a popular Joomla security extension that can manage CSP headers. If you use it, configure CSP through its interface instead of .htaccess to avoid conflicts.

Configuration Steps

  1. Go to Components → Admin Tools → Web Application Firewall → Configure WAF
  2. Scroll to the Security Headers section
  3. Find Content-Security-Policy settings

Adding Proclaim Domains

Akeeba Admin Tools provides per-directive fields. Add the domains from the Quick Reference table above to the matching directives:

frame-src:

'self' https://www.youtube.com https://www.youtube-nocookie.com https://player.vimeo.com https://fast.wistia.net https://www.facebook.com https://drive.google.com

script-src:

'self' 'unsafe-inline' https://www.youtube.com https://player.vimeo.com https://fast.wistia.com

style-src:

'self' 'unsafe-inline'

connect-src:

'self' https://www.googleapis.com https://youtube.googleapis.com https://oauth2.googleapis.com https://api.vimeo.com https://vimeo.com https://fast.wistia.com https://api.wistia.com https://query.getbible.net https://api.getbible.net https://api.anthropic.com https://api.openai.com https://generativelanguage.googleapis.com

img-src:

'self' data: https://img.youtube.com

media-src:

'self' blob:

font-src:

'self' data:

Important: Akeeba Admin Tools + Joomla HTTP Headers Conflicts

If you're using Joomla's built-in HTTP Headers plugin (recommended for J5+) to manage CSP, you must disable the overlapping settings in Akeeba Admin Tools' .htaccess Maker to avoid duplicate headers.

Confirmed Conflicts — Disable These in Admin Tools

Admin Tools .htaccess Maker Setting Header It Sends Action
Protect against clickjacking X-Frame-Options Set to No
Referrer Policy Referrer-Policy Set to "Do not set any policy"
HSTS Header Strict-Transport-Security Set to None (if Joomla plugin has HSTS on)
Custom .htaccess code sections Any manual Header set lines Audit — remove any CSP lines
Disable client-side risky behavior Content-Security-Policy on static files Evaluate — safe to disable during initial setup

1. Protect Against Clickjacking (.htaccess Maker → System Configuration) This appends an X-Frame-Options header. The Joomla HTTP Headers plugin already sends this (enabled by default), and the modern frame-ancestors CSP directive supersedes it. Set to No to avoid duplicates.

2. Referrer Policy (.htaccess Maker → Optimisation and Utility) The Joomla HTTP Headers plugin sets Referrer-Policy: strict-origin-when-cross-origin by default. If Admin Tools also sets this, you get duplicate headers. Set to "Do not set any policy".

3. HSTS Header (.htaccess Maker → Optimisation and Utility) Admin Tools offers None, Basic (1 year), or For HSTS Preload (includes includeSubDomains and preload — irreversible for a year). The Joomla plugin also has an HSTS toggle. Pick one source only. If using Joomla's plugin, set Admin Tools to None.

4. Custom .htaccess Code Sections (.htaccess Maker → Custom rules at top/bottom) Check for manually added Header set Content-Security-Policy lines. These are easy to forget and will conflict. Remove them and click "Save and create .htaccess".

5. Disable Client-Side Risky Behavior (.htaccess Maker → System Configuration) This adds Content-Security-Policy: script-src 'none' to static media files (under /media), not to Joomla page responses. It won't directly conflict with page-level CSP, but can break extensions that load inline JS from media files (like TinyMCE plugins). Set to No during initial CSP setup.

After Making Changes

  1. Click "Save and create .htaccess" in Admin Tools to regenerate the file
  2. Open Chrome DevTools → Network → [any page] → Response Headers
  3. Confirm you see only one copy of each security header
  4. If Proclaim's built-in CSP is also enabled, disable it (Enable CSP = No) — use only one CSP source

General Akeeba Notes

  • Report-Only mode: Test with Content-Security-Policy-Report-Only first to log violations without blocking resources
  • Admin panel: Akeeba's CSP applies site-wide. Proclaim's admin backend also needs connect-src whitelisting for AI generation and platform API sync. Make sure rules don't block admin-side API calls
  • Pick one method: Don't mix Akeeba WAF CSP, Akeeba .htaccess Maker CSP, Joomla HTTP Headers plugin, and Proclaim's built-in CSP. Use only one

Troubleshooting

How to Test CSP

  1. Open your site in Chrome/Firefox
  2. Press F12 to open Developer Tools
  3. Go to the Console tab
  4. Look for errors starting with Refused to... — these indicate blocked resources
  5. The error message tells you exactly which directive and domain to add

Common CSP Errors and Fixes

Error Message Fix
Refused to frame 'https://www.youtube.com' Add https://www.youtube.com to frame-src
Refused to connect to 'https://query.getbible.net' Add https://query.getbible.net to connect-src
Refused to load the script 'https://www.youtube.com/iframe_api' Add https://www.youtube.com to script-src
Refused to apply inline style Ensure 'unsafe-inline' is in style-src
Refused to execute inline script Ensure 'unsafe-inline' is in script-src

AJAX Filtering and CSP

Proclaim's sermon filter (AJAX pagination) makes fetch() calls to your own site ('self'). This should work with any CSP that includes 'self' in connect-src. If AJAX filtering breaks:

  1. Check that connect-src includes 'self'
  2. Verify no other extension or server config is setting a more restrictive CSP that overrides yours
  3. Check for mixed-content issues (HTTP vs HTTPS) — all Proclaim AJAX calls use relative URLs

Multiple CSP Headers

If multiple sources set CSP headers (e.g., Akeeba + .htaccess + Proclaim plugin), the most restrictive policy wins. The browser intersects all policies. Best practice: use only one CSP source.

Report-Only Testing

Before enforcing CSP, test with Content-Security-Policy-Report-Only to log violations without blocking:

Header set Content-Security-Policy-Report-Only "default-src 'self'; ..."

This logs violations to the browser console without breaking functionality.


Feature-Based Checklists

YouTube Integration

  • frame-src: https://www.youtube.com, https://www.youtube-nocookie.com
  • script-src: https://www.youtube.com
  • img-src: https://img.youtube.com
  • connect-src: https://www.googleapis.com, https://youtube.googleapis.com, https://oauth2.googleapis.com

Vimeo Integration

  • frame-src: https://player.vimeo.com
  • script-src: https://player.vimeo.com
  • connect-src: https://api.vimeo.com, https://vimeo.com

Wistia Integration

  • frame-src: https://fast.wistia.net
  • script-src: https://fast.wistia.com
  • connect-src: https://fast.wistia.com, https://api.wistia.com

Facebook Video Integration

  • frame-src: https://www.facebook.com

AI Content Generation (Admin)

  • connect-src: https://api.anthropic.com (Claude)
  • connect-src: https://api.openai.com (ChatGPT)
  • connect-src: https://generativelanguage.googleapis.com (Gemini)

Scripture Popups

  • connect-src: https://query.getbible.net, https://api.getbible.net

Google Drive Documents

  • frame-src: https://drive.google.com

Clone this wiki locally