Skip to content

Conversation

pYassine
Copy link
Contributor

No description provided.

@revu-bot revu-bot bot requested a review from revu-bot September 18, 2025 17:41
Copy link

@pYassine pYassine marked this pull request as ready for review September 18, 2025 17:41
Copy link
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

This PR improves security by removing 'unsafe-inline' from CSP directives and adding modern security headers. However, there's a critical issue where media-src directive was removed from frontend CSP, which could break media functionality. The CSP rules are becoming complex and may need better organization for maintainability.

@pYassine pYassine requested a review from revu-bot September 18, 2025 17:42
Copy link
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

This PR improves security by removing 'unsafe-inline' directives from CSP headers and adding modern security headers. However, the complete removal of the media-src directive could potentially break media functionality if the application loads audio/video content from external sources.

ingress:
customHeaders:
"Content-Security-Policy": "default-src 'none'; manifest-src 'self' https://*.gouv.fr; connect-src 'self' https://*.gouv.fr ; media-src 'self' https://domifaprod2.blob.core.windows.net/ https://tally.so/; font-src 'self'; img-src 'self' https://tally.so/ data:; script-src 'self' 'unsafe-inline' https://*.gouv.fr https://tally.so/ https://tally.so/widgets/embed.js ; frame-src 'self' https://*.gouv.fr https://tally.so/ ; style-src 'self' 'unsafe-inline'"
"Content-Security-Policy": "default-src 'none'; manifest-src 'self' https://*.gouv.fr; connect-src 'self' https://*.gouv.fr https://api.tally.so https://*.tally.so; font-src 'self' https://fonts.gstatic.com https://tally.so https://*.tally.so; img-src 'self' https://tally.so https://*.tally.so data:; script-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so; frame-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so; style-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same issue as the frontend CSP - the media-src directive has been removed. The portail-usagers previously allowed media from 'https://domifaprod2.blob.core.windows.net/' and 'https://tally.so/'. If this portal loads any media content, it will be blocked without the media-src directive.

Suggested change
"Content-Security-Policy": "default-src 'none'; manifest-src 'self' https://*.gouv.fr; connect-src 'self' https://*.gouv.fr https://api.tally.so https://*.tally.so; font-src 'self' https://fonts.gstatic.com https://tally.so https://*.tally.so; img-src 'self' https://tally.so https://*.tally.so data:; script-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so; frame-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so; style-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so"
"Content-Security-Policy": "default-src 'none'; manifest-src 'self' https://*.gouv.fr; connect-src 'self' https://*.gouv.fr https://api.tally.so https://*.tally.so; media-src 'self' https://domifaprod2.blob.core.windows.net/ https://tally.so/; font-src 'self' https://fonts.gstatic.com https://tally.so https://*.tally.so; img-src 'self' https://tally.so https://*.tally.so data:; script-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so; frame-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so; style-src 'self' https://*.gouv.fr https://tally.so https://*.tally.so"

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.41%. Comparing base (dbd3309) to head (e4b786b).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #3916    +/-   ##
========================================
  Coverage   65.41%   65.41%            
========================================
  Files         964      964            
  Lines       16469    16469            
  Branches     2286     2283     -3     
========================================
  Hits        10773    10773            
+ Misses       5509     5352   -157     
- Partials      187      344   +157     

see 67 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbd3309...e4b786b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pYassine pYassine merged commit 8fe9bd1 into master Sep 18, 2025
14 of 18 checks passed
@pYassine pYassine deleted the update-csp branch September 18, 2025 18:09
@tokenbureau
Copy link

tokenbureau bot commented Sep 18, 2025

🎉 This PR is included in version 2.221.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@tokenbureau tokenbureau bot added the released label Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants