Skip to content

Commit

Permalink
Merge pull request #2204 from cfpb/2192-nginx-nonce
Browse files Browse the repository at this point in the history
2192-nginx-nonce
  • Loading branch information
ojbravo authored Jun 4, 2024
2 parents 520cdf9 + 8e7038f commit b13e8f6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
-->
<title>HMDA - Home Mortgage Disclosure Act</title>

<script>
<script nonce="nonce-placeholder">
// Global node polyfill.
window.global = window
</script>
Expand All @@ -66,7 +66,7 @@
href="https://www.googletagmanager.com"
crossorigin
/>
<script>
<script nonce="nonce-placeholder">
;(function (w, d, s, l, i) {
w[l] = w[l] || []
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
Expand Down
8 changes: 7 additions & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ http {
# Enable HSTS
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';

# nonce Injection
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types *;
sub_filter nonce-placeholder $request_id;

# CSP
add_header Content-Security-Policy "default-src 'self' blob:; script-src 'self' blob: data: https://dap.digitalgov.gov https://tagmanager.google.com https://www.googletagmanager.com https://www.google-analytics.com https://*.cfpb.gov https://www.consumerfinance.gov https://cdn.mouseflow.com; img-src 'self' blob: data: https://www.google-analytics.com https://raw.githubusercontent.com; style-src 'self' 'unsafe-inline'; font-src 'self' data:; object-src 'none'; frame-src 'self' https://www.youtube.com/ https://ffiec.cfpb.gov/; connect-src 'self' https://*.cfpb.gov https://www.consumerfinance.gov https://raw.githubusercontent.com https://ffiec.cfpb.gov https://*.mapbox.com https://www.google-analytics.com https://s3.amazonaws.com https://*.algolia.net https://stats.g.doubleclick.net;";
add_header Content-Security-Policy "default-src 'self' blob:; script-src 'self' 'nonce-$request_id' blob: data: https://dap.digitalgov.gov https://tagmanager.google.com https://www.googletagmanager.com https://www.google-analytics.com https://*.cfpb.gov https://www.consumerfinance.gov https://cdn.mouseflow.com; img-src 'self' blob: data: https://www.google-analytics.com https://raw.githubusercontent.com; style-src 'self' 'unsafe-inline'; font-src 'self' data:; object-src 'none'; frame-src 'self' https://www.youtube.com/ https://ffiec.cfpb.gov/; connect-src 'self' https://*.cfpb.gov https://www.consumerfinance.gov https://raw.githubusercontent.com https://ffiec.cfpb.gov https://*.mapbox.com https://www.google-analytics.com https://s3.amazonaws.com https://*.algolia.net https://stats.g.doubleclick.net;";

# Restrict referrer
add_header Referrer-Policy "strict-origin";
Expand Down
42 changes: 21 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1653,9 +1653,9 @@ __metadata:
linkType: hard

"@bufbuild/protobuf@npm:^1.0.0":
version: 1.9.0
resolution: "@bufbuild/protobuf@npm:1.9.0"
checksum: 10c0/45b0b6789819defcfaf2f7c3a431310f47e246bad23fdb0d184b015c7c1a047d787232cc349d52c204d8757c274b1148e278e01f82288e19f574b0996c5ef0f1
version: 1.10.0
resolution: "@bufbuild/protobuf@npm:1.10.0"
checksum: 10c0/5487b9c2e63846d0e3bde4d025cc77ae44a22166a5d6c184df0da5581e1ab6d66dd115af0ccad814576dcd011bb1b93989fb0ac1eb4ae452979bb8b186693ba0
languageName: node
linkType: hard

Expand Down Expand Up @@ -2961,11 +2961,11 @@ __metadata:
linkType: hard

"@types/node@npm:*":
version: 20.12.12
resolution: "@types/node@npm:20.12.12"
version: 20.12.13
resolution: "@types/node@npm:20.12.13"
dependencies:
undici-types: "npm:~5.26.4"
checksum: 10c0/f374b763c744e8f16e4f38cf6e2c0eef31781ec9228c9e43a6f267880fea420fab0a238b59f10a7cb3444e49547c5e3785787e371fc242307310995b21988812
checksum: 10c0/2ac92bb631dbddfb560eb3ba4eedbb1c688044a0130bc1ef032f5c0f20148ac7c9aa3c5aaa5a9787b6c4c6299847d754b96ee8c9def951481ba6628c46b683f5
languageName: node
linkType: hard

Expand Down Expand Up @@ -4279,9 +4279,9 @@ __metadata:
linkType: hard

"caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001587":
version: 1.0.30001624
resolution: "caniuse-lite@npm:1.0.30001624"
checksum: 10c0/534fe35cacee745c08689a6a045ee1a9ca525b38f707746088b768bee06c71df5f13875787389648a134d82848d33a375e56590dde3cc86033d0350c2838f978
version: 1.0.30001625
resolution: "caniuse-lite@npm:1.0.30001625"
checksum: 10c0/26752c65c775ce24b8cfd39a241a4ce33accf2d2e2982f37827c2f94caac3520a3493419e096c42578d372073a2e9f4359f0122ca4c00e51cb02463c512fc6b3
languageName: node
linkType: hard

Expand Down Expand Up @@ -5133,14 +5133,14 @@ __metadata:
linkType: hard

"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.4":
version: 4.3.4
resolution: "debug@npm:4.3.4"
version: 4.3.5
resolution: "debug@npm:4.3.5"
dependencies:
ms: "npm:2.1.2"
peerDependenciesMeta:
supports-color:
optional: true
checksum: 10c0/cedbec45298dd5c501d01b92b119cd3faebe5438c3917ff11ae1bff86a6c722930ac9c8659792824013168ba6db7c4668225d845c633fbdafbbf902a6389f736
checksum: 10c0/082c375a2bdc4f4469c99f325ff458adad62a3fc2c482d59923c260cb08152f34e2659f72b3767db8bb2f21ca81a60a42d1019605a412132d7b9f59363a005cc
languageName: node
linkType: hard

Expand Down Expand Up @@ -5432,9 +5432,9 @@ __metadata:
linkType: hard

"dompurify@npm:^2.2.0":
version: 2.5.4
resolution: "dompurify@npm:2.5.4"
checksum: 10c0/c7e974a24375295b5762e688807aeea6d972f393fc07dd0c24800c6aa31660d4e628184b7e5eaf36a1ae527249537a96e5eb440ddaa9b4872162cc0580b08238
version: 2.5.5
resolution: "dompurify@npm:2.5.5"
checksum: 10c0/2e280e88c632bcee232b9be07fbe4f910f0d28278c79bfdb93c873e9c3418008123cb28b4ca6ada1d25efac7f632f85c3c59ba6b3cff3b89410aedf58dc16173
languageName: node
linkType: hard

Expand Down Expand Up @@ -5524,9 +5524,9 @@ __metadata:
linkType: hard

"electron-to-chromium@npm:^1.4.668":
version: 1.4.783
resolution: "electron-to-chromium@npm:1.4.783"
checksum: 10c0/d112e5602e2ee7516ead648e2d2449027f1106147858442781ac475f9a3861a783cb6c8f4638316800f5eff2c4a1f046cd412704678c90479c5417bf204de572
version: 1.4.787
resolution: "electron-to-chromium@npm:1.4.787"
checksum: 10c0/fa509ca710186461dd53e31773a7b06af3a958ab9b06b2e3d1d64de35204df2ff6f2050c94186adf4b850583666a50d30a6912103a0e3f5bcfc97864712ff424
languageName: node
linkType: hard

Expand Down Expand Up @@ -12975,9 +12975,9 @@ __metadata:
linkType: hard

"type@npm:^2.7.2":
version: 2.7.2
resolution: "type@npm:2.7.2"
checksum: 10c0/84c2382788fe24e0bc3d64c0c181820048f672b0f06316aa9c7bdb373f8a09f8b5404f4e856bc4539fb931f2f08f2adc4c53f6c08c9c0314505d70c29a1289e1
version: 2.7.3
resolution: "type@npm:2.7.3"
checksum: 10c0/dec6902c2c42fcb86e3adf8cdabdf80e5ef9de280872b5fd547351e9cca2fe58dd2aa6d2547626ddff174145db272f62d95c7aa7038e27c11315657d781a688d
languageName: node
linkType: hard

Expand Down

0 comments on commit b13e8f6

Please sign in to comment.