Review main Abandoned

80397[FEATURE] Introduce Content-Security-Policy-Report-Only handling

Sascha Nowak CR 0 V 0 Easy +46 −2 updated 08/28/24, 13:15

Commit message

The PSR-15 middlewares `ContentSecurityPolicyHeaders` apply
`Content-Security-Policy-Report-Only` HTTP headers to each response in
the frontend scope, when the feature flag
`security.frontend.contentSecurityPolicyReportOnly` is active.

To delegate CSP Report handling to TYPO3, the scope-specific feature
flags need to be enabled:

* `security.frontend.contentSecurityPolicyReportOnly`

When enabling the `security.frontend.contentSecurityPolicyReportOnly`
and `security.frontend.enforceContentSecurityPolicy` feature flags the
same time, the `Content-Security-Policy-Report-Only` header will be
applied to the response.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 4

Review log 1219

  1. Sascha Nowak uploaded patch set 1 08/04/23, 18:53

  2. core-ci voted on patch set 1 V -1 08/04/23, 19:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45083

  3. Sascha Nowak uploaded patch set 2 V -1 08/05/23, 06:09

  4. core-ci voted on patch set 2 V -1 08/05/23, 06:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45087

  5. Andreas Kienast uploaded patch set 3 V -1 08/08/23, 06:24

  6. core-ci voted on patch set 3 V +1 08/08/23, 06:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45213

  7. Oliver Hader commented on patch set 3 08/14/23, 10:39

    I guess this change would also make sense for the backend scope. Besides that, I think it would be fine to back-port it to TYPO3 v12, since it helps users to get started with CSP in TYPO3.
  8. Sascha Nowak commented on patch set 3 08/15/23, 05:26

    Reply

    Thanks for you feedback. It totally makes sense to have this in 12.4. Beni enables the CSP Mode in backend (https://review.typo3.org/c/Packages/TYPO3.CMS/+/79390) for 13 by default. When I add code for the backend now, I reduce the security for the backend, when the Developer is allowed to enable the reporting mode only. For 12.4 I would love to have this feature, but I don't know the workflow to provide a feature only for an older version and not master. I you can guide me, I would create a followup patch for 12.4 that adds the same feature for the backend.
  9. Simon Schaufelberger uploaded patch set 4 V +1 12/22/23, 01:10

  10. core-ci voted on patch set 4 V +1 12/22/23, 01:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50891

  11. Simon Schaufelberger uploaded patch set 5 V +1 07/12/24, 00:26

  12. core-ci voted on patch set 5 V +1 07/12/24, 00:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61428

  13. Simon Schaufelberger uploaded patch set 6 V +1 07/12/24, 11:46

  14. core-ci voted on patch set 6 V +1 07/12/24, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61480

  15. Simon Schaufelberger rebased onto patch set 7 V +1 08/01/24, 20:46

  16. Sascha Nowak commented on patch set 7 08/01/24, 20:49

    Reply

    Done
  17. core-ci voted on patch set 7 V +1 08/01/24, 21:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62656

  18. Oliver Hader commented on patch set 7 08/14/24, 17:18

    I've been working on a similar approach that considers the report-only mode for site-specific settings as well. → see https://review.typo3.org/c/Packages/TYPO3.CMS/+/85632
  19. Oliver Hader abandoned the change 08/28/24, 13:15

    The reworked versions (incl. site-config) has been merged to v12 & v13: https://review.typo3.org/q/I8c1a8305702629eac1bfedddbecbc19b452fd500