Skip to content

Conversation

@AnujRNair
Copy link
Contributor

Summary

Nonce attributes will now be added to external scripts and styles whos hostnames haven't been defined in the CSP policy already. If, however, you add your public path to your CSP policy, a nonce won't be added for that specific script tag.

Before merging this, we should check to see if strict-dynamic exists in the policy - if it does, we will still need to generate nonce ids for all external assets, even if their host has been allowed in the CSP policy

Requirements (place an x in each [ ])

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #27 into master-v3 will increase coverage by 1.43%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@ ## master-v3 #27 +/- ## ========================================== + Coverage 91.56% 93% +1.43%  ========================================== Files 2 2 Lines 83 100 +17 Branches 11 16 +5 ========================================== + Hits 76 93 +17  Misses 6 6 Partials 1 1
Impacted Files Coverage Δ
test-utils/webpack-helpers.js 100% <ø> (ø) ⬆️
plugin.js 91.13% <100%> (+2.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b75121...b821738. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #27 into master-v3 will increase coverage by 2.34%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@ ## master-v3 #27 +/- ## ============================================= + Coverage 91.56% 93.91% +2.34%  ============================================= Files 2 2 Lines 83 115 +32 Branches 11 21 +10 ============================================= + Hits 76 108 +32  Misses 6 6 Partials 1 1
Impacted Files Coverage Δ
plugin.js 92.47% <100%> (+3.76%) ⬆️
test-utils/webpack-helpers.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b75121...1ae9c9a. Read the comment docs.

… if the domain has been whitelisted. Also validating static sources
@AnujRNair AnujRNair merged commit cf2984d into master-v3 Jan 2, 2019
@AnujRNair AnujRNair deleted the an-add-nonce-to-external-scripts branch January 2, 2019 19:20
AnujRNair added a commit that referenced this pull request Jan 30, 2019
* Allow different policies on individual HtmlWebpackPlugin instances (#26) * renaming disableCspPlugin to cspPlugin.enabled to be more inline with the main enabled setting * Adding the option to allow individual policies on a specific html webpack plugin instance * Updating README to reflect the new changes * Adding nonce attrs to external scripts where their host hasnt been defined in the CSP already (#27) * Adding nonce attrs to external scripts where their host hasnt been defined in the CSP already * Making sure that nonces are included when strict-dynamic is set, even if the domain has been whitelisted. Also validating static sources * If plugin is disabled, we should not modify the html at all (#28) * If plugin is disabled, we should not modify the html at all * Updating readme to reflect new recommendation of not including a blank meta tag - it will be added for us * 3.0.0-beta.1 * Fine Grain control for hashes and nonces (#29) * Changing devAllowUnsafe to be more fine-grain by allowing the dev to decide when to allow hashes and nonces * Updating readme to reflect new options * 3.0.0-beta.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants