Add `wss://GITLAB_DOMAIN` and `ws://GITLAB_DOMAIN` to CSP's connect-src
Summary
The connect-src
directive is currently set to 'self'
in https://gitlab.com/gitlab-org/gitlab/-/blob/f55df3d80f96f5de344f5e19fdb382f7759136ff/lib/gitlab/content_security_policy/config_loader.rb#L17
In CSP Level 2, 'self'
strictly meant "same origin" however that definition was extended in CSP Level 3 and now 'self'
includes https
/wss
variations of the origin.
https://www.w3.org/TR/CSP3/#changes-from-level-2
Unfortunately, Safari still hasn't moved to that new definition so we have to explicitly support wss://GITLAB_DOMAIN
and ws://GITLAB_DOMAIN
.
Steps to reproduce
Run this in Safari's browser console when running the GDK
Example Project
What is the current bug behavior?
Web Socket connections are blocked in Safari
What is the expected correct behavior?
Web Socket connections should be allowed by the CSP
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)