Skip to content

[P1] Define and enforce all service-account policy edit states #339

Closed

Description

@Vonng

Service-account policy writes need one consistent contract across the SILO server, Console and mcli. Review baseline: local main e51bff35a. Treat correct policy-edit semantics as a coordinated release gate; detailed authorization evidence is retained privately under SECURITY.md.

Implement and test these distinct states:

  • A missing policy or JSON null on an edit preserves the existing restriction.
  • An explicit empty policy document resets inheritance, with or without a Version member.
  • A nonempty accepted policy is applied; normalize an omitted Version to the supported default before storage, including account creation with expiration.
  • Invalid documents fail explicitly. Do not report successful application of an ignored policy.
  • Replication snapshots, edits and export/import preserve the resulting state. Update the existing policy-ignored replication fixture to the corrected contract.
  • Validate before normalization where necessary so unsupported explicit versions are not silently accepted, and avoid mutating a caller-owned shared policy object.

The omitted-Version behavior is inherited; the newer preserve-on-omission fix exposes additional reset-contract mismatches. Keep that fix and complete its boundaries. Estimate: 0.5–1 day for server work, plus separate Console/mcli changes and integration. Private review reference: P0-3 server cases.

Coordinated component tasks: mcli #78, Console #89. Related snapshot acceptance: SILO #345.

Activity

  1. Vonng commented on Nov 11, 2026

    @Vonng
    MemberAuthor

    Implemented on main in 1d714834c, coordinated with Console 1be8a74bf and mcli d7262c2a5.

    The edit contract is now explicit:

    • Omitted or null policy preserves the current restriction.
    • A valid empty policy document removes the restriction and restores inheritance.
    • A nonempty policy is validated and stored; an omitted Version is normalized to the supported default.
    • Invalid versions, malformed statements and oversized policies fail without changing the account.

    The server validates before normalization and leaves caller-owned policy objects unchanged. The same serialization rules cover creation, expiring accounts, edits and snapshots. Console uses the existing impliedPolicy field to distinguish inherited and restricted accounts; mcli permits explicit empty session-policy resets while keeping named-policy validation strict.

    The trade-off is deliberate input strictness and an explicit reset action. Metadata edits no longer capture a potentially large parent policy as a new inline restriction. This preserves future inheritance and avoids the 4 KiB inline-policy limit on unrelated edits. Existing stored policies are not bulk-rewritten when the policy is omitted.

    Validation passed for policy semantics, persisted JWTs, authorization after cache reload, replication snapshots and import/export. Twelve local maintained-stack acceptance groups exercised real Console/mcli requests against the corrected SILO server, including effective S3 permissions, all three empty reset forms, rejected edits, and expiring-account state across restart. Full server tests and focused race checks passed.

    Closing the source and behavior acceptance scope. Release packaging still needs to select the corrected Server, Console and mcli revisions together; these commits do not by themselves update the published component pins.

  2. moved this from Backlog to Done in Siloon Nov 11, 2026
  3. added
    bug
    on Nov 11, 2026
  4. added this to the 20261115 milestone on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions