Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

2.0 KB
Raw Blame

Run: NIST 2.1 — Per-account failed-login lockout (3.1.8)

  • Branch: feat/nist-2.1-login-lockout (base nist-800-110-audit)
  • Mode: FULLY AUTONOMOUS /feature — plan → execute → self-review (research & grill skipped; design pre-resolved in .ai/plans/2026-08-15-nist-800-171-app-remediation.md §2.1)
  • Autonomy: no human gates; gated PR is the supervision point.

Grounding (verified in code)

  • ERP apps/erp/app/routes/_public+/login.tsx L94-110: IP-only sliding-window rate-limit (Ratelimit.slidingWindow(RATE_LIMIT, "1 h"), key = ip), emits login_rate_limited.
  • MES apps/mes/app/routes/_public+/login.tsx L79-94: same IP-only limit, no auth-event logging at all.
  • @carbon/kv exports Ratelimit (upstash-compatible, ioredis) + redis. Duration type available.
  • logAuthEvent + AuthEvent union in packages/auth/src/services/auth-events.server.ts; re-exported via @carbon/auth/auth.server.
  • redis client is ioredis Redis (supports incr/expire/pttl/set EX/del).

Design (resolved)

  • New @carbon/kv module src/lockout/ — email-keyed lockout layered ON TOP of the IP limit (additive).
    • Pure, TDD'd helpers: normalizeLoginIdentifier, lockDurationSeconds (exponential backoff, capped), evaluateLockout.
    • AccountLockout class: status() (read lock TTL), recordFailure() (count via Ratelimit.slidingWindow; engage/extend exponential lock when window exceeded), reset().
  • New auth event login_locked added to AuthEvent union (+ failure classification). Closes 1A.1 "no lockout event".
  • Wire into ERP + MES login actions: check status (block early), else recordFailure (block on tip-over), generic non-enumerating message, emit login_locked. IP limit and all existing behavior preserved.

Progress

  • Ground in real code
  • Red→green unit tests for pure helpers + class
  • login_locked event
  • ERP wiring
  • MES wiring
  • Scoped typecheck / lint / tests
  • Runtime/browser proof (UNVERIFIED — needs running stack + redis)

Gates

  • see final report