Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jan 9, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

- Add Common Expression Language (CEL) for dynamic conditions and field extraction
- Support short form (field names) and long form (CEL expressions) for output fields
- Add helper functions: getData(), getDataInt(), getDataUInt(), hasData()
- Rename extract_fields -> fields, source -> expression for clarity
- Update all existing YAML detectors to use CEL syntax
- Add comprehensive documentation for CEL features
- All unit tests pass (38.3% coverage)
- YAML detectors load successfully with CEL compilation

Breaking changes:
- YAML schema: extract_fields -> fields, source -> expression
- Field extraction now uses CEL expressions instead of JSONPath-like paths
Implements CEL global list variables to share common lists (e.g., shell
binaries, sensitive paths) across YAML detectors. Lists are defined in
{detector-dir}/lists/ subdirectory and exposed as CEL variables.

- Add list schema and loader with validation (uppercase snake_case names)
- Register lists as CEL variables (list<string>) in environment
- Pass lists to CEL evaluation context at runtime
- Add comprehensive unit and integration tests (16 new tests)
- Add example shell_binaries list and detector
- Update documentation with usage examples

Lists are compiled into CEL at load time for zero runtime overhead and
compile-time type safety.
Expose all core datastores (Process, Container, System, Kernel, DNS, Syscall)
as namespaced CEL functions for use in YAML detector conditions and outputs.

Key changes:
- Add datastores.Registry field to YAMLDetector, rebuild CEL env in Init()
- Implement 12 datastore functions: process.get/getAncestry/getChildren,
  container.get/getByName, system.info, kernel.resolveSymbol/getSymbolAddress,
  dns.getResponse, syscall.getName/getId
- Add comprehensive test coverage with mock datastores
- Update documentation with examples and usage patterns

Functions return null for not-found entities, handle time.Time conversion,
and integrate seamlessly with existing CEL expressions.
Add 8 string utility functions for YAML detectors:
- split(str, delimiter) - Split string into list
- join(list, delimiter) - Join list into string
- trim(str) - Remove leading/trailing whitespace
- replace(str, old, new) - Replace all occurrences
- upper(str) - Convert to uppercase
- lower(str) - Convert to lowercase
- basename(path) - Get filename from path
- dirname(path) - Get directory from path

Functions are available in both conditions and output expressions.
All functions handle CEL's various list representations ([]string, []interface{}, []ref.Val).

Includes comprehensive unit tests and documentation updates.
…ory structure

- Add required 'type' field to all YAML detector and list files
- Support flat directory structure (detectors and lists in same dir)
- Remove lists/ subdirectory requirement for K8s ConfigMap deployment
- Add type field validation in loader and validator
- Rewrite LoadFromDirectory with clean three-pass design
- Update all examples, tests, and documentation

BREAKING CHANGE: All YAML detector files must include 'type: detector' at the top.
All list files must include 'type: string_list'. Lists are no longer in a
subdirectory but in the same directory as detectors.
Replace /usr/bin/cat with /usr/bin/true for positive test case and
/usr/bin/id with /usr/bin/false for negative test case to avoid
interference from background processes that may execute common utilities.

Add 200ms delay before buffer clear to ensure all events from test 1
have arrived, preventing race conditions where late events cause false
positives in the negative assertion.
@pull pull bot locked and limited conversation to collaborators Jan 9, 2026
@pull pull bot added the ⤵️ pull label Jan 9, 2026
@pull pull bot merged commit dc45de2 into jynychen:main Jan 9, 2026
5 of 8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant