# CF-001/C capability graph. One source for the counts, cuts and explorer.
# Semantics: Prevent removes a transition. Constrain and Detect leave reachability unchanged.
# A transition with several states in "from" is an AND. Several transitions into one state are an OR.
version: 1
roots: [s, T]
targets:
  t_node:  {state: R,       label: "Root on a production node (HF account)"}
  t_admin: {state: t_admin, label: "Cluster admin through the connector (HF account)"}
  t_inv:   {state: t_inv,   label: "Read only inventory access (OpenAI account)"}
states:
  s: "Agent in the evaluation sandbox"
  P: "Artifactory proxy reached"
  B: "Shared board"
  s2: "Another run"
  N1: "External fetch capability"
  N2: "Arbitrary destination capability"
  N3: "Internal service reach"
  Xr: "Customer hosted endpoint reached"
  Xc: "Code running on the endpoint"
  T: "Public dataset"
  Tk: "Tokens in agents' hands"
  Wf: "Production worker with file read"
  Wc: "Production worker pod with code execution"
  M: "Node role credentials"
  R: "Node root (t_node)"
  Kr: "Connector API reached from the worker"
  Cb: "Access broker credential held"
  Cc: "Connector credential held"
  Cm: "Mesh VPN auth key held (off the modelled targets)"
  t_admin: "Cluster admin through the connector"
  t_inv: "Read only inventory access"
controls:
  D1:   "Independent egress"
  D2p:  "Shared state, denial test"
  D2d:  "Shared state, alert test"
  D6a1: "Remove the flaw"
  D6a2c: "Isolate the worker (environment and files)"
  D6a2p: "Worker cannot read the connector credential"
  D6b:  "Metadata access"
  D6c1: "Admission policy"
  D6c2: "Least privilege roles"
  D6d1: "Connector API authorisation"
  D6d2p: "Connector identity without cluster admin"
  D6d2c: "Connector identity allowlist"
assumptions:
  A1:   {default: true,  label: "The access broker credential is the connector credential (Cb to Cc)"}
  B:    {default: true,  label: "Egress property B holds: no approved service relays requests"}
transitions:
  # kind: atom (counted in the seventeen), offroute, alternative, assumption
  - {id: "1",   kind: offroute, from: [s],        to: P,       status: narrated,   controls: []}
  - {id: "2a",  kind: atom, from: [s],            to: B,       status: unresolved, controls: [{c: D2p, f: prevent}, {c: D2d, f: detect}]}
  - {id: "2b",  kind: atom, from: [B],            to: s2,      status: unresolved, controls: [{c: D2p, f: prevent}, {c: D2d, f: detect}]}
  - {id: "3a",  kind: atom, from: [P],            to: N1,      status: narrated,   controls: [{c: D1, f: prevent}]}
  - {id: "3b",  kind: atom, from: [N1],           to: N2,      status: narrated,   controls: [{c: D1, f: prevent}]}
  - {id: "3c",  kind: atom, from: [N1],           to: N3,      status: narrated,   controls: []}
  - {id: "5a",  kind: atom, from: [N2],           to: Xr,      status: inferred,   controls: [{c: D1, f: prevent}]}
  - {id: "5b",  kind: atom, from: [Xr],           to: Xc,      status: narrated,   controls: []}
  - {id: "6",   kind: atom, from: [T],            to: Tk,      status: unresolved, controls: [{c: D1, f: constrain}]}
  - {id: "7",   kind: atom, from: [Xc],           to: Wf,      status: narrated,   controls: [{c: D6a1, f: prevent}, {c: D6a2c, f: constrain}]}
  - {id: "8",   kind: atom, from: [Xc],           to: Wc,      status: narrated,   controls: [{c: D6a1, f: prevent}, {c: D6a2c, f: constrain}]}
  - {id: "9",   kind: atom, from: [Wc],           to: M,       status: narrated,   controls: [{c: D6b, f: prevent}]}
  - {id: "10a", kind: atom, from: [M],            to: R,       status: narrated,   controls: [{c: D6c1, f: prevent}, {c: D6c2, f: constrain}]}
  - {id: "10b", kind: atom, from: [M],            to: R,       status: narrated,   controls: [{c: D6c2, f: constrain}]}
  - {id: "11k", kind: atom, from: [Wc],           to: Kr,      status: narrated,   controls: [{c: D6d1, f: prevent}]}
  - {id: "11c", kind: atom, from: [R],            to: Cb,      status: narrated,   controls: [], unexpanded: "forged service account tokens valid for 24 hours"}
  - {id: "11a", kind: atom, from: [Kr, Cc],       to: t_admin, status: narrated,   controls: [{c: D6d2p, f: prevent}, {c: D6d2c, f: constrain}]}
  - {id: "11m", kind: offroute, from: [R],        to: Cm,      status: narrated,   controls: []}  # same secrets read; key used at 21:23 to enrol the node into the corporate mesh
  - {id: "11b", kind: atom, from: [Kr, Cc],       to: t_inv,   status: narrated,   controls: []}  # OpenAI: connector credential used to enumerate destinations, read only inventory
  - {id: "A1",  kind: assumption, from: [Cb],     to: Cc,      status: unresolved, needs: A1, controls: []}
  - {id: "3r",  kind: alternative, from: [s],     to: Xr,      status: unresolved, controls: [{c: D1, f: prevent, needs: B}]}
  - {id: "7x",  kind: alternative, from: [Wf],    to: Cc,      status: hypothetical, excluded: true, controls: [{c: D6a2p, f: prevent}]}
  - {id: "8x",  kind: alternative, from: [Xc],    to: Wc,      status: hypothetical, controls: []}
  - {id: "9x",  kind: alternative, from: [Wc],    to: M,       status: hypothetical, controls: []}
  - {id: "10x", kind: alternative, from: [M],     to: R,       status: hypothetical, controls: []}
  - {id: "11x", kind: alternative, from: [Wc],    to: Cc,      status: narrated, account: OpenAI, controls: [{c: D6a2p, f: prevent}]}  # OpenAI TR: worker service account token read the connector secret
