diff --git a/.github/workflows/website-image.yml b/.github/workflows/website-image.yml index 4fe4b03..c7af561 100644 --- a/.github/workflows/website-image.yml +++ b/.github/workflows/website-image.yml @@ -71,10 +71,12 @@ jobs: GITHUB_TOKEN: ${{ github.token }} # Assignments, not an echo of $(…): a failed fetch fails the step. The tag is resolved # once and pinned, so the tests, the image and the publish job read one release. + # The security feed with the token too (scripts/security_feed.py): a broken one fails here. run: | tag=$(python scripts/release_source.py --tag) dir=$(OW_RELEASE_TAG="$tag" python scripts/release_source.py --relative) - { echo "tag=$tag"; echo "dir=$dir"; } >> "$GITHUB_OUTPUT" + python scripts/security_feed.py .release/security.json + { echo "tag=$tag"; echo "dir=$dir"; echo "feed=.release/security.json"; } >> "$GITHUB_OUTPUT" - name: Set up Node 24 uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 @@ -100,7 +102,10 @@ jobs: - name: Build the image env: OW_APP_SOURCE: ${{ steps.release.outputs.dir }} - run: docker build -f website/Dockerfile --build-arg OW_APP_SOURCE -t openwhistle-website:test . + OW_SECURITY_FEED: ${{ steps.release.outputs.feed }} + run: | + docker build -f website/Dockerfile --build-arg OW_APP_SOURCE --build-arg OW_SECURITY_FEED \ + -t openwhistle-website:test . - name: Start it as it will run (read-only, unprivileged) run: | @@ -166,10 +171,12 @@ jobs: GITHUB_TOKEN: ${{ github.token }} OW_RELEASE_TAG: ${{ needs.test.outputs.tag }} # Never the latest again: a release published while the tests ran was not tested. + # The security feed is fetched again: an advisory published meanwhile belongs in it. run: | test -n "$OW_RELEASE_TAG" dir=$(python scripts/release_source.py --relative) - echo "dir=$dir" >> "$GITHUB_OUTPUT" + python scripts/security_feed.py .release/security.json + { echo "dir=$dir"; echo "feed=.release/security.json"; } >> "$GITHUB_OUTPUT" - id: meta uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6 @@ -184,7 +191,9 @@ jobs: with: context: . file: website/Dockerfile - build-args: OW_APP_SOURCE=${{ steps.release.outputs.dir }} + build-args: | + OW_APP_SOURCE=${{ steps.release.outputs.dir }} + OW_SECURITY_FEED=${{ steps.release.outputs.feed }} platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docs-tech/local-review.md b/docs-tech/local-review.md index d0f107f..2aeec31 100644 --- a/docs-tech/local-review.md +++ b/docs-tech/local-review.md @@ -84,7 +84,7 @@ the build reads the latest app release (`scripts/release_source.py`); with it, t | `/404.html` | Not-found page (noindex); open any missing path on the served site. | | `/en/changelog/` | Changelog, rendered from the release's `CHANGELOG.md` — check the version nav in the sidebar. | | `/en/changelog/older/` | The releases before the newest five, from the series without a page of their own — the version nav, the link back. | -| `/en/changelog/1.x/`, `/en/changelog/0.x/` | One page per closed series — the version nav, the links to the other series and back. | +| `/en/changelog/2.0.x/`, `/en/changelog/1.x/`, `/en/changelog/0.x/` | One page per closed series — the version nav, the links to the other series and back. | | `/de/blog/` | Blog index. | | `/de/blog/hinschg-compliance-leitfaden/` | Article. | | `/de/blog/hinweisgebersystem-dsgvo-eu-hosting/` | Article. | diff --git a/docs-tech/mutations/v2.1.2-site-p4.json b/docs-tech/mutations/v2.1.2-site-p4.json index ca79050..12651d9 100644 --- a/docs-tech/mutations/v2.1.2-site-p4.json +++ b/docs-tech/mutations/v2.1.2-site-p4.json @@ -236,8 +236,8 @@ { "id": "HEALTHZ-LOGGED", "file": "website/nginx.conf", - "old": " access_log off;\n", - "new": "", + "old": " location = /healthz {\n access_log off;\n", + "new": " location = /healthz {\n", "tests": "CONFIG" }, { diff --git a/docs-tech/mutations/v2.2.0-site-bug-bounty.json b/docs-tech/mutations/v2.2.0-site-bug-bounty.json index 41a39ec..79d3f5e 100644 --- a/docs-tech/mutations/v2.2.0-site-bug-bounty.json +++ b/docs-tech/mutations/v2.2.0-site-bug-bounty.json @@ -234,7 +234,7 @@ { "id": "CLAIM-CURRENT-RELEASE", "file": "docs/de/blog/whistleblower-software-vergleich.html", - "old": "data-label=\"OpenWhistle\">2.4.2, 4. November 2026", + "old": "data-label=\"OpenWhistle\">2.5.1, 4. November 2026", "new": "data-label=\"OpenWhistle\">2.1.0, 27. September 2026", "tests": "CLAIMS" }, diff --git a/docs-tech/mutations/v2.2.0-site-split.json b/docs-tech/mutations/v2.2.0-site-split.json index 4ed1dd3..4d8c26d 100644 --- a/docs-tech/mutations/v2.2.0-site-split.json +++ b/docs-tech/mutations/v2.2.0-site-split.json @@ -154,8 +154,8 @@ { "id": "IMAGE-BUILDS-ANOTHER-RELEASE", "file": ".github/workflows/website-image.yml", - "old": "--build-arg OW_APP_SOURCE -t", - "new": "-t", + "old": "--build-arg OW_APP_SOURCE --build-arg", + "new": "--build-arg", "tests": "WEBSITE_WF" }, { diff --git a/docs-tech/mutations/v2.2.1-changelog-series.json b/docs-tech/mutations/v2.2.1-changelog-series.json index e2a7d89..4a2a08e 100644 --- a/docs-tech/mutations/v2.2.1-changelog-series.json +++ b/docs-tech/mutations/v2.2.1-changelog-series.json @@ -7,14 +7,14 @@ { "id": "OLDER-KEEPS-ARCHIVED", "file": "scripts/render_changelog.py", - "old": " and not (older and _major(v) in ARCHIVED)\n", + "old": " and not (older and _series(v) is not None)\n", "new": "", "tests": "SPLIT" }, { "id": "ARCHIVE-ANY-MAJOR", "file": "scripts/render_changelog.py", - "old": "v.name not in on_main and _major(v) == major]", + "old": "v.name not in on_main and _series(v) == major]", "new": "v.name not in on_main]", "tests": "SPLIT" }, diff --git a/docs-tech/mutations/v2.5.0-site-security-feed.json b/docs-tech/mutations/v2.5.0-site-security-feed.json new file mode 100644 index 0000000..7a9b17a --- /dev/null +++ b/docs-tech/mutations/v2.5.0-site-security-feed.json @@ -0,0 +1,69 @@ +{ + "timeout_seconds": 600, + "test_groups": { + "FEED": [ + "tests/test_security_feed.py", + "-k", + "refused" + ], + "BUILT": [ + "tests/test_security_feed.py", + "-k", + "publishes_the_feed" + ], + "CONFIG": [ + "tests/test_website_config.py", + "-k", + "log_holds_no_address" + ], + "WF": [ + "tests/test_website_workflow.py", + "-k", + "security_feed" + ] + }, + "mutations": [ + { + "id": "FEED-ANY-SCHEMA", + "file": "scripts/security_feed.py", + "old": " if not isinstance(feed, dict) or feed.get(\"schema\") != 1:", + "new": " if not isinstance(feed, dict):", + "tests": "FEED" + }, + { + "id": "FEED-HTTP-LINK", + "file": "scripts/security_feed.py", + "old": "not url.startswith(\"https://\")", + "new": "not url.startswith(\"http\")", + "tests": "FEED" + }, + { + "id": "FEED-ANY-RANGE", + "file": "scripts/security_feed.py", + "old": " or not all(CONSTRAINT.fullmatch(part.strip()) for part in value.split(\",\"))", + "new": " or False", + "tests": "FEED" + }, + { + "id": "FEED-NOT-BUILT", + "file": "scripts/build_site.py", + "old": " write_security_feed(out)\n", + "new": "", + "tests": "BUILT" + }, + { + "id": "FEED-LOGGED", + "file": "website/nginx.conf", + "old": " location = /security.json {\n access_log off;\n", + "new": " location = /security.json {\n", + "tests": "CONFIG" + }, + { + "id": "FEED-UNTOKENED", + "file": ".github/workflows/website-image.yml", + "old": "--build-arg OW_SECURITY_FEED \\", + "new": "\\", + "tests": "WF" + } + ] +} diff --git a/docs-tech/mutations/v2.5.1-changelog-2-0.json b/docs-tech/mutations/v2.5.1-changelog-2-0.json new file mode 100644 index 0000000..f547882 --- /dev/null +++ b/docs-tech/mutations/v2.5.1-changelog-2-0.json @@ -0,0 +1,23 @@ +{ + "test_groups": { + "C": [ + "tests/test_changelog_page.py" + ] + }, + "mutations": [ + { + "id": "SERIES-2-0-NOT-ARCHIVED", + "file": "scripts/render_changelog.py", + "old": "ARCHIVED = (\"2.0\", \"1\", \"0\")", + "new": "ARCHIVED = (\"1\", \"0\")", + "tests": "C" + }, + { + "id": "SERIES-MATCHES-PREFIX-ONLY", + "file": "scripts/render_changelog.py", + "old": "version.name.startswith(f\"{s}.\")", + "new": "version.name.startswith(s)", + "tests": "C" + } + ] +} diff --git a/docs/_data/config.yml b/docs/_data/config.yml index 32f29db..cbd3929 100644 --- a/docs/_data/config.yml +++ b/docs/_data/config.yml @@ -200,10 +200,11 @@ groups: default: json - name: UPDATE_CHECK_ENABLED need: optional - description: Set to true to let OpenWhistle check GitHub once a day for a newer release, - shown on the Admin → System page. Off by default (no external calls); sends no - instance data to GitHub — only a standard request. - default: false + description: Once a day OpenWhistle fetches openwhistle.net/security.json, the latest + release and the published security advisories, shown on Admin → System and the + dashboard. The site sees the server's IP address and logs nothing; no instance data is sent. Set + false for an air-gapped server. + default: true - name: TELEMETRY_ENABLED need: optional description: 'The daily installation count. Unset or empty: diff --git a/docs/_diagrams/architecture.de.drawio b/docs/_diagrams/architecture.de.drawio index 865b33c..132a228 100644 --- a/docs/_diagrams/architecture.de.drawio +++ b/docs/_diagrams/architecture.de.drawio @@ -40,7 +40,7 @@ - + diff --git a/docs/_diagrams/architecture.drawio b/docs/_diagrams/architecture.drawio index eff5f99..a8e33b0 100644 --- a/docs/_diagrams/architecture.drawio +++ b/docs/_diagrams/architecture.drawio @@ -40,7 +40,7 @@ - + diff --git a/docs/de/blog/hinweisgebersystem-dsgvo-eu-hosting.html b/docs/de/blog/hinweisgebersystem-dsgvo-eu-hosting.html index 8fe3992..6ccf48a 100644 --- a/docs/de/blog/hinweisgebersystem-dsgvo-eu-hosting.html +++ b/docs/de/blog/hinweisgebersystem-dsgvo-eu-hosting.html @@ -4,7 +4,7 @@ translation_key: whistleblowing-system-gdpr-eu-hosting og_type: article published: '2026-09-27' -modified: '2026-10-27' +modified: '2026-11-04' css: - post js: @@ -19,7 +19,7 @@ '@type': WebPage '@id': https://openwhistle.net/de/blog/hinweisgebersystem-dsgvo-eu-hosting/ datePublished: '2026-09-27' - dateModified: '2026-10-27' + dateModified: '2026-11-04' author: '@type': Organization name: OpenWhistle Contributors @@ -58,7 +58,7 @@

