Skip to content

Commit

Permalink
[#678] Add Google Tag Manager to the img-src CSP directive
Browse files Browse the repository at this point in the history
In response to the user story requiring the metadata validation service
to be accessible only from localhost for security reasons, this commit
includes a modification to the CSP (Content Security Policy) directive
in the docker-compose.yml file. The change specifically adds
'https://www.googletagmanager.com' to the img-src directive, ensuring
that resources from Google Tag Manager are permitted in the service.
This adjustment enhances security measures by properly configuring the
CSP policy to allow resources only from specified sources.
  • Loading branch information
placek committed Apr 12, 2024
1 parent f3f3f8b commit a4ee118
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/govtool/config/templates/docker-compose.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ services:
- "traefik.http.routers.frontend.rule=Host(`<DOMAIN>`)"
- "traefik.http.routers.frontend.entrypoints=websecure"
- "traefik.http.routers.frontend.tls.certresolver=myresolver"
- "traefik.http.middlewares.frontend-csp.headers.contentSecurityPolicy=default-src 'self'; img-src *.usersnap.com 'self' data:; script-src *.usersnap.com 'self' 'unsafe-inline' https://www.googletagmanager.com https://browser.sentry-cdn.com; style-src *.usersnap.com *.googleapis.com 'self' 'unsafe-inline' https://fonts.googleapis.com; connect-src *.usersnap.com https://s3.eu-central-1.amazonaws.com/upload.usersnap.com 'self' o4506155985141760.ingest.sentry.io *.google-analytics.com; font-src *.usersnap.com *.gstatic.com 'self' 'unsafe-inline' https://fonts.gstatic.com; worker-src blob:"
- "traefik.http.middlewares.frontend-csp.headers.contentSecurityPolicy=default-src 'self'; img-src *.usersnap.com https://www.googletagmanager.com 'self' data:; script-src *.usersnap.com 'self' 'unsafe-inline' https://www.googletagmanager.com https://browser.sentry-cdn.com; style-src *.usersnap.com *.googleapis.com 'self' 'unsafe-inline' https://fonts.googleapis.com; connect-src *.usersnap.com https://s3.eu-central-1.amazonaws.com/upload.usersnap.com 'self' o4506155985141760.ingest.sentry.io *.google-analytics.com; font-src *.usersnap.com *.gstatic.com 'self' 'unsafe-inline' https://fonts.gstatic.com; worker-src blob:"
- "traefik.http.routers.frontend.middlewares=frontend-csp@docker"
- "traefik.http.services.frontend.loadbalancer.server.port=80"

Expand Down

0 comments on commit a4ee118

Please sign in to comment.