Repository navigation
[M2.3c2a-fix] Make key material append-only and track fleet and audit RLS - #99
Merged
Merged
Conversation
samuelmbabhazi
force-pushed
the
fix/m2.3-tenancy-follow-ups
branch
from
November 5, 2026 13:57
8f84cd7 to
7ae00a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
Review follow-up for #79 (M2.3b3) and #81 (M2.3c2a). Refs #22
What changed
deploy/postgres/runtime-role.sql: the runtime role now gets only SELECT and INSERT ondata_encryption_keysandinstallation_keys, likeaudit_events. No code updates or deletes these rows: both stores only usefindUniqueandcreate, and SPEC 9 says rotation inserts new rows.runtime-role.integration.spec.ts: UPDATE and DELETE on both key tables must now be rejected for the runtime login.nodes,join_tokens,node_certificatesandaudit_events, with cross-tenant lookups moved to a separate reviewed role. It must land before any node, join-token or audit read endpoint.Why
organization_idbut only repository filters protect them. SPEC 4 requires both layers, and the gap was not tracked anywhere ([M2.3b3] Bind fleet records to existing organizations #79 even marked the database isolation task done).How it was tested
nx run-many -t lint typecheck -p apiin a clean worktree: clean.Security considerations
Least privilege for key material. No change to tenant tables. The RLS gap is documented and scheduled, not fixed here, because it needs a design decision on the cross-tenant role (enrollment by join-token hash happens before any tenant context exists).
Checklist