Hinweisgebersystem mit EU-Hosting und DSGVO: wo die Da

Selbst gehostet liegen alle Meldungen auf dem Server des Betreibers, in der EU, wenn er sie dort betreibt. Was OpenWhistle verschlüsselt, was es nie speichert und was die DSGVO beim Betreiber lässt.

@@ -123,7 +123,7 @@

Was OpenWhistle nie speichert

  • IP-Adressen. nginx entfernt die IP-Header und schreibt kein Zugriffsprotokoll [3]. Die App verwirft die Adresse, die Datenbank hat keine IP-Spalte.
  • Uhrzeiten der meldenden Person. Meldung, Nachrichten und Anhänge tragen nur das Datum.
  • -
  • Daten für Dritte. Jede Anfrage nach außen ist optional und in der Dokumentation aufgelistet. Update-Prüfung und Installationszählung sind aus, bis Sie sie einschalten.
  • +
  • Daten für Dritte. Jede Anfrage nach außen ist optional und in der Dokumentation aufgelistet. Die Installationszählung ist aus, bis Sie sie einschalten. Die Update-Prüfung ruft täglich eine Datei von openwhistle.net ab und lässt sich abschalten.

Ist ein Hinweisgebersystem DSGVO-konform?

diff --git a/docs/de/blog/interne-meldestelle-kostenlos.html b/docs/de/blog/interne-meldestelle-kostenlos.html index 04e379f..a0d70b2 100644 --- a/docs/de/blog/interne-meldestelle-kostenlos.html +++ b/docs/de/blog/interne-meldestelle-kostenlos.html @@ -4,7 +4,7 @@ translation_key: free-internal-reporting-channel og_type: article published: '2026-09-27' -modified: '2026-10-27' +modified: '2026-11-04' section: Praxis css: - post @@ -20,7 +20,7 @@ '@type': WebPage '@id': https://openwhistle.net/de/blog/interne-meldestelle-kostenlos/ datePublished: '2026-09-27' - dateModified: '2026-10-27' + dateModified: '2026-11-04' author: '@type': Organization name: OpenWhistle Contributors @@ -59,7 +59,7 @@

Interne Meldestelle kostenlos: was „kostenlos“ wir

Die Software für eine interne Meldestelle kostenlos zu bekommen, ist leicht. Die Pflichten des HinSchG bleiben trotzdem. Was an Server, Betrieb und Arbeit übrig bleibt, welche Optionen es gibt und wie Sie mit OpenWhistle anfangen.

@@ -103,8 +103,8 @@

Was Sie selbst betreiben

So sieht der Stack aus, den OpenWhistle mit Docker Compose startet. Pflicht sind App, PostgreSQL und Redis hinter nginx. ClamAV und S3 sind optional.

