diff --git a/src/content/_index.html b/src/content/_index.html index 532db27..02e74a4 100644 --- a/src/content/_index.html +++ b/src/content/_index.html @@ -7,15 +7,13 @@ description: "cspresso crawls a site with headless Chromium (Playwright) and emi
cspresso crawls up to N same‑origin pages with headless Chromium (Playwright), watches the assets that load,
and emits a draft Content-Security-Policy header.
pipx install cspresso
-cspresso https://example.com --max-pages 10
+cspresso https://mig5.net --max-pages 10
-# visited: https://example.com/
+# visited: https://mig5.net/
Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; ...;
-
-cspresso https://mig5.net \
- --ignore-non-html \
- --max-pages 10
-
-
- --json
- --bypass-csp.
- # Evaluate a candidate CSP (Report-Only) and fail CI on violations
-cspresso https://mig5.net \
- --bypass-csp \
- --evaluate "default-src 'self'; img-src 'none';" \
- --json
-
-{
- [...]
- "violations": [
- {
- "console": true,
- "disposition": "report",
- "documentURI": "https://mig5.net/",
- "text": "Loading the image 'https://mig5.net/logo.svg' violates the following Content Security Policy directive: \"img-src 'none'\". The policy is report-only, so the violation has been logged but no further action has been taken.",
- "type": "info"
- },
- {
- "console": true,
- "disposition": "report",
- "documentURI": "https://mig5.net/static/mig5.asc",
- "text": "Applying inline style violates the following Content Security Policy directive 'default-src 'self''. Either the 'unsafe-inline' keyword, a hash ('sha256-4Su6mBWzEIFnH4pAGMOuaeBrstwJN4Z3pq/s1Kn4/KQ='), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback. The policy is report-only, so the violation has been logged but no further action has been taken.",
- "type": "info"
- }
- ]
-}
-
-# exit code: 1 if violations detected
- cspresso lets the browser do the hard part: execute the page, watch what it loads, and distill origins into directives.
++ It uses Playwright (a tool designed to run a browser in 'headless' mode, originally to help automate performing frontend testing of websites) to visit the website in the background and learn what directives of a Content-Security Policy would be needed in order to set such a header and still have the website function properly. +
++ It can also evaluate a provided CSP against a site and see if normal use of the site would trigger violations of the policy, before you ship it. +