Skip to content

fix(iam): enforce Admin credential authorization boundaries - #242

Merged
Vonng merged 1 commit into
mainfrom
codex/fix-iam-admin-authorization
Oct 16, 2026
Merged

Vonng merged 1 commit into
mainfrom
codex/fix-iam-admin-authorization

Conversation

@Vonng

@Vonng Vonng commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Contribution Licensing (no CLA, inbound=outbound, DCO required)

This pull request contributes to PGSTY SILO (pgsty/silo). Code contributions
are accepted under AGPL-3.0-or-later, the same license as the server.
This project does not use a CLA or require a separate Apache-2.0 license grant.
By submitting this pull request I represent that I have the right to contribute
the code changes under this repository's
GNU Affero General Public License v3.0 or later
and retain copyright in my original work. Existing copyright and license
notices remain intact; separately licensed material keeps its applicable terms.
Every commit must carry a DCO Signed-off-by trailer
(git commit -s) certifying the
Developer Certificate of Origin — see
CONTRIBUTING.md.

Description

Self-service Admin requests must respect user/group denies, inline session restrictions, and external authorization decisions. This change removes five handler-level authorization bypasses, blocks restricted credential creation/update, and protects root credential mutations under built-in IAM.

The patch remains local to the Admin handlers. It preserves policyless ordinary-user inspection/cleanup, historical empty-policy root service accounts, and authorized cleanup of disabled, expired, or damaged service accounts. New service-account issuance filters the caller's internal policy claims and normalizes semantically empty requested policies, including keys with expiration; import and replication retain their existing constructor semantics.

Related to #222. That issue requests a private reporting channel; private vulnerability reporting is enabled. No private report or reproduction material is included here.

Motivation and Context

Ownership is supplied as DenyOnly before authorization rather than used to override a denial afterward. The existing IAM engine and session-policy parsers remain authoritative. Expiring service accounts follow the temporary-credential branch first, matching IAM dispatch.

How to test this PR?

Final source commit: 2616d43fbc3400a02cc1e6f9299e26ae8b2e71a6, based directly on main. This PR contains only the five IAM implementation/test files.

  • Complete IAM/STS selection with real etcd, LDAP, two OIDC providers and an authorization plugin: 57 top-level tests and 380 passing records including subtests, 0 failures and 0 skips.
  • Focused race run: go test -race ./cmd -run '^(TestIAMAdmin|TestIAMPeerDeleteNotificationReloadsCommittedState)' -count=1 passed.
  • make verifiers and make build passed. The existing optional typos check was skipped because the binary is not installed.
  • All eight hosted checks passed at the final commit: DCO, vulnerability analysis, formatting/build/vet, lint/generated files, race, cross compilation, internal tests, and cmd tests.

Regression coverage includes self denials, restricted SA/STS delegation, root target protection, empty policies, corrupt credential cleanup and deletion replication, self aliases, and real LDAP child-key S3 access. Two existing test fixture corrections avoid stale etcd state and a hardcoded default-policy list.

Compatibility impact

No API routes/actions, wire or storage format, dependencies, or S3 data path changes. The intended authorization tightening rejects operations that previously escaped a denial, session-policy boundary, or root boundary. External authorization remains authoritative. Existing unusable expiring keys are not silently rewritten; an authorized parent/admin can reissue them. ListAccessKeysBulk retains its existing behavior. Rollback restores the authorization defects.

Types of changes

  • Bug fix
  • New feature
  • Optimization
  • Breaking wire/storage change

Checklist

  • DCO sign-off on every commit
  • Focused regression tests added
  • Compatibility and rollback impact documented
  • Final main-based local validation complete
  • Hosted CI complete
  • Bilingual companion-site record updated with final merge status: documentation PR #42, merged as c7e62d0982a6297e28c5299114515f1f601b1ebe.

Acceptance and integration

GO. Merged as 4e55fc7db4bd0f21ae187517f7438a8625768f6a; its tree is identical to the tested candidate, and the main-branch Go CI and vulnerability checks also passed. The bilingual design record was accepted and merged separately. Source integration is complete; this does not assert a server release, image publication, or production deployment.

Honor self-service authorization denials, prevent session-limited credential delegation and updates, and protect root credential mutations under built-in IAM. Preserve empty-policy inheritance and damaged-account cleanup, normalize new service policy claims at issuance, and add signed Admin API and LDAP regressions.

Signed-off-by: Feng Ruohang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant