[integration][windows] - Fixed parsing of winlog.event_data.MemberName in forwarded data stream when extra commas are present#8408
Conversation
…m when extra commas are present
packages/windows/data_stream/forwarded/elasticsearch/ingest_pipeline/security.yml
Outdated
Show resolved
Hide resolved
packages/windows/data_stream/forwarded/elasticsearch/ingest_pipeline/security.yml
Outdated
Show resolved
Hide resolved
🌐 Coverage report
|
There was a problem hiding this comment.
Since the original issue shows that the comma is preceded by a backslash, it seems to me that this could be done with a split processor; something like {"split": {"if": "ctx.winlog?.event_data?.MemberName != null", "field": "winlog.event_data.MemberName", "target_field": "_temp.MemberNameParts", "separator":"(?<!\\\\),"} with _temp.MemberNameParts being used as the direct source of the script's memberNameParts var.
@efd6 true, but we don't know if that's always the case or not, hence more of a generic approach was taken. |
I have asked at the original issue. If it is guaranteed, the simpler approach would be preferable. Note that you can use the key part of the list in a zw-look ahead. It's more costly than the lookbehind since that is only a single code point behind, but I still think preferable in terms of maintenance. |
|
Reference info for the distinguished name format:
Event IDs containing |
|
The key is in the table here. |
|
@efd6, @leehinman I've updated the PR with the split processor logic as suggested. |
packages/windows/data_stream/forwarded/elasticsearch/ingest_pipeline/security.yml
Show resolved
Hide resolved
…peline/security.yml Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
|
Package windows - 1.42.1 containing this change is available at https://epr.elastic.co/search?package=windows |
Type of change
Please label this PR with one of the following labels, depending on the scope of your change:
Proposed commit message
ISSUE: The Windows integration did not parse winlog.event_data.MemberName properly and map it to user.target.name when user CN contained extra "," characters. For example
CN=Reyes\, Elena (FFF),OU=Basic,OU=Domain Users,DC=ddd,DC=ccc,DC=fffwill be parsed to user.target.nameReyes\,which is wrong.FIX: Fixed parsing of winlog.event_data.MemberName in forwarded data stream by removing the old splitToken method and replaced it with a custom split processor logic that splits on the basis of commas but ignores escaped commas.
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots