Skip to content

Broker audit records: follow-ups from the implementation review #2999

Done

Description

@rdimitrov

Follow-ups from the last review of #2985, the broker's audit records. None of them blocked it. Line references are at 7bab17a.

  • An open's refusal can be dropped while its close is sent. refuseOpen sends the refusal through the record queue, which drops non-close records once 768 of its 1,024 slots are full. The held close that follows can still take a reserved slot, and it names that refusal (internal/identitybroker/recordqueue.go:74, sessions.go:343, :357-360). With the queue full of denied-call refusals, the sink can accept a close that names a record it never got, so the comment at sessions.go:352-355 does not hold. Either let open refusals use the reserved slots, or reserve room for a refusal and its close together. Add a test that floods the queue with denied calls and then refuses an open.
  • An ID-JAG record that is not accepted leaves no superseding refusal. AuthorizeCall returns errNotRecorded (internal/identitybroker/authorize.go, around :175). The design (docs/drafts/agent-identity/audit.md:142) asks for a refusal that supersedes the record whenever the broker undoes an event, because a sink can store a record it failed to confirm.
  • Client advice for the 503. user-docs/reference/http-sse-api.md:33 says to refresh "when the cause is the audit sink refusing your repeated session opens", but the 503 carries the same code whatever the cause. Change it to "after a 503 on a request that presented a token, refresh the token before retrying", and make the same change in caller-identity.md.
  • The host-closed mark ignores the incarnation. Key it on host session and the deleted incarnation, so a later create of the same ID can never be blocked. Only the scheduler creates with an explicit ID today, so this is latent.
  • When schedule setup and renewal arrive (Phase 2, Slice 3: Scheduled runs — A scheduled run calls gateway tools on its own grant, with no one present #2569), count their converted opens toward the 503 repeat rule, as docs(agent-identity): settle the broker's write order for every audit event #2984 says. Today only the two session-open sites in internal/adapter/server/identity_broker.go feed it.

Refs #2541, #2985

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions