Properly populate file.* fields for network share events#18348
Open
brian-mckinney wants to merge 2 commits intoelastic:mainfrom
Open
Properly populate file.* fields for network share events#18348brian-mckinney wants to merge 2 commits intoelastic:mainfrom
brian-mckinney wants to merge 2 commits intoelastic:mainfrom
Conversation
| "extension": "docx", | ||
| "name": "summary.docx", | ||
| "path": "C:\\Shares\\Documents\\reports\\Q1\\summary.docx", | ||
| "target_path": "\\\\\\\\*\\\\Documents\\\\\\reports\\\\Q1\\\\summary.docx" |
There was a problem hiding this comment.
🟡 Medium pipeline/test-security-5145.json-expected.json:28
The file.target_path value on line 28 contains inconsistent backslash escaping. The JSON \\\reports decodes to 3 actual backslashes while \\Q1 and \\summary.docx decode to 2 backslashes, creating a malformed UNC path that doesn't match expected Windows path formats. This typo will cause pipeline test failures when the actual implementation produces consistently escaped output.
Suggested change
| "target_path": "\\\\\\\\*\\\\Documents\\\\\\reports\\\\Q1\\\\summary.docx" | |
| "target_path": "\\\\*\\Documents\\reports\\Q1\\summary.docx" |
🤖 Copy this AI Prompt to have your agent fix this:
In file packages/windows/data_stream/forwarded/_dev/test/pipeline/test-security-5145.json-expected.json around line 28:
The `file.target_path` value on line 28 contains inconsistent backslash escaping. The JSON `\\\reports` decodes to 3 actual backslashes while `\\Q1` and `\\summary.docx` decode to 2 backslashes, creating a malformed UNC path that doesn't match expected Windows path formats. This typo will cause pipeline test failures when the actual implementation produces consistently escaped output.
💔 Build Failed
Failed CI StepsHistory |
🚀 Benchmarks reportTo see the full report comment with |
|
Pinging @elastic/sec-windows-platform (Team:Security-Windows Platform) |
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.
Proposed commit message
Network share events were not correctly populating the file.* fields according to the ECS Schema.
These fields have a
ShareLocalPathand aRelativeTargetName, we were simply using those fields forfile.directoryandfile.namerespectively.RelativeTargetNamehowever is all parts of the path after the share name, including the filename. For example:ECS Schema says
file.nameshould be the name of the file including extension. This PR applies logic to the two fields to construct the full path and use that to populate the fields accordinglyChecklist
changelog.ymlfile.Related issues
Fixes: https://github.com/elastic/sdh-beats/issues/7064