Web policies
By the end you can
- State that Authcha decides web policy but does not block sites itself
- Write allow-list and deny-list policies with domains, wildcards and categories
- Assign a policy and predict which one wins
- Explain why an HTTPS block shows an error, and when decrypting is appropriate
Decide here, enforce elsewhere
A web policy says which websites a person may reach: "only google.co.in", or "everything except social networks". You attach it to a user, a directory group or a user type, and Authcha tells the enforcement point which policy each signed-in person has.
Authcha does not block websites itself. It decides at the RADIUS layer and publishes the decision. A separate enforcement point turns the decision into rules, and which one you choose decides how exactly the policy is held.
| Enforcement point | Sees | Holds a user to one site? |
|---|---|---|
| Squid with the Authcha helper (peek-and-splice) | The TLS server name and the Host header | Yes, even when many sites share an address |
| A next-generation firewall with FQDN or URL objects | The name, if configured | Yes, with identity delivered by a connector |
| The pfSense agent, Squid path | The name | Yes |
| The pfSense alias path, or the alias connector | Only the address | No, approximate |
Web policies are part of the NAC edition.
Write a policy
Open Access Control → Web policies.
| Field | Meaning |
|---|---|
| Name | 1 to 48 characters: lower-case letters, digits, - and _. This is the name the device receives |
| Mode | Allow-list: the entries are the only destinations. Deny-list: the entries are blocked and everything else is allowed |
| Domains | Up to 500 entries |
| Categories | Up to 20 built-in groups |
A policy needs at least one domain or category.
Entries
| Write | Matches |
|---|---|
google.co.in | That name only |
*.google.co.in | Every subdomain, not google.co.in itself. Write both to cover both |
ip:203.0.113.7 | One address |
cidr:203.0.113.0/24 | A network |
ext:zip | A file type, by the end of the URL path (deny-lists only) |
Authcha checks every entry when you save. Names are lower-cased and converted to punycode, and a bare IP address as a domain is refused (say ip:). Only a leading *. is a wildcard. URLs with paths, single labels such as com and over-long names are refused.
Categories
Built-in lists of base domains, expanded when the policy is read, so a change to the built-in list reaches existing policies at the next poll.
| Category | Contains |
|---|---|
search | Google, Bing, DuckDuckGo |
social | Facebook, Instagram, X, TikTok, LinkedIn, Reddit, Snapchat, WhatsApp |
video-streaming | YouTube and its media hosts, Netflix, Prime Video, Hotstar, Twitch |
ads-trackers | Common advertising and tracking networks |
file-sharing | Dropbox, Box, Mega, WeTransfer, OneDrive, Google Drive |
software-updates | Windows Update, Ubuntu, Debian, Apple updates |
file-download, media-downloads, p2p-torrent | File types, not domains |
The map is deliberately small. It is not a content-filtering database.
Who gets which policy
Assignments attach a policy to a user, a directory group or a user type. A subject has at most one. When several apply, the most specific wins:
- the user
- a directory group the user belongs to (the lowest priority number wins if several); membership is the last synced one, so a directory that stops syncing leaves the restriction in place instead of lifting it
- the user type
Someone with no policy is unrestricted. There is no "unrestricted" assignment: to exempt a person, take them out of the group or attach a policy to a narrower subject.
What a device learns
Every Access-Accept for a user with a policy carries the policy name in the Authcha-Web-Policy attribute. It is informational and never changes whether the user is accepted. MAB logins never get it. Enforcement points read the full feed over the API (/api/web-policy/active-sessions and /api/web-policy/policies), using a token of kind Web policy agent that can call exactly those requests and nothing else.
A policy change reaches a polling enforcement point at its next poll, with no re-authentication. You can also turn on Re-authorize on policy change so the person's session ends and they pick up the new policy at once. It is off by default.
The block page, and HTTPS
With the pfSense Squid agent, a blocked plain-HTTP site shows a styled "This page is blocked" page with the host name and a Go back button, instead of Squid's grey text.
A blocked HTTPS site cannot show any page. The browser asks for the site's certificate before sending anything, so Squid can only show a page if it decrypts that connection with a CA the device trusts. Without that, the browser shows a connection error, and that is how HTTPS works without decrypting it. The cleanest setup, for devices you own, decrypts only the sites you block, leaving banking and pinned apps alone. For guests and personal devices you cannot install a CA on, do not decrypt.
LabHands-on
On the demo as demo-admin (password Authcha-Demo-2026).
- Open Web Policy. Find
no-social-networks,no-video-streamingandno-downloads. Open one and read its mode, categories and entries. - Look at the Assignments. For a user of type
network-user, which policy applies, and why? - Make a test policy
google-onlyas an allow-list withgoogle.co.in,*.google.co.inandgstatic.com. Use the resolver to see what a user resolves to. - Assign it to a test user, then to their user type as well, and confirm the user's own assignment wins.
- On your own install, read the feed with a Web policy agent token:
curl -s -H "Authorization: Bearer <token>" https://<host>/api/web-policy/policies. - Add
ext:zipto a deny-list and try it on an allow-list. Read the refusal.
Check yourselfQuiz
Cheat sheetKeep this
- Authcha decides; Squid, a firewall or an agent enforces.
- Modes: allow-list (only these) or deny-list (all but these). Entries:
name,*.name,ip:,cidr:,ext:(deny only). - Categories:
search,social,video-streaming,ads-trackers,file-sharing,software-updates, and file types. - Winner: user → directory group → user type. No policy = unrestricted.
- Address-based = approximate. Squid = exact.
- Blocked HTTPS = connection error unless Squid decrypts with a CA the device trusts. Decrypt only your own devices, only blocked sites.
- Read more: Web policies.