v0.6.354: sign-in messages, OIDC refusal, directory facts and checks, Certificates (#985, #987, #988, #989, #990, #992, #993, #994, #995, #998) #1004

Merged
Cordy merged 46 commits from b6 into main 2026-10-25 19:36:47 +00:00
Owner

Batch 6. Implements the #985 decisions and the three approved mockups.

  • Sign-in after a verified credential:
    • Codes account-not-allowed, account-expired and password-change-required; the AD 532/773 path stays off until the real-DC test.
    • auth.genericSigninErrors, auth.passwordChangeUrl, auth.signinHelp, auth.signinHelpUrl.
    • Throttle option D, the #992 refused-credential cache, and the audit verb auth-signin-refused.
  • OIDC:
    • /login?refused=not-allowed|failed|idp|removed with "Sign out of single sign-on".
    • Refusals end sessions and pause devices.
    • Removal notice, Entra overage detection (#989), #988 top-level rule, findGroup fix (#987).
  • Users & access: directory facts, Check connection / Check a person (stored per instance), AD lock badge with directory-locked, and the #990 guard.
  • Certificates: own admin topic, Overview row and cards, failure classes per integration, tls.expiryWarn / tls.expiryCritical with the lifetime rule, shared tlsstatus.json, bell items and the certificates mute, metrics.
  • Audit list: reasons shown (#998).
  • Image, chart and shared state:
    • distroless debian13 (#993).
    • chart 0.6.0 with serviceAccount values (#994).
    • device-pauses.json shared across instances.
  • Docs: CHANGELOG v0.6.354 and the #995 corrections.

Reviews: per-task reviews plus a final whole-branch review in .superpowers/sdd/2026-10-25-batch6/.

Follow-ups: #1001, #1002, #1003 (v0.6.355).

Batch 6. Implements the #985 decisions and the three approved mockups. - **Sign-in after a verified credential:** - Codes `account-not-allowed`, `account-expired` and `password-change-required`; the AD 532/773 path stays off until the real-DC test. - `auth.genericSigninErrors`, `auth.passwordChangeUrl`, `auth.signinHelp`, `auth.signinHelpUrl`. - Throttle option D, the #992 refused-credential cache, and the audit verb `auth-signin-refused`. - **OIDC:** - `/login?refused=not-allowed|failed|idp|removed` with "Sign out of single sign-on". - Refusals end sessions and pause devices. - Removal notice, Entra overage detection (#989), #988 top-level rule, `findGroup` fix (#987). - **Users & access:** directory facts, Check connection / Check a person (stored per instance), AD lock badge with `directory-locked`, and the #990 guard. - **Certificates:** own admin topic, Overview row and cards, failure classes per integration, `tls.expiryWarn` / `tls.expiryCritical` with the lifetime rule, shared `tlsstatus.json`, bell items and the `certificates` mute, metrics. - **Audit list:** reasons shown (#998). - **Image, chart and shared state:** - distroless debian13 (#993). - chart 0.6.0 with `serviceAccount` values (#994). - `device-pauses.json` shared across instances. - **Docs:** CHANGELOG v0.6.354 and the #995 corrections. Reviews: per-task reviews plus a final whole-branch review in `.superpowers/sdd/2026-10-25-batch6/`. Follow-ups: #1001, #1002, #1003 (v0.6.355).
- Thresholds: amber min(14 d, L/4), red min(7 d, L/10); 30 d / 7 d from
  100 d of lifetime; tls.expiryWarn / tls.expiryCritical override. The
  daily WARN uses it instead of the fixed 14 days.
- Trust.Status / ServerCert.Status: system bundle, tls.caDir certificates
  and skipped files with reason codes, SSL_CERT_* only when not the image
  default; served leaf and chain with SANs, key, fingerprint, level.
- Every tlstrust client names its integration (guard-enforced); failures
  are classified with errors.As (text fallback for go-ldap StartTLS) and
  recorded in the round trip, the gRPC handshake and the LDAP dial: last
  OK, last failure, 24 h count, failing since, peer expiry; 10 hosts per
  integration, 7 days. One WARN per integration and class an hour.
Days (21d) or Go durations (504h); the start refuses a value it cannot
parse, one not above zero, and critical >= warn, naming the key or the
variable. Reference rows added so the documentation drift test holds.
The fixed .tmp name of Write fails concurrent writers of one file
(rename: no such file); WriteShared uses os.CreateTemp and an atomic
rename on unbound paths, one Save on bound ones. InstanceID is the
lock's id (hostname), shared by the per-instance documents.
- ErrAccountRefused (wraps ErrUnauthenticated) with RefusedError
  {Reason, Source, User, Code}: LDAP not-allowed and account-expired,
  local disabled (ErrAccountDisabled is now one), AD 532/773 behind the
  unexported adPasswordChangeConfirmed switch (off until #741), app
  passwords of refused accounts. Carried through the LDAP single flight.
- POST /auth/password: 403 account-not-allowed, account-expired,
  password-change-required (+ passwordChangeUrl), account-disabled;
  auth.genericSigninErrors answers them exactly like a wrong password.
- Throttle option D: refusals spend the bucket (same delays, 429 at 20,
  own auth-throttled note) but never the failures notice, bell limit
  items, spray detection or the client-address alarm; Throttle.Clear on
  re-admission (OnResume).
- Audit verb auth-signin-refused (signin, admin tier), folded per user,
  reason and hour.
- #992: refused-credential cache for AD 52e (HMAC fingerprint, per
  process key, ldapCacheTTL, bounded, cleared on a successful bind);
  client address and client class in the AD refusal line.
- Config auth.genericSigninErrors, auth.passwordChangeUrl,
  auth.signinHelp, auth.signinHelpUrl (+ env); /auth/mode carries the
  help fields.
tlsstatus.json holds one entry per instance id; each instance rewrites
only its own (on a change, at least every 5 minutes), not reporting
after 15 minutes, pruned after 24 hours. Derive merges the reporting
instances: listed outbound per integration and host, the problems worst
first (ldap-plain ... not-reporting) for the Overview row and cards, and
the admin bell items with stable times from a spacealerts store.
spacealerts writes through WriteShared.
Admin session only (requireAdmin). Bell: tls-expiring, tls-expired,
tls-failing, ldap-insecure for administrators with a session; the new
pref key certificates mutes tls-expiring and tls-failing only.
setupTLS sets the expiry thresholds before the trust loads; the
configured TLS integrations show before their first connection;
tlsstatus.json and tlsalerts.json are state bound to the backend on s3.
S1: a host counts as failing only while its last failure is within 24 h;
a failure after that starts a new streak (card, bell and metric follow).
S2: ldapAllowPlain is flagged when any URL in ldapUrl is ldap://.
S3: lastFail.names from x509.HostnameError (tlstrust.CertNames); Classify
covers more of go-ldap's flattened StartTLS texts.
S4: bell items carry of (reporting instances).
N1-N5: recordTLS below urlHost; server.rootSource, issuerO, transport tag,
hosts as host:port; warn window never shorter than critical, thresholds at
most 3650d; partial view on an unreadable shared document without pruning;
View passes p.Alerts directly.
- callback outcomes without a session go to /login?refused=not-allowed|failed|idp;
  Sign in again with a missing or overage groups claim gets reauth=not-allowed
- an oidcAllowedGroups refusal with the claim present ends the sessions and
  pauses devices (also without a re-check, Entra), audited auth-signin-refused,
  folded per user, reason and hour; missing or overage claim: groups-unknown
- Entra groups overage detected (_claim_names), WARN hourly, counted per day
- removal tombstones: next GET / or /login goes once to /login?refused=removed
- findGroup finds subgroups and paths, exact compare; bare entries mean a
  top-level group at sign-in, re-check and for adminGroups; start-up WARN
- /auth/mode gains ssoSignOut in OIDC mode
- findGroup: a bare name resolves to a top-level group only, a /path by
  group-by-path; space operations never take a path (B1, S2)
- live groups and the Keycloak re-check carry each group's full path;
  the admin decision compares paths, app groups by name (S1)
- the #988 start-up check records time and error and retries on the
  re-check cadence until it succeeds; Checked/BareChecked (S3)
- RefusedGroupsUnknown; tombstones pruned once per call; a groups
  claim that is not a list counts as missing (N1-N3)
Conflict: internal/auth/oidclib/oidclib_test.go fakeIdP fields, both kept
(C's backchannel, B's edit hook).

Semantic adaptation to B's UserStatusID returning []spaces.GroupRef:
kcCheckDir and kcChecker.CheckPerson (groups shown as names, as before),
and the fakeKC test helper in directorywire985_test.go.
- DirectoryAPI.OIDCGroups = oidcGroupFacts (Entra overage counter, #988
  bare-name state) in OIDC mode; main.go passes bareGroupState.
- api.OIDCGroupFacts gains BareChecked; directory.oidc.bareCheck
  {state: not-checked|could-not-check|checked, at, instance}, only with
  the Keycloak admin client (the check runs there); no raw error.
- Keycloak Check a person: kcAllowedVia uses allowedRef (a bare entry
  means a top-level group); PersonCheck.GroupPaths carries the paths so
  the answer's admin follows the sign-in rule (personAdmin, as
  Resolver.adminGroupsOf).
Mockup B v2: the Provider and Overview chips read the observed directory
status instead of the constant Connected; Connection, Who may sign in and
Re-check and devices boxes (LDAP and OIDC, Keycloak and Entra); Check
connection with the stored per-instance results and Run again rest; the
Check a person dialog (never stored); the red ldapAllowPlain card on the
Access tab (insecureLdapCardNode, shared with U3); the Locked in the
directory badge, meta bit and filter on Accounts. Pure builders in
pure:dir-facts, tested in web/test/dirfacts985.test.js; EN/DE/FR/IT.
- Administration > Certificates under Instance (rosette icon), Status,
  server certificate and trust per instance, tls.caDir list with skipped
  files, outbound connections; aria-current on the active rail item
- Overview: one Certificates row with the worst state and Open
  Certificates; red and amber cards (one card for every failing
  connection); dots on Overview and on the Certificates item
- insecureLdapCardNode(kind, opts) for ldapInsecureSkipVerify and
  ldapAllowPlain (shared name with U2)
- bell: tls-failing, tls-expiring, tls-expired, ldap-insecure
- notification switch certificates, the cannot-be-muted line,
  aria-checked on every switch
- audit list: readable reasons for auth-signin-refused,
  auth-directory-change, devices-paused/resumed, directory-check,
  directory-locked; auth-throttled notes shown; users group label;
  150 px action column
Keep U3's insecureLdapCard / insecureLdapCardNode(kind, opts{L, doc, copy,
url, instances, only, onOpen}) and call it from Users & access with
onOpen: certOpen (Open Certificates). Remove U2's duplicate builder, its
LDAP_GUIDE constant, its copy of the certLdap* / certOpenTopic strings
(U3's copies match mockup C) and the unused certLdapKInst key (the card
uses certKInst), and U2's copy of the .cajump CSS rule.

dirfacts985.test.js: the pure insecureLdapCard is no longer in the
pure:dir-facts block (certs985.test.js covers it), so the U2 test pins
the Users & access call site instead.
CHANGELOG v0.6.354 (Security, Fixes, Operations, Upgrade notes incl. #988,
the new pause rules, #992 helpdesk caveat, chart 0.6.0, rollback); v0.6.352
SSL_CERT_FILE and converter lines corrected (#995).
Handbook: directory-ldap-ad (sub-code table, Samba/389-ds/OpenLDAP, GC,
WS2025, lock badge, #992 cache, refused-credential throttle, checks),
directory-entra-id (Assignment required and app roles heading, refusal flow,
pauses without re-check, #988, overage), users-access (directory facts and
checks, lock badge), tls-certificates (expiry rule and keys, Certificates
page, bell, metrics, SSL_CERT_*), deployment (sign-in messages, throttle),
deploy-kubernetes (chart 0.6.0, Agent injector, ESO, /tmp, converter),
configuration-reference, admin-policy, account, updates, security-standards,
index; values.yaml comments (#995).
index.html: uaPlainCard passes only like the Overview card (merge-ui issue 1).
Cordy merged commit 59bd3edb1d into main 2026-10-25 19:36:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#1004
No description provided.