-
Notifications
You must be signed in to change notification settings - Fork 549
Strengthen security practices in FF website #24762
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR restores inline script hash validation in the docs build, adds a deployment step to enforce it, and switches CSP to report-only with updated hashes.
- Adds a Bash task in the deployment pipeline to run script hash checks.
- Introduces
validateHashes.sh
to extract and compare inline script hashes. - Updates
staticwebapp.config.json
to use CSP report-only with the new hashes.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
tools/pipelines/deploy-website.yml | Added an Azure Pipelines Bash task for hash checking. |
docs/validateHashes.sh | New script to extract and validate inline script hashes. |
docs/static/staticwebapp.config.json | Changed CSP header to report-only and updated hashes. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…mework into hashes-inline
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
Bringing back a couple of hashes to validate inline scripts in the docs build, as well as an extra step in the website deployment to validate them.
The reason to bring these back is seeing some violations in our CREM board related to the couple of inline script docusaurus build generates which could be also the cause of M3 Strict CSP item not been resolved yet.
This was originally removed since FF website being an static site was expelled from solving M2 Strict CSP item, but M3 S360 item could still be active as it is still seeing some violations. Adding this back should bring an extra layer of security to our website even though it's not strictly needed, remove some CREM violations and help us prepare our case with security team in case M3 keeps unsolved.
Use DOMPurify to sanitize HTML strings in the website. Our default trusted types policy was just accepting any string as it comes. Now we are using DOMPurify to sanitize the strings before they are used in the website. Using the minified version of it to be able to set it up in a script prior to rendering and setting the policy.
Both changes have been tested in our staging environment but setting the header as Report Only again briefly to make sure everything works as expected in prod.