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

Cleanup embed CSP #99

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Cleanup embed CSP #99

merged 1 commit into from
Jul 21, 2022

Conversation

jdauphant
Copy link
Contributor

@jdauphant jdauphant commented Jul 12, 2022

We don't want recaptcha and gstatic


This PR currently has no changelog labels, so will not be included in changelogs.

Add one of: T-Deprecation, T-Enhancement, T-Defect, T-Task to indicate what type of change this is plus X-Breaking-Change if it's a breaking change.

@jdauphant jdauphant marked this pull request as ready for review July 12, 2022 12:17
@@ -26,7 +26,7 @@
<meta http-equiv="Content-Security-Policy" content="
default-src 'none';
style-src 'self' 'unsafe-inline';
script-src 'self' 'unsafe-eval' https://www.recaptcha.net https://www.gstatic.com;
script-src 'self' 'unsafe-eval';
Copy link
Contributor

Choose a reason for hiding this comment

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

on pourrait pas enlever unsafe-eval aussi ?
J'ai pas trouvé de eval dans le code.

Ya d'autres fonctions que ca pourrait bloquer, que j'ai pas cherché : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#unsafe_eval_expressions

Après, ca serait ptet un peu tricky à repérer si ca casse des trucs...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ça serait top d'enlever les unsafe eval mais je ne sais pas l'impact, on peut tester à la rigueur

Copy link
Contributor

Choose a reason for hiding this comment

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

Si on l'enlève, ça casse au moins le run de dev parce que webpack fait un eval pour se lancer. En revanche, c'est ptet pas un problème pour la prod. Mais je pense que c'est suffisant pour le moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

il y a des CSP qui impact le webpack ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Si je l'enlève, j'ai un message de violation de CSP sur le eval(...contenuAvecDuWebpackDedans...) dans bundle.js et l'appli ne se charge pas avec yarn start. C'est aussi possible de contourner ça en mettant en inline les scripts et utiliser le CSP d'inline mais je sais pas c'est quoi les implications niveau chargement après (package/chargement initial plus gros) (valable pour le CSS aussi)

Copy link
Contributor

Choose a reason for hiding this comment

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

Possible que ça soit lié à une lib que l'on utilise et qui se retrouve dans les fichiers compilés et qui respecte pas le CSP (vu sur le net), mais je sais pas comment trouver le coupable.

@celiacheff celiacheff merged commit 154840c into develop_tchap Jul 21, 2022
@odelcroi odelcroi deleted the fix/csp branch March 31, 2023 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants