authcha learn

Learn / Network engineer

Access rules

Module 3 of 5 · 30 minutes

By the end you can

  • Explain when rules run and what they can and cannot change
  • Read a rule list top to bottom and predict which rule decides
  • Write rules that admit with a class, and rules that reject
  • Test a rule before relying on it

Rules run after the sign-in succeeds

Authentication answers "who is this?". Access rules answer "given who it is, where it is and what state it is in, what should it get?". Use them to:

  • give a Wi-Fi network or a branch its own VLAN
  • keep contractors to working hours
  • require a posture agent on corporate laptops
  • reject combinations that should never be allowed

They apply to endpoint access: EAP-TTLS, EAP-TLS and MAB. Logins to network devices with a password and code are controlled by user types, jump servers and privilege mapping, not by these rules.

With no rules, or when no rule matches, a session keeps exactly what authentication decided: the MAB class or the certificate's class.

First match wins

Open Network Access → Access Rules. Rules are checked from the top of the list, and the first rule whose conditions all match decides. Put the most specific rules first and the most general last, using the arrow buttons.

A condition you leave empty matches anything. If you give several values in one condition, any one matches (SSID Corp or Corp-5G).

ConditionMatches
Authentication methodEAP-TTLS, EAP-TLS, MAB or Captive portal (PAP)
User typeThe user's type (802.1X only)
User policyThe network policy the user resolves to (not for MAB)
Directory groupThe user's group from the last directory sync (802.1X users only)
Device classThe class authentication resolved
Network device groupThe group of the switch or controller the request came through
Wi-Fi network (SSID)The SSID in Called-Station-Id
PostureCompliant, non-compliant, awaiting first report, grace period, stale, or no posture agent
MDM complianceWhat Intune or Jamf says: compliant, non-compliant, not in any MDM, or unknown
Days and time windowWeekdays and a time range. 22:00-06:00 runs across midnight

A rule does one of two things.

  • Admit with a device class. The session gets that class's VLAN, QoS filter, timeout and vendor attributes, replacing what it had.
  • Reject. The session is refused with your message. It is logged, and some devices show the message.

Examples

RuleWhenThen
Guest Wi-FiSSID GuestAdmit with class guest
Contractors after hoursUser type contractor, outside working hoursReject: "Outside contractor hours"
Laptops need the agentEAP-TTLS or EAP-TLS, device group HQ, posture No posture agentAdmit with class remediation
Managed devices onlyEAP-TLS, MDM Non-compliant, Not in any MDM or UnknownReject: "Device is not compliant"
Engineering VLANDirectory group EngineersAdmit with class engineering
Only the network teamDirectory group NetworkAdminsAdmit with class mgmt, then a rule with no conditions: Reject "Not authorised"

Admit one group, refuse everyone else

There is no "not in group" option. Put a rule that admits the group first, and below it a rule with no conditions that rejects. Directory groups also fail safe: a user whose groups Authcha does not know, or whose last sync is too old, never matches a rule with a group condition. A directory outage therefore stops group-based access instead of keeping it forever.

Captive-portal logins

Captive-portal PAP logins are evaluated with the method Captive portal (PAP). A VLAN or class means nothing there, so only Reject rules apply to them. Use that to refuse, for example, one policy on one gateway group or outside opening hours.

Test before you rely on it

Below the list, Test a session runs the same evaluation the RADIUS server uses, at the current time. Give it the method, the identity, the NAS address and, for Wi-Fi, the Called-Station-Id. It shows which rule decides and what Authcha worked out from the request: user type, device group, SSID, posture, MDM compliance and directory groups. The Hits column counts how often each rule has decided a real session.

Rules apply from the next authentication. To move sessions that are already connected, disconnect them from Network Sessions and they sign in again.

LabHands-on

  1. Open Access Rules on the demo (viewer login demo-viewer, password Authcha-View-2026). Read the list from the top. For each rule, say in words what it does.
  2. Find the rule list's order. Which rule would decide for a laptop on SSID Guest?
  3. Use Test a session with method EAP-TTLS and a demo username. Which rule decides? Change only the SSID and test again.
  4. Look at the Hits column. Which rule is used most?
  5. On your install, write a Reject rule for a user type outside working hours. Test it with Test a session at an allowed and a forbidden time. (You can test a time window by changing the rule temporarily.)
  6. Reorder two rules so a general rule sits above a specific one. Test again and see how the result changes. Put them back.

Check yourselfQuiz

1Two rules both match a session. Which one decides?
2Which kinds of login do access rules apply to?
3A rule has the condition SSID Corp, Corp-5G. When does it match?
4A device is non-compliant by posture, and a rule admits it. What happens?
5How do you admit one directory group and refuse everyone else?

Cheat sheetKeep this

  • Rules run after authentication, for EAP-TTLS, EAP-TLS, MAB and captive-portal PAP (reject only).
  • First match wins. Most specific first.
  • Empty condition matches anything. Several values in one condition: any one matches.
  • Actions: Admit with class or Reject.
  • Posture has the last word unless you add a Reject on non-compliant.
  • Group rules fail safe when groups are unknown or stale.
  • Test a session shows the deciding rule. Hits shows real use.
  • Read more: Access rules.