Skip to content
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

fix(docs): removing meta tag CSP, poking more holes in htaccess #27274

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
metadata: [{name: 'Content-Security-Policy', content: "default-src 'self'; frame-src 'https://calendar.google.com/' 'https://preset.io/' 'https://sidebar.bugherd.com/';"}],
Copy link
Member Author

@rusackas rusackas Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the quotes on URLs are part of the problem, I suspect... but we need more holes poked for other stuff as well since we're apparently overriding some apache server default.

}),
scripts: [
'/script/matomo.js',
Expand Down
12 changes: 11 additions & 1 deletion docs/static/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@ RewriteRule ^(.*)$ https://superset.apache.org/$1 [R,L]
RewriteCond %{HTTP_HOST} ^superset.incubator.apache.org$ [NC]
RewriteRule ^(.*)$ https://superset.apache.org/$1 [R=301,L]

Header set Content-Security-Policy "default-src 'self'; frame-src 'https://calendar.google.com/' 'https://preset.io/' 'https://sidebar.bugherd.com/' 'https://unpkg.com/';"
Header set Content-Security-Policy "default-src 'self'; img-src *;"

Header set Content-Security-Policy "default-src 'self'; \
script-src 'self'; \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to avoid 'unsafe-inline' wherever possible, but we may well have to resort to it here or elsewhere.

img-src 'self' https://static.scarf.sh *; \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the wildcard here isn't ideal. When the bulk of the site looks OK, we can tighten the screws here.

style-src 'self' https://fonts.googleapis.com; \
script-src-elem 'self' https://www.googletagmanager.com https://www.google-analytics.com; \
style-src-elem 'self' https://fonts.googleapis.com; \
font-src 'self' https://fonts.gstatic.com; \
frame-src 'self' https://calendar.google.com https://preset.io https://sidebar.bugherd.com https://unpkg.com; \
"
Loading