Skip to main content
Content Security Policy (CSP)

Make sure that resources used by Visualforce or Lightning components are retrieved securely in accordance to your Content Security Policy.

Lorenzo Frattini avatar
Written by Lorenzo Frattini
Updated over a week ago

Rationale

Content Security Policy (CSP) is a standard used to prevent attacks from malicious content in  trusted web pages. The Lightning Framework enforces CSP for technical reasons, however developers should always assume CSP is in place and fetch  content from trusted sources at all times.

Configuration

  • Enforcement. Use strict if you want to ensure that any resource is stored as Salesforce static resource and served by Salesforce itself. Use normal if you want to ensure that any external resource is referenced securely (using HTTPS)

Scope

  • Lightning components

  • Visualforce pages

  • Visualforce components

See also

Did this answer your question?