- Aufbau: Ein Browser erreicht nginx über TLS auf Port 443, Port 80 leitet um. Tor Browser erreicht den Onion-Zugang auf 8080, nur an 127.0.0.1 gebunden. Beide führen zur zustandslosen FastAPI-App. Sie braucht PostgreSQL und Redis, kann ClamAV und S3 nutzen und stellt zwei abschaltbare Anfragen nach außen: die GitHub-Update-Prüfung und die Installationszählung. - Aufbau: Ein Browser erreicht nginx über TLS auf Port 443, Port 80 leitet um. Tor Browser erreicht den Onion-Zugang auf 8080, nur an 127.0.0.1 gebunden. Beide führen zur zustandslosen FastAPI-App. Sie braucht PostgreSQL und Redis, kann ClamAV und S3 nutzen und stellt zwei abschaltbare Anfragen nach außen: die GitHub-Update-Prüfung und die Installationszählung. + Aufbau: Ein Browser erreicht nginx über TLS auf Port 443, Port 80 leitet um. Tor Browser erreicht den Onion-Zugang auf 8080, nur an 127.0.0.1 gebunden. Beide führen zur zustandslosen FastAPI-App. Sie braucht PostgreSQL und Redis, kann ClamAV und S3 nutzen und stellt zwei abschaltbare Anfragen nach außen: die Update-Prüfung bei openwhistle.net und die Installationszählung. + Aufbau: Ein Browser erreicht nginx über TLS auf Port 443, Port 80 leitet um. Tor Browser erreicht den Onion-Zugang auf 8080, nur an 127.0.0.1 gebunden. Beide führen zur zustandslosen FastAPI-App. Sie braucht PostgreSQL und Redis, kann ClamAV und S3 nutzen und stellt zwei abschaltbare Anfragen nach außen: die Update-Prüfung bei openwhistle.net und die Installationszählung.
Der OpenWhistle-Stack. Beide Anfragen nach außen sind aus, bis Sie sie einschalten.
diff --git a/docs/de/blog/whistleblower-software-vergleich.html b/docs/de/blog/whistleblower-software-vergleich.html index e5e20c8..dd2f876 100644 --- a/docs/de/blog/whistleblower-software-vergleich.html +++ b/docs/de/blog/whistleblower-software-vergleich.html @@ -182,7 +182,7 @@

GlobaLeaks: die ausgereifte Referenz

Seit2011 [1]April 2026 (0.1.0) - Aktuelles Release5.0.99, 26. Juli 2026 [3]2.4.2, 4. November 2026 + Aktuelles Release5.0.99, 26. Juli 2026 [3]2.5.1, 4. November 2026 LizenzAGPL-3.0 [2]GPL-3.0 ProgrammiersprachePython, TypeScript [2]Python InstallationDebian, Ubuntu; Docker [4] [5]Docker Compose, Helm diff --git a/docs/de/index.html b/docs/de/index.html index 8f0c8b4..791def7 100644 --- a/docs/de/index.html +++ b/docs/de/index.html @@ -21,7 +21,7 @@ price: '0' priceCurrency: EUR license: https://www.gnu.org/licenses/gpl-3.0.html - softwareVersion: 2.4.2 + softwareVersion: 2.5.1 downloadUrl: https://github.com/openwhistle/OpenWhistle/releases/latest installUrl: https://openwhistle.net/en/docs/install/ softwareHelp: @@ -179,7 +179,7 @@

- Version 2.4.2 + Version 2.5.1 GPL-3.0 Python 3.15 Docker diff --git a/docs/en/blog/free-internal-reporting-channel.html b/docs/en/blog/free-internal-reporting-channel.html index 10051c1..7850666 100644 --- a/docs/en/blog/free-internal-reporting-channel.html +++ b/docs/en/blog/free-internal-reporting-channel.html @@ -4,7 +4,7 @@ translation_key: free-internal-reporting-channel og_type: article published: '2026-09-27' -modified: '2026-10-27' +modified: '2026-11-04' section: Practice css: - post @@ -20,7 +20,7 @@ '@type': WebPage '@id': https://openwhistle.net/en/blog/free-internal-reporting-channel/ datePublished: '2026-09-27' - dateModified: '2026-10-27' + dateModified: '2026-11-04' author: '@type': Organization name: OpenWhistle Contributors @@ -59,7 +59,7 @@

A free internal reporting channel: what "free" really

Getting a whistleblowing tool for free is easy. The duties under the Whistleblower Protection Act (HinSchG) remain all the same. What is left in server, operations and work, which options exist and how to start with OpenWhistle.

@@ -103,8 +103,8 @@

What you run yourself

This is the stack that OpenWhistle starts with Docker Compose. The app, PostgreSQL and Redis behind nginx are required. ClamAV and S3 are optional.

- Architecture: a browser reaches nginx over TLS on port 443, port 80 redirects. Tor Browser reaches the onion access on 8080, bound only to 127.0.0.1. Both lead to the stateless FastAPI app. It needs PostgreSQL and Redis, can use ClamAV and S3, and makes two outbound requests that can be switched off: the GitHub update check and the installation count. - Architecture: a browser reaches nginx over TLS on port 443, port 80 redirects. Tor Browser reaches the onion access on 8080, bound only to 127.0.0.1. Both lead to the stateless FastAPI app. It needs PostgreSQL and Redis, can use ClamAV and S3, and makes two outbound requests that can be switched off: the GitHub update check and the installation count. + Architecture: a browser reaches nginx over TLS on port 443, port 80 redirects. Tor Browser reaches the onion access on 8080, bound only to 127.0.0.1. Both lead to the stateless FastAPI app. It needs PostgreSQL and Redis, can use ClamAV and S3, and makes two outbound requests that can be switched off: the update check at openwhistle.net and the installation count. + Architecture: a browser reaches nginx over TLS on port 443, port 80 redirects. Tor Browser reaches the onion access on 8080, bound only to 127.0.0.1. Both lead to the stateless FastAPI app. It needs PostgreSQL and Redis, can use ClamAV and S3, and makes two outbound requests that can be switched off: the update check at openwhistle.net and the installation count.
The OpenWhistle stack. Both outbound requests are off until you switch them on.
diff --git a/docs/en/blog/whistleblowing-software-comparison.html b/docs/en/blog/whistleblowing-software-comparison.html index 2966018..a6be47f 100644 --- a/docs/en/blog/whistleblowing-software-comparison.html +++ b/docs/en/blog/whistleblowing-software-comparison.html @@ -182,7 +182,7 @@

GlobaLeaks: the mature reference

Since2011 [1]April 2026 (0.1.0) - Current release5.0.99, 26 July 2026 [3]2.4.2, 4 November 2026 + Current release5.0.99, 26 July 2026 [3]2.5.1, 4 November 2026 LicenceAGPL-3.0 [2]GPL-3.0 Programming languagePython, TypeScript [2]Python InstallationDebian, Ubuntu; Docker [4] [5]Docker Compose, Helm diff --git a/docs/en/blog/whistleblowing-system-gdpr-eu-hosting.html b/docs/en/blog/whistleblowing-system-gdpr-eu-hosting.html index 5de0368..1e8a6bd 100644 --- a/docs/en/blog/whistleblowing-system-gdpr-eu-hosting.html +++ b/docs/en/blog/whistleblowing-system-gdpr-eu-hosting.html @@ -4,7 +4,7 @@ translation_key: whistleblowing-system-gdpr-eu-hosting og_type: article published: '2026-09-27' -modified: '2026-10-27' +modified: '2026-11-04' css: - post js: @@ -19,7 +19,7 @@ '@type': WebPage '@id': https://openwhistle.net/en/blog/whistleblowing-system-gdpr-eu-hosting/ datePublished: '2026-09-27' - dateModified: '2026-10-27' + dateModified: '2026-11-04' author: '@type': Organization name: OpenWhistle Contributors @@ -58,7 +58,7 @@

Whistleblowing system with EU hosting and GDPR: where

Self-hosted, all reports sit on the operator's server, in the EU if the operator runs it there. What OpenWhistle encrypts, what it never stores and what the GDPR leaves with the operator.

@@ -123,7 +123,7 @@

What OpenWhistle never stores

  • IP addresses. nginx removes the IP headers and writes no access log [3]. The app discards the address, and the database has no IP column.
  • Times of the reporting person. The report, messages and attachments carry only the date.
  • -
  • Data for third parties. Every outbound request is optional and listed in the documentation. The update check and the installation count stay off until you switch them on.
  • +
  • Data for third parties. Every outbound request is optional and listed in the documentation. The installation count stays off until you switch it on. The update check fetches one file a day from openwhistle.net and can be switched off.

Is a whistleblowing system GDPR-compliant?

diff --git a/docs/en/changelog/2.0.x/index.html b/docs/en/changelog/2.0.x/index.html new file mode 100644 index 0000000..7201aac --- /dev/null +++ b/docs/en/changelog/2.0.x/index.html @@ -0,0 +1,29 @@ +--- +title: '2.0.x Releases: Changelog | OpenWhistle' +description: 'Every OpenWhistle 2.0.x release, newest first: the features, fixes and security changes of the series, rendered from CHANGELOG.md.' +translation_key: changelog-2-0-x +css: +- docs +- page +js: +- site +- sidebar +jsonld: +- '@context': https://schema.org + '@type': BreadcrumbList + itemListElement: + - '@type': ListItem + position: 1 + name: OpenWhistle + item: https://openwhistle.net/en/ + - '@type': ListItem + position: 2 + name: Changelog + item: https://openwhistle.net/en/changelog/ + - '@type': ListItem + position: 3 + name: 2.0.x releases + item: https://openwhistle.net/en/changelog/2.0.x/ +generated: changelog_2.0 +--- + diff --git a/docs/en/compare/index.html b/docs/en/compare/index.html index 181ed27..42d17ab 100644 --- a/docs/en/compare/index.html +++ b/docs/en/compare/index.html @@ -166,7 +166,7 @@

Facts side by side

Latest release - 2.4.2 (2026-11-04) + 2.5.1 (2026-11-04) 5.0.99 (2026-07-26) 2.16.1 (2026-07-08) 0.7.34 (2026-10-21) diff --git a/docs/en/docs/admin/index.html b/docs/en/docs/admin/index.html index e2ce8db..3bee4fc 100644 --- a/docs/en/docs/admin/index.html +++ b/docs/en/docs/admin/index.html @@ -181,11 +181,12 @@

Dashboard statistics

System & updates

- System and updates: installed version and update status, the file integrity check, the installation count card and the two settings behind them. - System and updates: installed version and update status, the file integrity check, the installation count card and the two settings behind them. + System and updates: installed version and update status, the file integrity check, the installation count card and the two settings behind them. + System and updates: installed version and update status, the file integrity check, the installation count card and the two settings behind them.
    -
  • /admin/system (with multi-tenancy: superadmin only) shows the installed version. With UPDATE_CHECK_ENABLED=true (opt-in, off by default) it also says whether GitHub has a newer release: checked once a day, cached, no instance data sent.
  • +
  • /admin/system (with multi-tenancy: superadmin only) shows the installed version. It also says whether a newer release exists: once a day the server fetches openwhistle.net/security.json, cached, no instance data sent. UPDATE_CHECK_ENABLED=false turns it off.
  • +
  • Security advisories: the same file lists the published security advisories. When one affects the installed version, the page lists it with its severity, GHSA link and the release that fixes it. The dashboard then shows a red banner to the admins who may run the instance. After the upgrade, both disappear.
  • Installation count: whether this installation is counted, the exact request, its identifier and the last successful report. While it is off and the switch decides, the dashboard asks each admin who may switch it, once per release. An admin switches it (one audit entry per change) and resets the identifier; see Counting installations.
  • File integrity: the application files against a SHA-256 manifest baked into the image at build time. It reports missing, modified or unexpected files, which catches accidental changes, incomplete deployments and corruption. Re-check now refreshes it.
diff --git a/docs/en/docs/anonymity/index.html b/docs/en/docs/anonymity/index.html index 3f7d838..0f20f88 100644 --- a/docs/en/docs/anonymity/index.html +++ b/docs/en/docs/anonymity/index.html @@ -10,8 +10,8 @@ ---

The four anonymity layers

- Architecture: a browser reaches nginx over TLS on 443 (80 redirects), Tor Browser reaches the onion listener on 8080, bound to 127.0.0.1. Both lead to the stateless FastAPI app, which needs PostgreSQL and Redis, can use ClamAV and S3, and makes two opt-in outbound requests: the GitHub update check and the telemetry.wdkro.de count. - Architecture: a browser reaches nginx over TLS on 443 (80 redirects), Tor Browser reaches the onion listener on 8080, bound to 127.0.0.1. Both lead to the stateless FastAPI app, which needs PostgreSQL and Redis, can use ClamAV and S3, and makes two opt-in outbound requests: the GitHub update check and the telemetry.wdkro.de count. + Architecture: a browser reaches nginx over TLS on 443 (80 redirects), Tor Browser reaches the onion listener on 8080, bound to 127.0.0.1. Both lead to the stateless FastAPI app, which needs PostgreSQL and Redis, can use ClamAV and S3, and makes two outbound requests that can be switched off: the openwhistle.net update check and the telemetry.wdkro.de count. + Architecture: a browser reaches nginx over TLS on 443 (80 redirects), Tor Browser reaches the onion listener on 8080, bound to 127.0.0.1. Both lead to the stateless FastAPI app, which needs PostgreSQL and Redis, can use ClamAV and S3, and makes two outbound requests that can be switched off: the openwhistle.net update check and the telemetry.wdkro.de count.

Defence in depth for anonymity: four independent layers keep IP addresses out of diff --git a/docs/en/docs/index.html b/docs/en/docs/index.html index 8b4bee2..5919fe7 100644 --- a/docs/en/docs/index.html +++ b/docs/en/docs/index.html @@ -45,7 +45,13 @@

Supported platforms

Current version

-

v2.4.2, a security release. What it changed:

+

v2.5.1: /admin/system listed the default of UPDATE_CHECK_ENABLED as false; it is true.

+

What v2.5.0 changed:

+
    +
  • Admins see on the dashboard and on /admin/system when the running version has a published security advisory, and which release fixes it.
  • +
  • The update check is on by default and reads openwhistle.net/security.json once a day instead of GitHub; UPDATE_CHECK_ENABLED=false turns it off.
  • +
+

