Skip to content
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

Fix ReplaceStringTransformation and SigmaString plain string conversion #273

Merged
merged 2 commits into from
Sep 8, 2024

Conversation

thomaspatzke
Copy link
Member

This pull request fixes the behavior of the ReplaceStringTransformation and SigmaString classes. The ReplaceStringTransformation now works on the plain string representation of the SigmaString, allowing for special characters and placeholders in the replacement. Additionally, the SigmaString class now distinguishes between regex and string context in the to_plain() method and behaves differently on escaping. The pull request also includes an option in the ReplaceStringTransformation to skip special characters in the replacement.

* Reverted ReplaceStringTransformation to work on the whole SigmaString as plain string representation because backends/pipelines rely on this feature.
* ReplaceStringTransformation former misbehavior of "consuming" backslashes mitigated by doubling backslashes without escaping semantics.
* SigmaString now distinguishes in to_plain() method if it is in regex or string context and behaves differently on escaping.
* SigmaDetectionItem.to_plain() now also distinguishes between strings andregex.
@thomaspatzke thomaspatzke merged commit 0119040 into main Sep 8, 2024
30 checks passed
@thomaspatzke thomaspatzke deleted the fix-sigmastring branch September 13, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant