Commit 3305ecd
Zeek OCSF: add MAC addresses, MITRE ATT&CK, alert category, and severity fixes (DataDog#23864)
* [Zeek] Extend OCSF v1.5 normalization with additional field mappings
- Notice pipeline: map proto to ocsf.evidence.connection_info.protocol_name;
fix severity filter to use severity.level (not severity.id) per real Zeek logs
- Suricata pipeline: map service to evidence connection_info.protocol_name;
extract MITRE ATT&CK tactic/technique from alert.metadata into
finding_info.attacks; map alert.category to finding_info.types;
add risk_level mapping from signature_severity metadata
- Conn pipeline: map orig_l2_addr/resp_l2_addr to src/dst endpoint MAC addresses
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add changelog entry for PR DataDog#23864
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Fix grok pattern performance: replace data captures with word, drop changelog
- Replace 4x %{data} capture groups with %{word} for MITRE IDs/names
(MITRE tactic/technique values are alphanumeric+underscore only)
- Drop trailing %{data} (not needed; grok matches without consuming tail)
- Reduces expensive quantifier count from 6 to 1, under the 3-pattern limit
- Remove changelog entry (log asset changes don't require one)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Refactor OCSF intermediary fields to ocsf.* namespace per style guide
- Replace tmp_md5/sha1/sha256.* with ocsf.file.hash.* (style guide §7.2/8.3)
- Replace tmp_attack_str/tmp_attack.* with ocsf.finding_info.attack_raw/attack.*
- Remove grok-parser integer coercions for algorithm_id; schema-processor
handles type coercion for ocsf.file.hashes elements per OCSF schema
- Update string-builder names to follow Add <field> convention (§6.1)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Remove attack_raw intermediary: grok alert.metadata directly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix OCSF validator errors for algorithm_id type and MITRE extraction
- Restructure hash building to use unique named objects (ocsf.file.hash_md5,
ocsf.file.hash_sha1, ocsf.file.hash_sha256) with an intermediate
schema-processor to coerce algorithm_id from string to integer via
targetFormat: integer before appending to ocsf.file.hashes array
- Store alert.metadata stringification in alert.metadata_str (outside the
ocsf namespace) to avoid unknown-attribute validation errors; grok reads
from this field to extract MITRE tactic/technique into ocsf.finding_info.attack
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix MITRE grok pattern: add trailing %{data} anchor and correct sample
Datadog's grok engine uses m.matches() which requires the pattern to consume
the entire input string. The pattern was missing a trailing %{data} to absorb
remaining content after the last MITRE capture (e.g. ,performance_impact:Low,...).
Also update the sample to match the actual string-builder output format:
comma-joined without brackets or spaces, as TemplateEvaluator produces.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Restore original grok sample format with brackets
The pattern already handles both bracket/space and comma-only formats via the
leading and trailing %{data} captures; the sample documents the original
alert.metadata stringified representation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Use lazy quantifier at start of MITRE grok rule
Replace leading %{data} with .*? to avoid validate-logs Greedy At Start
warning; trailing %{data} is kept to consume remaining content and satisfy
the full-string m.matches() requirement.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Replace grok type cast for direction_id with schema-remapper
Use schema-remapper targetFormat: integer inside an intermediate schema-processor
instead of a grok parser for coercing evidence connection_info.direction_id
from string to integer in both Detection Finding sub-pipelines.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix intermediate schema-processor names to follow naming convention
Rename to bare 'Apply OCSF schema for <class_uid>' per style guide [NAMING-7].
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Update pipeline
* Replace intermediate schema-processors with grok type coercion
Use grok parsers to coerce string values to integer instead of
intermediate schema-processors: direction_id in Detection Finding
evidence and algorithm_id in File Hosting Activity file hashes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Update type casting
* Fix attribute-remapper targetType and support MITRE sub-techniques
- Add targetType: attribute to three attribute-remappers that perform
integer coercion (direction_id, hash_sha1/sha256 algorithm_id);
validate-logs requires the field.
- Replace %{word} captures in the Suricata MITRE grok rule with
regex captures that accept dotted sub-technique IDs (e.g. T1059.001),
so tactic/technique fields populate for sub-techniques as well.
- Add a sub-technique sample to exercise the new pattern.
* Map MITRE sub-technique to ocsf.finding_info.attacks[].sub_technique
Split dotted technique IDs (e.g. T1059.001) into a base technique uid
(T1059 → technique.uid) and a sub-technique object (T1059.001 →
sub_technique.uid). sub_technique is a sibling of technique within the
attack object, not nested inside it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Only populate sub_technique for dotted ATT&CK technique IDs
Restructure the MITRE grok into two rules: sub_technique (dotted IDs
like T1059.001) captures mitre_subtechnique_name separately, while
base_technique (plain IDs like T1071) does not. The sub_technique.name
remapper now sources from mitre_subtechnique_name, which only exists
for sub-techniques, so base techniques never get a spurious
sub_technique object. Adds an end-to-end test for T1059.001.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Remove sub-technique handling from Suricata MITRE extraction
Suricata metadata only emits base ATT&CK technique IDs, so the
sub_technique split logic was unnecessary. Revert to a single grok
rule mapping technique.uid and technique.name directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Address PR review comments on Zeek OCSF pipeline
- Replace Suricata direction_id grok-parser with attribute-remapper to match Notice sub-pipeline pattern
- Map MITRE grok captures directly to ocsf.finding_info.attack.* fields, removing 4 intermediate attribute-remappers
- Use ocsf.metadata.event_code as temp field for alert.metadata stringification (overwritten by schema-processor), eliminating alert.metadata_str
- Add severity.id OR conditions to Notice severity_id category mapper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix type-cast remapper names and convert md5 grok coercion to attribute-remapper
Rename all type-cast self-map processors to follow Map `source` to `target`
style guide convention. Convert remaining grok-parser type coercion for
hash_md5.algorithm_id to attribute-remapper with targetFormat: integer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8ea556c commit 3305ecd
2 files changed
Lines changed: 504 additions & 333 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1714 | 1714 | | |
1715 | 1715 | | |
1716 | 1716 | | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
1717 | 1744 | | |
1718 | 1745 | | |
1719 | 1746 | | |
| |||
1836 | 1863 | | |
1837 | 1864 | | |
1838 | 1865 | | |
1839 | | - | |
| 1866 | + | |
1840 | 1867 | | |
1841 | 1868 | | |
1842 | 1869 | | |
1843 | | - | |
| 1870 | + | |
1844 | 1871 | | |
1845 | 1872 | | |
1846 | 1873 | | |
1847 | | - | |
| 1874 | + | |
1848 | 1875 | | |
1849 | 1876 | | |
1850 | 1877 | | |
1851 | | - | |
| 1878 | + | |
1852 | 1879 | | |
1853 | 1880 | | |
1854 | 1881 | | |
1855 | | - | |
| 1882 | + | |
1856 | 1883 | | |
1857 | 1884 | | |
1858 | 1885 | | |
| |||
1929 | 1956 | | |
1930 | 1957 | | |
1931 | 1958 | | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
1932 | 1986 | | |
1933 | 1987 | | |
1934 | 1988 | | |
| |||
1977 | 2031 | | |
1978 | 2032 | | |
1979 | 2033 | | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
1980 | 2065 | | |
1981 | 2066 | | |
1982 | 2067 | | |
| |||
2009 | 2094 | | |
2010 | 2095 | | |
2011 | 2096 | | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
2012 | 2133 | | |
2013 | 2134 | | |
2014 | 2135 | | |
| |||
2348 | 2469 | | |
2349 | 2470 | | |
2350 | 2471 | | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
2351 | 2479 | | |
2352 | 2480 | | |
2353 | 2481 | | |
| |||
2356 | 2484 | | |
2357 | 2485 | | |
2358 | 2486 | | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
2359 | 2494 | | |
2360 | 2495 | | |
2361 | 2496 | | |
| |||
3450 | 3585 | | |
3451 | 3586 | | |
3452 | 3587 | | |
3453 | | - | |
| 3588 | + | |
3454 | 3589 | | |
3455 | 3590 | | |
3456 | | - | |
| 3591 | + | |
3457 | 3592 | | |
3458 | 3593 | | |
3459 | | - | |
| 3594 | + | |
3460 | 3595 | | |
3461 | 3596 | | |
3462 | | - | |
| 3597 | + | |
3463 | 3598 | | |
3464 | | - | |
3465 | | - | |
3466 | | - | |
3467 | | - | |
3468 | | - | |
3469 | | - | |
3470 | | - | |
3471 | | - | |
3472 | | - | |
3473 | 3599 | | |
3474 | | - | |
| 3600 | + | |
3475 | 3601 | | |
3476 | 3602 | | |
3477 | 3603 | | |
3478 | 3604 | | |
3479 | | - | |
| 3605 | + | |
3480 | 3606 | | |
3481 | 3607 | | |
3482 | 3608 | | |
3483 | | - | |
3484 | | - | |
3485 | | - | |
3486 | | - | |
3487 | | - | |
3488 | | - | |
3489 | | - | |
3490 | | - | |
3491 | 3609 | | |
3492 | | - | |
| 3610 | + | |
3493 | 3611 | | |
3494 | 3612 | | |
3495 | | - | |
| 3613 | + | |
3496 | 3614 | | |
3497 | 3615 | | |
3498 | | - | |
| 3616 | + | |
3499 | 3617 | | |
3500 | 3618 | | |
3501 | | - | |
| 3619 | + | |
3502 | 3620 | | |
3503 | | - | |
3504 | | - | |
3505 | | - | |
3506 | | - | |
3507 | | - | |
3508 | | - | |
3509 | | - | |
3510 | | - | |
3511 | | - | |
3512 | 3621 | | |
3513 | | - | |
| 3622 | + | |
3514 | 3623 | | |
3515 | 3624 | | |
3516 | 3625 | | |
3517 | 3626 | | |
3518 | | - | |
| 3627 | + | |
3519 | 3628 | | |
3520 | 3629 | | |
3521 | 3630 | | |
3522 | | - | |
3523 | | - | |
3524 | | - | |
3525 | | - | |
3526 | | - | |
3527 | | - | |
3528 | | - | |
3529 | | - | |
3530 | 3631 | | |
3531 | | - | |
| 3632 | + | |
3532 | 3633 | | |
3533 | 3634 | | |
3534 | | - | |
| 3635 | + | |
3535 | 3636 | | |
3536 | 3637 | | |
3537 | | - | |
| 3638 | + | |
3538 | 3639 | | |
3539 | 3640 | | |
3540 | | - | |
| 3641 | + | |
3541 | 3642 | | |
3542 | | - | |
3543 | | - | |
3544 | | - | |
3545 | | - | |
3546 | | - | |
3547 | | - | |
3548 | | - | |
3549 | | - | |
3550 | | - | |
3551 | 3643 | | |
3552 | | - | |
| 3644 | + | |
3553 | 3645 | | |
3554 | 3646 | | |
3555 | 3647 | | |
3556 | 3648 | | |
3557 | | - | |
| 3649 | + | |
3558 | 3650 | | |
3559 | 3651 | | |
3560 | 3652 | | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
3561 | 3702 | | |
3562 | | - | |
| 3703 | + | |
3563 | 3704 | | |
3564 | 3705 | | |
3565 | | - | |
| 3706 | + | |
3566 | 3707 | | |
3567 | 3708 | | |
3568 | 3709 | | |
| |||
0 commit comments