Skip to content

Commit 4fb9f17

Browse files
Merge remote-tracking branch 'origin/master' into darktrace-ccf-release-emails
2 parents 67ee4e2 + 7842d91 commit 4fb9f17

214 files changed

Lines changed: 16996 additions & 4953 deletions

File tree

Some content is hidden

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

.github/skills/asim-parser-creator-orchestrator/SKILL.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ requiredSkills:
77
- asim-parser-create-parser
88
- asim-parser-validator
99
- asim-parser-create-parameter-parser
10+
- asim-parser-filter-validator
1011
- asim-parser-la-deployer
1112
- asim-parser-github-pr-packager
1213
- log-analytics-workspace-queryer
@@ -72,7 +73,13 @@ The output of this step is a file named `vim<Schema><Vendor><Product>.kql`.
7273

7374
After creating the parameterized parser, repeat Step 4 (validation) and Step 5 (refinement loop) against this new parser to ensure the added parameters and filters do not introduce errors.
7475

75-
## Step 7: Ask the user what they want to do with the parser
76+
## Step 7: Validate filtering parameters
77+
78+
Run the filter validation tests against the parameterized parser to confirm that each filtering parameter behaves correctly. Use the `asim-parser-filter-validator` skill, passing the parameterized parser file (`vim<Schema><Vendor><Product>.kql`), the schema name, and the workspace ID.
79+
80+
If any filter tests fail, fix the parameterized parser and re-run the filter validation until all tests pass. Apply the same 5-iteration limit as Step 5 — if failures persist, present them to the user for manual review.
81+
82+
## Step 8: Ask the user what they want to do with the parser
7683

7784
After parser creation, ask the user what they want to do next. Present two options:
7885

@@ -86,7 +93,7 @@ Use the `asim-parser-github-pr-packager` skill to package the parser into a GitH
8693

8794
The user may choose one or both options.
8895

89-
## Step 8: Report
96+
## Step 9: Report
9097

9198
After the workflow is complete, present a summary report to the user that includes:
9299

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
name: asim-parser-filter-validator
3+
description: Validates ASIM parser filtering parameters by running filter tests against a Log Analytics workspace. Pure PowerShell using az CLI for authentication — no Python or Azure SDK packages required. Use this skill after creating or modifying an ASIM parser to verify that its filtering parameters work correctly.
4+
requiredSkills:
5+
- az-cli-command-runner
6+
---
7+
8+
# ASIM Parser Filter Validator
9+
10+
Validates that an ASIM parser's filtering parameters (e.g. `disabled`, `starttime`, `endtime`, `srcipaddr_has_any_prefix`, etc.) behave correctly by running queries against a Log Analytics workspace.
11+
12+
This skill is a **pure PowerShell** implementation that uses `az CLI` for authentication. No Python, Azure SDK packages, or YAML modules are required.
13+
14+
- **PowerShell 7+**
15+
- **Azure CLI** (logged in via `az login`)
16+
17+
## What it tests
18+
19+
For every filtering parameter declared in the parser's KQL function signature:
20+
21+
| Parameter type | Tests performed |
22+
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
23+
| `disabled` | `disabled=true` returns 0 rows; `disabled=false` returns rows |
24+
| `datetime` (`starttime` / `endtime`) | Filtering by the midpoint timestamp returns fewer rows than unfiltered |
25+
| Scalar (`string`, `int`) | Filtering by a real value returns exactly that value; filtering by a fictitious value returns 0 rows |
26+
| `dynamic` (`*_has_any`, `*_has_all`, `*_has_any_prefix`) | Filtering by one/two real values returns fewer rows; fictitious value returns 0 rows; substring / prefix variants tested where applicable |
27+
28+
## Supported schemas
29+
30+
AgentEvent, AlertEvent, AssetEntity, AuditEvent, Authentication, DhcpEvent, Dns, FileEvent, NetworkSession, ProcessEvent, RegistryEvent, UserManagement, WebSession.
31+
32+
## Inputs
33+
34+
| Input | Required | Description |
35+
| --------------- | -------- | ----------------------------------------------------------------- |
36+
| Parser KQL path | Yes | Path to the ASIM parser `.kql` file to test |
37+
| Schema name | Yes | ASIM schema name (e.g. `Dns`, `Authentication`, `NetworkSession`) |
38+
| Workspace ID | Yes | Log Analytics workspace GUID to run queries against |
39+
40+
## How to run
41+
42+
```powershell
43+
.\.github\skills\asim-parser-filter-validator\scripts\asimFilterTest.ps1 -ParserFile "{PathToFilterParserKQL}" -SchemaName "{SchemaName}" -WorkspaceId "{your-workspace-guid}"
44+
```
45+
46+
## Prerequisites
47+
48+
1. **Azure CLI authenticated** — run `az login` if not already logged in. If you get an authentication error, use the `az-cli-command-runner` skill to verify login status.
49+
2. The workspace must contain data for the tables referenced by the parser.
50+
51+
## Interpreting results
52+
53+
- **Green** — test passed.
54+
- **FAIL** — the filtering parameter did not behave as expected. The failure message indicates which parameter failed and what was expected.
55+
- **Known partial validations** — AuditEvent (`EventResult`), Authentication (`EventType`), and Dns (`EventType`) have known single-failure scenarios that are automatically ignored.
56+
57+
### Known acceptable failure reasons (can be ignored)
58+
59+
When analyzing filter-validation failures, a failure can be **ignored** if it matches one of these inherent-limitation categories:
60+
61+
1. **Documented schema known exception** — The schema defines a known exception for a parameter (e.g. a multi-value test that cannot succeed because the value combinations do not co-exist in that schema's data). Check whether the ASIM schema documentation lists the parameter as a known exception.
62+
2. **Constant or single-value field by design** — The parser maps the filtered field to a single constant value, so multi-value or reduction-based filtering cannot reduce rows further. This is expected when the source provides only one possible value for that field.
63+
3. **Insufficient distinct values in the test window** — The 2-day query window does not contain enough distinct values for the field to exercise multi-value filtering. This is a data-availability limitation, not a parser bug.
64+
65+
When reviewing filter-validation output, analyze each failure message against these categories. If **all other parameters pass** and every failure maps to one of the reasons above, the parser's filtering implementation is considered correct.
66+
67+
## Troubleshooting
68+
69+
| Symptom | Fix |
70+
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
71+
| `Failed to acquire access token via az CLI` | Run `az login` |
72+
| `No data in the provided workspace` | Ensure the workspace has ingested data for the relevant tables within the last 2 days |
73+
| `Schema: X - Not supported` | The schema name is not in the supported list — update the `$AllSchemasParameters` hashtable in `asimFilterTest.ps1` |

0 commit comments

Comments
 (0)