-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x-pack/filebeat : Sanitize cel input resource trace filename #35154
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
* Also contains fixes for httpjson input
This pull request is now in conflicts. Could you fix it? 🙏
|
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
This pull request is now in conflicts. Could you fix it? 🙏
|
@@ -25,12 +26,14 @@ import ( | |||
) | |||
|
|||
func TestInput(t *testing.T) { | |||
tempDirectory := t.TempDir() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather see each sub-test use its own unique temp dir to ensure test isolation. But with only one test using this directory it's only a minor concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change the structure to achieve this. To inject tempDir
into the config which is currently a Map
I felt difficult with current setup. As you said for one test using it , this should be a big change for the value it gives.
Merging the PR as the |
* Sanitize cel input resource trace filename * Also contains fixes for httpjson input * Send expected file through config * Fix windows tests (cherry picked from commit bebe337)
…#35201) * Sanitize cel input resource trace filename * Also contains fixes for httpjson input * Send expected file through config * Fix windows tests (cherry picked from commit bebe337) Co-authored-by: Bharat Pasupula <[email protected]>
@@ -31,594 +31,655 @@ import ( | |||
"github.com/elastic/elastic-agent-libs/mapstr" | |||
) | |||
|
|||
var inputTests = []struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice this (hidden for GitHub folding changes). It should not have been changed; large change with no reason.
Fix #35220
…#35154) * Sanitize cel input resource trace filename * Also contains fixes for httpjson input * Send expected file through config * Fix windows tests
* Sanitize cel input resource trace filename * Also contains fixes for httpjson input * Send expected file through config * Fix windows tests
What does this PR do?
This PR sanitizes the request.tracer.filename in filebeat config to replace : and / characters with _ character.
Why is it important?
There is a problem with different path separators between HFS+ (colon, ':') and UFS (slash, '/'). This also means that HFS+ file names may contain the slash character and not colons, while the opposite is true for UFS file names. Reference
So the file structure seems to be corrupted in MacOS if the filename has : and the same happens in Unix based systems if the filename has /. Hence replacing them with _.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.