Repository navigation
Add TLC-backed webhook gateway specification and threat model - #79283
Conversation
Model source admission, fenced discovery and dispatch, durable replay recovery, and destination provenance and workflow admission. Generate a reproducible threat model with negative controls and reachability witnesses. Co-authored-by: Copilot App <[email protected]>
Map bounded counterexamples to the existing replay, fencing, provenance, artifact admission, and continuation requirements. Record verification limits and refresh evidence for the updated specification. Co-authored-by: Copilot App <[email protected]>
Label grouped specification findings WGT-001 through WGT-005 and refresh TLC evidence for the updated specification. Co-authored-by: Copilot App <[email protected]>
|
✅ Ponytail Reviewer completed successfully! Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
|
🚀 PR Specification Reviewer has started processing this pull request |
|
✅ Test Quality Sentinel completed test quality analysis. Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs to troubleshoot the error. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
Address CodeQL review feedback without changing rendered report bytes; refresh pinned TLC evidence for the updated checker. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The model evidence does not substantiate the claimed generation-fencing and crash-recovery guarantees, while checker path, timeout, and report-link defects undermine reliable verification.
6 open issues
What changed in this PR
Adds a bounded, executable security contract for the webhook gateway, distinguishing shipped destination checks from external receiver and admission-server responsibilities. Runtime behavior is unchanged.
Changes:
- Add a TLA+ model covering admission, discovery and worker fencing, replay/recovery, and continuation.
- Add a checksum-pinned TLC checker, evidence-classification tests, and generated threat-model reports.
- Link the formal evidence and its limitations into the gateway specification.
| File | Description |
|---|---|
specs/webhook-gateway/WebhookGateway.tla |
Defines gateway states, security invariants, faults, and reachability witnesses. |
specs/webhook-gateway/WebhookGateway.cfg |
Configures the secure baseline and 18 invariants. |
specs/webhook-gateway/threat-model.md |
Summarizes results, counterexamples, assumptions, and residual risks. |
specs/webhook-gateway/threat-model.json |
Records TLC results, commands, tool identity, and evidence hashes. |
specs/webhook-gateway/README.md |
Documents reproduction, model bounds, and maintenance. |
specs/webhook-gateway/check.py |
Runs TLC cases and generates evidence reports. |
specs/webhook-gateway/check_test.py |
Tests fail-closed classification of TLC output. |
docs/src/content/docs/specs/webhook-gateway-specification.md |
Links formal evidence and summarizes contract-level security implications. |
Review effort: Max (adaptive)
| /\ ((s.approved /\ s.candidate = s.generation) | ||
| \/ Bypass("stale-publication")) |
| NoKnownRetry == ~(s.attempts = 2 /\ s.accepted = 1) | ||
| NoDuplicate == ~s.duplicateSeen | ||
| NoConflict == ~s.conflictSeen | ||
| NoCrash == ~s.crashed |
| ] | ||
| WITNESSES = ["NoAgent", "NoUncertainty", "NoKnownRetry", "NoDuplicate", "NoConflict", "NoCrash"] | ||
| INPUTS = [ | ||
| ROOT / "WebhookGateway.tla", ROOT / "WebhookGateway.cfg", Path(__file__), |
| "Reproduce with the commands in [README.md](README.md). " | ||
| + "Measured input hashes, Java identity, run time, per-case verdicts, exit statuses " | ||
| + "and log hashes are in [threat-model.json](threat-model.json).", "", |
| result = subprocess.run(command, cwd=directory, capture_output=True, text=True, timeout=120) | ||
| output = result.stdout + result.stderr | ||
| log = directory / "tlc.log" | ||
| log.write_text(output) |
| The [TLC-backed threat model](https://github.com/github/gh-aw/blob/main/specs/webhook-gateway/threat-model.md) | ||
| records an exhausted secure baseline of **23,620 distinct states**, with all | ||
| 18 invariant checks satisfied. Each of 18 deliberately weakened controls | ||
| produces its expected counterexample. Six reachability witnesses establish that | ||
| valid activation, uncertain outcomes, known-nonacceptance retries, duplicate and | ||
| conflicting receipts, and restart are reachable with security invariants enabled. |


Summary
Make the webhook gateway's security contract executable and document which guarantees depend on external integrations rather than shipped destination checks.
The secure model exhausts 23,620 distinct states with 18 invariants satisfied. All 18 deliberately weakened controls fail their expected invariants, and six reachability witnesses demonstrate positive behavior. These are bounded contract checks, not implementation proofs or discovered vulnerabilities. Receiver and admission-server behavior remains an external integration responsibility; runtime behavior is unchanged.
Validation
make agent-report-progressPYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s specs/webhook-gateway -p '*_test.py'python3 specs/webhook-gateway/check.py --results "$TMPDIR/webhook-gateway-tlc-verified" --report specs/webhook-gateway/threat-model.mdwith Java 21 and checksum-pinned TLA+ Tools v1.7.4 (TLC 2.19): all 25 cases produced their expected results.