Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
feat: update csp
Browse files Browse the repository at this point in the history
  • Loading branch information
Yudi committed Oct 1, 2024
1 parent f736991 commit 234d62d
Showing 1 changed file with 48 additions and 24 deletions.
72 changes: 48 additions & 24 deletions docker/frontend/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ server {
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ $uri.html /index.html;
limit_except GET HEAD POST { deny all; };
limit_except GET HEAD POST { deny all; }

# CSP nonce
set $cspNonce $request_id;
Expand All @@ -26,51 +26,75 @@ server {
# CSP header
add_header Content-Security-Policy "
script-src 'self' 'nonce-$cspNonce'
https://plausible.cacic.dev.br/js/
https://plausible.cacic.dev.br/js/
https://www.googletagmanager.com/gtag/
https://www.google.com/recaptcha/
https://accounts.google.com/gsi/
https://ajax.cloudflare.com
https://static.cloudflareinsights.com
https://www.gstatic.com/recaptcha/
'wasm-unsafe-eval';
'wasm-unsafe-eval';
script-src-elem * 'unsafe-inline';
script-src-attr * 'unsafe-inline';
style-src 'self' 'nonce-$cspNonce'
https://accounts.google.com/gsi/style ;
style-src-elem * 'unsafe-inline';
object-src 'none';
base-uri 'self';
base-uri 'self' ;
frame-ancestors 'none';
worker-src 'self';
worker-src 'self' blob:;
frame-src https://www.google.com/recaptcha/
https://accounts.google.com/ ;
img-src 'self'
# Allows user-uploaded receipts
data:
https://firebasestorage.googleapis.com/v0/b/fct-pp.appspot.com/
https://lh3.googleusercontent.com/a/
https://tile.openstreetmap.org/
https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/ ;
https://cdn.jsdelivr.net/gh/pointhi/leaflet-color-markers@master/
https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/ ;
connect-src 'self'
https://plausible.cacic.dev.br/api/
https://plausible.cacic.dev.br/js/
# Must be updated when version changes
https://fastly.jsdelivr.net/npm/zxing-wasm@1.2.12/dist/full/zxing_full.wasm
https://firestore.googleapis.com/
https://identitytoolkit.googleapis.com/
https://firebaseinstallations.googleapis.com/
https://securetoken.googleapis.com/
https://content-firebaseappcheck.googleapis.com/
https://firebaseremoteconfig.googleapis.com/
https://www.google.com/recaptcha/
https://firebase.googleapis.com/
https://www.gstatic.com/recaptcha/
https://www.googletagmanager.com/
https://www.google-analytics.com/g/
https://accounts.google.com/gsi/client
https://plausible.cacic.dev.br/api/
https://plausible.cacic.dev.br/js/
https://identitytoolkit.googleapis.com/
https://fct-pp.appspot.com/
https://fct-pp.firebaseapp.com/
https://firebasestorage.googleapis.com/v0/b/fct-pp.appspot.com/
https://firebaseinstallations.googleapis.com/
https://securetoken.googleapis.com/
https://content-firebaseappcheck.googleapis.com/
https://firebaseremoteconfig.googleapis.com/
https://www.google.com/recaptcha/
https://firebase.googleapis.com/
https://www.gstatic.com/recaptcha/
https://www.googletagmanager.com/
https://www.google-analytics.com/g/
https://accounts.google.com/gsi/client
https://lh3.googleusercontent.com/
https://tile.openstreetmap.org/
https://accounts.google.com/gsi/style
https://glitchtip.cacic.dev.br
https://southamerica-east1-fct-pp.cloudfunctions.net
https://api.open-meteo.com/v1/forecast
https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/
https://cdn.jsdelivr.net/gh/cacic-fct/fct-app@main/frontend/src/assets/certificates/templates/
https://cdn.jsdelivr.net/gh/cacic-fct/fonts@main/Inter/latin-ext/ ;
manifest-src 'self';
form-action 'self';
default-src 'none';";
https://cdn.jsdelivr.net/gh/cacic-fct/fonts@main/Inter/latin-ext/ ;
manifest-src 'self';
form-action 'self';
default-src 'none';
trusted-types angular
angular#unsafe-bypass
angular#bundler
google#safe
goog#html;";
}

location /health {
add_header 'Content-Type' 'application/json';
return 200 '{"status":"UP"}';
return 200 '{"status":"ok"}';
}

location ~* ^/(docs|documentacao|documentação)/ {
Expand Down

0 comments on commit 234d62d

Please sign in to comment.