Repository navigation
fix: HTTPS behind Anubis, and the site on the usage screen - #3
Merged
Merged
Conversation
Anubis sets its cookies Secure, and the front of the default site served plain HTTP only, so no browser passed the challenge by name (the maintainer's screenshot 114). default-anubis now serves port 443 as the default server with TLS 1.2 and 1.3, HTTP/2 and the machine's certificate, /usr/local/share/ca-certificates/cert.crt and /etc/ssl/private/cert.key, the default of decision 0042: self-signed by keel-host-keys at the first boot until the confconsole Certificate screen issues one through ACME (0042), at the same paths. Port 80 answers 301 to the same URL on HTTPS (0042, redirect_http). No HSTS, which over a self-signed certificate locks visitors out (0042, tls.hsts). By name and by IP alike, as the usage screen shows the IP. Simple installations keep Debian's site on port 80: no Anubis, so no cookie to carry. The state hook refuses, changing nothing, while the certificate or its key is missing, and the package activates nginx-reload so an upgrade serves the new front at once. Core's recipe ships a usage screen of Webmin and SSH only, and the web layer kept it (screenshot 024). The overlay now ships /etc/confconsole/services.txt with "Web: http://<address>" first, IPv6 then IPv4; port 80 serves the site in simple and redirects to HTTPS behind Anubis, so the one URL is right in every mode. conf.d/main fails the build when the usage screen does not list the site. keel-web 0.1.1 depends on keel-overlay-coraza 0.1.2 (the WAF lets Anubis's pass-challenge through by IP, and its audit log names the rule that blocked) and anubis 1.27.0-0+keel2 (the challenge for clients that do not accept gzip, instead of HTTP 500 to one in 64 at random). Closes #2
- default-anubis: ssl_ciphers is common's zz-ssl-ciphers list (Mozilla intermediate, forward secret only) with TLS 1.2 and 1.3 and ssl_prefer_server_ciphers off. Measured: TLS 1.1 and the non-PFS AES128-SHA and AES128-GCM-SHA256 are refused, 1.2 gets ECDHE-RSA-AES256-GCM-SHA384, 1.3 TLS_AES_256_GCM_SHA384. - HSTS once ACME issues a CA's certificate, and the 443 listen lines a tls-passthrough site must take away, are TODOs in the front linked to Keel-Linux/tracker#51, the implementation of decision 0042. - Anubis's pass-challenge redirected a solved challenge to any host: it compares redir's host with itself unless REDIRECT_DOMAINS is set. anubis-redirect-domains writes it from the machine's short name, fqdn and global addresses (IPv6 bracketed), failing when there is none; keel-web-anubis-domains.service runs it before each start, required by a drop-in of anubis@keel.service (systemd reads an EnvironmentFile before ExecStartPre: measured, the unit failed with "resources"). postinst reloads systemd and try-restarts a running Anubis. Depends on iproute2; IPv6 entries need anubis 1.27.0-0+keel2 (Keel-Linux/anubis#2). Measured on the Keel Web container: REDIRECT_DOMAINS=web,10.0.3.86, [fd42:...:f02a],[fd42:...:6554]; Chromium passes the challenge by name, IPv6 and IPv4, and by a name that is not the machine's it gets Anubis's "Oh noes!" from pass-challenge instead of a redirect. tests: 110 bats, coverage 100 percent for the four shell files.
This was referenced Oct 1, 2026
…gin check anubis-redirect-domains built Anubis's allowed list from hostname and ip addr at each start, never at spec apply, so a new DNS name, a 0042 site or a public IP behind NAT failed with redirect_domain_not_allowed after the challenge. anubis 1.27.0-0+keel3 (Keel-Linux/anubis#3) closes the open redirect itself while REDIRECT_DOMAINS is empty: redir must be relative or name the request's own scheme, host and port, never with userinfo. So keel-web drops the generator, its unit, the drop-in and the postinst, depends on anubis (>= 1.27.0-0+keel3), and drops iproute2. Measured on the Keel Web container (step7b image, cloud_simple, these packages): Chromium passes the challenge by unlisted.keel.test (in neither /etc/hosts nor DNS of the machine, sent as Host), by IPv6 and by IPv4. With the browser's pass-challenge rewritten to redir https://evil.example/, //evil.example/ or https://a@evil.example/, Anubis answers "Redirect domain not allowed" and the browser sends nothing to evil.example. tests: 100 bats, coverage 100 percent for the three shell files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three Keel Web bugs from the maintainer's test screenshots (114, 024 and #2), and the dependencies for the WAF fixes of Keel-Linux/common#27.
114: no browser passed Anubis over HTTP
Root cause: Anubis sets its cookies
Secure; SameSite=None; Partitioned.default-anubisserved plain HTTP on port 80 only, so a browser never sent the cookies back and the challenge failed with "cookies disabled".Default chosen: in the cloud modes, where Anubis is on, the front is HTTPS only. This is what decision 0042 sets for sites (
redirect_http: true, thedefaultcertificate):/usr/local/share/ca-certificates/cert.crt,/etc/ssl/private/cert.key);tls.hsts);Anubis's cookie option is left at Secure: no mode with Anubis needs HTTP. A simple installation keeps Debian's site on port 80. It has no Anubis, so it has no cookie to carry.
The state hook refuses, and changes nothing, while the certificate or its key is missing. The package also activates
nginx-reload, so an upgrade from 0.1.0 serves the new front at once.024: the usage screen did not list the site
Root cause: Core's recipe ships
overlay/etc/confconsole/services.txtwith Webmin and SSH only (keel-core), and the web layer kept it. confconsole itself is not involved: its default template lists Web, but Core's overlay replaces it. So there is no confconsole change, and nothing overlaps confconsole#16.The web recipe's overlay now ships its own
services.txt, withWeb: http://<address>first, IPv6 then IPv4. Port 80 serves the site in simple mode and redirects to HTTPS behind Anubis, so the one URL is right in every mode.conf.d/mainfails the build when the usage screen does not list the site.#2: Anubis's challenge returned 500 without gzip
Root cause: upstream Anubis refuses one request in 64 at random from clients without gzip (Keel-Linux/anubis#2). keel-web 0.1.1 depends on
anubis (>= 1.27.0-0+keel2)and onkeel-overlay-coraza (>= 0.1.2). Closes #2.Evidence (LXC container of the step7b Web image, moved to cloud_simple with
keel spec apply, these packages installed)Chromium (playwright-core, normal Chrome user agent), through a relay of the test VM:
http://web.keel.test/https://web.keel.test/, "Making sure you're not a bot!"https://web.keel.test/, "Keel Web"http://[fd42:…:fe06]/http://10.0.3.158/Accept-Encoding: identitygot 200 × 200.Web: http://[…]andWeb: http://10.0.3.158.Unit tests:
batsgives 73 + 25 passing tests.COVERAGE_THRESHOLD=100 tests/coverage.shgives anubis-front 84/84, conf.d/main 20/20 and boot-test-lib 109/109. The package build is lintian-clean.Test plan
tests / coverageandpackages / buildgreen