Migrating to Nauthilus v4
Nauthilus v4 establishes deliberate compatibility boundaries for the Go module and native plugin ABI, Policy
configuration and APIs, public Go protobuf imports, browser session state, and IdP token state. This guide targets the
stable v4.0.0 release and an upgrade from the 3.1 line. The 4.0.0 release notes summarize
every breaking change, the additional steps for v4 prereleases, and the new features. Validate the complete deployment
in a non-production environment before rollout. Operators who already run 4.0.x follow
Upgrading from 4.0.x to 4.1.
Migration Checklist
- Replace only the exact module prefix
github.com/croessner/nauthilus/v3withgithub.com/croessner/nauthilus/v4. - Use Go 1.27.4 (the toolchain since v4.0.8) with
GOEXPERIMENT=runtimesecret. Rebuild every native.soagainst the exact host commit, toolchain, module graph, build tags, CGO mode, OS, and architecture, and embed the host's native artifact identity with-ldflags "$(go run -mod=vendor ./scripts/native_artifact_fingerprint)". Unmarked artifacts are rejected. - Manually migrate the removed v3
auth.policysubtree to top-levelpolicy. There is no converter, dual root, or compatibility window. - Replace unqualified
standard_auth, rule/checkstage, and checkconfig_refwith exact qualified identities and checkpoint ownership. Move record-predicate fields fromrecords.fieldinto therecords.whereleaves, and use onlypermit/deny(plustempfail/neutralinauthn) as rule decisions. - Configure Generic Policy callers separately from management and backchannel callers. Preserve exact audience, scope, target, schema, fact, diagnostics, rate, concurrency, and optional mTLS admission.
- Update native plugins: declare
ReplaySafetyon every effect descriptor, grantallow_capabilities: [password_hash]to modules that read password digests (for example ClickHouse), and make sure admin hooks are only used bynauthilus:admincallers. - Add
decision_bindingsto every GeoIP module. Remove the Luageoip_reputation.luaplugin and its settings, and switch to the bundledreputationplugin if you need reputation data. - Replace the complete browser-serving pool uniformly. Do not mix v3.1 and v4 session readers or try to migrate in-flight browser state. Old records remain inert and can expire.
- Prepare the IdP Redis hard cut: Redis 6.2 or newer with
maxmemory-policy noevictionand a mandatorystorage.redis.encryption_secret. All tokens, device flows, and unredeemed codes are invalidated; clients must reauthenticate. Operators coming from a v4 prerelease with dynamic clients also remove the oldoidc:dcr:{dynamic}:*andoidc:dcr:{registry}:activekeys and register dynamic clients again. Edge nodes replace rejected authority caller tokens on their own, so no manual edge token flush is needed. - Validate the direct MFA self-service entry, which now requires MFA for users with an enrolled factor, and each TOTP, WebAuthn, recovery-code, enrollment, and step-up flow.
- Review brute-force bucket limits: every distinct wrong password now counts immediately, while backend faults are no longer counted.
- Check reverse proxies: all
X-Forwarded-Forlines are evaluated. An invalid chain falls back to the direct peer, not toX-Real-IP;X-Real-IPstill applies when noX-Forwarded-Forheader is sent. - Regenerate Go clients that consume v4
go_packagemetadata. Independently generated protobuf clients remain wire compatible where their package, service, method, field, and HTTP identifiers are unchanged. - If you used the
dkim2-reputationmodule of an early v4 prerelease, replace it withgeoip+reputation+dkim2-intelligence(an external plugin since v4.0.2), convert static data withscripts/convert-static-reputation.py, and keep enforcement off until a livedkim2dend-to-end run passes. - Run
nauthilus --config-checkagainst the final configuration. Authn rules must fit their checkpoint position (permit,deny, ortempfailat the final checkpoint;deny,tempfail, orneutralearlier), and an explicitfsm_event_markermust match decision and checkpoint. Omitted markers are still derived. - Make sure every authn
permitrule tests the host evidence it relies on (for examplebackend.authenticated), because a permit without host evidence fails closed as a temporary failure. Alert onauthn_fsm_guard_violations_total. - Review the LDAP pool settings of every pool section. Timeouts, size and time limits, retry, circuit-breaker, health,
cache, and
auth_rate_limit_*options now apply to every pool connection. - Point Kubernetes liveness probes at
/livezand keep/healthzfor readiness and startup probes, with a startup budget that covers the Redis readiness loop and the reputation start retry. - Update dashboards for the pipelined brute-force Redis labels of
bruteforce_redis_roundtrips_total, the halved failed-login share ofredis_write_total, and the new mail andjmapprotocol labels ofauthentication_response_time_seconds. - If the HTTP rate middleware is enabled, remember that the per-IP limit on caller-authenticated
/api/v1routes is a failure budget, and thatauth.pipeline.max_concurrent_requestsnow bounds the gRPC authority as well. - Optional features: enable the LDAP identity lookup cache (
storage.redis.identity_cache), Redis password caching for native backend modules (plugins.modules[].positive_password_cachewith plugin support),observability.log.notice_ignore_fields, and OIDC resource indicators (token_introspection) only after testing. Resource servers that readaudmust accept an array once resources are granted. - Validate the entire candidate in a non-production environment before any production rollout.
Migrate to Nauthilus 4.1.1 or later when you bring Lua callbacks from Nauthilus 3. These callbacks keep the Lua API they had on Nauthilus 3, including Redis writes, outbound HTTP, LDAP, DNS, mail, and backend server selection. The releases 4.0.0 to 4.1.0 rejected such callbacks when the configuration was loaded. See Lua runtimes and capabilities.
Upgrading from 4.0.x to 4.1
Nauthilus 4.1 keeps the v4 module path, pluginapi.APIVersion, and the configuration roots. Review these points
before the upgrade:
- Behavior change, brute-force toleration: toleration works again. On 4.0.x no request recorded toleration
observations, so
tolerate_percent,custom_tolerations,adaptive_toleration, and the reputation-scaled bucket limits had no effect. Negatives now count every failed attempt behind an address, positives count distinct accounts with a successful login, both withintolerate_ttl. Networks with recent successful logins get higher effective limits again, and shared addresses with many failures reach the end of their toleration sooner. Reviewtolerate_ttl,tolerate_percent,min_tolerate_percent,max_tolerate_percent,scale_factor,adaptive_toleration, andcustom_tolerations; see Toleration. Oldbf:tr:{<scoped ip>}counter hashes are no longer read and expire on their own. - Behavior change, affected accounts: entries of the brute-force listing now age out per account after
auth.controls.brute_force.affected_accounts.retention(default24h, raised to the longest brute-force state lifetime). Existing entries stay listed for at least that retention after the upgrade. Setaffected_accounts.cleanup_enabled: falseto keep entries until an explicit flush. The lifecycle needs Redis 6.2 or newer; see Affected Accounts. - Clients of
/api/v1/cache/flushmust expect HTTP503Account mapping lookup failed(or a failed async job) when the stored account mappings cannot be read, and retry. Earlier releases flushed only the literal name. - Update dashboards:
redis_write_totalcounts each command of the affected-account write and flush, and the newbruteforce_affected_accounts_*,policy_terminal_post_actions_total, andplugin_auth_events_totalseries appear. Watchpost_action_acceptance_failures_total{error_class="best_effort_saturated"}. - Optional: declare login-log post-actions such as
authn/plugin.clickhouse.post_actionasterminal_post_actionsof the authn target, so requests answered by built-in rules, such as brute-force rejects after a ban hit, are recorded once as well. Rule obligations that name the same effect are folded into the completion and need no removal, but must use the same parameters. - Security fix, secret redaction: with debug logging, earlier v4 releases printed secret values such as OIDC
client secrets in plain text in the configuration sections they log at startup. 4.1 renders every secret value as
<hidden>in formatted and logged output. Restrict or purge debug logs written by earlier releases, and rotate the OIDC client secrets they contain. - SAML: service providers that require signed logout responses now accept the Redirect-bound answer to an
SP-initiated logout, and LogoutRequests with several
SessionIndexelements match any listed index. Service providers that were configured to accept unsigned logout responses as a workaround can require signatures again; see SAML. - Rebuild every native plugin against the exact 4.1 host commit as before. Plugins that share Kafka dependencies with
the host must use the host's pinned module versions, currently
github.com/twmb/franz-gov1.22.1,github.com/twmb/franz-go/pkg/kmsgv1.14.0, andgithub.com/pierrec/lz4/v4v4.1.31: lz4 v4.1.32 and later cannot be built with-buildmode=pluginon amd64. New optional APIs are the event sinks andPostActionRequest.Outcome. Revisions that shipserver/default.pgobuild the server with profile-guided optimization; compile every plugin with the same profile, or Go refuses to load it. See PGO profile. - Action, ClickHouse plugin: apply
migrations/diagnostic-contract.sqlbefore deploying the 4.1 plugin, andmigrations/bruteforce-evidence.sqlbefore enabling the brute-force evidence URLs; ClickHouse drops unknown fields silently by default. The login export no longer writes the 20 retired columns (the flatreputation_*,gp_*,prot_*, anddyn_*fields), and tempfails are recorded asoutcome=tempfailwithhttp_status=500instead of a credential failure. Update dashboards and queries; theretire-legacy-columnsblock ofschema.sqlis a separate, irreversible step. See ClickHouse. - Behavior change, OIDC discovery: Nauthilus serves RFC 8414 metadata at
/.well-known/oauth-authorization-server(and its path-insertion form) and adds the RFC 9207issparameter to every redirect-based authorization response. Route the new well-known path to Nauthilus if the reverse proxy forwards onlyopenid-configuration, and keepidentity.oidc.issuerexactly as clients know it. See OIDC. - Security fix, consent challenges: the token endpoint refuses values outside the issued authorization-code shape
with
invalid_grant. Consent pages that a user opened on a 4.0.x instance during a rolling update must be restarted; nothing needs to be migrated. - Admin client: repeated
--resolveflags now replaceNAUTHILUS_RESOLVEinstead of adding to it, andbruteforce listrequests a page of 100 entries by default; page further with--offset. See Admin Client. - Behavior change, backchannel scopes: every
/api/v1route family asks only for its own scopes, andnauthilus:authenticateis no longer a base scope of all routes. Existing tokens keep working. Single-purpose clients can drop scopes they no longer need, for example a brute-force dashboard tonauthilus:security_readalone;nauthilus:security_writecovers flushes and OIDC session deletion. See OIDC Bearer Access. - Action, backchannel Basic authentication:
auth.backchannel.basic_authis validated more strictly.enabled: truerequires theusernameandpasswordpair or at least one entry underusers,usernameandpasswordmust be set together, and usernames must not contain a colon or a space. A configuredusernameandpasswordpair is the unrestricted credential and is announced with a warning at startup; scoped credentials underusershold only the scopes listed for them. A custom hook that declares scopes now refuses the unrestricted credential with403instead of401. See Backchannel Basic Credentials. - Upgrade effect, browser sessions: session payloads in Redis are sealed with
storage.redis.encryption_secretand plaintext records are discarded. Every live browser session ends once and stored OIDC consents are requested once more. Each edge replica also fetches its authority token once more, because the cached token is now stored encrypted. - Behavior change, OIDC signing keys: generated signing keys follow
identity.oidc.key_max_age(default 7 days) instead of a 365-day fallback, and inactive keys older than that age are removed. Setkey_max_ageexplicitly if relying parties cache keys for longer, and keepkey_rotation_intervalshorter thankey_max_age. - Action, bundled Lua plugins on Redis Cluster: delete the untagged and
{lua-nauthilus}-renamedmultilayer:global:current_metricshashes once. The plugins now keep the keys of one Redis script on one hash tag; all other old keys expire. - Fixed in 4.1.1, Lua callbacks: environment sources, subject sources, and actions run with the full Lua API again. A configuration that 4.0.x or 4.1.0 rejected because a callback writes to Redis, opens an outbound connection, or selects a backend server loads on 4.1.1. No configuration change is needed; see Nauthilus 4.1 Patch Releases.
The support history, MCP support access, and operational diagnostics are new and disabled by default; see Support Authentication History and Read-only Support Access over MCP. The 4.1.0 release notes list every change.
Detailed Contracts
- Nauthilus 4.0.0 release notes
- Policy configuration hard cut and manual migration
- Policy configuration overview
- Generic Policy REST and gRPC API
- Canonical browser session migration
- MFA self-service portal
- OIDC Dynamic Client Registration
- Native Go plugin guide
- Public protobuf APIs
- DKIM2/Rspamd Policy integration
- Reputation operations
- Generated protected HTTP API reference
Third-party module paths that independently contain a /v3 suffix are unrelated and must not be rewritten. The retired
browser /api/v1/mfa/* routes must not be confused with the separate cookie-free /api/v1/mfa-backchannel/* family.