-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
48 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = function(eleventyConfig) { | ||
eleventyConfig.addPassthroughCopy("www/css"); | ||
eleventyConfig.addPassthroughCopy("www/js"); | ||
eleventyConfig.addPassthroughCopy("www/favicon.ico"); | ||
eleventyConfig.addPassthroughCopy("www/robots.txt"); | ||
return { | ||
passthroughFileCopy: true, | ||
dir: { | ||
input: "www", | ||
output: "_site" | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
www/_site/ | ||
www/node_modules/ | ||
www/package-lock.json | ||
package-lock.json | ||
_site/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
"devDependencies": { | ||
"@11ty/eleventy": "^0.10.0" | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: Using a nonce in CSP | ||
layout: layout | ||
--- | ||
<div class="jumbotron"> | ||
<h1>Using a <code>nonce</code> with CSP</h1> | ||
<div class="lead">A <code>nonce</code> is a randomly generated token that should be used only one time. </div> | ||
</div> | ||
<h2>Example Nonce Usage</h2> | ||
<p>Using a <code>nonce</code> is one of the easiest ways to allow the execution of inline scripts in a Content Security Policy (CSP). Here's how one might use it with the CSP <a href="/script-src/"><code>script-src</code></a> directive:</p> | ||
<pre> | ||
script-src 'nonce-r@nd0m'; | ||
</pre> | ||
<blockquote> | ||
<strong>NOTE:</strong> We are using the phrase: <em>r@nd0m</em> to denote a random value. You should use a cryptographically secure random token generator to generate a nonce value. The random nonce value should only be used for a single HTTP request. | ||
</blockquote> | ||
<p>Now we can allow an inline <code><script></code> tag to execute by adding our random nonce value in the <code>nonce</code> attribute of the <code>script</code> tag:</p> | ||
<pre> | ||
<script nonce="r@nd0m"> | ||
doWhatever(); | ||
</script> | ||
</pre> | ||
<h2>Nonce Browser Support</h2> | ||
<p>The <code>nonce</code> source list directive was added to CSP Level 2. This means that support has existed since 2015 in Chrome and Firefox, Safari 10+ or Edge 15+.</p> | ||
<p>It is not supported at all in Internet Explorer, you need to use the Edge browser instead.</p> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters