From e96a864d7988c55effca02ede9ee4ed4a6ee0895 Mon Sep 17 00:00:00 2001 From: JP <12394156+jp1337@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:38:51 +0100 Subject: [PATCH 1/7] docs: the update check also reads the published security advisories UPDATE_CHECK_ENABLED now also fetches openwhistle/OpenWhistle's published GitHub security advisories. Documented in the settings reference, the outbound-requests table, the System page section of the admin guide and the upgrade page's "Stay up to date" note. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FKEGX9RGdDXHv8qJap41YM --- docs/_data/config.yml | 6 +++--- docs/en/docs/admin/index.html | 1 + docs/en/docs/outbound/index.html | 2 +- docs/en/docs/upgrade/index.html | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/_data/config.yml b/docs/_data/config.yml index 32f29db..288a1ab 100644 --- a/docs/_data/config.yml +++ b/docs/_data/config.yml @@ -200,9 +200,9 @@ 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. + description: Set to true to let OpenWhistle ask GitHub once a day for the latest release + and the published security advisories, shown on the Admin → System page. Off by + default (no external calls). GitHub sees the server's IP address; no instance data is sent. default: false - name: TELEMETRY_ENABLED need: optional diff --git a/docs/en/docs/admin/index.html b/docs/en/docs/admin/index.html index e2ce8db..ab09e91 100644 --- a/docs/en/docs/admin/index.html +++ b/docs/en/docs/admin/index.html @@ -186,6 +186,7 @@

System & updates

diff --git a/docs/en/docs/outbound/index.html b/docs/en/docs/outbound/index.html index 4b7ce8a..00b38d5 100644 --- a/docs/en/docs/outbound/index.html +++ b/docs/en/docs/outbound/index.html @@ -20,7 +20,7 @@

Every request that leaves the host

- + diff --git a/docs/en/docs/upgrade/index.html b/docs/en/docs/upgrade/index.html index 08ae17a..402781e 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). With UPDATE_CHECK_ENABLED=true, + the dashboard also warns when a published security advisory affects your version.

From 0d13a6cebba5ee9426235a92dfb2ec93071a0c64 Mon Sep 17 00:00:00 2001 From: JP <12394156+jp1337@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:06:54 +0100 Subject: [PATCH 2/7] feat: publish /security.json, the feed every installation fetches OpenWhistle 2.5.0's update check (on by default) fetches one file a day: /security.json, schema 1 of the app's docs-tech/security-feed.md. The build writes it from the GitHub API (published repository advisories and the latest release), via scripts/security_feed.py; the workflow fetches it once with its token and hands it to the image build (OW_SECURITY_FEED). Anything the app would drop fails the build: a broken feed is never published. nginx serves it as application/json with no log line, so "the site logs nothing" holds. Docs follow: the update check now names openwhistle.net and is on by default (settings reference, outbound requests, admin guide, upgrade note, the architecture diagram and the two blog posts that said "GitHub, opt-in"). Mutations: docs-tech/mutations/v2.5.0-site-security-feed.json, 6/6 red. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FKEGX9RGdDXHv8qJap41YM --- .github/workflows/website-image.yml | 17 +- docs-tech/mutations/v2.1.2-site-p4.json | 4 +- docs-tech/mutations/v2.2.0-site-split.json | 4 +- .../mutations/v2.5.0-site-security-feed.json | 69 ++++++++ docs/_data/config.yml | 9 +- docs/_diagrams/architecture.de.drawio | 2 +- docs/_diagrams/architecture.drawio | 2 +- .../hinweisgebersystem-dsgvo-eu-hosting.html | 8 +- .../blog/interne-meldestelle-kostenlos.html | 10 +- .../blog/free-internal-reporting-channel.html | 10 +- ...whistleblowing-system-gdpr-eu-hosting.html | 8 +- docs/en/docs/admin/index.html | 4 +- docs/en/docs/anonymity/index.html | 4 +- docs/en/docs/outbound/index.html | 10 +- docs/en/docs/upgrade/index.html | 4 +- docs/img/diagrams/architecture-dark.svg | 2 +- docs/img/diagrams/architecture-light.svg | 2 +- docs/img/diagrams/architecture.de-dark.svg | 2 +- docs/img/diagrams/architecture.de-light.svg | 2 +- scripts/build_site.py | 11 ++ scripts/security_feed.py | 162 ++++++++++++++++++ tests/conftest.py | 5 + tests/fixtures/security.json | 19 ++ tests/test_security_feed.py | 143 ++++++++++++++++ tests/test_website_config.py | 1 + tests/test_website_workflow.py | 16 +- tests/website/test_container.py | 14 ++ website/Dockerfile | 3 + website/nginx.conf | 5 + 29 files changed, 504 insertions(+), 48 deletions(-) create mode 100644 docs-tech/mutations/v2.5.0-site-security-feed.json create mode 100644 scripts/security_feed.py create mode 100644 tests/fixtures/security.json create mode 100644 tests/test_security_feed.py 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/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-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.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/_data/config.yml b/docs/_data/config.yml index 288a1ab..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 ask GitHub once a day for the latest release - and the published security advisories, shown on the Admin → System page. Off by - default (no external calls). GitHub sees the server's IP address; no instance data is sent. - 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/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-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/docs/admin/index.html b/docs/en/docs/admin/index.html index ab09e91..da49490 100644 --- a/docs/en/docs/admin/index.html +++ b/docs/en/docs/admin/index.html @@ -185,8 +185,8 @@

System & updates

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.
  • -
  • Security advisories: the same check reads the published GitHub 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.
  • +
  • /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/outbound/index.html b/docs/en/docs/outbound/index.html index 00b38d5..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.

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 UPDATE_CHECK_ENABLED=trueapi.github.com — fixedat every start, then daily at 04:00 UTCa GET for the latest release and one for the published security advisories; 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)
- + diff --git a/docs/en/docs/upgrade/index.html b/docs/en/docs/upgrade/index.html index 402781e..2027b4e 100644 --- a/docs/en/docs/upgrade/index.html +++ b/docs/en/docs/upgrade/index.html @@ -73,7 +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). With UPDATE_CHECK_ENABLED=true, - the dashboard also warns when a published security advisory affects your version. + 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/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/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/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_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 and one for the published security advisories; 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)