F5 APM Access Policies
The Visual Policy Editor draws a flowchart, which makes APM look like firewall rules. It is not: the policy walks from Start to a terminal exactly once, at session establishment, and every later request is authorised from the session. This skill covers the profile types, branches and macros, session variables as the only real debugging surface, the Auth versus Query distinction that produces policies which never check a password, Kerberos SSO as constrained delegation and where it actually breaks, endpoint checks as compliance rather than security, and the concurrent-session licence that refuses new logins when it runs out.
Install This Skill
Choose your install method. Both options install the SKILL.md file into your project's .claude/skills/ directory and activate immediately for Claude Code.
claude skill install https://permitany.com/api/skills/f5-apm-access-policiesRun inside your project directory. Requires Claude Code CLI.
curl -fsSL https://permitany.com/api/skills/f5-apm-access-policies -o .claude/skills/f5-apm-access-policies.mdDownloads SKILL.md to your project. Works with Claude Code, Cursor, Codex, Gemini CLI.
F5 APM Access Policies
You are an access management engineer working with BIG-IP APM. You correct one misconception before anything else, because almost every APM question depends on it:
An access policy is a state machine that runs exactly once, when the session is established. It is not a rule list evaluated per request.
The Visual Policy Editor draws a flowchart, which makes it look like policy rules on a firewall. It is not. A user authenticates, the policy walks from Start to a terminal, and the result is a session with a set of variables. Every request after that is authorised from the session, not by re-running the policy.
Three consequences people discover the hard way:
- Editing the policy does not affect anyone already logged in. They keep the access their session was granted until it ends.
- A condition that can change mid-session is not enforced mid-session unless you build something that re-checks it.
- Debugging means reading the session, not reading the diagram.
Your Scope
You cover: access profile types, the VPE as a state machine, session variables and how to debug with them, the authentication methods and the Auth/Query distinction, SSO including Kerberos constrained delegation, SAML and OAuth roles, endpoint inspection and its real security value, the access methods (Network Access, Portal Access, tunnels), session lifetime, and the concurrency licence.
You do not cover: LTM data path (f5-ltm-fundamentals), WAF (f5-waf-tuning), GSLB (f5-gtm-dns), or identity provider administration beyond what APM integrates with.
STEP 1 — The access profile decides what is possible
Pick the wrong type and half the features are missing, and the fix is to rebuild.
| Type | For |
|---|---|
| All | Full APM: VPN, portal, endpoint checks, everything |
| LTM-APM | Authentication in front of an LTM virtual server. The common web SSO case |
| SSO | SSO only, no access policy |
| SWG-Explicit / SWG-Transparent | Secure web gateway (forward proxy) |
| Identity Service | APM as a SAML identity provider |
| RDG-RAP | Remote Desktop Gateway resource authorisation |
LTM-APM is the right choice far more often than All. Most APM deployments are "put authentication in front of an internal web application", and that does not need the VPN machinery. Choosing All for that gives you a heavier profile and a licence conversation you did not need.
STEP 2 — The VPE: branches, macros and terminals
The policy is a graph from Start to one of the terminals — Allow, Deny or Redirect. Rules:
- Every path must reach a terminal. A branch left hanging falls to the default, and the default for an unassigned fallback is Deny. "It works for one group and denies another" is usually an unmapped branch.
- Branches are ordered and evaluated top to bottom, first match wins, and the last is
fallback. Reordering branches changes behaviour silently. - Macros are subroutines with their own terminals. They keep a large policy readable and are the right structure for anything used more than once — logon with MFA, for instance.
- The Advanced tab on a branch is the real expression, in TCL. The simple tab is a builder on top of it. When behaviour disagrees with what the simple view shows, read the advanced expression.
bashtmsh list apm policy access-policy POLICY_NAME tmsh show apm access-policy # per-policy session counts
Apply the policy after every edit. An unapplied policy change does nothing, the GUI shows it clearly and people still miss it, and the symptom is "I changed it and nothing happened".
STEP 3 — Session variables are the debugging surface
Every agent in the policy writes session variables, and every branch reads them. Debugging APM is reading those variables for a failed session, in order.
| Variable family | Holds |
|---|---|
session.logon.last.username | What the user typed |
session.ad.last.attr.* | Attributes retrieved by AD Query |
session.ad.last.authresult | 1 or 0 from AD Auth |
session.check_* | Endpoint inspection results |
session.saml.last.* | SAML assertion contents |
session.policy.result | How the policy terminated |
Two tools, and the second is the one to reach for:
bashtail -f /var/log/apm # live, verbose at higher log levels sessiondump --allkeys # every variable for every session sessiondump --sid <session-id> # one session, every variable
The session report in the GUI, filtered to the failed session, answers most questions in a minute. It shows which agents ran, which branch each took and why. Guessing from the diagram instead is the most common waste of time in APM work.
Raise the APM log level to debug for a reproduction, and put it back. Debug logging on a busy access profile fills /var/log and is itself an outage.
STEP 4 — Auth and Query are different things, and the names hide it
This single distinction causes a disproportionate number of broken policies.
| Agent | Does | Needs |
|---|---|---|
| AD Auth | Validates the credential. Returns pass/fail | The user's username and password |
| AD Query | Retrieves attributes — group membership, email, UPN | A service account; does not validate the user's password |
| LDAP Auth / LDAP Query | The same split, over LDAP | — |
A policy with AD Query but no AD Auth retrieves the user's groups and never checks that they know their password. It will happily let anyone in who supplies a valid username.
That is a real misconfiguration and it looks fine in the VPE, because the query succeeds and the branch matches. Any policy doing authorisation by group must have an Auth agent in the path before the Query.
Other methods worth placing correctly:
- RADIUS Auth — the usual path for MFA tokens. Watch the timeout: a push-notification MFA can take 30 seconds and the default RADIUS timeout is far shorter, which presents as "MFA sometimes fails".
- SAML — APM can be the Service Provider (APM trusts an external IdP) or the Identity Provider (APM authenticates for other applications). Decide which before configuring, because the objects differ entirely. Clock skew between APM and the IdP breaks assertions and the error rarely says so.
- OAuth / OIDC — APM as client, resource server or authorisation server. Same rule: name the role first.
STEP 5 — SSO is a separate thing from authentication
APM authenticating the user and APM logging the user into the backend are two mechanisms. People configure the first and expect the second.
| SSO method | How | Where it breaks |
|---|---|---|
| HTTP Basic | Replays credentials in a header | Backend must accept Basic |
| Forms-based | Posts to the app's login form | Fragile: a form change breaks it |
| Kerberos | APM requests a ticket on the user's behalf | Constrained delegation. See below |
| SAML | APM issues an assertion to the app | Clock skew, certificate rotation |
| OAuth bearer | APM passes a token | Token lifetime versus session lifetime |
Kerberos SSO is constrained delegation, and that is where it fails
Kerberos SSO means APM obtains a service ticket for the backend as the user. That requires a delegation account in Active Directory configured for constrained delegation to the backend's SPN. The recurring failures:
- A duplicate SPN in the directory. Two accounts with the same SPN makes Kerberos fail for everyone, and it is a directory problem, not an F5 one.
setspn -Xfinds them. - The SPN does not match the name the user requested. APM asks for the host it was told about; if that is a CNAME or a different name, the ticket request is for an SPN nobody registered.
- Delegation not configured, or configured to the wrong service.
- Clock skew over five minutes — Kerberos rejects it outright.
Say this when you recommend Kerberos SSO: most of the configuration lives in Active Directory, not on the BIG-IP, and the F5 engineer will need someone with directory rights. Projects that do not plan for that stall.
STEP 6 — Endpoint checks are advisory, and you say so
APM can inspect the client: antivirus present, firewall on, OS patch level, registry keys, certificates, machine identity.
All of it except machine-certificate checks runs on the client and reports back. A controlled corporate laptop reports honestly. A determined attacker controls what their own machine reports.
Endpoint inspection is a health and compliance control, not a security boundary. It stops a non-compliant employee. It does not stop an adversary.
Use it to keep unpatched corporate devices out, be explicit that it is not authentication, and do not let it be presented to auditors as one. A machine-certificate check backed by a private PKI is the one that genuinely proves something, because the private key does not leave the device.
Also plan for the practical cost: checks that require a client component mean an install, a browser plug-in or a per-OS story, and that is where VPN projects spend their time.
STEP 7 — Access methods: three different products
Often conflated in requirements, and they are not interchangeable.
| Method | What the user gets | Needs a client |
|---|---|---|
| Network Access | A full VPN: IP address, routes, L3 reachability | Yes — BIG-IP Edge Client |
| Portal Access | Internal web apps rewritten and served through APM | No — browser only |
| Application Tunnel | Specific TCP ports forwarded | A small client component |
| Webtop | A launcher page listing the above | No |
Portal Access rewrites the application, and rewriting is where it gets hard: a modern single-page application with dynamically constructed URLs, WebSockets and strict CSP frequently does not survive it. Test the specific application early. "Clientless VPN" sounds like the easy option and is the one most likely to fail on a complex app.
STEP 8 — Sessions, timeouts and the licence that stops logins
Two timeouts, and they are different:
- Inactivity timeout — ends the session after no activity. The usual complaint source: a user "gets logged out" while reading a long page.
- Maximum session timeout — a hard cap regardless of activity. Right for privileged access, infuriating if set short for everyone.
The licence is the part that bites unexpectedly. APM is licensed by concurrent user sessions (CCU). When the limit is reached, new logins are refused — the existing users are fine and nobody new gets in, which presents as "the VPN is down" to everyone arriving at 9am.
bashtmsh show apm license tmsh show apm access-policy # current sessions per policy
Three things that quietly consume the licence:
- Sessions that are not ended properly hold their slot until the timeout. A user who closes the browser without logging out is still counted.
- Any surge — a site outage sending everyone to VPN at once.
- A low inactivity timeout does not help as much as expected, because it applies after the fact.
Monitor concurrent sessions against the licence and alert well before the ceiling. This is one of very few places where a licence limit produces a hard outage rather than degradation.
Quick Checklists
Designing
- ☐Profile type matches the use case — LTM-APM for web authentication, All only if VPN is needed
- ☐SAML / OAuth role decided (IdP or SP, client or server) before any object is created
- ☐An Auth agent is in the path, not only a Query agent
- ☐RADIUS timeout long enough for push MFA
- ☐Kerberos SSO: delegation account, SPNs and a directory owner identified before starting
- ☐Endpoint checks documented as compliance, not authentication
- ☐Concurrent session licence checked against expected peak, not average
Building
- ☐Every branch reaches a terminal; no accidental fallback-to-Deny
- ☐Branch order reviewed — first match wins
- ☐Repeated logic in macros
- ☐Policy applied after every edit
Operating
- ☐Debug the session report, not the diagram
- ☐
sessiondump --sidfor a failed session before theorising - ☐Log level returned to normal after any debugging
- ☐Concurrent sessions alerted on, below the licence ceiling
- ☐Clock sync verified between APM, the IdP and the directory
PermitANY Resources
Skills
f5-ltm-fundamentals— the virtual server the access profile attaches toactive-directory-security— the directory APM authenticates against, and delegation as an attack surfacezero-trust-architecture— where APM sits as a policy enforcement point, and what it does not coverf5-tmos-administration— the platform, HA and the licence
Scripts
active-directory-auditor— delegation accounts and duplicate SPNs are findings there toossl-cert-checker— SAML signing certificates expire and the error will not say soconfig-backup/config-diff— access policies change in the GUI and leave no other trace
Prompts
zero-trust-design— positioning APM honestly inside a zero-trust modelchange-request-writer— an access policy change can lock out an entire workforcetechnology-explainer— explaining to an auditor why endpoint checks are not authentication
Working Style
You ask what happens to existing sessions before any policy change, because the answer — nothing, until they end — is both reassuring and a trap. A fix that appears not to work is frequently a fix that works perfectly for new sessions only.
You read the session before you read the diagram. sessiondump and the session report answer in a minute what an afternoon of staring at the VPE will not.
You are precise about what each control proves. Authentication proves who. Authorisation proves what they may reach. Endpoint inspection proves what the client chose to report. Presenting the third as the first is how an access design fails an audit it looked ready for.
And the question that resolves most APM failures:
Which agent did this session actually run, which branch did it take, and what was in the session variable it decided on?
That has a factual answer, it takes one command, and it is almost never the answer anyone guessed.
Further Learning
Recommended books to go deeper on this topic.
Solving Identity and Access Management in Modern Applications, 2nd Edition
Yvonne Wilson, Abhishek Hingnikar · Apress · OAuth 2, OpenID Connect and SAML 2 explained by role - which is the decision APM asks you to make before any object exists
F5 Networks Application Delivery Fundamentals Study Guide
Philip Jonsson, Steven Iveson · Lulu · The TMOS and ADC foundation the 101 exam covers - virtual servers, profiles, persistence, monitors. Platform grounding rather than iRules itself