Skip to content

Commit bdcbc1a

Browse files
fix(front): form action restrictions (#471)
## 📝 Description When implementing security restrictions, we created an issue with connectingthe semaphore and GH/BB accounts. This should fix it renderedtext/tasks#8368 ## ✅ Checklist - [ ] I have tested this change - [ ] This change requires documentation update
1 parent ca99da9 commit bdcbc1a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

front/lib/front_web/plugs/content_security_policy.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,24 @@ defmodule FrontWeb.Plug.ContentSecurityPolicy do
2727
end
2828

2929
defp options do
30+
base_domain = System.get_env("BASE_DOMAIN")
31+
3032
[
3133
nonces_for: [:script_src],
3234
report_only: Application.get_env(:front, :environment) in [:dev, :test],
3335
directives: %{
3436
base_uri: ~w('self'),
3537
connect_src: connect_src(),
3638
default_src: ~w('none'),
37-
form_action: ~w('self' semaphoreci.zendesk.com),
39+
form_action:
40+
~w('self' semaphoreci.zendesk.com bitbucket.org github.com gitlab.com) ++
41+
["*.#{base_domain}"],
3842
media_src: ~w(beacon-v2.helpscout.net),
3943
child_src: ~w('self'),
4044
font_src: ~w('self' beacon-v2.helpscout.net fonts.gstatic.com cdn.jsdelivr.net),
4145
img_src:
42-
~w(data: 'self' *.userpilot.io static.zdassets.com *.zendesk.com gravatar.com *.gravatar.com *.wp.com *.githubusercontent.com d12wqas9hcki3z.cloudfront.net bitbucket.org github.com gitlab.com beacon-v2.helpscout.net d33v4339jhl8k0.cloudfront.net chatapi-prod.s3.amazonaws.com/ bitbucket-assetroot.s3.amazonaws.com ui-avatars.com *.atl-paas.net *.sitesearch360.com docs.semaphoreci.com),
46+
~w(data: 'self' *.userpilot.io static.zdassets.com *.zendesk.com gravatar.com *.gravatar.com *.wp.com *.githubusercontent.com d12wqas9hcki3z.cloudfront.net bitbucket.org github.com gitlab.com beacon-v2.helpscout.net d33v4339jhl8k0.cloudfront.net chatapi-prod.s3.amazonaws.com/ bitbucket-assetroot.s3.amazonaws.com ui-avatars.com *.atl-paas.net *.sitesearch360.com) ++
47+
["docs.#{base_domain}"],
4348
script_src:
4449
~w(https: 'self' 'strict-dynamic' *.userpilot.io static.zdassets.com beacon-v2.helpscout.net d12wqas9hcki3z.cloudfront.net d33v4339jhl8k0.cloudfront.net *.sitesearch360.com www.googletagmanager.com cdn.jsdeliver.net),
4550
style_src:

0 commit comments

Comments
 (0)