permission audit: daemon-made resolutions (orchestration allowlist, scheduler no-client deny, refused-edit deny) are never audited

Open
#9,129 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js
Domain
backend, security

Research direction

Start with packages/server/src/ws-server.js and _sessionEventAuditHandler, then read PermissionManager.respondToPermission and the three named decision paths in orchestration/permission-gate.js, scheduler.js, and permission-resolver.js. Run or add tests for each daemon decision and a client answer. Done means each daemon decision produces exactly one audit entry with clientId: null and its resolvedBy kind, while a client answer is audited exactly once.

Written by the indexing model from the issue text.

Description

enhancement from-review server

Context

Identified during review of PR #9127 (S4 of #9112, closes #9119). This is pre-existing behaviour: #9127 does not change what is audited.

Location: packages/server/src/ws-server.js (_sessionEventAuditHandler, about line 1460) and PermissionManager.respondToPermission

Description

The permission audit log records each resolution in one of two places:

  • User answers: a client's WS answer is audited inline by the settings handler.
  • Auto-deny paths (timeout, abort, cleared): audited by _sessionEventAuditHandler, which skips any event with reason === 'user'.

Daemon-made decisions go through respondToPermission, which always emits reason: 'user'. That covers:

  • the orchestration allowlist's allow and deny (orchestration/permission-gate.js)
  • the scheduler's auto-deny when no client is connected (scheduler.js)
  • the deny after a refused edit (permission-resolver.js)

These decisions are neither client answers nor caught by the auto-deny handler, so they are never written to the audit log.

#9127 added resolvedBy to permission_resolved. These paths now carry rule or cleared, and only a client answer carries user. The audit handler can use that field to tell the cases apart.

Acceptance Criteria

  • _sessionEventAuditHandler audits every resolution whose resolvedBy.kind is not user (or is absent), with clientId: null and the resolvedBy kind recorded. Client answers are not double-audited.
  • Tests cover an orchestration allowlist allow, a scheduler no-client deny and a refused-edit deny, each producing exactly one audit entry.
  • A test shows a client answer is still audited exactly once.
Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 3m
Merged PRs (30d)
333

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.