Repository navigation
Commit 5a1ec7c
fix(diff-logs): ignore OCSF network Refuse (policy DNS) records (#72)
Closes #69
OpenShell logs a Network Activity "Refuse" record (`class_uid` 4001,
`activity_id` 5, `status_detail: policy_dns_ineligible`) when policy DNS
refuses a name the policy doesn't allow. The record has no port and no
actor. The connection attempt that follows gets its own record: a denied
Open with host, port and binary.
`parse_json_line` counted the Refuse record as a second denial and added
a bogus `manual review: <host>:? (denied connection without a port)`
item. It now skips 4001 records with `activity_id` 5 or `status_detail
== "policy_dns_ineligible"`. The shorthand parser already ignores
`NET:REFUSE`, so JSON and shorthand logs now give the same results.
- Unit test `skips_ocsf_network_refuse_records` uses a record shaped
like the real OpenShell v0.1.7 (OCSF 1.8.0) Refuse record.
- Tested against the real v0.1.7 capture behind #70, using the
playground repo:
- Before: `12 events: 5 denied, 7 allowed`, plus two `manual review:
example.com:?` / `pypi.org:?` items.
- After: `10 events: 3 denied, 7 allowed`, the same as the shorthand log
from the same run.
- CHANGELOG: added an Unreleased entry.
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 0f413a1 commit 5a1ec7c
2 files changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
108 | 118 | | |
109 | 119 | | |
110 | 120 | | |
| |||
949 | 959 | | |
950 | 960 | | |
951 | 961 | | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
952 | 991 | | |
953 | 992 | | |
954 | 993 | | |
| |||
0 commit comments