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

[BUG] Plugin crash when searching with a query with syntax errors in Modules/Security events #4237

Conversation

Desvelao
Copy link
Member

@Desvelao Desvelao commented Jun 9, 2022

Description

This PR fixes a plugin crash when searching with a query with syntax errors in Modules/Security events.

Screenshot
image

Closes #4168

Test

  • Go to Modules/Security events and search with a query with syntax errors, by example:
    test()
    The plugin UI should not crash and should display toast messages with the errors.

…ery syntax in Modules/Security events

Replaced the error level from `CRITICAL` to `BUSINESS`. With this
change, a toast will be displayed with the error.

Removed the storing of the error in the plugin logs related to UI.

Removed unused variable
@Desvelao Desvelao force-pushed the fix/4168-plugin-crash-search-syntax-error-modules-security-events branch from 065c06d to ef1b06e Compare June 9, 2022 14:24
@Desvelao Desvelao linked an issue Jun 9, 2022 that may be closed by this pull request
Copy link
Member

@AlexRuiz7 AlexRuiz7 left a comment

Choose a reason for hiding this comment

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

Code review: ✔️
Test: ✔️

Copy link
Member

@Machi3mfl Machi3mfl left a comment

Choose a reason for hiding this comment

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

CR ✅
Test ✅

Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

CR: ✔️
Test: ✔️

the issue is resolved, 2 issues were found after resolving this issue

@github-actions
Copy link
Contributor

Jest Test Coverage % values
Statements 4.09% ( 1489 / 36383 )
Branches 1.67% ( 473 / 28242 )
Functions 3.06% ( 272 / 8897 )
Lines 4.14% ( 1440 / 34801 )

@AlexRuiz7 AlexRuiz7 merged commit 431c204 into 4.3-7.10 Jun 13, 2022
@AlexRuiz7 AlexRuiz7 deleted the fix/4168-plugin-crash-search-syntax-error-modules-security-events branch June 13, 2022 15:47
@github-actions
Copy link
Contributor

The backport to 4.3-7.16 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.3-7.16 4.3-7.16
# Navigate to the new working tree
cd .worktrees/backport-4.3-7.16
# Create a new branch
git switch --create backport-4237-to-4.3-7.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 431c20465264e9dc490fa58dcf1287a727ae9b1e
# Push it to GitHub
git push --set-upstream origin backport-4237-to-4.3-7.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.3-7.16

Then, create a pull request where the base branch is 4.3-7.16 and the compare/head branch is backport-4237-to-4.3-7.16.

@github-actions
Copy link
Contributor

The backport to 4.3-1.2-wzd failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.3-1.2-wzd 4.3-1.2-wzd
# Navigate to the new working tree
cd .worktrees/backport-4.3-1.2-wzd
# Create a new branch
git switch --create backport-4237-to-4.3-1.2-wzd
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 431c20465264e9dc490fa58dcf1287a727ae9b1e
# Push it to GitHub
git push --set-upstream origin backport-4237-to-4.3-1.2-wzd
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.3-1.2-wzd

Then, create a pull request where the base branch is 4.3-1.2-wzd and the compare/head branch is backport-4237-to-4.3-1.2-wzd.

Desvelao added a commit that referenced this pull request Jun 17, 2022
…Modules/Security events (#4237)

* fix: fixed plugin UI crash when there is an error related to wrong query syntax in Modules/Security events

Replaced the error level from `CRITICAL` to `BUSINESS`. With this
change, a toast will be displayed with the error.

Removed the storing of the error in the plugin logs related to UI.

Removed unused variable

* changelog: Add PR entry

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
Desvelao added a commit that referenced this pull request Jun 17, 2022
…Modules/Security events (#4237)

* fix: fixed plugin UI crash when there is an error related to wrong query syntax in Modules/Security events

Replaced the error level from `CRITICAL` to `BUSINESS`. With this
change, a toast will be displayed with the error.

Removed the storing of the error in the plugin logs related to UI.

Removed unused variable

* changelog: Add PR entry

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
Desvelao added a commit that referenced this pull request Jun 17, 2022
…Modules/Security events (#4237)

* fix: fixed plugin UI crash when there is an error related to wrong query syntax in Modules/Security events

Replaced the error level from `CRITICAL` to `BUSINESS`. With this
change, a toast will be displayed with the error.

Removed the storing of the error in the plugin logs related to UI.

Removed unused variable

* changelog: Add PR entry

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
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.

Invalid search leads to page crash
4 participants