Skip to content

Commit 288f435

Browse files
committed
fix: align Generic Input filter and rule contracts
1 parent 6c3af7e commit 288f435

3 files changed

Lines changed: 63 additions & 1 deletion

File tree

‎filters/audits/generic.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Generic Input normalization and rule review
2+
3+
Use the SDK fieldName key so message extraction is retained.
4+
5+
This draft targets UTMStack `v11`. It contains 1 filter changes
6+
and 0 rule changes for this technology only. Review covered
7+
1 filter configurations and 1 matching shipped rule files.
8+
Unchanged rules are listed in the regression manifest; they are not duplicated in the diff.
9+
10+
## Contract and validation
11+
12+
- Compared exact standard names/types with go-sdk v1.1.31 and the supplied UTMStack dictionaries.
13+
- Checked documented pipeline ordering, rename/move behavior, open vendor log fields,
14+
event-side versus alert-side fields, and surviving fields used by affected rule predicates/history/grouping.
15+
- Strict SDK configuration decoding and actual CEL compilation pass for this scope.
16+
- 1 synthetic normalization cases pass, including SDK Event conversion and any
17+
trigger predicate assertions recorded in the manifest.
18+
- The scoped alerts module tests and `git diff --check` pass with the shared contract runner applied.
19+
20+
The shared alert-contract PR supplies the reusable Go runner for the manifest in
21+
`plugins/alerts/testdata/filter-contracts/generic.json`. Apply that support before running `go test ./...` in `plugins/alerts`.
22+
23+
The model starts from synthetic extraction results. It does not run complex grok,
24+
JSON/KV/XML/CSV extraction, time conversion, dynamic plugins, historical OpenSearch
25+
queries, or the closed EventProcessor. Raw vendor logs and resulting alerts must
26+
still be checked in staging before rollout. No customer false-positive reduction
27+
has been measured and no production rollout is included.
28+
29+
The one-field message capture is validated as a copy and the configuration decodes strictly against the SDK.
30+
31+
## References
32+
33+
- [SDK schema](https://github.com/threatwinds/go-sdk/blob/v1.1.31/plugins/plugins.proto)
34+
- [Filter steps](https://github.com/threatwinds/go-sdk/wiki/Filter-Steps-Reference)
35+
- [Standard event schema](https://github.com/threatwinds/go-sdk/wiki/Standard-Event-Schema)
36+
- [Rule implementation](https://github.com/threatwinds/go-sdk/wiki/Implementing-Rules)
37+
38+
`afterEvents`, empty noncapturing grok names, supported numeric strings, and custom
39+
`log.*` fields are accepted. Existing textual protocol casing and vendor action names
40+
are preserved unless a concrete consumer mismatch requires correction.

‎filters/generic/generic.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pipeline:
66
steps:
77
- grok:
88
patterns:
9-
- field_name: log.message
9+
- fieldName: log.message
1010
pattern: '(.*)'
1111
source: raw
1212
- json:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"technology": "Generic Input",
3+
"filters": [
4+
"filters/generic/generic.yml"
5+
],
6+
"rules": [
7+
"rules/generic/generic/cross_source_lateral_movement.yml"
8+
],
9+
"fixtures": [
10+
{
11+
"name": "generic_message_capture",
12+
"filter": "generic/generic.yml",
13+
"input": {
14+
"raw": "unstructured test message"
15+
},
16+
"expected": {
17+
"log.message": "unstructured test message",
18+
"raw": "unstructured test message"
19+
}
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)