Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
"problemMatcher": []
},
{
"label": "Check: CSP Scripts",
"label": "Check: CSP",
"type": "process",
"command": "checks/check-csp-scripts.py",
"command": "checks/check-csp.py",
"args": [
"public"
],
Expand All @@ -82,7 +82,7 @@
"Lint: Shell",
"Lint: Shell Format",
"Check: URL Parity",
"Check: CSP Scripts"
"Check: CSP"
],
"problemMatcher": []
}
Expand Down
4 changes: 2 additions & 2 deletions CONTENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ This is the reason this file exists, so it is worth stating plainly.
| --- | --- |
| `hugo --gc --minify --panicOnWarning` | yes, it must build |
| [`checks/check-url-parity.py`][parity] | yes, for URLs, asset references, and the orphan count |
| [`checks/check-csp-scripts.py`][csp-scripts] | yes, for a script, inline handler, `javascript:` URL, frame, media file, or object a post's raw HTML adds |
| [`checks/check-csp.py`][csp] | yes, for an inline handler or `javascript:` URL a post's raw HTML adds, and for a script, image, stylesheet, font, frame, media file, or object it loads from another host |
| `checks/check-live-urls.sh` | yes, against a running server |
| markdownlint | no, `content/.markdownlint-cli2.jsonc` ignores the tree |
| CSpell | no, `cspell.json` ignores the tree |
Expand All @@ -211,7 +211,7 @@ A fact in a published post that proves wrong is corrected in the post. It is not

[checks]: ./checks/
[codestyle]: ./CODESTYLE.md
[csp-scripts]: ./checks/check-csp-scripts.py
[csp]: ./checks/check-csp.py
[operations]: ./OPERATIONS.md
[metadata]: ./checks/check-media-metadata.py
[normalize]: ./scripts/normalize-media.py
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ For a defect in the site or the tooling, such as a broken link, a missing redire

The required tools and their install commands are listed in [deploy/README.md][deploy-readme]. Hugo must be the extended build.

Build the site and verify it against the URL contract and the blog's Content-Security-Policy:
Build the site and verify it against the URL contract and both sites' Content-Security-Policies:

```sh
hugo --gc --minify --panicOnWarning
checks/check-url-parity.py public
checks/check-csp-scripts.py public
checks/check-csp.py public
```

Build a release and verify it against a running server:
Expand Down
4 changes: 2 additions & 2 deletions checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This README covers the URL contract alone. The other checks in this directory ea
| Check | Fails when |
| --- | --- |
| [`check-csp-browser.py`][check-csp-browser] | a page on a running mirror makes the browser block something that `csp-browser-allow.txt` does not list |
| [`check-csp-scripts.py`][check-csp-scripts] | the scripts, frames, media, or objects the built site loads and the blog's policy disagree |
| [`check-csp.py`][check-csp] | a page or stylesheet on either site fetches something its site's policy does not allow, or a policy names another host |
| [`check-env-docs.py`][check-env-docs] | a configuration value is declared without a description in `ENVIRONMENT.md`, or described there and declared nowhere |
| [`check-github-env.py`][check-github-env] | the variables and secrets GitHub holds differ from the ones `ENVIRONMENT.md` lists |
| [`check-media-metadata.py`][check-media-metadata] | carried media is not in a form the gate can vouch for |
Expand Down Expand Up @@ -190,7 +190,7 @@ Three traps in that adjudication, each of which produced a wrong answer first an
[caddy-dockerfile]: ./caddy/Dockerfile
[capture-readme]: ../capture/README.md
[check-csp-browser]: ./check-csp-browser.py
[check-csp-scripts]: ./check-csp-scripts.py
[check-csp]: ./check-csp.py
[check-env-docs]: ./check-env-docs.py
[check-github-env]: ./check-github-env.py
[check-live-urls]: ./check-live-urls.sh
Expand Down
5 changes: 3 additions & 2 deletions checks/check-csp-browser.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
"""Load a running site in headless Chromium and report what its Content-Security-Policy blocks.

`check-csp-scripts.py` proves the built scripts match the policy's hashes. It cannot see what a
browser blocks at run time: a style, a font, a fetch, an image, or a script a proxy injects. This
`check-csp.py` proves the built scripts match the policy's hashes and that every fetch the pages
and stylesheets name is one the policy allows. It cannot see what a browser blocks at run time: a
fetch a script makes, or a script a proxy injects. This
check loads each page in a URL list against a mirror. It records every `securitypolicyviolation`
event in the page and in each frame it holds, as it fires. The event fires for an enforcing policy
and a Report-Only one alike. Each page is scrolled to its end so lazy images load, and its
Expand Down
239 changes: 0 additions & 239 deletions checks/check-csp-scripts.py

This file was deleted.

Loading
Loading