feat(authz): ADR-0066 Phase 1 — secure-by-default object posture + requiredPermissions (D2/D3)#2235
Merged
Merged
Conversation
…edence order, roadmap - ① Generalize the private RLS exemption into one explainable rule: viewAllRecords bypasses read RLS and modifyAllRecords bypasses write RLS, gated by the object's platform-global/private posture (Salesforce View All Data / Dataverse Org level). Covers the write path too; replaces the narrow "private skips tenant_isolation". - ② Add an explicit "Precedence / combination semantics" section (AND-gates → union grants → RLS OR-within/AND-with-global → deny overrides), closing the ADR's own open edge-case; fix the vague Consequences bullet. - ③ Author guidance for private (posture) vs requiredPermissions (capability contract); clarify requiredPermissions is an AND-gate. - ④–⑦ "Future refinements": deny-by-default target, per-operation requiredPermissions, capabilities in the CEL surface, permission-set-group muting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- access: { default: 'public' | 'private' } — secure-by-default object posture
(ObjectAccessConfigSchema), a data-model posture like tenancy. private opts the
object out of wildcard '*' grants and (via the engine) out of wildcard RLS.
- requiredPermissions: string[] on Object — capability contract (mirrors
App.requiredPermissions), enforced by the engine as an AND-gate.
- Both optional; absent ⇒ public / no gate (no migration for existing objects).
- Tests + full-DTS build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…iredPermissions, posture-gated RLS bypass - D2 CRUD: a `private` object is not covered by a non-super-user '*' wildcard grant (resolveObjectPermission); access needs an explicit per-object grant OR the View/Modify All Data super-user wildcard. Explicit grants always honored. - D3 capability AND-gate: object `requiredPermissions` checked before the CRUD grant (caller's systemPermissions union); missing capability → deny. - ① posture-gated super-user RLS bypass: on a private/platform-global object, viewAllRecords bypasses read RLS and modifyAllRecords bypasses write RLS (incl. pre-image + post-image check) — so a platform admin who is also an org admin sees all rows, while the bypass never leaks cross-tenant data on ordinary tenant business objects. - New getObjectSecurityMeta cache (private/tenancy/requiredPermissions), invalidated on metadata change. Evaluator: getSystemPermissions, hasSuperuserRead/WriteBypass; checkObjectPermission/getEffectiveScope take an isPrivate option (backward-compatible). - 10 new tests (evaluator units + full-middleware integration). Full DTS green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 3 package(s): 98 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…ions in liveness ledger ADR-0054 spec-property liveness gate requires every governed-type property to be classified. Mark both new object props `live`, citing their plugin-security enforcement sites. Not in BOUND_PROOF_PATHS, so no dogfood proof is required; unit + full-middleware coverage lives in plugin-security/security-plugin.test.ts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-0066 D2) Non-breaking: +ObjectAccessConfig (type) +ObjectAccessConfigSchema (const). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…der an active org resolveExecutionContext queried sys_user_permission_set with `organization_id = tenantId`, which DROPPED a platform-scoped (organization_id IS NULL) grant the moment a user had an active org. A platform admin who also owns an org therefore silently lost `admin_full_access` (and its systemPermissions) — and with ADR-0066 that locked them out of a requiredPermissions-gated control-plane object (sys_license). Mirror the role-binding logic (null org = global, cross-org): fetch the user's grants and keep null-org + active-org ones, dropping only grants scoped to a DIFFERENT org. +2 regression tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Implements ADR-0066 Phase 1 (D2 + D3 + engine enforcement) — the minimal unblock so a sensitive object like cloud
sys_licensecan be expressed: platform-global, secure-by-default, platform-admin-only.What's here
docs/adr/0066-...): generalizes the private RLS exemption into one explainable rule —viewAllRecordsbypasses read RLS /modifyAllRecordsbypasses write RLS, gated by the object's platform-global/private posture (Salesforce View/Modify All Data); adds an explicit Precedence / combination semantics section (AND-gates → union grants → RLS OR-within/AND-with-global → deny overrides); author guidance forprivate(posture) vsrequiredPermissions(capability); a Future refinements roadmap (deny-by-default target, per-op requiredPermissions, capabilities in CEL, PSG muting).packages/spec):access: { default: 'public' | 'private' }object posture + object-levelrequiredPermissions: string[](mirrorsApp.requiredPermissions). Both optional; absent ⇒ public / no gate (no migration for existing objects).privateobject is not covered by a non-super-user'*'wildcard grant (resolveObjectPermission); access needs an explicit per-object grant or a View/Modify-All-Data wildcard. Explicit grants always honored.requiredPermissionschecked before the CRUD grant — caller'ssystemPermissionsunion must cover it, else deny.private/platform-global object, the super-user bit skips wildcard RLS (incl. pre-image + post-image write checks) so a platform admin who is also an org admin sees all rows — without ever leaking cross-tenant data on ordinary tenant business objects.Tests
@objectstack/specand@objectstack/plugin-security.Follow-ups (separate PRs)
sys_licenseadopts the posture +.framework-shabump to this PR's merge SHA (browser-verified on the local stack).🤖 Generated with Claude Code