From 0.8.3 (beta, free; function block-page of the
catalogue, and after
0.8.4 block-page-same-device;
internal/blockpage). The request behind it: the people of a household
did not understand that Warda blocked a page, which simply did not open.
With the answer Block page (see Answers: "blocked_response": "page"; up to 0.8.3 chosen by an administrator, from 0.8.4 the
default where the box can show it), a browser that asks a blocked site
shows "Blocked by Warda" instead.
How. The DNS of Warda answers a blocked name with the address of the
box on the network the query came from: A with its IPv4 address there
(the addresses set by WARDA_ADVERTISE_ADDR first: a container whose own
address is not the one the network reaches), AAAA with its IPv6 address
there, or :: when it has none but a link-local one; the short TTL of the
blocked answers (WARDA_BLOCKED_TTL, 10 seconds). The other types get an
empty answer, as with the null address. The browser then asks the box for
the page; the box recognises the name (by the Host of the request, or
over HTTPS by the name of the TLS handshake, SNI) and answers the block
page, whatever the path, never the interface, its API nor the
redirection to HTTPS: a request for one of the names or addresses of
the box goes to the interface as before. Apps that are not browsers
simply fail, as with the null address.
What keeps the null address (or NXDOMAIN), whatever the mode:
- the devices outside the home (the relay and its DoH): the box is not reachable at a home address from there;
- the names of a confidential list: the category of child sexual abuse material and the lists of hashes — the page could not tell them, and the name must never be kept (below);
- the category
bypass, which always gets NXDOMAIN.
The page. HTTP status 403, in the language of the browser
(Accept-Language; English, French, Spanish, German, Dutch, Italian,
Portuguese; English otherwise): the name of the site, then, on the
device the block was decided for (below):
| Line | What it says |
|---|---|
| Category | the kind of block in a few words: "Ads, trackers and threats" (a block list), the category of the profile ("Gambling", "Social networks"…), "Security" (a threat, a look-alike, a spyware, a rebinding, the quarantine, a mining pool, a dangerous reputation), "Ads and tracking" (a reputation of ads or tracking), "Rule of this network", "Rule of this device", "Internet hours", "Blocked service", "Data protection", "Restricted mode" |
| Why | the reason in plain words (on a block list of this network; blocked by an administrator; outside the Internet hours; the service, or the category, blocked for this profile; a leak through DNS; a look-alike name; a spyware; a rebinding; the quarantine of the device; the data protection policy; the restricted mode of an object; a mining pool; the analysis service of Warda) |
| Decided by (when known) | "The Warda base list", "The Warda list “…”" (another list of Warda), "A block list chosen by the administrators of this network" (any other list: never its address, which may be private), "A rule of this network", "A rule set for this device only" (never the rule itself), "The Internet hours of Léa", "The profile of Léa" (a category or a service), the reputation of the domain with its verdict (malware, phishing, scam, tracking, advertising, spyware, control of malware), "The domain was registered a few days ago and looks suspicious", "It looks like paypal.com" (a look-alike) |
| Device | the name of the device (the one given, else the one the network gives) and its person ("PC of the living room (Léa)"; no person for a shared device) |
| When | the time of the block |
Then What can you do?: Ask for more time when the reason is the
Internet hours (the page /ask of the box); the unblock request form
(below) when the unblock requests are available and
the reason can be lifted by one; otherwise why not ("Unblock requests are
not enabled on this network", "This block protects the device: a request
cannot lift it", "Warda does not know this device yet…", or on another
device "A mistake? Tell the person who manages this network."). For the
administrators, a link to the page Rules of the interface (the
interface still asks them to sign in). And a link to the certificate
page (below). The links lead to the plain HTTP listener of the box, at
the address the request reached.
- Never another member's data: the details are shown only on the device the block was decided for. Up to 0.8.4 that meant the same address only, so a computer that asks the DNS over IPv6 (often from a temporary address) and opens the page over IPv4 (or the reverse) got the generic text on itself. From 0.8.5 the box matches by device: the decision of another address is shown when the registry of the box gives both addresses the same device — the same hardware address in the neighbour tables of the box (ARP for IPv4, NDP for IPv6), in a running lease of its DHCP server, or in an IPv6 address made from it (EUI-64); without a hardware address, the device that used the address within the last hour. A hardware address the registry does not know is never taken for the device that used the address before. Any other address (another device, a router that forwards every query, an unknown machine) gets the name, the time and "The reason is shown only on the device it was blocked for." The lookups are bounded: the 8 last addresses of a name, answers kept 30 seconds (1,024 at most), the neighbour tables read at most every 2 seconds for an unknown address.
- The device of the page is checked more strictly (from 0.8.5): the device whose reasons, person and request the page shows is that of the address the page is asked from, and that machine has a connection open to the box, so on a network of the box the neighbour tables have its own hardware address. An address the tables did not have when last read is never guessed then from its EUI-64, a lease or its recent use (a machine of the network could make up an IPv6 address from the hardware address of another device and be taken for it): the tables are read again for it (at most every 0.2 second, else the device is unknown for that page: the name and the reason of the decision of this very address only, no form). Only when they still do not have it (a machine behind a router, tables that cannot be read) is it identified as above.
- Nothing from elsewhere: one inline style allowed by its hash, no
script, no image (but the logo below), no font, no frame, forms sent to
the page itself (
Content-Security-Policy: default-src 'none'; style-src 'sha256-…'; base-uri 'none'; form-action 'self'; frame-ancestors 'none', and; img-src 'self'only when the logo is shown; up to 0.8.4form-action 'none', without form),Cache-Control: no-store,X-Frame-Options: DENY,Referrer-Policy: no-referrer,noindex. - Rate limited by address (below).
- Only for the networks allowed to use the box (the same rule as the interface).
The page you open, not its parts (from 0.8.4). With a quarter of the
names or more blocked, every page of the web also sends the box dozens of
requests at once for its blocked ads, trackers, beacons and icons. In
0.8.3 they used up the rate of the block page of the device, which then
showed the plain text "too many requests" (or a certificate warning)
instead of "Blocked by Warda" on sites such as safebrowsing.google.com
or radar.cloudflare.com. So the box tells apart:
- a page the browser opens (the browser says it:
Sec-Fetch-Mode: navigate, orSec-Fetch-Dest: document,iframeorframe; without those headers, aGETorHEADwhoseAcceptholdstext/html): the block page; - everything else (images, scripts, the requests of scripts, beacons,
icons, the preflights
OPTIONS): an empty answer at once,204, no body,Cache-Control: no-storeand the same security headers. It takes nothing from the block pages nor from the certificate page.
A page opened in a frame of another page (an ad in an iframe), which
the browser never shows (frame-ancestors 'none'), gets a small fixed
page: 403, "Blocked by Warda" in the language of the browser (the 7
languages), without the name, the reason, the time nor any link, and
"This device opened many blocked pages in a moment, so the details are
not shown. Reload this page in a few seconds to see them."
The rates, by client address (a bucket refilled every second; 4,096 addresses at most for each: an address idle long enough to have its whole burst again is forgotten every 10 seconds, and from 0.8.4 within a second while the bound is reached, so that a device that changes its IPv6 addresses cannot keep new devices from the block page):
| What | Rate | Burst | Beyond |
|---|---|---|---|
| The block pages (a page opened) | 2 a second | 30 | the small fixed page (above), never an error |
| Everything else for a blocked name: the empty answers and the small fixed pages | 200 a second | 400 | an empty 429 with Retry-After: 1 and Connection: close (a program that loops) |
| The certificate page and its files (from 0.8.4 a rate of its own) | 5 a second | 20 | 429 with Retry-After: 1 |
Up to 0.8.3 the block page and the certificate page shared one rate of 5 a second (burst 20), and every request for a blocked name took from it.
The unblock request on the page (from 0.8.5; function
block-page-unblock-request, the unblock requests,
business.unblock: open to every installation during the beta). The
person in front of the page asks, without signing in, the person who
manages the network to unblock the site:
- the form: For how long (15, 30, 45 or 60 minutes, or For good, the default) and a Message (optional), 280 characters at most. The name is the blocked one (shown, not a field); the device is the one the box identified (above), never one chosen in the form. No form for another device, an unknown device, a protection (a leak through DNS, a look-alike, a spyware, a rebinding, the quarantine, a mining pool, the categories Security threats and child sexual abuse material), nor the Internet hours (Ask for more time instead).
- it is sent with
POST /.warda/unblockto the blocked name itself (so it reaches the block page, never the interface; only from the networks allowed to use the box). It carries a token signed by the box (HMAC-SHA-256, a key made at each start, compared in constant time), bound to the name and to the address of the device, valid 30 minutes; a form from another site is refused (Sec-Fetch-Sitemust besame-originandOrigin, when the browser gives it, the page itself). A page too old says "This page is too old: reload it, then send the request again." - limits: 3 requests in a moment for each address (then one every 10
seconds), 10 a day for each device, 30 a day for all the block pages of
the network together (a machine can show itself under many hardware
addresses, each a new device: "Many requests were already sent from
this network today. Try again tomorrow, or tell the person who manages
this network."), one waiting per device and name; a body of 4 KB at
most. A browser that does not send the
Sec-Fetch-*headers (Safari before 16.4) sends the form too. - the request is the same as those of the accounts: the administrators
see it on the dashboard and on Business → Unblock requests, asked
by "Someone on the block page" with the device, and answer it as usual;
it goes to the administration log (
unblock.request, actorblockpage) and to the collective base when it is on. - the page then says "Request sent to the person who manages this network.", and shows the state of the last request of this device for the name: waiting (no form), accepted (no form: "the site opens within a minute. Reload this page."), refused (with the answer of the administrator, and the form to ask again). An unblock that ended, or a request expired, shows the form again.
- when the unblock requests are locked (after the beta, without Warda Business) the page says "Unblock requests are not enabled on this network."
Unblock for 15 minutes on the page (from 0.8.5, Warda Business, off
by default). When an administrator turned it on (see Unblock
requests) and the block may be lifted that way, the
page also shows Unblock it for 15 minutes now ("This network lets you
open a blocked site for 15 minutes without waiting, a few times a day.
Choose why: the person who manages this network sees it."), a choice of
Why and Unblock for 15 minutes. It is sent like the request
(POST /.warda/unblock on the blocked name, the same token and checks,
with auto=1), for the device the box identified only. The page then
says until when the site is unblocked on this device, or why not: "This
device used all its unblocks of today…", "This network used all its
unblocks of today…", "Unblocking without a request is not enabled on this
network."
The logo of the company (from 0.8.5, Warda Business). When a logo
is set, the page shows it at the top instead of the Warda
shield. The page asks it on the blocked name itself,
/.well-known/warda-logo (the only image its policy then allows, img-src 'self', served by the box with the cheap rate of the parts of a page;
404 without a logo): never an address elsewhere. Once the name is
unblocked for the device (by the 15 minutes above, or a request approved),
the browser could ask the real site for that address, which would tell
the site of Warda and show a broken image: the page then shows the Warda
shield and its policy allows no image.
The memory of the blocks. To know the reason, the box keeps the last block decision by address and name (and, for each name, its 8 last addresses, for the match by device above): 10 minutes, 8,192 at most, the least recently used out but never a name blocked less than 5 minutes ago, in memory only (never on disk, never in a backup, gone at a restart), and only in the mode page. The box answers its own address only for a name it keeps in that memory: when the memory is full of recent blocks, a new block gets the null address instead (so a page cannot push its own name out and then reach the interface under that name — DNS rebinding). The answers of the mode page live 60 seconds at most, whatever the TTL of the blocked answers; each block page shown renews the name. A name not blocked within 10 minutes is no longer recognised, and the box answers it as any request (the interface, or 404). The names of the confidential lists (and a name blocked because its CNAME target is on one) are never kept and always get the null address.
The local certificate authority#
Over HTTPS, the browser checks the certificate of the site it asked; the
box cannot present the real one. So the box has its own certificate
authority: ECDSA P-256, valid 10 years, made on first use (when the
mode page is chosen, or the certificate page opened; from 0.8.4 also at
the start when the block page is the default answer), in the data
directory, blockca/ (ca.crt, and ca.key readable by Warda only,
0600). For a name blocked lately, the HTTPS listener presents a
certificate for that name, made on the fly and signed by this authority:
valid 48 hours (made again a day before its end), from 0.8.4
4,096 kept in memory (least recently used out; about 4 KiB each with
its parsed certificate, 16 MiB at most; 512 up to 0.8.3), 50 made a
second at most for all names (burst 200; 10 and 30 up to 0.8.3) and,
from 0.8.4, 20 a second for one device (its client address, burst
100), so that the trackers of one device never leave the others without
a certificate; beyond, the usual certificate of the box is presented. A
certificate kept costs nothing; making one takes about 0.2 ms on a small
x86 server (BenchmarkLeafIssuance), estimated around 1 ms on a
Raspberry Pi 4. No wildcard certificate is made.
The authority signs only servers, only names (never an address, never
another authority), and only the names blocked lately; the names of the
box keep their own certificate.
- Without the authority installed on a device, the browser shows its security alert first; once past it (when the browser allows it), the block page shows. Installed, the block page shows at once.
- Never in a backup: the backups take only the files they name, and
blockca/is not one. A restored box makes a new authority, to install again on the devices; the key never leaves the box that made it. - In a pair of high availability, each box has its own authority (the configuration given to the secondary does not carry it): a device that may be answered by either installs both certificates (the certificate page of each box).
- Make a new authority (Network → DNS services → Answers,
administrators, after a confirmation;
POST /api/v1/dns-services/block-authority/regenerate, written to the administration log asblockpage.authority): when the key may have been copied, or to start afresh. The devices that installed the old one show the alert again until they install the new one.
The page DNS services shows, under Answers, the SHA-256 fingerprint of the authority and the date it was made (or that it is made at the first use), a link to the certificate page, and Make a new authority. The dashboard says Block page on.
The certificate page#
http://warda/certificate (or the address of the box), no
sign-in, linked from the block page; only for a request that names the
box (its names, localhost, an address: never a name of another site
pointed to it), from the networks allowed, rate limited (5 a second by
address, burst 20; from 0.8.4 apart from the block pages). It gives:
- the certificate of the authority (never its key) as
warda-ca.crt(DER: Windows, Android, macOS),warda-ca.pem(Linux, Firefox) andwarda-ca.mobileconfig, a profile for iPhone, iPad and Mac ("Warda — block page"; a new authority gives a new profile, the same one installed again replaces itself):GET /certificate/<file>; - its SHA-256 fingerprint, to compare with the one the device shows
before trusting it, the date it was made and the end of its validity
(
GET /api/v1/certificate, JSON); - the steps for Windows (the store "Trusted Root Certification
Authorities", used by Edge and Chrome), Mac (the profile, or
Keychain Access, "Always Trust"), iPhone and iPad (the profile in
Safari, then Settings → General → About → Certificate
Trust Settings, full trust), Android ("CA certificate" in the
settings; Chrome trusts it, many apps ignore the certificates added by
the user), Linux (
update-ca-certificatesorupdate-ca-trust; Chrome and Chromium keep their own list there) and Firefox (its own store, on every system; orsecurity.enterprise_roots.enabledon Windows and Mac), and how to remove it; - a plain warning: a device that installs it trusts every certificate this box makes; Warda makes them only for its block page and its key never leaves the box, but install it only on your own devices, only from the Warda of your home or organisation, and remove it when the device leaves the network.
The same steps are in the user guide, chapter 5.
Limits#
- Ports 80 and 443 are required. Browsers ask the blocked sites on 80
and 443: when the web interface listens elsewhere (
WARDA_HTTP_LISTEN:8080,WARDA_HTTPS_LISTEN:8443, beside a reverse proxy, see Run with Docker), they cannot reach the block page and show a connection error instead. The page DNS services says so, with the ports in use; with Docker, publish the ports 80 and 443 of the machine to those of Warda. From 0.8.4 the default answer is then the null address (see Answers). - Sites with HSTS (the large sites, those preloaded in the browsers): without the authority installed, the browser shows its alert with no way past it; installed, the page shows. A site or an app that pins its certificate refuses it whatever.
- Apps (not browsers) fail as with the null address: the page is for people at a browser. Many apps on Android ignore the certificates added by the user.
- A browser with its own encrypted DNS, or a device whose DNS is not Warda, never asks Warda: it gets neither the block nor the page (see Encrypted DNS for the devices).
- The page may come a few seconds late for a name the device asked just before it was blocked (the answer in its cache).
Privacy. The block decisions are kept in memory only, 10 minutes, bounded, for the device they were decided for; never the names of the confidential lists; nothing is written to the database (no change of the schema in 0.8.3 nor in 0.8.4), nothing sent to the online service. The key of the authority stays in the data directory and out of the backups. Allowed names: a name an administrator allows (My rules, for everyone or for a device: allowing always wins) is never blocked by a list — a downloaded list, a list of hashes, a list behind a CNAME, the reputation, a category (but the child sexual abuse material) — so it never gets the block page; a test proves it from 0.8.3.