Skip to content

Commit 88498c2

Browse files
committed
feat: modernize OpenGhost assessment workflow
Add local caching, stricter scope enforcement, evidence integrity, coverage tracking, modern assessment modules, improved reporting, and CI validation.
1 parent 1e6287b commit 88498c2

44 files changed

Lines changed: 2405 additions & 179 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish-sandbox-image.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,7 @@ jobs:
8686
push: ${{ github.event_name != 'pull_request' }}
8787
tags: ${{ steps.meta.outputs.tags }}
8888
labels: ${{ steps.meta.outputs.labels }}
89+
provenance: mode=max
90+
sbom: true
8991
cache-from: type=gha
9092
cache-to: type=gha,mode=max

.github/workflows/validate.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Validate skill
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
validate:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Validate shell syntax
19+
run: |
20+
bash -n openghost
21+
bash -n skills/openghost
22+
bash -n skills/openghost-skill/openghost
23+
bash -n skills/openghost-skill/scripts/openghost.sh
24+
bash -n skills/openghost-skill/scripts/verify-toolchain.sh
25+
26+
- name: Validate Python syntax
27+
run: |
28+
python3 -m compileall -q skills/openghost-skill/scripts
29+
30+
- name: Validate skill references
31+
run: |
32+
python3 skills/openghost-skill/scripts/check-references.py
33+
34+
- name: Run deterministic helper tests
35+
run: |
36+
python3 -m unittest discover -s tests -v
37+
38+
- name: Reject generated engagement state
39+
run: |
40+
if git ls-files '.openghost/**' | grep -q .; then
41+
echo 'Generated .openghost engagement state must not be committed.' >&2
42+
exit 1
43+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33

44
__pycache__/
55
*.py[cod]
6+
.openghost/

AGENTS.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ Primary commands:
7474
./openghost todo add ...
7575
./openghost todo list
7676
./openghost todo update ...
77+
./openghost coverage set ...
78+
./openghost context show
79+
./openghost evidence verify
80+
./openghost report validate
7781
./openghost report generate
7882
```
7983

@@ -87,8 +91,11 @@ Compatibility aliases exist in `openghost.sh`; preserve them unless intentionall
8791
- `.openghost/current`
8892
- `.openghost/engagements/<name>/scope.yaml`
8993
- `.openghost/engagements/<name>/engagement.json`
90-
- `.openghost/engagements/<name>/findings.json`
91-
- `.openghost/engagements/<name>/todos.json`
94+
- `.openghost/engagements/<name>/state/findings.json`
95+
- `.openghost/engagements/<name>/state/evidence.json`
96+
- `.openghost/engagements/<name>/state/artifacts.json`
97+
- `.openghost/engagements/<name>/state/todos.json`
98+
- `.openghost/engagements/<name>/state/coverage.json`
9299
- evidence, notes, reports, artifacts, scripts, browser, and run directories.
93100

94101
`OPENGHOST_SCOPE` should point to the active `scope.yaml` before testing. Scope files are operational data, not source docs.
@@ -143,7 +150,12 @@ bash -n skills/openghost-skill/scripts/verify-toolchain.sh
143150
For Python edits:
144151

145152
```bash
146-
python3 -m py_compile skills/openghost-skill/scripts/select-modules.py
153+
python3 -m py_compile skills/openghost-skill/scripts/select-modules.py \
154+
skills/openghost-skill/scripts/scope_utils.py \
155+
skills/openghost-skill/scripts/openghost-assess.py \
156+
skills/openghost-skill/scripts/openghost-state.py
157+
python3 skills/openghost-skill/scripts/check-references.py
158+
python3 -m unittest discover -s tests -v
147159
```
148160

149161
For sandbox/runtime changes:

ARCHITECTURE.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ The agent owns planning, scope decisions, module selection, and reporting
66
judgment. OpenGhost owns the sandboxed execution layer, deterministic helpers,
77
engagement state, and evidence/report files.
88

9+
OpenGhost has no hosted control plane or managed service dependency. Runtime,
10+
state, caches, and credentials for authorized target applications stay local.
11+
912
## Design Goals
1013

1114
- Keep offensive tooling out of the host environment.
1215
- Make authorization, scope, and evidence explicit.
1316
- Give agents a short skill entrypoint with deeper references loaded only when
1417
relevant.
1518
- Keep engagement output separate from source code.
19+
- Reduce repeated agent context and deterministic work with local, invalidated caches.
1620
- Preserve one canonical launcher implementation.
1721

1822
## System Overview
@@ -91,16 +95,19 @@ Maintainers build the sandbox image from:
9195
docker/Dockerfile
9296
```
9397

94-
The sandbox mounts the current workspace at `/workspace`, starts from
95-
`WORKDIR /workspace`, and exposes tools only through the launcher allowlist.
98+
The sandbox mounts the current workspace read-only at `/workspace`, overlays
99+
`.openghost/` read-write for generated state, starts from `WORKDIR /workspace`,
100+
and exposes tools only through the launcher allowlist. Full workspace writes
101+
and the host gateway are explicit opt-ins. Memory, CPU, and process limits are
102+
set by the launcher.
96103
The launcher also contains a bash blocklist for obvious destructive host or
97104
system-damage patterns.
98105

99106
### State Helper
100107

101108
`skills/openghost-skill/scripts/openghost-state.py` owns structured engagement
102-
state. The shell launcher delegates evidence, artifact, finding, todo, and
103-
report operations to this helper.
109+
state. The shell launcher delegates evidence, artifact, finding, todo,
110+
coverage, compact context, cache status, and report operations to this helper.
104111

105112
Generated state normally lives under:
106113

@@ -118,6 +125,7 @@ Generated state normally lives under:
118125
|-- scripts/
119126
|-- notes/
120127
|-- reports/
128+
|-- cache/
121129
`-- runs/
122130
```
123131

