Skip to content

feat(convert): support nested JSONB paths for dotted Sigma field names#45

Merged
mostafa merged 1 commit intomainfrom
feat/jsonb-nested-paths
Apr 28, 2026
Merged

feat(convert): support nested JSONB paths for dotted Sigma field names#45
mostafa merged 1 commit intomainfrom
feat/jsonb-nested-paths

Conversation

@mostafa
Copy link
Copy Markdown
Member

@mostafa mostafa commented Apr 28, 2026

Summary

  • When json_field is set, dotted Sigma field names (e.g. securityContext.isProxy) now generate chained -> / ->> PostgreSQL JSONB operators (data->'securityContext'->>'isProxy') instead of a flat top-level key lookup (data->>'securityContext.isProxy').
  • This matches the nested traversal behavior already implemented in rsigma-eval's JsonEvent::get_field, which splits dotted field names on . and walks into nested JSON objects.
  • Top-level fields (no dots) are unchanged: data->>'eventType'.

Test plan

  • test_jsonb_nested_field_access: two-level nested path with string equality
  • test_jsonb_deeply_nested_field: four-level nested path (a.b.c.d)
  • test_jsonb_nested_field_exists: |exists modifier on a nested path
  • test_jsonb_nested_field_cidr: |cidr modifier on a nested path
  • test_jsonb_nested_field_regex: |re modifier on a nested path
  • test_jsonb_flat_field_unchanged: regression guard for flat fields
  • All 78 postgres backend tests pass
  • cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  • cargo fmt --all -- --check clean

When json_field is set, dotted Sigma field names like
securityContext.isProxy now generate chained -> / ->> operators
(data->'securityContext'->>'isProxy') instead of a flat key lookup
(data->>'securityContext.isProxy'). This matches the eval crate's
nested traversal behavior and produces correct SQL for nested JSON
documents like Okta System Log events.
@mostafa mostafa merged commit 5dc6829 into main Apr 28, 2026
8 checks passed
@mostafa mostafa deleted the feat/jsonb-nested-paths branch April 28, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant