You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docusaurus generates only 2 inline scripts during our website build, one
for banner insertion and other one for setting dark/light theme. By
doing a search on script tags on our build output, these are the only
ones. After adding their respective hashes and testing the website on a
staging environment, I could confirm that such scripts don't get flagged
by the CSP. I also edited some files in our docs folder (react and docs)
to see if script generation changed, but remained the same.
In addition, adding an extra step to our website deployment pipeline to
generate hashes for every script in our index.html and verifies that
matches with the ones we have hard coded in our config file. This will
give us a failure in case someone changes something in our code that
changes the generated inline scripts. No check on other files is needed
since the option 'self' in CSP allows us run external scripts (in
comparison to inline scripts which we have removed the option to permit
(unsafe-inline)). Moving script-src to report only mode again to have a
test period.
0 commit comments