@@ -156,6 +164,7 @@ assessment automation and parsing, not for bypassing scope or safety controls.
156164
openghost script run api-inventory -- --target-url https://target.example
157165
-> read manifest
158166
-> locate bundled script
167+
-> reuse a content-addressed script/helper bundle
159168
-> execute inside Docker
160169
```
161170

@@ -167,12 +176,30 @@ directory.
167176

168177
```text
169178
openghost evidence add ...
179+
openghost evidence verify
170180
openghost finding add ...
181+
openghost coverage set ...
182+
openghost report validate
171183
openghost report generate
172184
```
173185

174186
Findings should reference evidence IDs and distinguish confirmed behavior from
175-
likely or possible signals.
187+
likely or possible signals. Evidence records include SHA-256 integrity metadata.
188+
Final report generation requires reviewed scope, closed coverage, valid evidence,
189+
complete confirmed findings, and no unresolved high-priority test work.
190+
191+
### Local Cache Layers
192+
193+
```text
194+
.openghost/cache/scripts/ content-addressed script bundles
195+
.openghost/engagements/<name>/cache/assessment/ deterministic bounded outputs
196+
.openghost/engagements/<name>/cache/context/ compact agent resume snapshots
197+
```
198+
199+
Cache keys include relevant source and state hashes. Target-authenticated
200+
assessment reuse is disabled by default. `openghost context show` is the
201+
preferred agent resume point so raw state and evidence are loaded only when
202+
needed for the active hypothesis.
176203

177204
## Trust Boundaries
178205

DEVELOPMENT.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ Python changes:
3838
```bash
3939
PYTHONPYCACHEPREFIX=/tmp/openghost-pycache python3 -m py_compile \
4040
skills/openghost-skill/scripts/select-modules.py \
41-
skills/openghost-skill/scripts/openghost-state.py
41+
skills/openghost-skill/scripts/scope_utils.py \
42+
skills/openghost-skill/scripts/openghost-assess.py \
43+
skills/openghost-skill/scripts/openghost-state.py \
44+
skills/openghost-skill/scripts/check-references.py
45+
PYTHONPYCACHEPREFIX=/tmp/openghost-pycache python3 -m unittest discover -s tests -v
46+
python3 skills/openghost-skill/scripts/check-references.py
4247
rm -rf /tmp/openghost-pycache
4348
```
4449

@@ -108,7 +113,7 @@ OPENGHOST_BUILD=1 OPENGHOST_IMAGE=openghost-sandbox:dev ./openghost sandbox upda
108113
1. Add module guidance under `skills/openghost-skill/references/modules/`.
109114
2. Keep the module focused on one assessment area.
110115
3. Link it from `SKILL.md` only where agents need to discover it.
111-
4. Update `skills/openghost-skill/references/module-map.md` when module
116+
4. Update `skills/openghost-skill/references/modules/module-map.md` when module
112117
selection changes.
113118
5. Update `skills/openghost-skill/scripts/select-modules.py` when automatic
114119
selection should include the module.

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ plans the work, tests carefully, validates evidence, and writes findings.
1212
OpenGhost provides the Docker sandbox, scope files, evidence folders, reusable
1313
checks, and report templates.
1414

15+
OpenGhost is fully local and open source. It has no hosted service, account,
16+
API key, telemetry requirement, or managed control plane.
17+
1518
> [!IMPORTANT]
1619
> Use OpenGhost only on systems you are explicitly authorized to test.
1720
>
@@ -34,7 +37,7 @@ Use $openghost-skill to assess https://target.example.
3437
Authorization and scope details are in the engagement notes.
3538
```
3639

37-
Make sure Docker is running. Security tools are executed through the OpenGhost
40+
Make sure Docker is running and Bash 4.3+ plus Python 3 are available. Security tools are executed through the OpenGhost
3841
sandbox, not directly on your host machine.
3942

4043
<details>
@@ -74,6 +77,8 @@ Create a scoped workspace before testing:
7477
openghost sandbox start
7578
openghost engagement init --url https://target.example --name target-example
7679
export OPENGHOST_SCOPE=.openghost/engagements/target-example/scope.yaml
80+
# Edit scope.yaml, set authorization.reviewed: true, then validate it.
81+
openghost scope validate
7782
```
7883

7984
Edit the generated scope file:
@@ -140,7 +145,7 @@ openghost script run api-inventory -- --target-url https://target.example
140145
Record evidence:
141146

142147
```bash
143-
openghost evidence add --path response.txt --kind response --title "Baseline response"
148+
openghost evidence add --path response.txt --kind response --title "Baseline response" --redaction redacted
144149
```
145150

146151
Save a confirmed finding:
@@ -163,6 +168,10 @@ openghost finding add \
163168
Generate the report:
164169

165170
```bash
171+
openghost context show
172+
openghost coverage set --module server-integrity --status tested
173+
openghost evidence verify
174+
openghost report validate
166175
openghost report generate
167176
```
168177

@@ -201,9 +210,12 @@ openghost browser devtools --url https://target.example --zap
201210

202211
```bash
203212
openghost todo add --task "Complete surface mapping" --module surface-map --priority high
204-
openghost evidence add --path <file> --kind <kind> --title <title>
213+
openghost evidence add --path <file> --kind <kind> --title <title> --redaction <raw|redacted|sanitized>
205214
openghost artifact add --path <file> --kind <kind> --title <title>
206215
openghost finding add --title <title> --severity <severity> --module <module> --url <url> --confidence <90-100> --evidence E-001
216+
openghost coverage set --module <module> --status <status>
217+
openghost evidence verify
218+
openghost report validate
207219
openghost report generate
208220
```
209221

0 commit comments

Comments
 (0)