How to configure CSP Trusted Sites
Customers using the CSP Trusted Sites feature may receive a 500
or 502
server internal error if the HTTP header size exceeds the limit of 8 KB
. We recommend that you review your trusted sites, deselect directives that aren't relevant for the site and use the wildcard character (*
) when appropriate to reduce repetition.
Step-by-step guide
Navigate to the Salesforce Setup:
If you’re using Lightning Experience, click the settings icon, then select Setup Home.
If you’re using Salesforce Classic and you see Setup in the user interface header, click it.
If you’re using Salesforce Classic and you don’t see Setup in the header, click your name, then select Setup.
Enter "CSP Trusted Sites" in the Quick Find box, then select the appropriate page from the menu.
Search for the following entries and delete them by pressing "Del" under the "Action" column on the specific row of the listed entry:
GiphyApi: https://api.giphy.com
Giphy0: https://media0.giphy.com
Giphy1: https://media1.giphy.com
Giphy2: https://media2.giphy.com
Giphy3: https://media3.giphy.com
Giphy4: https://media4.giphy.com
Pusher: https://sockjs-eu.pusher.com
Pusher_Https: https://ws-eu.pusher.com
Pusher_Sock50: https://sock50-eu.pusher.com
Pusher_Sock51: https://sock51-eu.pusher.com
Pusher_Sock52: https://sock52-eu.pusher.com
Pusher_Sock53: https://sock53-eu.pusher.com
Pusher_Sock54: https://sock54-eu.pusher.com
Pusher_Sock55: https://sock55-eu.pusher.com
Pusher_Sock56: https://sock56-eu.pusher.com
Pusher_Sock57: https://sock57-eu.pusher.com
Social25_Api_Acc: https://social25-acc.herokuapp.com
Social25_Api_Dev: https://social25-dev.herokuapp.com
Now, let’s edit the CSP Directives for the remaining entries. Search for the following entries and edit them by pressing "Edit" under the "Action" column on the specific row that the entry is listed:
AWS_prod: https://social25-prod.s3.amazonaws.com
Click "Edit" and navigate under the CSP Directives section.
Check the checkboxes next to "Allow site for img-src" and "Allow site for media-src" ,and uncheck the rest of the checkboxes.
Press "Save".
AWS_staging: https://social25-staging.s3.amazonaws.com
Click "Edit" and navigate under the CSP Directives section.
Check the checkboxes next to "Allow site for img-src" and "Allow site for media-src" ,and uncheck the rest of the checkboxes.
Press "Save".
Social25_Api_Prod: https://social25.herokuapp.com
Click "Edit" and navigate under the CSP Directives section.
Check the checkbox next to "Allow site for connect-src" ,and uncheck the rest of the checkboxes.
Press "Save".
Social25_Api_Staging: https://social25-staging.herokuapp.com
Click "Edit" and navigate under the CSP Directives section.
Check the checkbox next to "Allow site for connect-src" ,and uncheck the rest of the checkboxes.
Press "Save".
Finally, we can add the following entries by clicking "New Trusted Site":
Giphy : https://*.giphy.com
Under General Information, enter
Giphy
as the Trusted Site Name andhttps://*.giphy.com
as the Trusted Site URL.Under CSP Directives, check the checkboxes next to "Allow site for connect-src" and "Allow site for img-src", and uncheck the rest of the checkboxes. Press “Save & New”.
Pusher: https://*.pusher.com
Under General Information, enter
Pusher
as the Trusted Site Name andhttps://*.pusher.com
as the Trusted Site URL.Under CSP Directives, check the checkbox next to "Allow site for connect-src", and uncheck the rest of the checkboxes.
Press "Save & New".
Pusher_Wss: wss://*.pusher.com
Under General Information, enter
Pusher_Wss
as the Trusted Site Name andwss://*.pusher.com
as the Trusted Site URL.Under CSP Directives, check the checkbox next to "Allow site for connect-src", and uncheck the rest of the checkboxes.
Press "Save & New".
Instagram_CDN: https://lookaside.fbsbx.com
Note: You do not need to create this entry unless you plan to use the Instagram Platform.
Under General Information, enter
Instagram_CDN
as the Trusted Site Name andhttps://lookaside.fbsbx.com
as the Trusted Site URL.Under CSP Directives, check the checkbox next to "Allow site for img-src" and "Allow site for media-src" , and uncheck the rest of the checkboxes.
Press "Save".
After making changes to the CSP Trusted Sites, all the users of the org should clear their browser cookies and hard-refresh the Salesforce browser tabs/windows to make sure that the new configuration propagates as expected.