skip to content

A pipeline enforces approved job identity, permitted tools, permitted egress and change review - how many layers is that?

level: middleimportance: must knowfreq 47%

answer

  1. annotate each box with its accepted fact
  2. three are set by the definition file
  3. the reviewer holds the same role
  4. no intrusion is required here
  5. one fact: may edit and run

basics

~20 s

Effectively one. All four are satisfied by the same fact: this is a legitimate pipeline job. A contributor entitled to edit the pipeline definition and start a build holds that fact honestly and clears all four without defeating anything.

solid answer

~50 s

Write beside each control the fact it actually accepts. The identity gate accepts 'the job started under the approved service identity'. The permitted-tool list accepts 'the pipeline definition named a listed tool'. The egress list accepts 'the definition named a listed destination'. The change review accepts 'someone holding the repository approval role approved the definition'. Three of the four are decided by the contents of the pipeline definition, and the fourth is decided by a role held by the same population that writes it — so all four reduce to *whoever may change the pipeline definition and start a job*. Nothing has to be exploited: an insider with standing rights adds a step that uses the job's own identity, a listed tool and a listed destination, and the change looks like ordinary work to a peer approver. Four boxes, one precondition.

code

text · 11 lines
text
control                        fact it accepts before permitting the action
------------------------------------------------------------------------
job runs as approved identity  the build was started by a principal entitled to start builds
tool is on the permitted list  the pipeline definition names a listed tool
destination is permitted       the pipeline definition names a listed host
change passed review           a holder of the repository approval role approved it
...
three facts are set by the pipeline definition; the fourth is held by the
same population that writes it
=> distinct preconditions: 1  ("may change the definition and start a job")
=> layer count claimed: 4      layer count actual: 1

go deeper

for a junior

Be able to state, for each of the four controls, the one fact it accepts before letting an action through. Getting that list right is most of the answer even before you group them.

for a middle

Explain the grouping out loud: three controls are decided by a file the contributor may write, the fourth by a role their peers hold. Say why nothing had to be exploited for all four to pass.

for a senior

Demonstrate the review move — give the true layer count, then name the single control you would re-anchor and the principal you would anchor it on, and explain why adding a fifth check would not change the number.

for a principal

Be ready to defend that re-anchoring to the people whose delivery speed it costs, and to decide which pipelines get the independent layer and which run with a known single precondition.

## The architecture as drawn A build platform with self-hosted runners is presented with four controls, and the sentence attached to the diagram is 'we have four layers here, so we are fine': 1. Every job runs as an **approved service identity** rather than a personal one. 2. Jobs may invoke only tools on a **permitted list**. 3. Runners may reach only destinations on a **permitted egress list**. 4. Every change to a pipeline definition **passes review**. Each control is real, each blocks something, and each was bought or built separately. The question is not whether they work. It is how many distinct things an actor must obtain to get an action through all four. ## Annotating the preconditions Control 1 is satisfied when the build was started by a principal entitled to start builds. Controls 2 and 3 are satisfied by what the pipeline definition says — the definition names the tool and names the destination, and the checks confirm those names appear on lists. Control 4 is satisfied when a holder of the approval role has approved the definition. So controls 2 and 3 are not conditioned on anything about the *actor* at all; they are conditioned on the **contents of a file the actor is entitled to write**. Control 4 is conditioned on a role held by the actor's own peers, doing the same job, reviewing changes that look like ordinary pipeline work. Control 1 is conditioned on the standing right the actor already has. Group by fact and four collapses to one: *whoever may change the pipeline definition and start a job*. ## The worked case, with no intrusion in it A contributor with normal rights edits a pipeline definition to add a step. The step uses the job's own service identity — which is exactly what every other step does — invokes a tool that is on the permitted list, and publishes an extra artifact to a destination already on the egress list because the pipeline legitimately publishes there. The change is small, plausible and reviewed by another contributor with the same role, who approves it because it looks like ordinary work. Every control was satisfied **honestly**. Nothing was exploited, no credential was stolen, no rule was evaded. This matters for how the architecture is judged: correlated layers do not need an intrusion to fail together, and a review that only asks 'could an outsider get in' will never surface the problem. ## Why this shape recurs Controls tend to be conditioned on whatever the platform already knows, and a build platform knows one thing very well: that a job is a legitimate job. Identity, list membership and approval are all cheap to express in those terms, so they all get expressed in those terms. The correlation is not a mistake anybody made; it is the default outcome of building four controls on the same substrate. The same shape appears wherever one session or one role is the platform's unit of truth. When a single valid privileged session satisfies the identity condition, the permitted-binary condition and the permitted-protocol condition simultaneously, three controls have become one, whatever their diagram shows. ## What actually changes the count One layer must be re-anchored on a precondition the other three cannot inherit. The usual answer is a **different principal**: the promotion or publish step requires an approval recorded out of band by a named human who is not able to start the job and who did not author the change. Holding the job identity does not produce that approval, so the count goes from one to two — and two is a real two. Notice what does *not* work. Requiring two reviewers instead of one adds effort inside the same precondition: both reviewers hold the same role, drawn from the same population, so the fact being checked is unchanged. Adding a fifth list-based control has the same problem. More checks conditioned on 'this is a legitimate job' produce a longer diagram and the same single fact. ## Answering it well Give the number, then the reason: one, because three of the four are decided by a file the actor may write and the fourth by a role the actor's peers hold. Then name the fix as a re-anchoring rather than an addition, and say which single step you would put it on.

  • Does requiring two reviewers instead of one fix the correlation?
    No. Both reviewers hold the same approval role and come from the same population, so the fact being checked is unchanged — you have raised the effort inside one precondition rather than adding a second. It helps against a careless approval and slightly against one dishonest peer, but an actor who can get one plausible change approved can usually get two approvals on it.
  • Which of the four would you re-anchor, and on what?
    The review gate, and on a different principal: an approval for the promotion step recorded out of band by a named human who cannot start the job and did not author the change. The other three are structurally tied to the pipeline definition and the job identity, so re-anchoring them means re-architecting the platform. Moving one control onto a principal the job cannot impersonate buys a genuine second layer for the least disruption.
  • Is this scenario an attack?
    It does not have to be. The same architecture flaw is exposed by a contributor doing something careless, by a contributor doing something deliberate, and by anyone who ends up holding those standing rights. That is the point of judging layers by their preconditions: the conclusion 'these four are one' is true regardless of intent, so you can reach it in a design review with no incident behind it.

saying these in an interview costs you the question

  • Counts four controls and reports four layers
  • Assumes an intrusion is needed before layers can fail together
  • Proposes a fifth list-based check as the fix
  • Treats two peer reviewers as a second precondition
  • Says the permitted lists constrain the actor, not the definition file

context