Skip to content

Commit 324da5a

Browse files
chaliyclaude
andauthored
chore: pre-release maintenance checklist (#223)
## Summary - **cargo-vet**: Add exemption for `pyo3-build-config:0.28.2` (new transitive dep) - **Threat model**: Sync public doc with spec — add Python (TM-PY-*) threat table, Git (TM-GIT-*) security section, and git test references - **Orphaned TODOs**: Rename `TODO:` headings to `Known` sections in `compatibility.md`, `004-testing.md`, `009-implementation-status.md` ## Maintenance Checklist Results | Section | Status | |---------|--------| | 1. Dependencies | `cargo update` ✓, `cargo audit` ✓ (3 warnings, 0 vulns), `cargo deny` ✓, `cargo vet` ✓ | | 2. Security | Threat model reviewed, public doc synced with spec | | 3. Tests | `just test` ✓ — all unit + failpoint tests pass | | 4. Documentation | `cargo doc` clean (0 warnings), CHANGELOG current | | 5. Examples | All 15 Rust examples + feature-gated (python, git) pass | | 6. Specs | Status fields accurate, TODO comments cleaned up | | 7. Code Quality | `cargo fmt` ✓, `cargo clippy` ✓, no stale TODOs in src | | 8. Agent Config | AGENTS.md accurate, spec table complete | ## Test plan - [x] `cargo fmt --check` - [x] `cargo clippy --all-targets --all-features -- -D warnings` - [x] `cargo test --all-features` - [x] `cargo vet` - [x] `cargo doc --all-features --no-deps` (0 warnings) https://claude.ai/code/session_012Au6KZ2BqLnfn7Kk5tb5Gz Co-authored-by: Claude <noreply@anthropic.com>
1 parent 83a6f74 commit 324da5a

File tree

5 files changed

+69
-10
lines changed

5 files changed

+69
-10
lines changed

crates/bashkit/docs/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ cargo test --test spec_tests -- bash_comparison_tests --ignored
424424
- [x] Array indices `${!arr[@]}`
425425
- [x] `/dev/null` support (interpreter-level, cannot be bypassed by custom fs)
426426

427-
### TODO: LLM Compatibility Gaps
427+
### Known LLM Compatibility Gaps
428428

429429
Identified from eval analysis — features frequently used by LLM-generated scripts:
430430

crates/bashkit/docs/threat-model.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,62 @@ attacks:
314314
5. **Parser fuel** (`max_parser_operations`, default 100K): Independent of depth,
315315
limits total parser work to prevent CPU exhaustion.
316316

317-
## Python Direct Integration
317+
### Python / Monty Security (TM-PY-*)
318+
319+
The `python`/`python3` builtins embed the Monty Python interpreter with VFS bridging.
320+
Python `pathlib.Path` operations are bridged to Bashkit's virtual filesystem.
321+
322+
| Threat | Attack Example | Mitigation |
323+
|--------|---------------|------------|
324+
| Infinite loop (TM-PY-001) | `while True: pass` | Monty time limit (30s) + allocation cap |
325+
| Memory exhaustion (TM-PY-002) | Large allocation | Monty max_memory (64MB) + max_allocations (1M) |
326+
| Stack overflow (TM-PY-003) | Deep recursion | Monty max_recursion (200) |
327+
| Shell escape (TM-PY-004) | `os.system()` | Monty has no os.system/subprocess |
328+
| Real FS access (TM-PY-005) | `open()` | Monty has no open() builtin |
329+
| Real FS read (TM-PY-015) | `Path.read_text()` | VFS bridge reads only from BashKit VFS |
330+
| Real FS write (TM-PY-016) | `Path.write_text()` | VFS bridge writes only to BashKit VFS |
331+
| Path traversal (TM-PY-017) | `../../etc/passwd` | VFS path normalization |
332+
| Network access (TM-PY-020) | Socket/HTTP | Monty has no socket/network module |
333+
| VM crash (TM-PY-022) | Malformed input | Parser depth limit + resource limits |
334+
335+
**Architecture:**
336+
337+
```text
338+
Python code → Monty VM → OsCall pause → BashKit VFS bridge → resume
339+
```
318340

319341
Monty runs directly in the host process. Resource limits (memory, allocations,
320342
time, recursion) are enforced by Monty's own runtime. All VFS operations are
321343
bridged through the host process — Python code never touches the real filesystem.
322344

345+
### Git Security (TM-GIT-*)
346+
347+
Optional virtual git operations via the `git` feature. All operations are confined
348+
to the virtual filesystem.
349+
350+
| Threat | Attack Example | Mitigation | Status |
351+
|--------|---------------|------------|--------|
352+
| Host identity leak (TM-GIT-002) | Commit reveals real name/email | Configurable virtual identity | MITIGATED |
353+
| Host git config (TM-GIT-003) | Read ~/.gitconfig | No host filesystem access | MITIGATED |
354+
| Credential theft (TM-GIT-004) | Access credential store | No host filesystem access | MITIGATED |
355+
| Repository escape (TM-GIT-005) | Clone outside VFS | All paths in VFS | MITIGATED |
356+
| Many git objects (TM-GIT-007) | Millions of objects | `max_file_count` FS limit | MITIGATED |
357+
| Deep history (TM-GIT-008) | Very long commit log | Log limit parameter | MITIGATED |
358+
| Large pack files (TM-GIT-009) | Huge .git/objects/pack | `max_file_size` FS limit | MITIGATED |
359+
| Unauthorized clone (TM-GIT-001) | `git clone evil.com` | Remote URL allowlist | PLANNED (Phase 2) |
360+
| Push to unauthorized (TM-GIT-010) | `git push evil.com` | Remote URL allowlist | PLANNED (Phase 2) |
361+
362+
**Virtual Identity:**
363+
364+
```rust,ignore
365+
use bashkit::Bash;
366+
367+
let bash = Bash::builder()
368+
.git_author("sandbox", "sandbox@example.com")
369+
.build();
370+
// Commits use virtual identity, never host ~/.gitconfig
371+
```
372+
323373
## Security Testing
324374

325375
Bashkit includes comprehensive security tests:
@@ -331,6 +381,7 @@ Bashkit includes comprehensive security tests:
331381
- **Network Security**: [`tests/network_security_tests.rs`][network_tests] - 53 tests
332382
- **Builtin Error Security**: `tests/builtin_error_security_tests.rs` - 39 tests
333383
- **Logging Security**: `tests/logging_security_tests.rs` - 26 tests
384+
- **Git Security**: `tests/git_security_tests.rs` + `tests/git_remote_security_tests.rs`
334385
- **Fuzz Testing**: [`fuzz/`][fuzz] - Parser and lexer fuzzing
335386

336387
## Reporting Security Issues
@@ -352,6 +403,7 @@ All threats use stable IDs in the format `TM-<CATEGORY>-<NUMBER>`:
352403
| TM-ISO | Multi-Tenant Isolation |
353404
| TM-INT | Internal Error Handling |
354405
| TM-LOG | Logging Security |
406+
| TM-GIT | Git Security |
355407
| TM-PY | Python/Monty Security |
356408

357409
Full threat analysis: [`specs/006-threat-model.md`][spec]

specs/004-testing.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,17 @@ to Codecov and available as CI artifacts.
156156
- Text processing tools: 73% pass rate (234/319 running, 85 skipped)
157157
- Core bash specs: 78% pass rate (367/471 running, 104 skipped)
158158

159-
## TODO: Testing Gaps
159+
## Known Testing Gaps
160160

161-
The following items need attention:
161+
Completed:
162+
163+
- [x] Enable bash_spec_tests in CI — 330/435 tests running
164+
- [x] Add bash_comparison_tests to CI — 309 tests compared against real bash
165+
- [x] Fix control-flow.test.sh — 31 tests now running
166+
- [x] Add coverage tooling — cargo-tarpaulin + Codecov via `.github/workflows/coverage.yml`
167+
168+
Outstanding:
162169

163-
- [x] **Enable bash_spec_tests in CI** - Done! 330/435 tests running
164-
- [x] **Add bash_comparison_tests to CI** - Done! 309 tests compared against real bash
165-
- [x] **Fix control-flow.test.sh** - Enabled! 31 tests now running
166-
- [x] **Add coverage tooling** - cargo-tarpaulin + Codecov via `.github/workflows/coverage.yml`
167170
- [ ] **Fix skipped spec tests** (189 total):
168171
- Bash: 104 skipped (various implementation gaps)
169172
- AWK: 41 skipped (operators, control flow, functions)

specs/009-implementation-status.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ Features that may be added in the future (not intentionally excluded):
247247
- Field assignment `$2 = "X"`
248248
- `next` statement
249249

250-
<!-- TODO: AWK remaining gaps for LLM compatibility -->
250+
<!-- Known AWK gaps for LLM compatibility (tracked in docs/compatibility.md) -->
251251
<!-- - Power operators (^ and **) - used in math scripts -->
252252
<!-- - printf %x/%o/%c formats - used in hex/octal output -->
253253
<!-- - match()/gensub() functions - used in text extraction -->
@@ -278,7 +278,7 @@ Features that may be added in the future (not intentionally excluded):
278278
- Numeric-regex range: `N,/pattern/`
279279
- Extended regex (`-E`), nth occurrence, address negation (`!`)
280280

281-
<!-- TODO: SED remaining gaps for LLM compatibility -->
281+
<!-- Known SED gaps for LLM compatibility (tracked in docs/compatibility.md) -->
282282
<!-- - Ampersand (&) in replacement - very commonly used by LLMs -->
283283
<!-- - \n literal newline in replacement - used in line splitting -->
284284
<!-- - Grouped commands {cmd1;cmd2} - used in complex transforms -->

supply-chain/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,10 @@ criteria = "safe-to-deploy"
830830
version = "0.24.2"
831831
criteria = "safe-to-deploy"
832832

833+
[[exemptions.pyo3-build-config]]
834+
version = "0.28.2"
835+
criteria = "safe-to-deploy"
836+
833837
[[exemptions.pyo3-ffi]]
834838
version = "0.24.2"
835839
criteria = "safe-to-deploy"

0 commit comments

Comments
 (0)