cbe-review 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cbe_review-0.1.0/PKG-INFO +279 -0
- cbe_review-0.1.0/README.md +266 -0
- cbe_review-0.1.0/pyproject.toml +34 -0
- cbe_review-0.1.0/setup.cfg +4 -0
- cbe_review-0.1.0/src/cbe/__init__.py +3 -0
- cbe_review-0.1.0/src/cbe/__main__.py +3 -0
- cbe_review-0.1.0/src/cbe/baseline.py +156 -0
- cbe_review-0.1.0/src/cbe/cbp_compat.py +120 -0
- cbe_review-0.1.0/src/cbe/cli.py +354 -0
- cbe_review-0.1.0/src/cbe/commands/__init__.py +1 -0
- cbe_review-0.1.0/src/cbe/commands/common.py +11 -0
- cbe_review-0.1.0/src/cbe/commands/emit_sarif.py +74 -0
- cbe_review-0.1.0/src/cbe/commands/enforce_no_bypass.py +654 -0
- cbe_review-0.1.0/src/cbe/commands/run_provider.py +57 -0
- cbe_review-0.1.0/src/cbe/commands/symbol_index.py +229 -0
- cbe_review-0.1.0/src/cbe/commands/validate_manifest.py +66 -0
- cbe_review-0.1.0/src/cbe/errors.py +136 -0
- cbe_review-0.1.0/src/cbe/exemptions.py +126 -0
- cbe_review-0.1.0/src/cbe/jsonio.py +118 -0
- cbe_review-0.1.0/src/cbe/manifest.py +485 -0
- cbe_review-0.1.0/src/cbe/paths.py +15 -0
- cbe_review-0.1.0/src/cbe/providers.py +528 -0
- cbe_review-0.1.0/src/cbe/release_train.py +105 -0
- cbe_review-0.1.0/src/cbe/report.py +87 -0
- cbe_review-0.1.0/src/cbe/sarif.py +287 -0
- cbe_review-0.1.0/src/cbe/schemas/provider-output.v1.schema.json +98 -0
- cbe_review-0.1.0/src/cbe/schemas/rule-pack-manifest.v1.schema.json +228 -0
- cbe_review-0.1.0/src/cbe/schemas/v1.7/cbe-report.schema.json +36 -0
- cbe_review-0.1.0/src/cbe/schemas/v1.7/release-train.schema.json +52 -0
- cbe_review-0.1.0/src/cbe/schemas/v1.7/releases.schema.json +87 -0
- cbe_review-0.1.0/src/cbe/walk.py +173 -0
- cbe_review-0.1.0/src/cbe_review.egg-info/PKG-INFO +279 -0
- cbe_review-0.1.0/src/cbe_review.egg-info/SOURCES.txt +35 -0
- cbe_review-0.1.0/src/cbe_review.egg-info/dependency_links.txt +1 -0
- cbe_review-0.1.0/src/cbe_review.egg-info/entry_points.txt +2 -0
- cbe_review-0.1.0/src/cbe_review.egg-info/requires.txt +7 -0
- cbe_review-0.1.0/src/cbe_review.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cbe-review
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Cyber-Butler Enforcement gate: rule-pack manifest, provider execution, no-bypass enforcement, and SARIF evidence.
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: jsonschema>=4.20
|
|
8
|
+
Requires-Dist: pyyaml>=6.0
|
|
9
|
+
Provides-Extra: e2e
|
|
10
|
+
Requires-Dist: pytest>=8; extra == "e2e"
|
|
11
|
+
Requires-Dist: pytest-cov>=7; extra == "e2e"
|
|
12
|
+
Requires-Dist: cbp-action==1.2.2; extra == "e2e"
|
|
13
|
+
|
|
14
|
+
# CBE — Cyber-Butler Enforcement gate
|
|
15
|
+
|
|
16
|
+
CBE is the rule-pack manifest, provider execution, no-bypass enforcement, and
|
|
17
|
+
SARIF evidence gate for the Cyber-Butler release train. It is a sibling project
|
|
18
|
+
to `public-release` (CBS), `cbp-action-release` (CBP), and `cbm`.
|
|
19
|
+
|
|
20
|
+
Status: **0.1.0 RC candidate — not released, no tag, no release**. Commit 1
|
|
21
|
+
froze the manifest schema, the five CLI interfaces, and the E2E fixtures. Commit
|
|
22
|
+
2 added the manifest validator (P0-03). Commit 3 added `enforce-no-bypass`
|
|
23
|
+
(P0-04). Commit 4 added workflow gate-skip detection (P0-04.5). Commit 5 added
|
|
24
|
+
static-analysis warnings. Commit 6 added the restricted-evaluator evidence and
|
|
25
|
+
`warn_count`. Commit 7 added the Ubuntu+Windows CI matrix and coverage gate.
|
|
26
|
+
Commit 8 implemented P0-05 (`symbol-index`, `run-provider`, `emit-sarif`,
|
|
27
|
+
`tools/cbe_gate.py`). Commit 9 made CBE-07b a real CBP 1.1.0 assertion. Commit
|
|
28
|
+
10 is the 0.1.0 RC candidate: CBE-07b re-run on CBP 1.2.0 RC, CBE-09/10/11
|
|
29
|
+
implemented, CBE-08 kept DRAFT, CBP 1.2.0 manifest fields aligned, and schemas
|
|
30
|
+
bundled in the wheel. Commit 13 pins the released CBP 1.2.0 from PyPI; commit
|
|
31
|
+
14 follows contract RC2 and the object `artifact_repository` shape. Commit 15
|
|
32
|
+
pins the frozen contract tag `contract-v1.7.1` and CBP 1.2.2. Commit 16 consumes
|
|
33
|
+
`FREEZE_NOTICE_ADDENDUM.md` at `e318cbd`; all four frozen F2 checks match, so
|
|
34
|
+
CBE-08 is **PASS**. No tag/release exists.
|
|
35
|
+
|
|
36
|
+
## 0.1.0 RC inputs
|
|
37
|
+
|
|
38
|
+
- CBP 1.2.2 official: tag `v1.2.2` / `d4bfefb`; PyPI wheel
|
|
39
|
+
`2b73b4a4c387e4eb0700a339235249d62accfbe0a14c505188c53c484df7d046`,
|
|
40
|
+
sdist `91974398ea0bc850633919e287f546d48b53f08d0ca57befce3a4a091de092d5`;
|
|
41
|
+
real quality manifest `228594d0…`. CBE-07b and CBE-10 pass against it; the
|
|
42
|
+
project pin is `cbp-action==1.2.2`.
|
|
43
|
+
- CBS `contract/v1.7.1` frozen tag `contract-v1.7.1` at commit `c2b5e9`;
|
|
44
|
+
contract SHA256 `209d75b4…`; `vm-proof.yml` clean.
|
|
45
|
+
`FREEZE_NOTICE_ADDENDUM.md` at `e318cbd` authorizes CBE-08 PASS when the four
|
|
46
|
+
F2 checks match; all four match, so CBE-08 is PASS.
|
|
47
|
+
- CBE: `0.1.0` package version; PyPI distribution `cbe-review`; import package
|
|
48
|
+
`cbe`; CLI `cbe`; no tag, no release.
|
|
49
|
+
|
|
50
|
+
## 0.1.0 release package
|
|
51
|
+
|
|
52
|
+
Status: **awaiting human approval; no tag, no release, no PyPI upload.** The
|
|
53
|
+
PyPI distribution name is now `cbe-review` (the old `cbe` name belongs to
|
|
54
|
+
`azizo-b/CBE` and is never used). PyPI remains pending approval.
|
|
55
|
+
|
|
56
|
+
- [Release notes](release/0.1.0/RELEASE_NOTES.md)
|
|
57
|
+
- [Release runbook](release/0.1.0/RELEASE_RUNBOOK.md)
|
|
58
|
+
- [Release manifest](release/0.1.0/RELEASE_MANIFEST.json)
|
|
59
|
+
- [Evidence index](release/0.1.0/EVIDENCE.md)
|
|
60
|
+
- [Artifacts and SHA256SUMS](release/0.1.0/)
|
|
61
|
+
|
|
62
|
+
Do not run the runbook until a human completes its approval record.
|
|
63
|
+
|
|
64
|
+
## Runtime dependencies
|
|
65
|
+
|
|
66
|
+
CBE is **not** zero-runtime-dependency. It declares:
|
|
67
|
+
|
|
68
|
+
| Dependency | Used by | Notes |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `jsonschema>=4.20` | `validate-manifest`; any command that loads a manifest | core dependency |
|
|
71
|
+
| `pyyaml>=6.0` | `enforce-no-bypass --workflows` | target GitHub Actions YAML parsing; currently a core dependency, not an optional extra |
|
|
72
|
+
| `cbp-action==1.2.2` | CBE-07b cross-repo assertion | test-only `e2e` extra; not a CBE runtime dependency |
|
|
73
|
+
|
|
74
|
+
Both are in `pyproject.toml`. The workflow parser reads only the target
|
|
75
|
+
repository's `.github/workflows/`; it does not execute workflow YAML or any
|
|
76
|
+
GitHub expression.
|
|
77
|
+
|
|
78
|
+
## CI
|
|
79
|
+
|
|
80
|
+
`.github/workflows/cbe-e2e.yml` runs on `ubuntu-latest` and `windows-latest`
|
|
81
|
+
with Python 3.10. Each job installs `.[e2e]` (including `cbp-action==1.2.2`
|
|
82
|
+
for CBE-07b), runs `tests/e2e/run_e2e.py`, and enforces a 60% unit-test
|
|
83
|
+
coverage gate (`--cov=cbe --cov-fail-under=60`). The gate covers measured
|
|
84
|
+
unit-test coverage; E2E commands run in subprocesses and are not counted by
|
|
85
|
+
coverage.
|
|
86
|
+
|
|
87
|
+
## Scope of the first commit
|
|
88
|
+
|
|
89
|
+
- `schemas/rule-pack-manifest.v1.schema.json`
|
|
90
|
+
- `schemas/v1.7/release-train.schema.json`
|
|
91
|
+
- `schemas/v1.7/cbe-report.schema.json` (CBE-local proposal; CBS schema update pending)
|
|
92
|
+
- `src/cbe/` CLI skeleton (five subcommands, `--help`, JSON envelope, exit codes)
|
|
93
|
+
- `tests/e2e/fixtures/` (manifests, providers, bypass cases, exemptions, releases, SARIF, release-train)
|
|
94
|
+
- `docs/` decisions, contract amendment patches, CLI/manifest/E2E/boundary specs
|
|
95
|
+
|
|
96
|
+
No security rule implementation is included in the first commit.
|
|
97
|
+
|
|
98
|
+
## Commit 2 scope
|
|
99
|
+
|
|
100
|
+
- `src/cbe/manifest.py`: manifest schema + semantic checks S01–S14,
|
|
101
|
+
applicability, canonical hash.
|
|
102
|
+
- `src/cbe/commands/validate_manifest.py`: P0-03 command, including
|
|
103
|
+
`blocking_applicable_count` and `gate_errors`.
|
|
104
|
+
- `tests/unit/test_manifest.py`: 34 tests covering valid/invalid fixtures,
|
|
105
|
+
mixed LF/CRLF hashes, semantic failures, gate failures, duplicate keys, BOM,
|
|
106
|
+
and version constraints.
|
|
107
|
+
|
|
108
|
+
## Commit 3 scope
|
|
109
|
+
|
|
110
|
+
- `src/cbe/manifest.py`: `RuleSet` / `Rule` / `Applicability` shared model; the
|
|
111
|
+
manifest validator and no-bypass command consume the same in-memory model.
|
|
112
|
+
- `src/cbe/walk.py`: deterministic, bounded source walk with symlink-escape
|
|
113
|
+
rejection and CBE self-repository detection.
|
|
114
|
+
- `src/cbe/commands/enforce_no_bypass.py`: config/comment/env/workflow
|
|
115
|
+
detection, strict exemption parser, F2 denominator, blocking skip, and the
|
|
116
|
+
CBE self-workflow guard.
|
|
117
|
+
- `tests/e2e/run_e2e.py` + CBE-01..CBE-04 E2E; `.github/workflows/cbe-e2e.yml`.
|
|
118
|
+
- Negative sample: `run-provider`, `symbol-index`, and `emit-sarif` return exit 3
|
|
119
|
+
`NOT_IMPLEMENTED`, never `PASS`.
|
|
120
|
+
|
|
121
|
+
## Commit 4 scope
|
|
122
|
+
|
|
123
|
+
- PyYAML job-graph parsing for GitHub Actions workflows.
|
|
124
|
+
- Detection of a `cbe-gate` job skipped by literal `if: false`,
|
|
125
|
+
`${{ false }}` reachability through `needs`, a missing dependency, or a
|
|
126
|
+
commented-out job. Exit 3 with `reason=WORKFLOW_SKIPS_CBE_GATE`.
|
|
127
|
+
- CBE-04 subcases: direct `if: false`, unreachable `needs`, commented-out job,
|
|
128
|
+
and a reachable `cbe-gate` control.
|
|
129
|
+
|
|
130
|
+
## Commit 5 scope
|
|
131
|
+
|
|
132
|
+
- Literal condition evaluation: `!true`, `1 == 2`, `true && false` are
|
|
133
|
+
evaluated; a statically false gate is `WORKFLOW_SKIPS_CBE_GATE`.
|
|
134
|
+
- Dynamic conditions (`inputs.*`, `vars.*`, `github.*`, functions) emit
|
|
135
|
+
`UNVERIFIABLE_CONDITION`; dynamic `needs` chains emit
|
|
136
|
+
`UNVERIFIABLE_NEEDS_CHAIN`. These are warnings, never silent passes.
|
|
137
|
+
- B-30 static-analysis limits, B-31 CBP `report_aggregator.py` interop block,
|
|
138
|
+
and CBE-08 “rewrite, not re-assert” wording.
|
|
139
|
+
- Runtime dependencies documented: jsonschema + PyYAML.
|
|
140
|
+
|
|
141
|
+
## Commit 6 scope
|
|
142
|
+
|
|
143
|
+
- Restricted condition evaluator evidence: `env.FOO()` and
|
|
144
|
+
`__import__('os')...` are `UNVERIFIABLE_CONDITION`, never executed.
|
|
145
|
+
- `warn_count` in `enforce-no-bypass` JSON, equal to `len(warnings)`.
|
|
146
|
+
- B-32: `warn_count` must flow into `cbe-report.json` and Release body Section B
|
|
147
|
+
in P0-05; not claimed before that wiring exists.
|
|
148
|
+
- CBE-07 split: 07a (CBE output `CBE-*`) must PASS; 07b introduced as an
|
|
149
|
+
explicit SKIP and converted to a real CBP 1.1.0 assertion in commit 9.
|
|
150
|
+
|
|
151
|
+
## Commit 7 scope
|
|
152
|
+
|
|
153
|
+
- Dynamic comparison test `inputs.foo == inputs.bar` -> `UNVERIFIABLE_CONDITION`.
|
|
154
|
+
- B-32 consequence text.
|
|
155
|
+
- Ubuntu+Windows CI matrix and unit coverage gate.
|
|
156
|
+
|
|
157
|
+
## Commit 8 scope
|
|
158
|
+
|
|
159
|
+
- `symbol-index`: deterministic Python/PowerShell symbol index with file hashes.
|
|
160
|
+
- `run-provider`: manifest-driven provider execution, SARIF/JSON validation,
|
|
161
|
+
zero findings vs empty artifact, native ID mapping, exemptions, F2 counts.
|
|
162
|
+
- `emit-sarif`: merged SARIF 2.1.0 with `CBE-*` rule IDs and namespace checks.
|
|
163
|
+
- `tools/cbe_gate.py`: assembles `cbe-report.json` and
|
|
164
|
+
`cbe-body-section.md`; `warn_count` and warning codes reach Section B.
|
|
165
|
+
- CBE-05/06/07/07a E2E.
|
|
166
|
+
|
|
167
|
+
## Commit 9 scope
|
|
168
|
+
|
|
169
|
+
- CBE-07b is a real assertion against CBP 1.1.0, installed via the `e2e` extra.
|
|
170
|
+
- CBE emits `CBE-SECRET-001`; CBP emits `CBP-EXT-SECRET-001` in `rule` and
|
|
171
|
+
retains `origin_rule: CBE-SECRET-001`.
|
|
172
|
+
- The old “CBP preserves CBE-*” assumption is retired; CBP namespace isolation
|
|
173
|
+
is the actual contract.
|
|
174
|
+
- CI installs `.[e2e]` on Ubuntu and Windows.
|
|
175
|
+
|
|
176
|
+
## Commit 10 scope (0.1.0 RC candidate)
|
|
177
|
+
|
|
178
|
+
- CBE-07b re-run against CBP 1.2.0 RC `5da8b87`, `bb8d4d6`, and `855fed7` in
|
|
179
|
+
temporary venvs; wheel hashes recorded in `artifacts/rc-0.1.0/`.
|
|
180
|
+
- CBE-09 F4 baseline selector; CBE-10 F5/F6 release-train and CBP 1.2.0
|
|
181
|
+
manifest checks; CBE-11 self-bootstrap harness.
|
|
182
|
+
- CBE-08 kept DRAFT against CBS `contract/v1.7.1` RC `04c9f8b`; no PASS claim.
|
|
183
|
+
- CBP 1.2.0 fields: `body_hash_scope=base`, `artifact_repository` string,
|
|
184
|
+
no private `cbc_event` manifest field.
|
|
185
|
+
- Schemas bundled in the wheel; installed-wheel smoke test passes.
|
|
186
|
+
- RC audit package at `artifacts/rc-0.1.0/`; no tag, no release.
|
|
187
|
+
|
|
188
|
+
## Commit 11 scope (RC closeout)
|
|
189
|
+
|
|
190
|
+
- CBE-08 draft re-pinned to CBS `contract/v1.7.1` RC `3de93ae`; declared and
|
|
191
|
+
observed contract hash both `c1653c…`; `vm-proof.yml` has no conflict markers;
|
|
192
|
+
status remains **DRAFT — NOT PASS**.
|
|
193
|
+
- CBE-07b re-run on CBP 1.2.0 RC `855fed7`; wheel
|
|
194
|
+
`9469a8e980a536e9481e0b14239cd4857a5cd6173a61043d47645b82cf3b4d51`;
|
|
195
|
+
`CBE-SECRET-001` → `CBP-EXT-SECRET-001`, `origin_rule` retained.
|
|
196
|
+
- RC audit package and SHA256SUMS updated; no tag, no release.
|
|
197
|
+
|
|
198
|
+
## Commit 12 scope (contract guard)
|
|
199
|
+
|
|
200
|
+
- `tests/e2e/fixtures/contract/v1.7.1-pin.json` pins `3de93ae` / `c1653c…`.
|
|
201
|
+
- `tools/cbe_contract_guard.py` fetches the current `contract/v1.7.1` head,
|
|
202
|
+
contract bytes, and `vm-proof.yml`; drift exits 3 `CONTRACT_CHANGED`.
|
|
203
|
+
- `tests/e2e/test_cbe_08_contract_guard.py` proves the pinned case and simulated
|
|
204
|
+
commit/hash drift. Guard `PINNED` is **not** CBE-08 PASS.
|
|
205
|
+
- CBE-07b re-run on CBP 1.2.0 RC `855fed7`; audit package refreshed.
|
|
206
|
+
|
|
207
|
+
## Commit 13 scope (CBP 1.2.0 official)
|
|
208
|
+
|
|
209
|
+
- `pyproject.toml` `e2e` extra pins `cbp-action==1.2.0` (released, not RC).
|
|
210
|
+
- PyPI wheel `188639bb…` and sdist `08392b2a…` downloaded and hash-checked.
|
|
211
|
+
- CBE-07b re-run with the installed official 1.2.0: `CBE-SECRET-001` →
|
|
212
|
+
`CBP-EXT-SECRET-001`, `origin_rule: CBE-SECRET-001`.
|
|
213
|
+
- Audit package records the official dependency evidence; CBE-08 remains DRAFT.
|
|
214
|
+
|
|
215
|
+
## Commit 14 scope (contract RC2)
|
|
216
|
+
|
|
217
|
+
- Contract pin updated to `6835789` / `209d75b4…`; CBE-08 stays DRAFT.
|
|
218
|
+
- CBE report schema replaced with RC2 exact schema; real CBE report validates
|
|
219
|
+
against it, including the `NOT_UPLOADED` gate status.
|
|
220
|
+
- `artifact_repository` canonical shape is the RC2 object
|
|
221
|
+
`{repository, run_id, artifact_name}`; bare `owner/repo` strings are rejected.
|
|
222
|
+
- CBP 1.2.2 is not released; object-shape behavior is fixture-tested only and
|
|
223
|
+
is **not** claimed as a CBP 1.2.2 PASS. The `cbp-action==1.2.0` pin remains
|
|
224
|
+
until 1.2.2 ships.
|
|
225
|
+
- B-33 is resolved on the contract side; CBP 1.2.2 adoption remains pending.
|
|
226
|
+
|
|
227
|
+
## Commit 15 scope (freeze + CBP 1.2.2)
|
|
228
|
+
|
|
229
|
+
- Contract guard pins the immutable tag `contract-v1.7.1` / `c2b5e9`; contract
|
|
230
|
+
hash remains `209d75b4…`.
|
|
231
|
+
- `cbp-action==1.2.2` pin; CBE-07b and CBE-10 run against real 1.2.2 artifacts.
|
|
232
|
+
- Real CBP 1.2.2 quality manifest is validated, including the object
|
|
233
|
+
`artifact_repository`; B-33 is resolved.
|
|
234
|
+
- CBE-08 stayed DRAFT at commit 15 because the frozen `FREEZE_NOTICE.md` said
|
|
235
|
+
so. No tag, no release.
|
|
236
|
+
|
|
237
|
+
## Commit 16 scope (CBE-08 PASS)
|
|
238
|
+
|
|
239
|
+
- Consume `FREEZE_NOTICE_ADDENDUM.md` at `e318cbd` / `51604f56…`, which
|
|
240
|
+
authorizes PASS when the four frozen F2 checks match.
|
|
241
|
+
- `five_advisory_valid=0`, `non_blocking_1_of_5_skip=0`,
|
|
242
|
+
`blocking_skip_exits_3=3`, `zero_rules_exits_3=3`; all match.
|
|
243
|
+
- CBE-08 flips to PASS; evidence `artifacts/rc-0.1.0/evidence/cbe-08-frozen.json`.
|
|
244
|
+
- No tag, no release; CBE 0.1.0 remains an RC candidate.
|
|
245
|
+
|
|
246
|
+
## Commands
|
|
247
|
+
|
|
248
|
+
```text
|
|
249
|
+
cbe validate-manifest
|
|
250
|
+
cbe run-provider
|
|
251
|
+
cbe symbol-index
|
|
252
|
+
cbe enforce-no-bypass
|
|
253
|
+
cbe emit-sarif
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Every command supports `--help`, writes a single JSON object to stdout, and uses
|
|
257
|
+
only `0 / 2 / 3 / 4` as exit codes. See `docs/CLI_V1.md`.
|
|
258
|
+
|
|
259
|
+
## Contract source
|
|
260
|
+
|
|
261
|
+
The only contract source is:
|
|
262
|
+
|
|
263
|
+
```text
|
|
264
|
+
public-release/docs/v1.7/CONTRACT.md @ commit 4a437df
|
|
265
|
+
sha256 a561f19e0a8e4dba92af82400b5696da18e000ba5362571cb0b40243b9a3afca
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
`public-release` is read-only from CBE. The three required amendments (F2
|
|
269
|
+
blocking set, hash format, report identity) are staged as an applicable patch in
|
|
270
|
+
`docs/CONTRACT_AMENDMENTS_PROPOSED.md`; they are not in force until CBS applies
|
|
271
|
+
them.
|
|
272
|
+
|
|
273
|
+
## First run
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
python -m pip install -e .
|
|
277
|
+
cbe --help
|
|
278
|
+
cbe validate-manifest --help
|
|
279
|
+
```
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# CBE — Cyber-Butler Enforcement gate
|
|
2
|
+
|
|
3
|
+
CBE is the rule-pack manifest, provider execution, no-bypass enforcement, and
|
|
4
|
+
SARIF evidence gate for the Cyber-Butler release train. It is a sibling project
|
|
5
|
+
to `public-release` (CBS), `cbp-action-release` (CBP), and `cbm`.
|
|
6
|
+
|
|
7
|
+
Status: **0.1.0 RC candidate — not released, no tag, no release**. Commit 1
|
|
8
|
+
froze the manifest schema, the five CLI interfaces, and the E2E fixtures. Commit
|
|
9
|
+
2 added the manifest validator (P0-03). Commit 3 added `enforce-no-bypass`
|
|
10
|
+
(P0-04). Commit 4 added workflow gate-skip detection (P0-04.5). Commit 5 added
|
|
11
|
+
static-analysis warnings. Commit 6 added the restricted-evaluator evidence and
|
|
12
|
+
`warn_count`. Commit 7 added the Ubuntu+Windows CI matrix and coverage gate.
|
|
13
|
+
Commit 8 implemented P0-05 (`symbol-index`, `run-provider`, `emit-sarif`,
|
|
14
|
+
`tools/cbe_gate.py`). Commit 9 made CBE-07b a real CBP 1.1.0 assertion. Commit
|
|
15
|
+
10 is the 0.1.0 RC candidate: CBE-07b re-run on CBP 1.2.0 RC, CBE-09/10/11
|
|
16
|
+
implemented, CBE-08 kept DRAFT, CBP 1.2.0 manifest fields aligned, and schemas
|
|
17
|
+
bundled in the wheel. Commit 13 pins the released CBP 1.2.0 from PyPI; commit
|
|
18
|
+
14 follows contract RC2 and the object `artifact_repository` shape. Commit 15
|
|
19
|
+
pins the frozen contract tag `contract-v1.7.1` and CBP 1.2.2. Commit 16 consumes
|
|
20
|
+
`FREEZE_NOTICE_ADDENDUM.md` at `e318cbd`; all four frozen F2 checks match, so
|
|
21
|
+
CBE-08 is **PASS**. No tag/release exists.
|
|
22
|
+
|
|
23
|
+
## 0.1.0 RC inputs
|
|
24
|
+
|
|
25
|
+
- CBP 1.2.2 official: tag `v1.2.2` / `d4bfefb`; PyPI wheel
|
|
26
|
+
`2b73b4a4c387e4eb0700a339235249d62accfbe0a14c505188c53c484df7d046`,
|
|
27
|
+
sdist `91974398ea0bc850633919e287f546d48b53f08d0ca57befce3a4a091de092d5`;
|
|
28
|
+
real quality manifest `228594d0…`. CBE-07b and CBE-10 pass against it; the
|
|
29
|
+
project pin is `cbp-action==1.2.2`.
|
|
30
|
+
- CBS `contract/v1.7.1` frozen tag `contract-v1.7.1` at commit `c2b5e9`;
|
|
31
|
+
contract SHA256 `209d75b4…`; `vm-proof.yml` clean.
|
|
32
|
+
`FREEZE_NOTICE_ADDENDUM.md` at `e318cbd` authorizes CBE-08 PASS when the four
|
|
33
|
+
F2 checks match; all four match, so CBE-08 is PASS.
|
|
34
|
+
- CBE: `0.1.0` package version; PyPI distribution `cbe-review`; import package
|
|
35
|
+
`cbe`; CLI `cbe`; no tag, no release.
|
|
36
|
+
|
|
37
|
+
## 0.1.0 release package
|
|
38
|
+
|
|
39
|
+
Status: **awaiting human approval; no tag, no release, no PyPI upload.** The
|
|
40
|
+
PyPI distribution name is now `cbe-review` (the old `cbe` name belongs to
|
|
41
|
+
`azizo-b/CBE` and is never used). PyPI remains pending approval.
|
|
42
|
+
|
|
43
|
+
- [Release notes](release/0.1.0/RELEASE_NOTES.md)
|
|
44
|
+
- [Release runbook](release/0.1.0/RELEASE_RUNBOOK.md)
|
|
45
|
+
- [Release manifest](release/0.1.0/RELEASE_MANIFEST.json)
|
|
46
|
+
- [Evidence index](release/0.1.0/EVIDENCE.md)
|
|
47
|
+
- [Artifacts and SHA256SUMS](release/0.1.0/)
|
|
48
|
+
|
|
49
|
+
Do not run the runbook until a human completes its approval record.
|
|
50
|
+
|
|
51
|
+
## Runtime dependencies
|
|
52
|
+
|
|
53
|
+
CBE is **not** zero-runtime-dependency. It declares:
|
|
54
|
+
|
|
55
|
+
| Dependency | Used by | Notes |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `jsonschema>=4.20` | `validate-manifest`; any command that loads a manifest | core dependency |
|
|
58
|
+
| `pyyaml>=6.0` | `enforce-no-bypass --workflows` | target GitHub Actions YAML parsing; currently a core dependency, not an optional extra |
|
|
59
|
+
| `cbp-action==1.2.2` | CBE-07b cross-repo assertion | test-only `e2e` extra; not a CBE runtime dependency |
|
|
60
|
+
|
|
61
|
+
Both are in `pyproject.toml`. The workflow parser reads only the target
|
|
62
|
+
repository's `.github/workflows/`; it does not execute workflow YAML or any
|
|
63
|
+
GitHub expression.
|
|
64
|
+
|
|
65
|
+
## CI
|
|
66
|
+
|
|
67
|
+
`.github/workflows/cbe-e2e.yml` runs on `ubuntu-latest` and `windows-latest`
|
|
68
|
+
with Python 3.10. Each job installs `.[e2e]` (including `cbp-action==1.2.2`
|
|
69
|
+
for CBE-07b), runs `tests/e2e/run_e2e.py`, and enforces a 60% unit-test
|
|
70
|
+
coverage gate (`--cov=cbe --cov-fail-under=60`). The gate covers measured
|
|
71
|
+
unit-test coverage; E2E commands run in subprocesses and are not counted by
|
|
72
|
+
coverage.
|
|
73
|
+
|
|
74
|
+
## Scope of the first commit
|
|
75
|
+
|
|
76
|
+
- `schemas/rule-pack-manifest.v1.schema.json`
|
|
77
|
+
- `schemas/v1.7/release-train.schema.json`
|
|
78
|
+
- `schemas/v1.7/cbe-report.schema.json` (CBE-local proposal; CBS schema update pending)
|
|
79
|
+
- `src/cbe/` CLI skeleton (five subcommands, `--help`, JSON envelope, exit codes)
|
|
80
|
+
- `tests/e2e/fixtures/` (manifests, providers, bypass cases, exemptions, releases, SARIF, release-train)
|
|
81
|
+
- `docs/` decisions, contract amendment patches, CLI/manifest/E2E/boundary specs
|
|
82
|
+
|
|
83
|
+
No security rule implementation is included in the first commit.
|
|
84
|
+
|
|
85
|
+
## Commit 2 scope
|
|
86
|
+
|
|
87
|
+
- `src/cbe/manifest.py`: manifest schema + semantic checks S01–S14,
|
|
88
|
+
applicability, canonical hash.
|
|
89
|
+
- `src/cbe/commands/validate_manifest.py`: P0-03 command, including
|
|
90
|
+
`blocking_applicable_count` and `gate_errors`.
|
|
91
|
+
- `tests/unit/test_manifest.py`: 34 tests covering valid/invalid fixtures,
|
|
92
|
+
mixed LF/CRLF hashes, semantic failures, gate failures, duplicate keys, BOM,
|
|
93
|
+
and version constraints.
|
|
94
|
+
|
|
95
|
+
## Commit 3 scope
|
|
96
|
+
|
|
97
|
+
- `src/cbe/manifest.py`: `RuleSet` / `Rule` / `Applicability` shared model; the
|
|
98
|
+
manifest validator and no-bypass command consume the same in-memory model.
|
|
99
|
+
- `src/cbe/walk.py`: deterministic, bounded source walk with symlink-escape
|
|
100
|
+
rejection and CBE self-repository detection.
|
|
101
|
+
- `src/cbe/commands/enforce_no_bypass.py`: config/comment/env/workflow
|
|
102
|
+
detection, strict exemption parser, F2 denominator, blocking skip, and the
|
|
103
|
+
CBE self-workflow guard.
|
|
104
|
+
- `tests/e2e/run_e2e.py` + CBE-01..CBE-04 E2E; `.github/workflows/cbe-e2e.yml`.
|
|
105
|
+
- Negative sample: `run-provider`, `symbol-index`, and `emit-sarif` return exit 3
|
|
106
|
+
`NOT_IMPLEMENTED`, never `PASS`.
|
|
107
|
+
|
|
108
|
+
## Commit 4 scope
|
|
109
|
+
|
|
110
|
+
- PyYAML job-graph parsing for GitHub Actions workflows.
|
|
111
|
+
- Detection of a `cbe-gate` job skipped by literal `if: false`,
|
|
112
|
+
`${{ false }}` reachability through `needs`, a missing dependency, or a
|
|
113
|
+
commented-out job. Exit 3 with `reason=WORKFLOW_SKIPS_CBE_GATE`.
|
|
114
|
+
- CBE-04 subcases: direct `if: false`, unreachable `needs`, commented-out job,
|
|
115
|
+
and a reachable `cbe-gate` control.
|
|
116
|
+
|
|
117
|
+
## Commit 5 scope
|
|
118
|
+
|
|
119
|
+
- Literal condition evaluation: `!true`, `1 == 2`, `true && false` are
|
|
120
|
+
evaluated; a statically false gate is `WORKFLOW_SKIPS_CBE_GATE`.
|
|
121
|
+
- Dynamic conditions (`inputs.*`, `vars.*`, `github.*`, functions) emit
|
|
122
|
+
`UNVERIFIABLE_CONDITION`; dynamic `needs` chains emit
|
|
123
|
+
`UNVERIFIABLE_NEEDS_CHAIN`. These are warnings, never silent passes.
|
|
124
|
+
- B-30 static-analysis limits, B-31 CBP `report_aggregator.py` interop block,
|
|
125
|
+
and CBE-08 “rewrite, not re-assert” wording.
|
|
126
|
+
- Runtime dependencies documented: jsonschema + PyYAML.
|
|
127
|
+
|
|
128
|
+
## Commit 6 scope
|
|
129
|
+
|
|
130
|
+
- Restricted condition evaluator evidence: `env.FOO()` and
|
|
131
|
+
`__import__('os')...` are `UNVERIFIABLE_CONDITION`, never executed.
|
|
132
|
+
- `warn_count` in `enforce-no-bypass` JSON, equal to `len(warnings)`.
|
|
133
|
+
- B-32: `warn_count` must flow into `cbe-report.json` and Release body Section B
|
|
134
|
+
in P0-05; not claimed before that wiring exists.
|
|
135
|
+
- CBE-07 split: 07a (CBE output `CBE-*`) must PASS; 07b introduced as an
|
|
136
|
+
explicit SKIP and converted to a real CBP 1.1.0 assertion in commit 9.
|
|
137
|
+
|
|
138
|
+
## Commit 7 scope
|
|
139
|
+
|
|
140
|
+
- Dynamic comparison test `inputs.foo == inputs.bar` -> `UNVERIFIABLE_CONDITION`.
|
|
141
|
+
- B-32 consequence text.
|
|
142
|
+
- Ubuntu+Windows CI matrix and unit coverage gate.
|
|
143
|
+
|
|
144
|
+
## Commit 8 scope
|
|
145
|
+
|
|
146
|
+
- `symbol-index`: deterministic Python/PowerShell symbol index with file hashes.
|
|
147
|
+
- `run-provider`: manifest-driven provider execution, SARIF/JSON validation,
|
|
148
|
+
zero findings vs empty artifact, native ID mapping, exemptions, F2 counts.
|
|
149
|
+
- `emit-sarif`: merged SARIF 2.1.0 with `CBE-*` rule IDs and namespace checks.
|
|
150
|
+
- `tools/cbe_gate.py`: assembles `cbe-report.json` and
|
|
151
|
+
`cbe-body-section.md`; `warn_count` and warning codes reach Section B.
|
|
152
|
+
- CBE-05/06/07/07a E2E.
|
|
153
|
+
|
|
154
|
+
## Commit 9 scope
|
|
155
|
+
|
|
156
|
+
- CBE-07b is a real assertion against CBP 1.1.0, installed via the `e2e` extra.
|
|
157
|
+
- CBE emits `CBE-SECRET-001`; CBP emits `CBP-EXT-SECRET-001` in `rule` and
|
|
158
|
+
retains `origin_rule: CBE-SECRET-001`.
|
|
159
|
+
- The old “CBP preserves CBE-*” assumption is retired; CBP namespace isolation
|
|
160
|
+
is the actual contract.
|
|
161
|
+
- CI installs `.[e2e]` on Ubuntu and Windows.
|
|
162
|
+
|
|
163
|
+
## Commit 10 scope (0.1.0 RC candidate)
|
|
164
|
+
|
|
165
|
+
- CBE-07b re-run against CBP 1.2.0 RC `5da8b87`, `bb8d4d6`, and `855fed7` in
|
|
166
|
+
temporary venvs; wheel hashes recorded in `artifacts/rc-0.1.0/`.
|
|
167
|
+
- CBE-09 F4 baseline selector; CBE-10 F5/F6 release-train and CBP 1.2.0
|
|
168
|
+
manifest checks; CBE-11 self-bootstrap harness.
|
|
169
|
+
- CBE-08 kept DRAFT against CBS `contract/v1.7.1` RC `04c9f8b`; no PASS claim.
|
|
170
|
+
- CBP 1.2.0 fields: `body_hash_scope=base`, `artifact_repository` string,
|
|
171
|
+
no private `cbc_event` manifest field.
|
|
172
|
+
- Schemas bundled in the wheel; installed-wheel smoke test passes.
|
|
173
|
+
- RC audit package at `artifacts/rc-0.1.0/`; no tag, no release.
|
|
174
|
+
|
|
175
|
+
## Commit 11 scope (RC closeout)
|
|
176
|
+
|
|
177
|
+
- CBE-08 draft re-pinned to CBS `contract/v1.7.1` RC `3de93ae`; declared and
|
|
178
|
+
observed contract hash both `c1653c…`; `vm-proof.yml` has no conflict markers;
|
|
179
|
+
status remains **DRAFT — NOT PASS**.
|
|
180
|
+
- CBE-07b re-run on CBP 1.2.0 RC `855fed7`; wheel
|
|
181
|
+
`9469a8e980a536e9481e0b14239cd4857a5cd6173a61043d47645b82cf3b4d51`;
|
|
182
|
+
`CBE-SECRET-001` → `CBP-EXT-SECRET-001`, `origin_rule` retained.
|
|
183
|
+
- RC audit package and SHA256SUMS updated; no tag, no release.
|
|
184
|
+
|
|
185
|
+
## Commit 12 scope (contract guard)
|
|
186
|
+
|
|
187
|
+
- `tests/e2e/fixtures/contract/v1.7.1-pin.json` pins `3de93ae` / `c1653c…`.
|
|
188
|
+
- `tools/cbe_contract_guard.py` fetches the current `contract/v1.7.1` head,
|
|
189
|
+
contract bytes, and `vm-proof.yml`; drift exits 3 `CONTRACT_CHANGED`.
|
|
190
|
+
- `tests/e2e/test_cbe_08_contract_guard.py` proves the pinned case and simulated
|
|
191
|
+
commit/hash drift. Guard `PINNED` is **not** CBE-08 PASS.
|
|
192
|
+
- CBE-07b re-run on CBP 1.2.0 RC `855fed7`; audit package refreshed.
|
|
193
|
+
|
|
194
|
+
## Commit 13 scope (CBP 1.2.0 official)
|
|
195
|
+
|
|
196
|
+
- `pyproject.toml` `e2e` extra pins `cbp-action==1.2.0` (released, not RC).
|
|
197
|
+
- PyPI wheel `188639bb…` and sdist `08392b2a…` downloaded and hash-checked.
|
|
198
|
+
- CBE-07b re-run with the installed official 1.2.0: `CBE-SECRET-001` →
|
|
199
|
+
`CBP-EXT-SECRET-001`, `origin_rule: CBE-SECRET-001`.
|
|
200
|
+
- Audit package records the official dependency evidence; CBE-08 remains DRAFT.
|
|
201
|
+
|
|
202
|
+
## Commit 14 scope (contract RC2)
|
|
203
|
+
|
|
204
|
+
- Contract pin updated to `6835789` / `209d75b4…`; CBE-08 stays DRAFT.
|
|
205
|
+
- CBE report schema replaced with RC2 exact schema; real CBE report validates
|
|
206
|
+
against it, including the `NOT_UPLOADED` gate status.
|
|
207
|
+
- `artifact_repository` canonical shape is the RC2 object
|
|
208
|
+
`{repository, run_id, artifact_name}`; bare `owner/repo` strings are rejected.
|
|
209
|
+
- CBP 1.2.2 is not released; object-shape behavior is fixture-tested only and
|
|
210
|
+
is **not** claimed as a CBP 1.2.2 PASS. The `cbp-action==1.2.0` pin remains
|
|
211
|
+
until 1.2.2 ships.
|
|
212
|
+
- B-33 is resolved on the contract side; CBP 1.2.2 adoption remains pending.
|
|
213
|
+
|
|
214
|
+
## Commit 15 scope (freeze + CBP 1.2.2)
|
|
215
|
+
|
|
216
|
+
- Contract guard pins the immutable tag `contract-v1.7.1` / `c2b5e9`; contract
|
|
217
|
+
hash remains `209d75b4…`.
|
|
218
|
+
- `cbp-action==1.2.2` pin; CBE-07b and CBE-10 run against real 1.2.2 artifacts.
|
|
219
|
+
- Real CBP 1.2.2 quality manifest is validated, including the object
|
|
220
|
+
`artifact_repository`; B-33 is resolved.
|
|
221
|
+
- CBE-08 stayed DRAFT at commit 15 because the frozen `FREEZE_NOTICE.md` said
|
|
222
|
+
so. No tag, no release.
|
|
223
|
+
|
|
224
|
+
## Commit 16 scope (CBE-08 PASS)
|
|
225
|
+
|
|
226
|
+
- Consume `FREEZE_NOTICE_ADDENDUM.md` at `e318cbd` / `51604f56…`, which
|
|
227
|
+
authorizes PASS when the four frozen F2 checks match.
|
|
228
|
+
- `five_advisory_valid=0`, `non_blocking_1_of_5_skip=0`,
|
|
229
|
+
`blocking_skip_exits_3=3`, `zero_rules_exits_3=3`; all match.
|
|
230
|
+
- CBE-08 flips to PASS; evidence `artifacts/rc-0.1.0/evidence/cbe-08-frozen.json`.
|
|
231
|
+
- No tag, no release; CBE 0.1.0 remains an RC candidate.
|
|
232
|
+
|
|
233
|
+
## Commands
|
|
234
|
+
|
|
235
|
+
```text
|
|
236
|
+
cbe validate-manifest
|
|
237
|
+
cbe run-provider
|
|
238
|
+
cbe symbol-index
|
|
239
|
+
cbe enforce-no-bypass
|
|
240
|
+
cbe emit-sarif
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Every command supports `--help`, writes a single JSON object to stdout, and uses
|
|
244
|
+
only `0 / 2 / 3 / 4` as exit codes. See `docs/CLI_V1.md`.
|
|
245
|
+
|
|
246
|
+
## Contract source
|
|
247
|
+
|
|
248
|
+
The only contract source is:
|
|
249
|
+
|
|
250
|
+
```text
|
|
251
|
+
public-release/docs/v1.7/CONTRACT.md @ commit 4a437df
|
|
252
|
+
sha256 a561f19e0a8e4dba92af82400b5696da18e000ba5362571cb0b40243b9a3afca
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
`public-release` is read-only from CBE. The three required amendments (F2
|
|
256
|
+
blocking set, hash format, report identity) are staged as an applicable patch in
|
|
257
|
+
`docs/CONTRACT_AMENDMENTS_PROPOSED.md`; they are not in force until CBS applies
|
|
258
|
+
them.
|
|
259
|
+
|
|
260
|
+
## First run
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
python -m pip install -e .
|
|
264
|
+
cbe --help
|
|
265
|
+
cbe validate-manifest --help
|
|
266
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "cbe-review"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Cyber-Butler Enforcement gate: rule-pack manifest, provider execution, no-bypass enforcement, and SARIF evidence."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"jsonschema>=4.20",
|
|
13
|
+
"pyyaml>=6.0",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[project.optional-dependencies]
|
|
17
|
+
e2e = [
|
|
18
|
+
"pytest>=8",
|
|
19
|
+
"pytest-cov>=7",
|
|
20
|
+
"cbp-action==1.2.2",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
cbe = "cbe.cli:main"
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.packages.find]
|
|
27
|
+
where = ["src"]
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.package-data]
|
|
30
|
+
cbe = ["schemas/*.json", "schemas/v1.7/*.json"]
|
|
31
|
+
|
|
32
|
+
[tool.pytest.ini_options]
|
|
33
|
+
testpaths = ["tests"]
|
|
34
|
+
addopts = "-q"
|