Review main Merged

77998[FEATURE] Introduce Content Security Policy reporting & inspection

Oliver Hader CR +2 V +2 Nightmare +3116 −63 updated 03/27/23, 09:34

Commit message

An internal csp-violation reporting endpoint is integrated, which
keeps track of potential violations in frontend and backend scope.
Alternative remote endpoints of 3rd party services can be configured
with in TYPO3_CONF_VARS setting `contentSecurityPolicyReportingUrl`
for `BE` or `FE`.

Violations ("reports") are visualized in the new
Content-Security-Policy backend module, which allows to select from
possible suggestions that would resolve a violation - however a user
with system maintainer privileges has to make this decision.

For the time being, the `GoogleMapsHandler` has been added, which
can be used as an inspiration for additional custom CSP violation
handlers. The following test extension triggers CSP violations:
https://packagist.org/packages/oliver-hader/csp-test

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Georg Ringer +1
    • Torben Hansen +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Georg Ringer +1
    • Torben Hansen +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 2

Files 50

Show 30 more files

Review log 5683

Show 3558 earlier messages
  1. Oliver Hader uploaded patch set 1 03/01/23, 22:13

  2. Oliver Hader updated the commit message in patch set 2 03/01/23, 22:17

  3. core-ci voted on patch set 1 V +1 03/01/23, 22:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38277

  4. core-ci voted on patch set 2 V +1 03/01/23, 22:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38278

  5. Oliver Hader uploaded patch set 3 V +1 03/02/23, 08:43

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

  7. Georg Ringer voted on patch set 3 CR +2 03/02/23, 13:26

  8. Georg Ringer voted on patch set 3 V +2 03/02/23, 13:26

  9. Oliver Hader wrote 03/02/23, 15:13

    Removed Code-Review+2 by Georg Ringer
  10. Oliver Hader wrote 03/02/23, 15:13

    Removed Verified+2 by Georg Ringer
  11. Oliver Hader commented on patch set 3 03/07/23, 12:17

    This change is ready for review.

    ReportRepository.php:70

    Leads to ``` An exception occurred while executing a query: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'db.sys_http_report.uuid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by` and needs to be solved in a different way. ```
  12. Oliver Hader uploaded patch set 4 V +1 03/07/23, 17:37

  13. Oliver Hader commented on patch set 4 03/07/23, 17:38

    ReportRepository.php:70 Reply

    Done
  14. core-ci voted on patch set 4 V +1 03/07/23, 17:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38619

  15. Benjamin Kott uploaded patch set 5 V +1 03/09/23, 16:32

  16. core-ci voted on patch set 5 V -1 03/09/23, 16:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38706

  17. Oliver Hader uploaded patch set 6 V -1 03/09/23, 17:01

  18. core-ci voted on patch set 6 V +1 03/09/23, 17:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38708

  19. Oliver Hader uploaded patch set 7 V +1 03/10/23, 10:17

  20. core-ci voted on patch set 7 V +1 03/10/23, 10:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38762

  21. Oliver Hader uploaded patch set 8 V +1 03/10/23, 23:35

  22. Oliver Hader uploaded patch set 9 03/10/23, 23:41

  23. core-ci voted on patch set 8 V -1 03/10/23, 23:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38783

  24. core-ci voted on patch set 9 V -1 03/11/23, 00:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38784

  25. Markus Klein commented on patch set 9 03/11/23, 07:37

    is this line supposed to be removed before merge? I would rather see it within the ticket
  26. Oliver Hader uploaded patch set 10 V -1 03/11/23, 12:44

  27. core-ci voted on patch set 10 V -1 03/11/23, 12:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38791

  28. Oliver Hader uploaded patch set 11 V -1 03/11/23, 15:12

  29. Oliver Hader updated the commit message in patch set 12 03/11/23, 15:13

  30. Oliver Hader commented on patch set 12 03/11/23, 15:15

    Reply

    Yepp, these comments have to be adjusted, refined and put to proper RST files. This changeset is still work-in-progress - however testing and feedback is appreciated.
  31. Oliver Hader marked it work in progress 03/11/23, 15:19

  32. core-ci voted on patch set 11 V +1 03/11/23, 15:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38796

  33. core-ci voted on patch set 12 V +1 03/11/23, 15:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38797

  34. Oliver Hader updated the commit message in patch set 13 V +1 03/11/23, 18:09

  35. core-ci voted on patch set 13 V +1 03/11/23, 18:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38807

  36. Jasmina Ließmann wrote 03/12/23, 09:18

    Removed cc Jasmina Ließmann.
  37. Oliver Hader uploaded patch set 14 V +1 03/15/23, 09:25

  38. core-ci voted on patch set 14 V +1 03/15/23, 09:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38963

  39. Oliver Hader uploaded patch set 15 V +1 03/15/23, 11:00

  40. core-ci voted on patch set 15 V +1 03/15/23, 11:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38974

  41. Oliver Hader rebased onto patch set 16 V +1 03/16/23, 00:33

  42. core-ci voted on patch set 16 V +1 03/16/23, 00:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39027

  43. Oliver Hader uploaded patch set 17 V +1 03/16/23, 10:38

  44. core-ci voted on patch set 17 V +1 03/16/23, 10:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39049

  45. Oliver Hader uploaded patch set 18 V +1 03/16/23, 11:46

  46. core-ci voted on patch set 18 V +1 03/16/23, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39054

  47. Oliver Hader uploaded patch set 19 V +1 03/18/23, 08:42

  48. core-ci voted on patch set 19 V +1 03/18/23, 08:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39178

  49. Oliver Hader uploaded patch set 20 V +1 03/23/23, 11:33

  50. core-ci voted on patch set 20 V +1 03/23/23, 11:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39464

  51. Oliver Hader voted on patch set 20 CR -1 03/23/23, 13:23

  52. Oliver Hader uploaded patch set 21 CR -1 V +1 03/23/23, 15:04

  53. core-ci voted on patch set 21 V +1 03/23/23, 15:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39479

  54. Oliver Hader uploaded patch set 22 V +1 03/23/23, 15:53

  55. core-ci voted on patch set 22 V +1 03/23/23, 16:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39482

  56. Oliver Hader uploaded patch set 23 V +1 03/23/23, 22:36

  57. Oliver Hader commented on patch set 23 03/23/23, 22:37

    This change is ready for review.
  58. core-ci voted on patch set 23 V +1 03/23/23, 22:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39502

  1. Susi Moog commented on patch set 23 03/24/23, 14:46

    Tested with sentry as external reporting tool: when using an external reporting URI everything works as expected, however, it would be nice to: - not have the backend module available if reporting is disabled or configured to an external URL - if not possible, then it would be nice to have a hint in the backend module that there may be no reports because there is an external report URL configured
  2. Oliver Hader commented on patch set 23 CR -1 03/26/23, 08:07

    On it, received some additional feedback during TYPO3camp Dresden
  3. Michael Schams wrote 03/26/23, 09:58

    Removed cc Michael Schams.
  4. Oliver Hader uploaded patch set 24 CR -1 V +1 03/26/23, 14:29

  5. Oliver Hader commented on patch set 24 03/26/23, 14:34

    Reply

    Thx. I've added some hints in the UI in case CSP handling is disabled or remote reporting is used.
  6. core-ci voted on patch set 24 V -1 03/26/23, 14:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39646

  7. Oliver Hader uploaded patch set 25 V -1 03/26/23, 15:02

  8. core-ci voted on patch set 25 V +1 03/26/23, 15:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39649

  9. Torben Hansen voted on patch set 25 V +1 03/26/23, 17:58

  10. Georg Ringer voted on patch set 25 V +1 CR +1 03/26/23, 19:03

  11. Andreas Kienast commented on patch set 25 V +1 03/27/23, 06:26

    CspAjaxController.php:62

    Shouldn't this be 403? There's nothing wrong on server side, IMO.

    CspAjaxController.php:83

    Suggestion: use an enum for actions, not necessarily for this patch.

    GoogleMapsHandler.php:75

    `$event->setMutationSuggestions(self::$suggestion);`?

    Resolution.php:31

    Method is unused.

    ScopeRepository.php:36

    findAll

    ext_tables.sql:417

    char, we always have 36 characters
  12. Andreas Kienast commented on patch set 25 03/27/23, 07:00

    ext_tables.sql:417 Reply

    Never mind, the Database Analyzer always converts this to VARCHAR...
  13. Andreas Kienast uploaded patch set 26 CR +1 V +1 03/27/23, 07:15

  14. Andreas Kienast commented on patch set 26 03/27/23, 07:23

    GoogleMapsHandler.php:75 Reply

    Done

    Resolution.php:31 Reply

    Done

    ScopeRepository.php:36 Reply

    Done
  15. core-ci voted on patch set 26 V +1 03/27/23, 07:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39664

  16. Andreas Kienast commented on patch set 26 V +1 CR +1 03/27/23, 07:37

    Remaining comments of me shall not block this patch.
  17. Benni Mack commented on patch set 27 CR +1 V +1 03/27/23, 08:27

    Published edit on patch set 26.
  18. Benni Mack commented on patch set 27 03/27/23, 08:29

    CspAjaxController.php:62 Reply

    Done

    CspAjaxController.php:83 Reply

    I suggest using separate actions for this module but I also think, we could do this in the next iteration-
  19. Oliver Hader commented on patch set 27 03/27/23, 08:30

    CspAjaxController.php:83 Reply

    I don't think this is necessary since that `enum CspAjaxControllerAction` would not be reused at other places in the PHP code.
  20. core-ci voted on patch set 27 V +1 03/27/23, 08:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39672

  21. Andreas Kienast voted on patch set 27 V +1 CR +1 03/27/23, 08:49

  22. Georg Ringer voted on patch set 27 V +1 CR +1 03/27/23, 09:19

  23. Torben Hansen voted on patch set 27 V +1 CR +1 03/27/23, 09:23

  24. Oliver Hader commented on patch set 27 V +2 CR +2 03/27/23, 09:34

    Thanks folks! ❤️
  25. Oliver Hader merged patch set 28 03/27/23, 09:34