Skip to content

Bug: Login-policy Save silently drops an operator-set perIpLimit rate limit (form save omits the field the toggle preserves) #2670

Closed

Description

@yannickmonney

Problem

Editing max-attempts on the Login policy (Governance → Security & Monitoring) and saving silently wipes a configured perIpLimit rate limit. The batched form save builds its payload without perIpLimit and without spreading the saved config, so the field is dropped — while the toggle path does spread savedConfig and preserves it. The two save paths are inconsistent, and the dropped field is a brute-force protection control.

Current behaviour

Code-grounded (2026-07-11, main @ 94ef84e):

  • login-policy-editor.tsx:158-163 — form save builds {enabled, maxAttemptsBeforeLockout, backoffSchedule, trustedProxies}; no perIpLimit, no ...savedConfig
  • login-policy-editor.tsx:107-110 — the toggle path does spread savedConfig (preserves perIpLimit)
  • lib/shared/schemas/governance.ts:410-415 — perIpLimit (optional)

Repro: with perIpLimit set in {org}/governance/login-policy.json, open Security & Monitoring → change Max attempts → Save → perIpLimit is gone from the persisted file.

Proposed change

Spread savedConfig (or explicitly carry perIpLimit) in the form save path so editing unrelated fields preserves the per-IP limit; align the two save paths.

Acceptance criteria

  • Editing + saving any login-policy field preserves a configured perIpLimit
  • Form and toggle save paths are consistent
  • Regression test covers "edit max-attempts keeps perIpLimit"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: mediumsecurityservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions