Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ flowchart LR
style n2 fill:#ffd7d7,stroke:#d62728
```

The last hop is labelled "forwarding assumed by policy": nobody has recorded whether orders-api relays BI's traffic into checkout-api, and ScopeMoat's default, `restricted_hops=in_scope`, assumes it does. That default is ScopeMoat's choice, not PCI SSC text. Under the `review` policy the same change is REVIEW REQUIRED.
The last hop is labelled "forwarding assumed by policy": nobody has recorded whether orders-api relays BI's traffic into checkout-api, and ScopeMoat's default, `restricted_hops=in_scope`, assumes it does. That default applies the PCI SSC's scoping starting point, "everything is in scope until verified otherwise" ([Guidance for PCI DSS Scoping and Network Segmentation](https://listings.pcisecuritystandards.org/documents/Guidance-PCI-DSS-Scoping-and-Segmentation_v1_1.pdf), May 2017, p. 3), and the same guidance puts systems that reach the CDE through another system in scope (p. 11). Treating an unrecorded relay as forwarding is ScopeMoat's application of that principle, not an SSC rule. Under the `review` policy the same change is REVIEW REQUIRED; under neither does it pass.

The recorded agent repair passes the same hook. It sets `ORDER_STATUS_SOURCE: data-warehouse`, reading from the warehouse replica BI already reaches, and drops `orders-db-net`. The run is a recorded run that is replayed, not a live model call, and its final feature read is simulated. PASS means "no modeled scope expansion", not "BI is out of scope".

Expand All @@ -40,7 +40,7 @@ Use a full `git clone`: not `--depth 1`, and not a ZIP download. You need Python
Without the Relate CLI: 19 PASS, 1 SKIPPED.<br>
With it: 20 PASS.

A shallow clone skips the T4 rescore; a ZIP download (no git) skips the T4 and T5 rescores, the recorded-run replay and the explorer data check (16 PASS, 4 SKIPPED); without Node.js, two browser checks print SKIPPED.
A shallow clone skips one agent-benchmark rescore. A ZIP download (no git) skips both agent rescores, the recorded-run replay and the explorer data check: 16 PASS, 4 SKIPPED with the Relate CLI, 15 PASS, 5 SKIPPED without it. Without Node.js, two browser checks print SKIPPED.

## Explore it in Relate (no export, one command)

Expand Down Expand Up @@ -77,22 +77,25 @@ No AI decides scope. Relate computes confirmed scope and supplies the path shown
## Checked against answer keys

- **Published answer keys.** Result: against keys it did not write (PCI SSC's scoping examples, 2017: 8 of 10 matched, 2 stricter; 2024: 15 of 15; AWS and Google's PCI reference architectures, 25 labels: 15 match, 3 stricter, 7 UNRESOLVED), ScopeMoat never put a system out of scope that the publisher put in scope (0 looser). Key limitation: every graph was built by the author from the published text, and the 7 UNRESOLVED labels are held for review because the source states no control (publishers label 4 of them in scope). [Full tables](docs/EVALUATION.md#checked-against-published-answer-keys)
- **The author's own keys.** Result: on 40 frozen cases it passed none of the changes the key blocks or holds for review (0 false PASS); a one-hop check passed 15 and plain reachability 16. Key limitation: the author wrote that key and used 17 of the cases to develop the rules, and two agent experiments, giving an agent the gate's output (T4) or a raw Relate query tool (T5), showed no demonstrated improvement in the agent's decisions. [Full tables](docs/EVALUATION.md#checked-against-the-authors-own-keys)
- **The author's own keys.** Result: on 40 frozen cases it passed none of the changes the key blocks or holds for review (0 false PASS); a one-hop check passed 15 and plain reachability 16. Key limitation: the author wrote that key and used 17 of the cases to develop the rules, and two agent experiments, giving an agent the gate's output or a raw Relate query tool, showed no demonstrated improvement in the agent's decisions. ScopeMoat's value is enforcement at commit time and a path a reviewer can check, not a smarter agent. [Full tables](docs/EVALUATION.md#checked-against-the-authors-own-keys)

## What the graph tells an auditor, a company and a red team

Scope labels used below: CDE (stores, processes or transmits card data), OTHER (in scope through a connection or a path), UNRESOLVED (the answer depends on a fact nobody recorded, so it is held for review), OUT (not in scope).


- **Auditor: the first fact to verify.** On the Brightline snapshot before the edit, all 7 transit paths share one hop, `orders-api -> checkout-api`, whose forwarding is unrecorded ([acceptance.py C1](acceptance.py), query [queries/chokepoint.cypher](queries/chokepoint.cypher)). Confirming that orders-api does not forward moves those 7 systems from OTHER to UNRESOLVED, not to OUT, because each still depends on other unrecorded facts ([acceptance.py C2](acceptance.py)).
- To see the shared hop yourself (needs the Relate CLI): `.venv/bin/python -m scopemoat export-reach graph/brightline.rl reach.rl` (if reach.rl already exists from an earlier run, delete it first; export-reach will not overwrite it), then `relate --database reach.rl --read-only "$(cat queries/chokepoint.cypher)"` (Windows: `.\.venv\Scripts\python.exe -m scopemoat export-reach graph\brightline.rl reach.rl` then `relate --database reach.rl --read-only (Get-Content queries\chokepoint.cypher -Raw)`). The first of 8 rows is hop `orders-api->checkout-api`, `restricted`, relay `unrecorded`, 7 paths through it of 7. The export's "14 already in scope by other rules" are the 8 CDE systems plus the 6 systems direct rules place in scope; the 13 OTHER (`check`'s "13 other in scope") are those 6 plus the 7 transit systems ([docs/WALKTHROUGH.md](docs/WALKTHROUGH.md) line 119). No-CLI version: [docs/WALKTHROUGH.md (step 5)](docs/WALKTHROUGH.md).
- **Company: which missing fact clears which system.** Every UNRESOLVED label in the provider run lists the missing control it depends on, in the [UNRESOLVED table](provider_reference/RESULTS.md#other-results-unresolved-not-matched). One example: recording a control on the AWS API Gateway link moves `api-gateway` from UNRESOLVED to in scope, matching AWS ([sensitivity variants](provider_reference/RESULTS.md#a3_r5_cde_gw)). In W3, removing one recorded denial moves Google's 7 out-of-scope services to UNRESOLVED ([LABELS.md](experiments/w3_gke/LABELS.md)).
- To see the shared hop yourself: `.venv/bin/python -m scopemoat export-reach graph/brightline.rl reach.rl`, then `relate --database reach.rl --read-only "$(cat queries/chokepoint.cypher)"` (needs the Relate CLI; delete an old reach.rl first). The first row is hop `orders-api->checkout-api`, `restricted`, relay `unrecorded`, 7 of 7 paths. Windows commands, the count breakdown and a no-CLI version are in [docs/WALKTHROUGH.md (step 5)](docs/WALKTHROUGH.md).
- **Company: which missing fact clears which system.** Every UNRESOLVED label in the provider run lists the missing control it depends on, in the [UNRESOLVED table](provider_reference/RESULTS.md#other-results-unresolved-not-matched). One example: recording a control on the AWS API Gateway link moves `api-gateway` from UNRESOLVED to in scope, matching AWS ([sensitivity variants](provider_reference/RESULTS.md#a3_r5_cde_gw)). In the Google GKE reconstruction, removing one recorded denial moves Google's 7 out-of-scope services to UNRESOLVED ([LABELS.md](experiments/w3_gke/LABELS.md)).
- **Red team: the path, hop by hop.** For a changed system, `gate --explain` prints Relate's row for the path to the CDE. The row gives each hop's segmentation (`none`, then `restricted`) and marks which hop the edit added. [experiments/twin_replay.py](experiments/twin_replay.py) prints the same row, and shows the path disappearing when one forwarding fact is recorded.

## Limitations

- [G1-03](provider_reference/RESULTS.md#g1-03-main-web-app-publisher-out-engine-other): R1 marks the cardholder endpoint `user` as CDE, because it is an end of a card-data flow. The public web app it also uses therefore becomes connected-to, which is stricter than Google's label ([GAPS.md G-SEED, G-DATA](provider_reference/GAPS.md)).
- [G-RW](provider_reference/GAPS.md): read-only and write-only cannot be expressed. A connection the CDE initiates counts as connected-to (G1-04 and G1-06 stricter).
- [G-DIR](provider_reference/GAPS.md): when a one-way connection's control is unstated, the stated direction is lost.
- [G-SEG](provider_reference/GAPS.md): "a connection exists, its control is not stated" is recorded as missing evidence. All 7 UNRESOLVED provider labels come from it.
- C6b default forwarding ([GAPS.md](provider_reference/GAPS.md), [RULE_TO_SSC.md](provider_reference/RULE_TO_SSC.md)): a restricted hop with no relay fact forwards under `in_scope`. This is ScopeMoat's policy, not SSC text. The demo BLOCK depends on it, and so do two sensitivity variants.
- Card-data endpoints: the cardholder's browser counts as CDE because it is one end of a card-data flow, so a public web app it also uses becomes connected-to, stricter than Google's label ([details](provider_reference/RESULTS.md#g1-03-main-web-app-publisher-out-engine-other)).
- Read-only and write-only connections cannot be expressed. A connection the CDE initiates counts as connected-to, so two Google labels come out stricter ([GAPS.md](provider_reference/GAPS.md)).
- When a one-way connection's control is unstated, its direction is lost ([GAPS.md](provider_reference/GAPS.md)).
- "A connection exists, its control is not stated" is recorded as missing evidence. All 7 UNRESOLVED provider labels come from it ([GAPS.md](provider_reference/GAPS.md)).
- Default forwarding: a restricted hop with no recorded relay fact forwards under `in_scope`. This applies the SSC's "in scope until verified" principle but is not an SSC rule. The demo BLOCK depends on it, and so do two sensitivity variants ([RULE_TO_SSC.md](provider_reference/RULE_TO_SSC.md)).
- Segmentation is a recorded property, not linked to a test report. Firewalls, people and processes are not modeled. The commit gate understands one change type: services on plain Compose networks. Anything else is REVIEW REQUIRED, and `git commit --no-verify` skips the local hook. The gate models network membership, not application settings such as a database URL in an environment variable. The local hook runs the engine in your working tree.
- A scoping aid on modeled graphs, not a QSA assessment. PASS means "no modeled scope expansion".

Expand All @@ -109,7 +112,7 @@ The same gate runs on every pull request ([.github/workflows/scopemoat.yml](.git
| `graph/brightline.rl`, `queries/` | the Relate store (single file) and the published Cypher |
| `deploy/compose.yaml`, `changes/`, `fixtures/` | the file the gate checks, change files, alternate baselines |
| `provider_reference/` | AWS and Google reference architectures: graphs, labels, scorer, results, baselines, [GAPS.md](provider_reference/GAPS.md) |
| `experiments/` | SSC 2017 and 2024 examples, W3, twin P01, Relate ablation, the Cypher rules |
| `experiments/` | PCI SSC 2017 and 2024 examples, the Google GKE reconstruction, a replayed twin, the Relate ablation, the Cypher rules |
| `t3/`, `t4/`, `t5/` | the recorded agent run and replay, the agent benchmark, the pre-registered agent A/B |
| `blind/` | the frozen 40-case comparison with simpler checks |
| `explorer/` | the browser explorer and scope page (Relate WebAssembly) |
Expand Down
Loading