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: improve rule ID detection #436

Merged
merged 2 commits into from
Jan 3, 2025
Merged

Conversation

theseion
Copy link
Collaborator

@theseion theseion commented Jan 3, 2025

  • use two separate regular expressions to find rule IDs, one for the standard log format, and one for JSON as fallback
  • be stricter about the format, especially for IDs in JSON

Fixes #435

- use two separate regular expressions to find rule IDs, one for the
  standard log format, and one for JSON as fallback
- be stricter about the format, especially for IDs in JSON

Fixes coreruleset#435
Copy link
Member

@M4tteoP M4tteoP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
Just for confirmation, this issue has not been introduced by #410, because it is related to the second part of the regex that was |"id":\s*"?(\d+)"?. This PR makes this part stricter and moves it to a new regex. Am I reading this correctly?

@theseion
Copy link
Collaborator Author

theseion commented Jan 3, 2025

Yes, the issue would have existed before already.

@theseion theseion merged commit 7806472 into coreruleset:main Jan 3, 2025
4 checks passed
@theseion theseion deleted the fix-id-detection branch January 3, 2025 12:11
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.

go-ftw finds IDs in arguments
2 participants