skip to content

A team's principal is allowed to update the permission document attached to itself; how does that single grant become full administrator access?

level: seniorimportance: should knowfreq 46%

answer

  1. the document is evaluated at call time
  2. who may rewrite the limit
  3. narrow resource, unlimited outcome
  4. attaching a strong document needs no writing
  5. a deny only helps outside your write reach

basics

~20 s

Write access to the permission system is write access to your own limits: the principal appends an allow for every action, or attaches a stronger document to itself, and is administrator on the next call. Nothing else in the estate had to change.

solid answer

~40 s

The platform evaluates the document at call time, so whoever may rewrite the document decides the answer. A principal allowed to update the permissions attached to itself simply adds an allow covering every action and resource, or attaches an existing stronger document to itself, and the next request succeeds. Editing a group it belongs to, or the trust condition of a stronger identity so that it may be taken on, is the same defect wearing a different resource. The usual instinct is to add an explicit deny for the escalating actions — but a deny only helps if it lives somewhere the principal cannot write. Put it in a document they can edit and it is decoration.

code

json · 17 lines
json
{
  "effect": "allow",
  "actions": [
    "permission.update",
    "permission.attachToPrincipal"
  ],
  "resources": ["principals/team-checkout"],
  "condition": {}
}

{
  "effect": "deny",
  "actions": ["permission.*"],
  "resources": ["*"],
  "attachedTo": "principals/team-checkout",
  "comment": "editable by the same principal - no protection"
}

go deeper

for a junior

Recall that permissions are stored as documents the platform reads on every call. If somebody can change the document, they change what the platform will allow next time.

for a middle

Explain the mechanics of the four edits — appending an allow, attaching an existing stronger document, changing a trust condition, deleting a deny — and why each needs no administrative permission of its own.

for a senior

Show the placement argument: a deny constrains only where the principal cannot edit the document carrying it, so the fix is a ceiling or a separately owned document, not a stronger sentence in the same file.

for a principal

Weigh it as an organisational trade-off: self-service permission writing is real velocity, and the price of keeping it is a ceiling attached at principal creation plus a function that owns what teams cannot write.

## Write access to the permission system is a different kind of grant Most permissions answer the question *what may this principal do to the estate*. A small set answer a different question: *what may this principal do to the permission system itself*. Those are the actions that write, attach, detach or delete a permission document, or that change the `condition` under which an identity may be taken on. The platform evaluates the current document on every call. So a grant of write access to the document that governs you is not one permission among many — it is a grant of every permission, one edit away. The scoping in it usually looks careful, because the resource genuinely is narrow: **the team's own principal**. That narrowness is what makes it pass review, and it is also what makes it total. ## Four edits that all end in the same place 1. **Append an allow.** Add a statement allowing every action on every resource to the document attached to your own principal. The next call succeeds. 2. **Attach a stronger document.** Do not write anything new; attach an existing administrative document that somebody else already wrote and the platform already trusts. 3. **Edit a trust condition.** Change the condition on a stronger identity so that it will accept being taken on by you, then take it on. You never edited your own document at all. 4. **Remove a deny.** Delete the explicit deny that was the whole control, from a document you are permitted to edit. Each of these is one management API call. None of them requires an administrative action to be granted anywhere, and after step 5 — putting the document back — the grant set looks exactly as it did before. ## Why an explicit deny is usually the wrong fix, and when it is the right one An explicit deny normally beats any allow, which makes it the first thing people reach for: deny the permission-writing actions, keep the convenient grant. The reasoning is sound and the placement is usually wrong. **A deny constrains a principal only where that principal cannot edit the document carrying it.** If the deny sits in the same self-managed document, removing it is the first call of the attack, and the control is decoration. So the deny has to live outside the principal's write reach: in a ceiling applied to the principal that local grants cannot exceed, or in a document owned by a separate function that self-service teams have no write action against. Where it lives matters more than what it says. ## What closes the path | Approach | Effect | The catch | |---|---|---| | Remove the permission-writing actions from self-service principals entirely | The path does not exist | Every permission change becomes a request to another team, which is the friction self-service was meant to remove | | Ceiling above the principal that no document it writes can exceed | The team keeps writing its own grants, but cannot write itself past the ceiling | The ceiling has to be attached when the principal is created, and it must itself be unwritable from inside | | Deny the permission-writing actions in a document the team cannot edit | Blocks the edit at call time | Worthless if the deny is anywhere the team can reach | | Alert on any change to a permission document | Gives you the moment it happened | Detective only; the call already succeeded | ## Why the review misses it The grant is small. It names one or two actions and one resource, and the resource is unmistakably the team's own. An approver checking *does this principal have administrative permissions* reads it and correctly answers no. The question that finds it is a different one: *can this principal change what the answer will be on the next call?* That reframing is the whole skill. The actions that write the permission system, that attach an identity to a workload, that issue a credential for another principal, and that take on another identity are all answers to the second question, and none of them looks administrative in the first. Platforms differ in how finely these write actions are split — some expose separate actions for writing a document, for attaching one, and for changing a trust condition, others fold them together — and that granularity decides how precisely you can grant part of it. What holds everywhere is that partial write access to the permission system is still write access to the outcome unless a ceiling caps it.

  • The team never writes its own document by hand — a pipeline applies it. Does that change the analysis?
    Only if the pipeline's identity, not the team's, holds the write action and the team cannot alter what the pipeline applies. If the team can change the definition the pipeline submits, the path is identical with one extra step. The question is always which principal holds the write action at the moment of the call.
  • Is attaching an existing administrative document worse than writing a new allow?
    It is harder to notice. Writing a new allow changes a document's contents, which document-diff review and change alerts are built to catch. Attaching an existing, already-approved document changes only the attachment, and the document itself remains exactly as its author wrote it.
  • Where should the ceiling that caps a self-service principal live?
    Somewhere the principal has no write action against — applied when the principal is created, by the process that creates it, and owned by a function the team cannot act as. A ceiling the team can detach is the same defect one level up.

saying these in an interview costs you the question

  • Calls the grant safe because the resource is only the team's own principal
  • Assumes an explicit deny helps even when the principal can edit the document holding it
  • Thinks escalation requires an administrative action to be granted somewhere
  • Misses that attaching an existing strong document needs no writing at all
  • Treats a change alert on permission documents as the control