Repository navigation
fix(iam): enforce Admin credential authorization boundaries - #242
Merged
Merged
Conversation
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]>
Vonng
marked this pull request as ready for review
October 16, 2026 14:02
This was referenced Oct 16, 2026
This was referenced Oct 24, 2026
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.
Contribution Licensing (no CLA, inbound=outbound, DCO required)
This pull request contributes to PGSTY SILO (
pgsty/silo). Code contributionsare 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-bytrailer(
git commit -s) certifying theDeveloper 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.go test -race ./cmd -run '^(TestIAMAdmin|TestIAMPeerDeleteNotificationReloadsCommittedState)' -count=1passed.make verifiersandmake buildpassed. The existing optional typos check was skipped because the binary is not installed.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
Checklist
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.