Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .claude/agents/extension-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ Optional interfaces:
- Table-driven tests with named subtests
- Tests for Check (current state detection) and Apply (convergence)
- Tests for error cases and edge conditions
- Use `testutil.AssertConverges(t, ext)` for the Check/Apply/Check contract
- Use `testutil.MapFS` for file I/O tests without root (see `internal/testutil/`)

### 6. Testability (FS Interface)
- Extensions that manage files must accept `extensions.FS` in their Opts struct
- `nil` defaults to the real OS filesystem via `extensions.RealFS()`
- Direct `os.ReadFile`/`os.WriteFile`/`os.Stat` calls that bypass `fsys()` are a finding
- Use `errors.Is(err, fs.ErrNotExist)` not `os.IsNotExist()` for mock FS compatibility

## Output

Expand Down
7 changes: 6 additions & 1 deletion .claude/agents/security-auditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ Review: registry paths that could escalate privileges, security policy weakening

Review: `Check` methods with side effects, `Apply` without rollback capability, missing error handling that leaves partial state.

### 5. File Permissions (`extensions/file/`)
### 5. Condition Shell Execution (`condition/shell.go`)
`condition.Shell()` runs user-supplied commands in the platform shell as the daemon user (root). The command string is passed to `internal/shell.Command()` which wraps it in PowerShell/bash/cmd.

Review: commands constructed from untrusted blueprint input, unquoted arguments interpolated into the shell string, `Match()` bypass via output injection (e.g. attacker controlling stdout to match an expected value).

### 6. File Permissions (`extensions/file/`)
Creates/modifies files with specified ownership and permissions.

Review: files created world-writable, ownership changes to root-owned paths, symlink following.
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Read `docs/design.md` for philosophy and security model, `docs/extensions.md` fo
| Extensions | `extensions/` (one subdirectory per resource type, see directory for full list) |
| Conditions | [`condition/`](condition/) (see directory for full list) |
| Blueprints | `blueprints/` (baseline, per-OS, CIS benchmarks) |
| Internals | `internal/` (daemon, engine, exit, graph, logging, output, platform, version, watch, winreg) |
| Internals | `internal/` (daemon, engine, exit, graph, logging, output, platform, shell, testutil, version, watch, winreg) |
| CLI | `cmd/converge/` |

## Build and test
Expand Down
Loading