Repository navigation
Commit 8fff5f4
test: add real OpenShell v0.1.7 OCSF 1.8.0 log fixtures (#73)
Closes #70
Rebased onto main after #71 and #72 merged. The golden note now says
OpenShell 0.1.7.
Adds a log fixture captured from a real OpenShell v0.1.7 sandbox: the
playground image and policy, with `ocsf_json_enabled=true`.
- `tests/fixtures/logs/ocsf-1.8.0.jsonl`: 17 native OCSF 1.8.0 records
(`metadata.version` is `1.8.0` on every line):
- 4001 Open, allowed and denied
- two 4001 Refuse records with `policy_dns_ineligible`
- 4002 L7 allow and deny
- one record each of 0 (relay open/close), 4007 (SSH) and 5019 (policy
DNS mapped/staged), which `diff-logs` ignores
- Scrubbed:
- Device hostname → `sandbox`.
- Container → `fixture` with an all-zero UUID.
- `metadata.uid`, SSH channel ids and DNS mapping ids → fixed fake
UUIDs.
- Real resolved IPs → 203.0.113.x (TEST-NET-3).
- The 198.18.x synthetic IPs, the proxy loopback address and the public
test hostnames are unchanged.
- Timestamps rebased.
- No usernames or tokens.
- `tests/fixtures/ocsf-1.8.0-app/`: a minimal annotated app that matches
the captured run.
- `tests/cli.rs` `diff_logs_reads_openshell_0_1_7_ocsf_1_8_0_records`:
- Checks `10 events: 3 denied, 7 allowed`.
- Expects `missing_egress` for example.com (curl) and pypi.org
(python3.12), and `l7_allow` for httpbin.org POST /post.
- Expects no `manual` items.
- Adds the plain human golden
`tests/golden/diff_logs_ocsf_1_8_0_plain.txt`.
Filesystem denials (two in the run) were not logged at all, which
matches NVIDIA/OpenShell#4270 (still open).
Ran locally: fmt, clippy `-D warnings`, `cargo test --locked`, `--test
gateway_policies` and `gen-docs.sh --check` all pass.
Signed-off-by: Ilan Harel <[email protected]>
Co-authored-by: Ilan Harel <[email protected]>1 parent 5a1ec7c commit 8fff5f4
5 files changed
Lines changed: 148 additions & 0 deletions
File tree
- tests
- fixtures
- logs
- ocsf-1.8.0-app
- golden
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2152 | 2152 | | |
2153 | 2153 | | |
2154 | 2154 | | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
0 commit comments