-
Notifications
You must be signed in to change notification settings - Fork 529
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
[Bug] Hunting - Add UTF-8 Encoding for all Read and Write Operations #3886
Merged
terrancedejesus
merged 6 commits into
main
from
bug-hunting-encoding-content-from-files
Jul 11, 2024
Merged
[Bug] Hunting - Add UTF-8 Encoding for all Read and Write Operations #3886
terrancedejesus
merged 6 commits into
main
from
bug-hunting-encoding-content-from-files
Jul 11, 2024
Conversation
This file contains 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
Collaborator
Bug - GuidelinesThese guidelines serve as a reminder set of considerations when addressing a bug in the code. Documentation and Context
Code Standards and Practices
Testing
Additional Checks
|
shashank-elastic
approved these changes
Jul 11, 2024
Mikaayenson
approved these changes
Jul 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport: auto
bug
Something isn't working
python
Internal python for the repository
threat hunting
Related to hunting/ library.
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.
Pull Request
Issue link(s):
Summary - What I changed
⚡ A list of hunting queries (see below) had
ñ
characters in the regex when normalizing paths in ES|QL queries. This was added intentionally to match on that character. However, when runninghunting/generate_markdown.py
script, we did not include UTF-8 encoding on the content when loading the TOML file, only when writing to Markdown. As a result @Aegrah pointed out that theñ
changed when writing to the Markdown files from a Windows host.This is likely because UTF-8 was used on the writing operations and not the loading.
List of hunts affected:
Note that the hunts listed, both TOML and MD files, are correct in main and do not require further adjustment.
How To Test
python ~/detection-rules/hunting/generate_markdown.py
bug-hunting-encoding-content-from-files
branchpython ~/detection-rules/hunting/generate_markdown.py
Checklist
bug
,enhancement
,Rule: New
,Rule: Deprecation
,Rule: Promote
,Rule: Tuning
,Hunt: New
, orHunt: Tuning
so guidelines can be generatedmeta:rapid-merge
label if planning to merge within 24 hoursContributor checklist