authcha learn

Learn / Integrations

Web policies

Module 1 of 6 · 30 minutes

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 pointSeesHolds a user to one site?
Squid with the Authcha helper (peek-and-splice)The TLS server name and the Host headerYes, even when many sites share an address
A next-generation firewall with FQDN or URL objectsThe name, if configuredYes, with identity delivered by a connector
The pfSense agent, Squid pathThe nameYes
The pfSense alias path, or the alias connectorOnly the addressNo, approximate

Web policies are part of the NAC edition.

Write a policy

Open Access Control → Web policies.

FieldMeaning
Name1 to 48 characters: lower-case letters, digits, - and _. This is the name the device receives
ModeAllow-list: the entries are the only destinations. Deny-list: the entries are blocked and everything else is allowed
DomainsUp to 500 entries
CategoriesUp to 20 built-in groups

A policy needs at least one domain or category.

Entries

WriteMatches
google.co.inThat name only
*.google.co.inEvery subdomain, not google.co.in itself. Write both to cover both
ip:203.0.113.7One address
cidr:203.0.113.0/24A network
ext:zipA 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.

CategoryContains
searchGoogle, Bing, DuckDuckGo
socialFacebook, Instagram, X, TikTok, LinkedIn, Reddit, Snapchat, WhatsApp
video-streamingYouTube and its media hosts, Netflix, Prime Video, Hotstar, Twitch
ads-trackersCommon advertising and tracking networks
file-sharingDropbox, Box, Mega, WeTransfer, OneDrive, Google Drive
software-updatesWindows Update, Ubuntu, Debian, Apple updates
file-download, media-downloads, p2p-torrentFile 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:

  1. the user
  2. 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
  3. 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).

  1. Open Web Policy. Find no-social-networks, no-video-streaming and no-downloads. Open one and read its mode, categories and entries.
  2. Look at the Assignments. For a user of type network-user, which policy applies, and why?
  3. Make a test policy google-only as an allow-list with google.co.in, *.google.co.in and gstatic.com. Use the resolver to see what a user resolves to.
  4. Assign it to a test user, then to their user type as well, and confirm the user's own assignment wins.
  5. 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.
  6. Add ext:zip to a deny-list and try it on an allow-list. Read the refusal.

Check yourselfQuiz

1Does Authcha block websites itself?
2Which enforcement path can hold a user to a single named site on a CDN?
3What does *.example.com match?
4A user has a policy on their user type and one on their own account. Which applies?
5Why does a blocked HTTPS site show a browser error and not a nice page?

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.