2.2
Interface metrics on Windows
On Windows, when Defguard Client is configured to route all traffic through the VPN, the tunnel interface’s metric is set to 0. For predefined traffic, the tunnel interface’s metric is set to automatic.
Windows uses the interface metric to choose between routes of equal specificity and to order DNS servers across adapters. A lower value means a higher priority, so 0 is the highest possible priority.
In an all traffic setup, this makes the VPN’s default route take precedence over the physical adapter’s default route, and makes Windows send DNS queries to the tunnel’s DNS servers first. This helps prevent traffic and DNS leaks outside the tunnel.
In a predefined traffic (split-tunnel) setup, the metric is left at its default, automatic value. Forcing it to 0 would give the tunnel’s DNS servers priority for every lookup, including local and non-tunneled names, which could break local name resolution or send queries through the VPN unnecessarily.
To check the tunnel interface metrics, run the following commands for IPv4 and IPv6 respectively:
netsh interface ipv4 show interfaces
netsh interface ipv6 show interfacesMFA Flows
Before 2.2, MFA was a single setting on each VPN location: disabled, internal (any one of the built-in methods) or external (the OpenID provider). An administrator could not require more than one proof, could not ask different users for different proofs, and had to repeat the same choice on every location.
Defguard 2.2 replaces that setting with MFA flows. A flow is a named, ordered list of steps. Each step lists the factors that can satisfy it, the user proves one factor per step, and the tunnel is established only after the last step succeeds. Flows exist as a separate entity and are assigned to locations.
Requirements
Every user connecting to an MFA-enabled location must resolve to exactly one flow.
Adding a user to a group, removing them from one, deleting a group or changing a location's allowed groups must never make it ambiguous, or impossible to decide, which flow a user gets.
Administrators must be able to require more than one proof, in a fixed order.
One flow must be reusable across locations, and editing a flow must change what it requires, never who it applies to.
Existing internal and external location MFA must keep working after an upgrade, without any action from the administrator.
A client older than 2.2 must never be offered a location whose MFA it cannot complete, and must never connect to such a location without MFA.
A client older than 2.2 must still be able to connect to a location compatible with the legacy MFA approach.
Considered options
1. A default flow with ordered group overrides, assigned on the location
A flow carries no targeting at all. It is only a recipe: a title and its steps.
Each location has exactly one Default MFA flow, which applies to everyone.
A location can add group-level MFA overrides. Each override assigns a different flow to a set of groups.
The administrator orders the overrides. When a user connects, Core checks the overrides from the top down, and the first one that contains any of the user's groups decides the flow. A user who matches no override gets the default.
Pros
Resolution is total: the default matches everyone, so there is always a flow to apply.
Resolution is deterministic: a user in two overridden groups gets the higher override, every time. Overlapping groups are allowed by design, so there is nothing that can conflict.
All of the targeting for a location sits on that location's MFA settings, which is the only screen that has to validate it. The single check, that a default is set, can always be satisfied there and never depends on group membership.
Editing a flow changes its steps everywhere it is used, but never changes which users it applies to on any location.
Cons
The order of overrides carries meaning. Placing a weaker override above a stricter one lets users who are in both groups through with the weaker flow.
The same flow can be targeted at different groups on different locations, so finding out who uses a flow means looking at every location it is assigned to.
2. Groups assigned on the flow itself
This was the first design. Each flow carried its own list of groups, or an "apply to all groups" flag, and a location simply listed the flows it enforced. A user would get the flow whose groups they belong to.
Deal-breaking issue: a user can belong to several groups, so two flows on the same location can both claim them. Whether a configuration is valid then depends on group membership, which changes all the time and is managed elsewhere: by administrators on group and user screens, and by LDAP or directory sync. Every such change would have to be validated against every flow on every location, and a conflict would surface as an MFA error on a screen that has nothing to do with MFA, such as adding a user to a group, or as a sync failure. The alternative, picking a winner silently, would need an ordering anyway, and an ordering of flows is global, while the same flow can mean different things on different locations. Editing a flow's groups would also change targeting on every location using it at once.
3. Applying every matching flow
Instead of choosing one flow, apply all flows whose groups match the user, one after another.
Deal-breaking issue: a user in three groups would have to complete three flows, repeating factors the flows have in common, and the number of prompts would depend on group membership rather than on what the location requires. A "flow" would stop describing what a user actually goes through, so administrators could no longer reason about it.
Decision
Option 1, a default flow with ordered group overrides assigned on the location, is selected.
Rationale
The aim is that "which flow applies to this user here" always has exactly one answer, and that the answer can only become wrong because of a change to MFA settings, never because of a change somewhere else. The mandatory default provides the first half of that: every user matches it. Ordering provides the second half: when a user matches several overrides, the order already decides between them, so overlapping groups are a normal situation rather than an error. Together they make a conflict impossible to represent, so there is nothing to validate when group membership changes.
Keeping groups off the flow follows from the same aim. A flow is something administrators reuse, while targeting is a decision about one location. Putting both on the flow would tie them together, so a change made for one location would silently apply to others.
The cost is that order matters: the most specific or strictest override goes first.
Database model changes
The migration adds four tables:
mfa_flowholds the flow's title.mfa_flow_stepholds the flow's steps, each with itspositionand a non-empty array of allowedmethods.location_mfa_flowassigns a flow to a location with apositionand anis_defaultflag. A flow can be assigned to a location only once, and a partial unique index allows at most one default per location. The API requires exactly one default on every save, so a location cannot be left without one.location_mfa_flow_grouplists the groups of an override. The default always has an empty group set, so it cannot accidentally be limited to some groups, and an override cannot accidentally become the default by losing its groups.
wireguard_network gets a stored mfa_enabled flag in place of the previous location_mfa_mode column. Turning MFA off on a location keeps its flows and overrides, so turning it back on restores the same policy.
Migrating existing locations
On upgrade, existing settings are converted without changing behaviour. If any location used internal MFA, a shared "Default Internal MFA" flow is created, with a single step that accepts the authenticator app, email code, biometrics or mobile approval, and it becomes the default of every such location. External MFA locations get a shared "Default External MFA" flow with a single OpenID step in the same way. Locations with MFA disabled get no flow.
Resolution
Core resolves the user's flow when a connection starts, against the current assignments and the user's current groups. The configuration a client has cached is only a hint: if the client prepared for a different flow, Core rejects the attempt, and the client fetches the updated configuration and starts again. A change to group membership therefore takes effect on the user's next connection, and connections that are already established are not affected.
Legacy client support
A client older than 2.2 understands only the old internal and external modes. A location is sent to such a client only when its configuration has an exact old equivalent: a single flow with a single step that holds either all legacy internal methods or only the OpenID provider. Any other location is withheld from the old client entirely, so it is never offered without MFA.
Consequences
Administrators have to order overrides from the strictest to the weakest. Defguard 2.2 does not warn when a weaker override is placed above a stricter one, so a user in both groups is asked for less than the stricter flow requires.
Deleting a flow that is a location's default, or the only flow of an MFA-enabled location, is refused, and the error names the locations involved.
The resolution guarantee covers which flow applies, not whether its factors can be used. Disabling SMTP, deleting the OpenID provider, an expired license, or a user who never set up a factor can leave a step that nobody, or a given user, can complete. Core checks every factor when a connection starts and refuses one that is not available, so the user is blocked rather than let through. Deleting the OpenID provider is allowed even while flows use it, because it is often part of incident response, and the response lists the affected locations so they can be fixed.
MFA client protocols
Before 2.2, a client completed MFA in a single exchange: it started a login with one method, then finished it with one proof. MFA flows need more than that: several steps in order, a choice of factors within each step, and new factors such as FIDO2 security keys. Desktop and mobile clients released before 2.2 are deployed everywhere and cannot be changed. This ADR explains how 2.2 adds the multi-step protocol without breaking them.
Requirements
Clients released before 2.2 must keep working against a 2.2 instance, with no end date. They cannot complete multi-step flows, but everything they could do before must keep behaving exactly as it did.
A 2.2 client must keep working against an instance older than 2.2, because clients and servers are upgraded independently.
Core must never guess what kind of client is calling from which fields a request happens to carry. The client states it by the endpoint it calls.
Both protocols must use the same MFA session storage, with the same attempt limit and timeout. The aim is code that can be maintained, not two separate MFA stacks.
Considered options
1. Two protocols, chosen by the client
The pre-2.2 protocol is frozen exactly as deployed, under
/api/v1/client-mfa/.The multi-step protocol is new and lives under
/api/v1/mfa-flow/, with its own Edge endpoints, its own messages between Edge and Core, and its own path through the MFA engine in Core.Both paths store in-progress logins in the same MFA session table, which records which protocol started each session.
The client decides which protocol to use for each instance it is enrolled in.
Pros
Behaviour that deployed clients depend on cannot change by accident, because nothing in the frozen path is shared with new features. For example, the mobile client waits for an OpenID login by repeating a request until it stops returning HTTP 428, and that response stays exactly as it was.
Each path handles one kind of client, so it contains no conditions of the form "if this is an old client". Changes to the multi-step protocol cannot affect old clients.
The new protocol is free to use a clean message design, without the fields and quirks it would otherwise have to carry for compatibility.
Sessions, the attempt limit and the timeout are implemented once and apply to both protocols equally, so neither protocol is a weaker way in.
Cons
Edge and Core expose two sets of endpoints and messages for the same purpose, and both have to be maintained and tested.
The client needs to know which protocol an instance supports, which requires a way for Core to tell it and a stored value on the client.
2. Extending the pre-2.2 protocol
Keep a single set of endpoints and add optional fields for multi-step flows. Core treats a request as coming from a new client when those fields are present.
Deal-breaking issue: every part of the engine that behaves differently for old and new clients has to repeat that check, and the checks spread through starting a login, finishing it, mobile approval and error handling. Each one is a place where an old client can receive new behaviour by mistake, and a request from an old client is identified only by what it lacks, which is the weakest possible signal. Any later change to the shared path risks breaking deployed clients, whose behaviour cannot be fixed after the fact.
3. Requiring all clients to upgrade
Drop the pre-2.2 protocol and require every client to be upgraded before 2.2 MFA works.
Deal-breaking issue: in a large deployment it is not realistic to upgrade every desktop and mobile client at the same moment as the server. Users with an older client would lose access to every MFA-protected location as soon as the server was upgraded.
Decision
Option 1, two protocols chosen by the client, is selected.
Rationale
The pre-2.2 protocol has to keep working indefinitely, and the only reliable way to guarantee that is to stop changing it. Once it is frozen, the multi-step protocol cannot live in the same code path without that path asking, again and again, which kind of client it is serving. Separating the two at the endpoint means the question is answered once, by the client, before any MFA logic runs, and each path can be read and changed on its own.
Splitting only the protocol, and not the storage, keeps the cost down. A login under either protocol is the same kind of in-progress MFA session, with the same limit on failed attempts and the same time limit, so the security-relevant rules exist once.
Choosing the protocol
Core reports whether it supports the multi-step protocol in the instance information it sends to clients. Desktop and mobile clients store the result for each instance and refresh it whenever they receive new instance information: on enrollment, on Instance Update, and on the periodic configuration poll where the license includes it.
An instance older than 2.2 does not report multi-step support, so a 2.2 client uses the pre-2.2 protocol with it, as requirement 2 asks. After an instance is upgraded to 2.2, a client keeps using the pre-2.2 protocol until it next refreshes its instance information. Until then, locations whose flows have no pre-2.2 equivalent refuse it with an error saying the configuration is not supported by the client, so it is blocked rather than let through.
Consequences
The pre-2.2 protocol is frozen, not deprecated. It is maintained, keeps its contract and has no removal date, but new MFA features are added only to the multi-step protocol.
A mobile app older than 2.2 can still approve a desktop login that uses the pre-2.2 protocol, but not a step of a multi-step flow. Users need the 2.2 mobile app for multi-step flows that use mobile approval.
A session started under one protocol cannot be continued under the other. Core treats such a request as a request for an unknown session.
Last updated
Was this helpful?