Enforcement connectors
By the end you can
- Explain what an enforcement connector delivers and why Authcha does not block anything itself
- Choose between Squid, the pfSense alias, a webhook, syslog, FortiGate and Palo Alto
- Describe the delivery guarantees: ordered, retried, reconciled
- Explain fail closed and what an outage does to restrictions
What they deliver
Authcha knows who is on which address, because every RADIUS accounting packet says "this user, at this address, on this NAS". It does not block anything itself. Enforcement connectors deliver that fact, together with the user's policy, to the devices that can act on it, within a second or two of the accounting Start and again of the Stop, and keep those devices correct across restarts and outages. Open Network access → Enforcement. It is part of the NAC edition.
RADIUS accounting ─▶ outbox ──▶ dispatcher ──▶ per connector, per address:
compare desired state with what the
connector confirmed; send only a differenceWhich one
| Decides on | Good for | |
|---|---|---|
| Squid + the Authcha helper | The TLS server name and HTTP Host header | A user held to one site, or kept from some, exactly, even when sites share an address |
| pfSense alias | The address only | "These users are limited": rate limits, ports. Approximate for websites |
| Webhook | Whatever your receiver does | Any firewall, NAC or automation that takes an HTTP call |
| Syslog (CEF or JSON) | Whatever your SIEM or firewall does | Identity feeds into a SIEM, or a firewall that learns users from syslog |
| FortiGate (RADIUS accounting SSO) | FortiGate policies on the group Authcha supplies | FortiGate user-based policy |
| Palo Alto User-ID | PAN-OS policy keyed on the user | User-ID based security policy |
An address-based enforcer cannot isolate one website on a CDN. Use Squid for that.
What every connector gets
- Event driven. A database trigger writes an outbox row and sends a notification. There is no polling. A one-second tick is only a safety net.
- Ordered per address. One pending delivery per connector and address. If a Start, Stop and second Start arrive together, the connector receives what is true now.
- A "stop-start" is not a logout. Some NAS (pfSense) end a session with the cause
NAS-Requestand start it again a second later. Releasing at once would leave a restricted user unrestricted for that gap, so such a Stop is held forrelease_grace_seconds(default 8) and a Start in that time cancels it. - At least once, idempotent. A delivery is forgotten only after the device confirmed it, and every operation is a set operation. A webhook receiver can de-duplicate on
key. - Retries and dead letters. A failed delivery is retried after 1, 2, 4, up to 60 seconds. After ten attempts it is a dead letter, shown on the page with its error. Retry or Discard it.
- Reconcile, not only deltas. On console start, after an outage, when a connector is edited, on Re-sync, and every five minutes, the connector is pushed the complete state. A restart, a lost event or a hand edit cannot leave it wrong for long.
- Secrets sealed. Keys and secrets are encrypted under
PKI_KEY_ENCRYPTION_KEYand never returned by the API. - Guarded and verified. A connector never reaches this host or a link-local address, redirects are refused, and TLS certificates are always verified. There is no "skip verification" switch.
Outages never lift a restriction
While a connector's device is unreachable, nothing is released. Aliases, User-ID entries and Squid's cache stay as they are, and the connector retries. What a new limited session gets while its connector cannot confirm it is the fail closed option:
| Off (default) | On | |
|---|---|---|
| A limited session unconfirmed after the grace period (default 10 s) | Marked unenforced, and an alert is raised | The same, and the session is disconnected (quarantine) |
| The user | Keeps the unenforced access until the connector is back | Must sign in again, and is enforced once the connector returns |
Authcha cannot configure a device that is down, so with fail closed it removes the unenforced session instead. Only users who resolve to a web policy are ever quarantined. Watch the metric authcha_enforcement_unenforced_sessions: alert on anything above zero.
The connectors in a little detail
- pfSense alias. Keeps an alias (default
authcha_limited) equal to the addresses of limited users, optionally one per policy. It writes only aliases that differ, waits until the live pf table matches, then kills the connection states of changed addresses so existing connections meet the rule, and on any error restores the previous contents. It needs the pfSense REST API package and a certificate chain the console can verify: the server certificate must be a leaf certificate issued by the CA you paste, not the CA certificate itself. Its mock tests have not been checked against a real pfSense. - Webhook. One signed JSON
POSTper event (session.apply,session.release,session.revoke,snapshot,test). The signature is HMAC-SHA256 of<timestamp>.<body>, so a receiver can verify it. Answer any 2xx to confirm. - Syslog. RFC 5424 over UDP, TCP or TLS, with a CEF or JSON body. UDP has no acknowledgement, so use TCP or TLS when delivery matters.
- FortiGate. Sends RADIUS Accounting packets (UDP 1813) with
Fortinet-Group-Name. Not tested against a real FortiGate. - Palo Alto.
type=user-idlogin and logout messages, with a timeout so a dead console does not leave users mapped forever. Not verified against a real PAN-OS. - The Squid helper. An external ACL helper that decides on the TLS server name from the policy Authcha resolved for the client's address. It supports fail-closed or fail-open and
--require-session.
LabHands-on
- Open Enforcement on the demo as
demo-admin(passwordAuthcha-Demo-2026). Look at the connectors, queue depth and health. - Add a webhook connector pointing at a test receiver you control and click Test.
- Sign a test user in and watch the
session.applyevent arrive. Verify its HMAC signature with a few lines of Python. - Stop the receiver, sign another user in, and watch the delivery retry and eventually become a dead letter. Start the receiver and press Retry.
- Turn on Fail closed, stop the receiver, sign a limited user in, and see the session quarantined after the grace period.
- Read
authcha_enforcement_unenforced_sessionsin the metrics.
Check yourselfQuiz
Cheat sheetKeep this
- Network access → Enforcement. Connectors: pfSense alias, webhook, syslog, FortiGate, Palo Alto, Squid helper.
- Squid = exact. Address-based = approximate.
- Guarantees: event driven, ordered per address, at-least-once, retried 1 to 60 s, dead letter after 10, full re-sync every 5 min.
NAS-Requeststop is held 8 s by default.- Outages never lift a restriction. Fail closed quarantines unconfirmed limited sessions.
- Webhook signature: HMAC-SHA256 of
<timestamp>.<body>. - Alert on
authcha_enforcement_unenforced_sessions > 0. - Read more: Enforcement connectors.