What v2.4.2 changed, a security release:

  • pypdf 6.21.4 and pyasn1 0.6.5: eleven CVEs, the pypdf ones reachable through an anonymous PDF upload.
  • A password change, deactivation or authenticator reset now ends a stolen session even while it refreshes.
  • diff --git a/docs/en/docs/outbound/index.html b/docs/en/docs/outbound/index.html index 4b7ce8a..60a23cc 100644 --- a/docs/en/docs/outbound/index.html +++ b/docs/en/docs/outbound/index.html @@ -1,6 +1,6 @@ --- title: Every request that leaves the host | OpenWhistle -description: Every network request an OpenWhistle installation can make, all of them opt-in and off by default, so you can prove nothing else leaves your server. +description: Every network request an OpenWhistle installation can make, and how to switch each off, so you can prove nothing else leaves your server. translation_key: docs-outbound layout: docs css: @@ -12,15 +12,15 @@

    Every request that leaves the host

    - The whole list; nothing on it is on until you switch it on. Three destinations are fixed - — api.github.com, telemetry.wdkro.de and ClamAV's mirrors. - Every other one is a server you name. + The whole list. Only the update check is on by default; everything else waits until you + switch it on. Three destinations are fixed — openwhistle.net, + telemetry.wdkro.de and ClamAV's mirrors. Every other one is a server you name.

    - + diff --git a/docs/en/docs/upgrade/index.html b/docs/en/docs/upgrade/index.html index 08ae17a..2027b4e 100644 --- a/docs/en/docs/upgrade/index.html +++ b/docs/en/docs/upgrade/index.html @@ -73,6 +73,7 @@

    Rollback

    Stay up to date

    Security fixes are released as patch versions. To hear about them, watch the repository's - releases (GitHub: Watch → Custom → Releases). + releases (GitHub: Watch → Custom → Releases). The dashboard also warns when a published + security advisory affects your version, unless UPDATE_CHECK_ENABLED=false.

    diff --git a/docs/en/docs/whistleblower/index.html b/docs/en/docs/whistleblower/index.html index ac6410c..5b3a9fb 100644 --- a/docs/en/docs/whistleblower/index.html +++ b/docs/en/docs/whistleblower/index.html @@ -53,8 +53,8 @@

    Submitting a report

    saved them.

    - Report submitted: the case number and the secret PIN, each with a copy button, a checkbox confirming they are saved, and Continue to report status. - Report submitted: the case number and the secret PIN, each with a copy button, a checkbox confirming they are saved, and Continue to report status. + Report submitted: the case number and the secret PIN, each with a copy button, a checkbox confirming they are saved, and Continue to report status. + Report submitted: the case number and the secret PIN, each with a copy button, a checkbox confirming they are saved, and Continue to report status.
    • A second click on Submit never creates a second report. It shows the same case number and PIN, or, while the first click still runs, a still being processed page with Check again.
    • diff --git a/docs/en/index.html b/docs/en/index.html index b117ab2..4ef0d21 100644 --- a/docs/en/index.html +++ b/docs/en/index.html @@ -21,7 +21,7 @@ price: '0' priceCurrency: EUR license: https://www.gnu.org/licenses/gpl-3.0.html - softwareVersion: 2.4.2 + softwareVersion: 2.5.1 downloadUrl: https://github.com/openwhistle/OpenWhistle/releases/latest installUrl: https://openwhistle.net/en/docs/install/ softwareHelp: @@ -172,7 +172,7 @@

      - Version 2.4.2 + Version 2.5.1 GPL-3.0 Python 3.15 Docker diff --git a/docs/en/roadmap/index.html b/docs/en/roadmap/index.html index a510345..b8f5401 100644 --- a/docs/en/roadmap/index.html +++ b/docs/en/roadmap/index.html @@ -29,9 +29,9 @@ @@ -67,15 +67,15 @@

      Roadmap

      Ordering principle

      - Breadth before depth. Release 2.5.0 changes how every deployment receives and - connects reports. Release 2.6.0 changes how every deployment stores them. v2.7.0 adds modules for specific German + Breadth before depth. Release 2.6.0 changes how every deployment receives and + connects reports. Release 2.7.0 changes how every deployment stores them. v2.8.0 adds modules for specific German regulations (LkSG, KWG, CSRD), useful to some operators only. The order is a plan, not a promise: it moves when a reason turns up.

      - -
      -

      v2.5.0 — Multi-Channel Intake & Integration Hooks

      + +
      +

      v2.6.0 — Multi-Channel Intake & Integration Hooks

      More ways to receive a report, and hooks into compliance tooling (SIEM, GRC, ticketing) that never expose case content. @@ -163,11 +163,11 @@

      Design system

    - -
    -

    v2.6.0 — End-to-End Encryption

    + +
    +

    v2.7.0 — End-to-End Encryption

    - Today the server encrypts a report at rest but can read it. From v2.6.0 it cannot: a + Today the server encrypts a report at rest but can read it. From v2.7.0 it cannot: a report is readable only with the reporter's PIN or a handler's key.

    @@ -191,9 +191,9 @@

    Open questions

    - -
    -

    v2.7.0 — Compliance Expansion (LkSG, KWG, CSRD)

    + +
    +

    v2.8.0 — Compliance Expansion (LkSG, KWG, CSRD)

    Obligations beyond HinSchG, as add-on modules that leave the whistleblower flow unchanged. LkSG (since 2023) needs a supply-chain channel, KWG a banking one; CSRD disclosures refer @@ -306,7 +306,7 @@

    Reporting & transparency

    Already released

    Every shipped release, newest first, is on the - Changelog page. The latest, v2.4.2, is a security patch. It updates pypdf and pyasn1 (eleven CVEs) and ends a stolen admin session with the password change. It also keeps the reporter's address out of a full nginx disk's log, and § 17 deadlines end with their last day. Version 2.4.1 refused a crafted PDF that could stall the anonymous channel. Version 2.4.0 added branding and linked the external reporting offices and the operator's legal notices from every page. + Changelog page. The latest, v2.5.1, fixes a wrong default on the System page. Version 2.5.0 tells admins on the dashboard when their version has a published security advisory. Version 2.4.2 was a security patch. It updated pypdf and pyasn1 (eleven CVEs) and ended a stolen admin session with the password change. It also kept the reporter's address out of a full nginx disk's log, and § 17 deadlines now end with their last day. Version 2.4.1 refused a crafted PDF that could stall the anonymous channel. Version 2.4.0 added branding and linked the external reporting offices and the operator's legal notices from every page.

    diff --git a/docs/img/diagrams/architecture-dark.svg b/docs/img/diagrams/architecture-dark.svg index a5aae1f..78c5fda 100644 --- a/docs/img/diagrams/architecture-dark.svg +++ b/docs/img/diagrams/architecture-dark.svg @@ -1,2 +1,2 @@ -Browser / Tor BrowsernginxTLS :443:80 redirects to :443Onion :8080127.0.0.1 onlyapp (FastAPI)statelessrequiredPostgreSQLRedisoptionalClamAVscanS3storeoutboundGitHub APIupdate check, opt-intelemetry.wdkro.deopt-inonion service \ No newline at end of file +Browser / Tor BrowsernginxTLS :443:80 redirects to :443Onion :8080127.0.0.1 onlyapp (FastAPI)statelessrequiredPostgreSQLRedisoptionalClamAVscanS3storeoutboundopenwhistle.netupdate checktelemetry.wdkro.deopt-inonion service \ No newline at end of file diff --git a/docs/img/diagrams/architecture-light.svg b/docs/img/diagrams/architecture-light.svg index 8dbe0ca..5f913ba 100644 --- a/docs/img/diagrams/architecture-light.svg +++ b/docs/img/diagrams/architecture-light.svg @@ -1,2 +1,2 @@ -Browser / Tor BrowsernginxTLS :443:80 redirects to :443Onion :8080127.0.0.1 onlyapp (FastAPI)statelessrequiredPostgreSQLRedisoptionalClamAVscanS3storeoutboundGitHub APIupdate check, opt-intelemetry.wdkro.deopt-inonion service \ No newline at end of file +Browser / Tor BrowsernginxTLS :443:80 redirects to :443Onion :8080127.0.0.1 onlyapp (FastAPI)statelessrequiredPostgreSQLRedisoptionalClamAVscanS3storeoutboundopenwhistle.netupdate checktelemetry.wdkro.deopt-inonion service \ No newline at end of file diff --git a/docs/img/diagrams/architecture.de-dark.svg b/docs/img/diagrams/architecture.de-dark.svg index 30405ab..997c323 100644 --- a/docs/img/diagrams/architecture.de-dark.svg +++ b/docs/img/diagrams/architecture.de-dark.svg @@ -1,2 +1,2 @@ -Browser / Tor-BrowsernginxTLS :443:80 leitet um auf :443Onion :8080nur 127.0.0.1app (FastAPI)zustandsloserforderlichPostgreSQLRedisoptionalClamAVVirenscanS3SpeicherausgehendGitHub-APIUpdate-Prüfung, opt-intelemetry.wdkro.deopt-inOnion-Dienst \ No newline at end of file +Browser / Tor-BrowsernginxTLS :443:80 leitet um auf :443Onion :8080nur 127.0.0.1app (FastAPI)zustandsloserforderlichPostgreSQLRedisoptionalClamAVVirenscanS3Speicherausgehendopenwhistle.netUpdate-Prüfungtelemetry.wdkro.deopt-inOnion-Dienst \ No newline at end of file diff --git a/docs/img/diagrams/architecture.de-light.svg b/docs/img/diagrams/architecture.de-light.svg index bcb7ed7..72ba7ee 100644 --- a/docs/img/diagrams/architecture.de-light.svg +++ b/docs/img/diagrams/architecture.de-light.svg @@ -1,2 +1,2 @@ -Browser / Tor-BrowsernginxTLS :443:80 leitet um auf :443Onion :8080nur 127.0.0.1app (FastAPI)zustandsloserforderlichPostgreSQLRedisoptionalClamAVVirenscanS3SpeicherausgehendGitHub-APIUpdate-Prüfung, opt-intelemetry.wdkro.deopt-inOnion-Dienst \ No newline at end of file +Browser / Tor-BrowsernginxTLS :443:80 leitet um auf :443Onion :8080nur 127.0.0.1app (FastAPI)zustandsloserforderlichPostgreSQLRedisoptionalClamAVVirenscanS3Speicherausgehendopenwhistle.netUpdate-Prüfungtelemetry.wdkro.deopt-inOnion-Dienst \ No newline at end of file diff --git a/docs/img/screens/_release b/docs/img/screens/_release index 8e8299d..73462a5 100644 --- a/docs/img/screens/_release +++ b/docs/img/screens/_release @@ -1 +1 @@ -2.4.2 +2.5.1 diff --git a/docs/img/screens/admin-branding-dark-m.webp b/docs/img/screens/admin-branding-dark-m.webp index 2440d1d..e648609 100644 Binary files a/docs/img/screens/admin-branding-dark-m.webp and b/docs/img/screens/admin-branding-dark-m.webp differ diff --git a/docs/img/screens/admin-branding-dark.png b/docs/img/screens/admin-branding-dark.png index 6cc6d76..bb723ef 100644 Binary files a/docs/img/screens/admin-branding-dark.png and b/docs/img/screens/admin-branding-dark.png differ diff --git a/docs/img/screens/admin-branding-light-m.webp b/docs/img/screens/admin-branding-light-m.webp index 41f5c53..70eea96 100644 Binary files a/docs/img/screens/admin-branding-light-m.webp and b/docs/img/screens/admin-branding-light-m.webp differ diff --git a/docs/img/screens/admin-branding-light.png b/docs/img/screens/admin-branding-light.png index fd58aa3..25d498e 100644 Binary files a/docs/img/screens/admin-branding-light.png and b/docs/img/screens/admin-branding-light.png differ diff --git a/docs/img/screens/admin-dashboard-dark-m.webp b/docs/img/screens/admin-dashboard-dark-m.webp index cec908b..456fdc0 100644 Binary files a/docs/img/screens/admin-dashboard-dark-m.webp and b/docs/img/screens/admin-dashboard-dark-m.webp differ diff --git a/docs/img/screens/admin-dashboard-dark.png b/docs/img/screens/admin-dashboard-dark.png index b456711..fcac7c7 100644 Binary files a/docs/img/screens/admin-dashboard-dark.png and b/docs/img/screens/admin-dashboard-dark.png differ diff --git a/docs/img/screens/admin-dashboard-light-m.webp b/docs/img/screens/admin-dashboard-light-m.webp index 8e4f000..d88e2f0 100644 Binary files a/docs/img/screens/admin-dashboard-light-m.webp and b/docs/img/screens/admin-dashboard-light-m.webp differ diff --git a/docs/img/screens/admin-dashboard-light.png b/docs/img/screens/admin-dashboard-light.png index 30d85d4..5a1a372 100644 Binary files a/docs/img/screens/admin-dashboard-light.png and b/docs/img/screens/admin-dashboard-light.png differ diff --git a/docs/img/screens/admin-login-light.png b/docs/img/screens/admin-login-light.png index 472b05b..d6f217c 100644 Binary files a/docs/img/screens/admin-login-light.png and b/docs/img/screens/admin-login-light.png differ diff --git a/docs/img/screens/admin-report-dark-m.webp b/docs/img/screens/admin-report-dark-m.webp index 8cb57b0..2fa4ab4 100644 Binary files a/docs/img/screens/admin-report-dark-m.webp and b/docs/img/screens/admin-report-dark-m.webp differ diff --git a/docs/img/screens/admin-report-dark.png b/docs/img/screens/admin-report-dark.png index ab23695..53e56f1 100644 Binary files a/docs/img/screens/admin-report-dark.png and b/docs/img/screens/admin-report-dark.png differ diff --git a/docs/img/screens/admin-report-light-m.webp b/docs/img/screens/admin-report-light-m.webp index d23f29c..8e636e5 100644 Binary files a/docs/img/screens/admin-report-light-m.webp and b/docs/img/screens/admin-report-light-m.webp differ diff --git a/docs/img/screens/admin-report-light.png b/docs/img/screens/admin-report-light.png index 5887bc7..79239a6 100644 Binary files a/docs/img/screens/admin-report-light.png and b/docs/img/screens/admin-report-light.png differ diff --git a/docs/img/screens/admin-system-dark-m.webp b/docs/img/screens/admin-system-dark-m.webp index 8bdd7b5..90b8b98 100644 Binary files a/docs/img/screens/admin-system-dark-m.webp and b/docs/img/screens/admin-system-dark-m.webp differ diff --git a/docs/img/screens/admin-system-dark.png b/docs/img/screens/admin-system-dark.png index 163f63a..37ffc1c 100644 Binary files a/docs/img/screens/admin-system-dark.png and b/docs/img/screens/admin-system-dark.png differ diff --git a/docs/img/screens/admin-system-light-m.webp b/docs/img/screens/admin-system-light-m.webp index 2ad5f91..dbaa7b1 100644 Binary files a/docs/img/screens/admin-system-light-m.webp and b/docs/img/screens/admin-system-light-m.webp differ diff --git a/docs/img/screens/admin-system-light.png b/docs/img/screens/admin-system-light.png index d205a9d..4995a55 100644 Binary files a/docs/img/screens/admin-system-light.png and b/docs/img/screens/admin-system-light.png differ diff --git a/docs/img/screens/submit-success-dark-m.webp b/docs/img/screens/submit-success-dark-m.webp index 12ab0ed..4472378 100644 Binary files a/docs/img/screens/submit-success-dark-m.webp and b/docs/img/screens/submit-success-dark-m.webp differ diff --git a/docs/img/screens/submit-success-dark.png b/docs/img/screens/submit-success-dark.png index 6068adf..602a66e 100644 Binary files a/docs/img/screens/submit-success-dark.png and b/docs/img/screens/submit-success-dark.png differ diff --git a/docs/img/screens/submit-success-light-m.webp b/docs/img/screens/submit-success-light-m.webp index 28123e1..32f5e31 100644 Binary files a/docs/img/screens/submit-success-light-m.webp and b/docs/img/screens/submit-success-light-m.webp differ diff --git a/docs/img/screens/submit-success-light.png b/docs/img/screens/submit-success-light.png index 0470e1f..d29e2c5 100644 Binary files a/docs/img/screens/submit-success-light.png and b/docs/img/screens/submit-success-light.png differ diff --git a/scripts/build_site.py b/scripts/build_site.py index b657d40..84b9885 100644 --- a/scripts/build_site.py +++ b/scripts/build_site.py @@ -48,6 +48,7 @@ DOCS = ROOT / "docs" sys.path.insert(0, str(ROOT / "scripts")) import release_source # noqa: E402 (a sibling script, not a package) +import security_feed # noqa: E402 PAGE_KEYS = { "title", @@ -723,6 +724,15 @@ def write_security_txt(out: Path, site: dict[str, Any]) -> None: (out / ".well-known" / "security.txt").write_text("\n".join(lines) + "\n", encoding="utf-8") +def write_security_feed(out: Path) -> None: + """/security.json, fetched daily by every installation (scripts/security_feed.py).""" + try: + feed = security_feed.load() + except security_feed.FeedError as error: + raise BuildError(f"security.json: {error}") from error + (out / "security.json").write_text(security_feed.dump(feed), encoding="utf-8") + + def write_feeds(out: Path, pages: list[Page], site: dict[str, Any], i18n: dict[str, Any]) -> None: """One Atom feed per language: every post under //blog//.""" base = site["base_url"] @@ -1038,6 +1048,7 @@ def build(src: Path, out: Path) -> list[Page]: dest.write_text(render_page(env, page, data, by_key), encoding="utf-8") write_sitemap(out, src, pages, site) write_security_txt(out, site) + write_security_feed(out) write_feeds(out, pages, site, data["i18n"]) write_og_images(out, src, pages, data["i18n"][site["default_language"]]["og_image_alt"]) subset_fonts(out, src) # writes the fonts the pages link diff --git a/scripts/render_changelog.py b/scripts/render_changelog.py index caf3259..d906b0b 100644 --- a/scripts/render_changelog.py +++ b/scripts/render_changelog.py @@ -234,13 +234,16 @@ def compare_line(version: Version, link_defs: dict[str, str]) -> str: # new release never pushes the page over the 100 KB first-view budget by itself. NEWEST = 5 -# Closed release series with a page of their own, /en/changelog/.x/: one page of every +# Closed release series with a page of their own, /en/changelog/.x/: one page of every # older release outgrew the budget at 2.2.1 (107 KB first view), and a closed series never grows. -ARCHIVED = ("1", "0") +# A series is a major ("1") or, once /older/ outgrows the budget again, a closed minor ("2.0": +# /older/ reached 103 KB at 2.5.1). +ARCHIVED = ("2.0", "1", "0") -def _major(version: Version) -> str: - return version.name.split(".", 1)[0] +def _series(version: Version) -> str | None: + """The ARCHIVED series ``version`` belongs to, if any.""" + return next((s for s in ARCHIVED if version.name.startswith(f"{s}.")), None) def render_content( @@ -261,13 +264,13 @@ def render_content( released = [v for v in shown if v.name.lower() != "unreleased"] on_main = {v.name for v in released[:NEWEST]} if major: - shown = [v for v in released if v.name not in on_main and _major(v) == major] + shown = [v for v in released if v.name not in on_main and _series(v) == major] else: shown = [ v for v in shown if (v.name in on_main or v.name.lower() == "unreleased") != older - and not (older and _major(v) in ARCHIVED) + and not (older and _series(v) is not None) ] if major and not shown: raise ValueError(f"CHANGELOG.md has no {major}.x release older than the newest {NEWEST}") diff --git a/scripts/security_feed.py b/scripts/security_feed.py new file mode 100644 index 0000000..92f30f6 --- /dev/null +++ b/scripts/security_feed.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python3 +"""/security.json: the latest release and the published security advisories of OpenWhistle. + + python scripts/security_feed.py OUT fetch from GitHub, validate, write OUT + +Every OpenWhistle installation with the update check on (the default since 2.5.0) fetches this +file once a day and nothing else; the format is schema 1 of the app's +docs-tech/security-feed.md. The build writes it (scripts/build_site.py): from OW_SECURITY_FEED, +a file this script wrote earlier in the workflow, or else straight from the GitHub API +(GITHUB_TOKEN is sent when set, as scripts/release_source.py does). Anything the app would drop +fails the build instead: a broken feed is never published. +""" + +from __future__ import annotations + +import json +import os +import re +import sys +from pathlib import Path +from typing import Any + +import release_source + +SEVERITIES = {"low", "medium", "high", "critical"} +VERSION = re.compile(r"[0-9]{1,6}(?:\.[0-9]{1,6}){0,3}") # ASCII digits, as release_source.TAG +CONSTRAINT = re.compile(r"(?:<=|>=|<|>|=)?\s*v?[0-9]{1,6}(?:\.[0-9]{1,6}){0,3}") +GHSA = re.compile(r"GHSA(?:-[23456789cfghjmpqrvwx]{4}){3}") +CVE = re.compile(r"CVE-[0-9]{4}-[0-9]{4,7}") +MAX_ADVISORIES = 100 + + +class FeedError(Exception): + """The feed would not pass the app's validation: the build fails instead of publishing it.""" + + +def _https(url: Any, what: str) -> str: + if not isinstance(url, str) or not url.startswith("https://") or len(url) > 500: + raise FeedError(f"{what}: {url!r} is not an https URL") + return url + + +def _range(value: Any, what: str) -> str: + if ( + not isinstance(value, str) + or len(value) > 200 + or not all(CONSTRAINT.fullmatch(part.strip()) for part in value.split(",")) + ): + raise FeedError(f"{what}: {value!r} is not a version range") + return value + + +def validate(feed: Any) -> dict[str, Any]: + """The feed unchanged when every field passes; FeedError naming the first that does not.""" + if not isinstance(feed, dict) or feed.get("schema") != 1: + raise FeedError("not a schema 1 feed") + latest = feed.get("latest") + if not isinstance(latest, dict) or not VERSION.fullmatch(str(latest.get("version"))): + raise FeedError(f"latest: {latest!r} names no version") + _https(latest.get("url"), "latest.url") + advisories = feed.get("advisories") + if not isinstance(advisories, list) or len(advisories) > MAX_ADVISORIES: + raise FeedError(f"advisories: a list of at most {MAX_ADVISORIES} expected") + for adv in advisories: + if not isinstance(adv, dict) or not GHSA.fullmatch(str(adv.get("id"))): + raise FeedError(f"advisory {adv!r}: no GHSA id") + what = adv["id"] + summary = adv.get("summary") + if not isinstance(summary, str) or not summary.strip() or len(summary) > 1024: + raise FeedError(f"{what}: summary {summary!r}") + if adv.get("severity") not in SEVERITIES: + raise FeedError(f"{what}: severity {adv.get('severity')!r}") + _range(adv.get("affected"), f"{what}.affected") + fixed = adv.get("fixed") + if not isinstance(fixed, str) or (fixed and not VERSION.fullmatch(fixed)): + raise FeedError(f"{what}: fixed {fixed!r} is not a version") + cves = adv.get("cve_ids") + if not isinstance(cves, list) or not all(CVE.fullmatch(str(c)) for c in cves): + raise FeedError(f"{what}: cve_ids {cves!r}") + _https(adv.get("url"), f"{what}.url") + return feed + + +def from_github(advisories: Any, release: Any) -> dict[str, Any]: + """Schema 1 from GitHub's published repository advisories and its latest release.""" + if not isinstance(advisories, list) or not isinstance(release, dict): + raise FeedError("GitHub answered with something other than advisories and a release") + entries = [] + for adv in advisories: + vulns = adv.get("vulnerabilities") if isinstance(adv, dict) else None + if not vulns or not isinstance(vulns[0], dict): + raise FeedError(f"advisory {adv!r}: no affected versions") + cve = adv.get("cve_id") + entries.append( + { + "id": adv.get("ghsa_id"), + "cve_ids": [cve] if cve else [], + "summary": adv.get("summary"), + "severity": adv.get("severity"), + "affected": vulns[0].get("vulnerable_version_range"), + "fixed": vulns[0].get("patched_versions") or "", + "url": adv.get("html_url"), + } + ) + tag = str(release.get("tag_name", "")) + return validate( + { + "schema": 1, + "latest": { + "version": tag.removeprefix("v"), + "url": release.get("html_url"), + "published_at": release.get("published_at") or "", + }, + "advisories": entries, + } + ) + + +def fetch() -> dict[str, Any]: + """The feed from the GitHub API now.""" + api = release_source.API + try: + return from_github( + release_source._json(f"{api}/security-advisories?state=published&per_page=100"), + release_source._json(f"{api}/releases/latest"), + ) + except release_source.ReleaseError as error: + raise FeedError(str(error)) from error + + +def load() -> dict[str, Any]: + """OW_SECURITY_FEED (validated again: it may have been edited), or a fresh fetch.""" + path = os.environ.get("OW_SECURITY_FEED") + if not path: + return fetch() + try: + return validate(json.loads(Path(path).read_text(encoding="utf-8"))) + except (OSError, ValueError) as error: + raise FeedError(f"OW_SECURITY_FEED={path}: {error}") from error + + +def dump(feed: dict[str, Any]) -> str: + return json.dumps(feed, indent=1, ensure_ascii=False) + "\n" + + +def main(argv: list[str] | None = None) -> int: + args = sys.argv[1:] if argv is None else argv + if len(args) != 1: + print(__doc__, file=sys.stderr) + return 2 + try: + feed = fetch() + except FeedError as error: + print(f"security feed: {error}", file=sys.stderr) + return 1 + Path(args[0]).write_text(dump(feed), encoding="utf-8") + print(f"{len(feed['advisories'])} advisories, latest {feed['latest']['version']}") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tests/conftest.py b/tests/conftest.py index 09d8fcc..b40b6fa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,6 +2,7 @@ from __future__ import annotations +import os from collections.abc import Iterator from pathlib import Path @@ -9,6 +10,10 @@ import release_source FIXTURE_APP = Path(__file__).parent / "fixtures" / "app_source" +FIXTURE_FEED = Path(__file__).parent / "fixtures" / "security.json" +# The built /security.json comes from this file, not the GitHub API: no test reads the network +# for it. The image build reads the real one (scripts/security_feed.py, the workflow). +os.environ.setdefault("OW_SECURITY_FEED", str(FIXTURE_FEED)) @pytest.fixture diff --git a/tests/fixtures/security.json b/tests/fixtures/security.json new file mode 100644 index 0000000..48e5d16 --- /dev/null +++ b/tests/fixtures/security.json @@ -0,0 +1,19 @@ +{ + "schema": 1, + "latest": { + "version": "2.4.2", + "url": "https://github.com/openwhistle/OpenWhistle/releases/tag/v2.4.2", + "published_at": "2026-11-01T10:00:00Z" + }, + "advisories": [ + { + "id": "GHSA-2c4f-6h8j-9mpq", + "cve_ids": ["CVE-2026-0001"], + "summary": "Fixture advisory: never published", + "severity": "high", + "affected": ">= 1.4.0, < 2.4.2", + "fixed": "2.4.2", + "url": "https://github.com/openwhistle/OpenWhistle/security/advisories/GHSA-2c4f-6h8j-9mpq" + } + ] +} diff --git a/tests/test_changelog_page.py b/tests/test_changelog_page.py index 0fa7e2f..618511f 100644 --- a/tests/test_changelog_page.py +++ b/tests/test_changelog_page.py @@ -64,10 +64,12 @@ def test_the_older_page_holds_the_rest_and_no_release_is_on_both() -> None: } for major, archive in archives.items(): assert archive in (built() / f"en/changelog/{major}.x/index.html").read_text("utf-8") - assert ids(archive) and all(i.startswith(f"v{major}-") for i in ids(archive)), major + prefix = f"v{major.replace('.', '-')}-" + assert ids(archive) and all(i.startswith(prefix) for i in ids(archive)), major assert not ids(archive) & (current | ids(older)), major assert "v1-0-0" in ids(archives["1"]) and "v0-1-0" in ids(archives["0"]) - assert not any(i.startswith(("v0-", "v1-")) for i in ids(older)) + assert not any(i.startswith(("v0-", "v1-", "v2-0-")) for i in ids(older)) + assert "v2-0-0" in ids(archives["2.0"]) # Unreleased plus the newest NEWEST releases: a count, so a release never breaks the budget. assert len(current - {"unreleased"}) <= 5 == RENDER_CHANGELOG.NEWEST @@ -178,3 +180,14 @@ def test_a_quote_in_a_changelog_url_stays_inside_its_href() -> None: version = RENDER_CHANGELOG.Version("9.9.9", "") line = RENDER_CHANGELOG.compare_line(version, {"9.9.9": 'https://a/compare/v1"x...v2'}) assert 'href="https://a/compare/v1"x...v2"' in line + + +def test_a_series_is_a_whole_version_prefix() -> None: + """ "1" archives 1.5.0, never a 10.0.0; "2.0" archives 2.0.1, never 2.1.0.""" + from types import SimpleNamespace + + series = RENDER_CHANGELOG._series + assert series(SimpleNamespace(name="1.5.0")) == "1" + assert series(SimpleNamespace(name="2.0.1")) == "2.0" + assert series(SimpleNamespace(name="10.0.0")) is None + assert series(SimpleNamespace(name="2.1.0")) is None diff --git a/tests/test_security_feed.py b/tests/test_security_feed.py new file mode 100644 index 0000000..8e05ac9 --- /dev/null +++ b/tests/test_security_feed.py @@ -0,0 +1,143 @@ +"""/security.json: what every OpenWhistle installation fetches daily. A feed the app would drop +fails the build; it is never published.""" + +from __future__ import annotations + +import copy +import json +from pathlib import Path +from typing import Any + +import pytest +import security_feed + +from tests.built_site import builder, built +from tests.conftest import FIXTURE_FEED + +FEED = json.loads(FIXTURE_FEED.read_text(encoding="utf-8")) +GITHUB_ADVISORY = { + "ghsa_id": "GHSA-2c4f-6h8j-9mpq", + "cve_id": "CVE-2026-0001", + "summary": "Fixture advisory: never published", + "severity": "high", + "html_url": "https://github.com/openwhistle/OpenWhistle/security/advisories/GHSA-2c4f-6h8j-9mpq", + "description": "not carried", + "vulnerabilities": [ + { + "package": {"ecosystem": "other", "name": "openwhistle"}, + "vulnerable_version_range": ">= 1.4.0, < 2.4.2", + "patched_versions": "2.4.2", + } + ], +} +GITHUB_RELEASE = { + "tag_name": "v2.4.2", + "html_url": "https://github.com/openwhistle/OpenWhistle/releases/tag/v2.4.2", + "published_at": "2026-11-01T10:00:00Z", +} + + +def test_github_data_maps_to_schema_1() -> None: + assert security_feed.from_github([GITHUB_ADVISORY], GITHUB_RELEASE) == FEED + + +def test_an_advisory_without_a_cve_or_a_fix_yet_is_still_published() -> None: + adv = {**GITHUB_ADVISORY, "cve_id": None} + adv["vulnerabilities"] = [{"vulnerable_version_range": "<= 2.4.2", "patched_versions": None}] + [entry] = security_feed.from_github([adv], GITHUB_RELEASE)["advisories"] + assert (entry["cve_ids"], entry["fixed"]) == ([], "") + + +def _broken(path: str, value: Any) -> dict[str, Any]: + feed = copy.deepcopy(FEED) + *parents, last = path.split(".") + node: Any = feed + for part in parents: + node = node[int(part)] if part.isdigit() else node[part] + node[last] = value + return feed + + +@pytest.mark.parametrize( + ("path", "value"), + [ + ("schema", 2), + ("latest.version", "latest"), + ("latest.url", "http://example.org/"), + ("advisories.0.id", "GHSA-
    Request, switched on byDestinationHow oftenCarries
    Update check UPDATE_CHECK_ENABLED=trueapi.github.com — fixedat every start, then daily at 04:00 UTCa GET for the latest release; the User-Agent is just OpenWhistle, no version
    Update check on by default; UPDATE_CHECK_ENABLED=false turns it offopenwhistle.net — fixedat every start, then daily at 04:00 UTCa GET of /security.json (latest release, security advisories), not logged there; the User-Agent is just OpenWhistle, no version
    Installation count the setup wizard or Admin → System, or TELEMETRY_ENABLED=truetelemetry.wdkro.de — fixedonce a daya random identifier and the version, in full below
    Email NOTIFY_EMAIL_ENABLED=trueNOTIFY_SMTP_HOST — yoursa digest every NOTIFICATION_BATCH_MINUTES; SLA reminders (REMINDER_ENABLED, checked every 30 min); a security alert at once on suspected password spraying; a reply notice when a case manager answerscounts and case numbers to your admins; a bare "you have a reply" to a whistleblower's own address
    Webhook NOTIFY_WEBHOOK_ENABLED=trueNOTIFY_WEBHOOK_URL — yoursthe digest, SLA reminders and the security alert, as for emailcounts only, never a case number (Notifications)