Repository navigation
[ASIM] Add Microsoft Defender for Office 365 EmailEvent parser - #15354
Closed
JamesAde11 wants to merge 4 commits into
Closed
JamesAde11 wants to merge 4 commits into
JamesAde11 wants to merge 4 commits into
Conversation
Add regular and filtering parsers, unifier integration, synthetic fixtures, local static tests, mapping notes, changelogs, and generated deployment templates. Runtime and representative-data validation remain pending. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a87d261-1f21-44f1-818d-2dce48c48b95
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a87d261-1f21-44f1-818d-2dce48c48b95
JamesAde11
requested review from
Ofer Shezaf (oshezaf) and
Derrick Lee (yummyblabla)
October 19, 2026 18:22
Hash LF-normalized UTF-8 source text in the generator and C# tests. Exercise LF and CRLF inputs so Windows-generated fixtures bind on Linux CI without weakening stale-source detection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4a87d261-1f21-44f1-818d-2dce48c48b95
|
|
||
| private static Dictionary<string, object> Parser(string prefix) | ||
| { | ||
| var path = Path.Combine(Root, "Parsers", "ASimEmailEvent", "Parsers", prefix + Suffix + ".yaml"); |
|
|
||
| private static GlobalState Globals(bool optionalColumns = true) | ||
| { | ||
| var path = Path.Combine(Root, ".script", "tests", "KqlvalidationsTests", "CustomTables", "EmailEvents.json"); |
| var code = Analyze(Declaration(parser) + parser["ParserName"] + "()"); | ||
| var output = Assert.IsType<TableSymbol>(code.ResultType).Columns.ToDictionary(c => c.Name, c => c.Type.Name); | ||
| var specification = new Dictionary<string, (string Type, string Class)>(); | ||
| using (var csv = new TextFieldParser(Path.Combine(Root, "ASIM", "dev", "ASimTester", "ASimTester.csv"))) |
Comment on lines
+103
to
+113
| foreach (var prefix in new[] { "ASim", "vim" }) | ||
| { | ||
| var parser = Parser(prefix); | ||
| var code = Analyze(Declaration(parser) + parser["ParserName"] + "()"); | ||
| schemas.Add(Assert.IsType<TableSymbol>(code.ResultType).Columns.Select(c => c.Name + ":" + c.Type.Name).ToArray()); | ||
| var sourceReads = code.Syntax.GetDescendants<NameReference>() | ||
| .Where(n => n.ReferencedSymbol is TableSymbol table && table.Name == "EmailEvents").ToList(); | ||
| Assert.Single(sourceReads); | ||
| var prohibited = new[] { "MvExpandOperator", "MvApplyOperator", "SummarizeOperator", "DistinctOperator", "JoinOperator" }; | ||
| Assert.DoesNotContain(code.Syntax.GetDescendants<QueryOperator>(), op => prohibited.Contains(op.GetType().Name)); | ||
| } |
| [InlineData("\r\n")] | ||
| public void SyntheticRegressionQueryBindsWithoutAnyExternalTables(string lineEnding) | ||
| { | ||
| var path = Path.Combine(Root, "Parsers", "ASimEmailEvent", "Tests", "EmailEventsRegression.kql"); |
| var query = File.ReadAllText(path); | ||
| foreach (var name in new[] { "ASim" + Suffix, "vim" + Suffix, "vimEmailEventEmpty", "ASimEmailEvent", "imEmailEvent" }) | ||
| { | ||
| var source = Path.Combine(Root, "Parsers", "ASimEmailEvent", "Parsers", name + ".yaml"); |
Retain development helpers outside the repository and remove their README commands. Parser logic and the existing KQL regression assets are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3079d9d2-7890-4fc1-9495-30193ae5209b
Collaborator
Author
|
Superseded by #15373. Closing this earlier draft in favor of the replacement contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change(s)
Add regular and filtering ASIM EmailEvent parsers for the native Microsoft Sentinel
EmailEventstable, using EmailEvent schema version1.0.0.The contribution includes:
The Python fixture-generation and template-check helpers used during development are retained locally and are not included in this PR.
Each source record is normalized independently. The parsers do not join other event tables, expand records, deduplicate messages, or normalize post-delivery remediation events. Delivery success is kept separate from threat detection.
Reason for Change(s)
Provide source-specific ASIM EmailEvent coverage for Microsoft Defender for Office 365
EmailEvents, allowing queries to use normalized email fields instead of product-specific field names.Version Updated
0.1.0.1.0.0to1.0.1.1.0.0.Testing Completed
Local static validation completed:
Runtime validation remains pending:
All included fixture records are synthetic. They do not establish production correctness. No deployment, sample ingestion, or validation against customer email records has been performed.
Checked that the validations are passing and have addressed any issues that are present
The targeted local checks listed above passed, including a rerun after removing the Python helpers. GitHub checks must be evaluated on the latest commit and are separate from those local results. Hosted ASIM tests require maintainer
SafeToRunapproval for each code update; a new push can invalidate the previous approval. Full runtime validation is incomplete.This draft requests review of the mappings, delivery-result semantics, filtering behavior, source compatibility, and remaining validation requirements before merge.
Known Limitations
Unavailable source fields are not invented. Attachment and URL counts are mapped, but detailed attachment and URL records are outside scope.
Deployment links reference the upstream
masterbranch and will not resolve to the new templates until those files are merged.This contribution does not itself deploy parsers or change the installed
_Im_EmailEventbuilt-in function.