-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images Not Displaying Due to Content Security Policy (CSP) Restrictions #30761
Comments
A similar issue was discussed in a closed thread titled Cached thumbnails not showing in browser due to CSP. The solution involved modifying the In your case, it seems that despite setting To troubleshoot, ensure that there are no other configurations or middleware that might be overriding your CSP settings. Additionally, consider specifying trusted domains explicitly in the |
The fact that you have a log explicitly stating If would suggest double checking that your config file is properly found and loaded. |
@mistercrunch I considered that and ran the from flask import current_app
print(current_app.config.get("TALISMAN_CONFIG")) This returned the same configuration I had defined in the config file. Is this an appropriate way to verify the TALISMAN_CONFIG, or would you recommend a different method? |
Seems like a fair way to validate the configuration. In that context, do you still get the There's a lot of different ways to confirm or double check that the endpoint you are hitting is aligned with the configuration / process you think you are running. Do you still get an error/warning after killing all processes (trying to ensure it's not a zombie or other process) or just no answer as expected? Could you add or alter an exsiting endpoint to serve the |
Does it work without brackets, e.g. |
Hello @mistercrunch @rusackas, I found a solution, though it seems unusual. To display images, I need to modify two configurations:
However, I’m running docker-compose-image-tag.yml, which indicates a production setup, not a development one. |
All of our From https://superset.apache.org/docs/installation/docker-compose/ On top of what is described there, there was a challenge around segmentation while supporting dev AND prod use cases within docker-compose semantics, where there was a lot of conditionality in docker-compose (if dev then do_this else do_something_else) which could lead to confusion and security issues. Because of that we decided to recommend helm/k8s/minikube for prod use cases, where we can make sure all the conditions and configurations point to prod/secure images and configurations. |
@mistercrunch ok i got it. |
Bug description
Images hosted on external URLs are not displaying in Apache Superset due to Content Security Policy (CSP) restrictions. Despite configuring TALISMAN_CONFIG to allow all sources, the browser console still reports CSP violations, specifically blocking image loading from external URLs.
Steps to Reproduce:
The image should display as configured, following the img-src: '*' directive.
Actual Behavior:
The image does not load, and the browser console shows a CSP error similar to the following:
Impact:
This CSP restriction prevents images hosted on external URLs from being displayed in Superset, limiting the ability to include necessary external visual content.
Request:
An option to fully relax or disable CSP checks specifically for images would provide flexibility, ensuring that Superset can display images hosted on external URLs as intended.
Additional Context:
This issue specifically affects the display of externally hosted images within Superset, which are essential for various dashboards and visualizations.
Screenshots/recordings
Superset version
4.0.2
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: