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

Manual testing - Fix permission error in JSON alert #3133

Closed
1 task done
FrancoRivero opened this issue Jul 27, 2022 · 6 comments
Closed
1 task done

Manual testing - Fix permission error in JSON alert #3133

FrancoRivero opened this issue Jul 27, 2022 · 6 comments
Assignees

Comments

@FrancoRivero
Copy link

FrancoRivero commented Jul 27, 2022

Target version Related issue Related PR
4.5.0 wazuh/wazuh#12073 wazuh/wazuh#14019

Description

The goal of this issue is to manually test the change in analysisd to fix a bug which discards events when these events have a bad format in their permission. This bug was found in a stress test and this was tested in unit tests and it could not be reproduced manually.

Proposed checks

  • Create a stress tests for 24 hours and check that the error won't show in the logs.

Steps to reproduce

We could not reproduce this error manually because this error is generated in the Windows system when Wazuh has a lot of stress applied to it.
However we could detect a format inside a Windows permission which generates a error to reproduce it. this would be:

USER (allowed or denied): permission_1|permission_2|permission_3,USER2 (allowed or denied): permission_1|permission_2|permission_3

If the permission does not have this format then this permission is skipped and the next one is searched in this case if USER fails to have the format then this permission is skipped and USER2 is searched.

Expected results

The error wazuh-analysisd: ERROR: The new permissions could not be added to the JSON alert.
should not be seen in the log but, depending on the error, we should see a message in debug1 such as :

Uncontrolled condition when parsing the username from 'USERNAME'. Skipping permission. or
Uncontrolled condition when parsing the permission type from 'PERM_TYPE'. Skipping permission.

Configuration and considerations

This bug can be reproduced with this configuration

@chemamartinez
Copy link
Contributor

Hi @wazuh/qa, this issue cannot be started until PR wazuh/wazuh#14019 is ready. We still have to reach 100% green in Jenkins and complete the review.

Sorry for the inconvenience.

@jmv74211 jmv74211 added this to the Core PRs approval - 4.4.0 milestone Aug 1, 2022
@chemamartinez
Copy link
Contributor

@wazuh/qa the pull request is now completed.

@Deblintrake09
Copy link
Contributor

Deblintrake09 commented Aug 10, 2022

Review data

Tester PR commit
@Deblintrake09 850faee

Testing environment

OS OS version Deployment Image/AMI Notes
Windows <JENKINS | Stress Pipeline

Tested packages

wazuh-manager wazuh-agent
.rpm Manager msi Agent

Status

  • In progress
  • Pending Review
  • Team leader approved
  • Manager approved

@Deblintrake09
Copy link
Contributor

Update 2022/08/10

  • Research Issue
  • Generate packages
  • Launch Stress test instances 🔴

@Deblintrake09
Copy link
Contributor

Deblintrake09 commented Aug 29, 2022

Task Results

Integration Tests

System path Results Notes
Windows test_fim/ 🟢 🟢 🟢

Stress Tests

Test run duration results Debug Level
R1 2.5 days 🟢 Debug 2
R2 2.5 days 🟢 Debug1
R3 2.5 days 🟢 Debug1
R4 2.5 days 🟢 Debug1
R5 1 day 🟢 Debug 2
R6 1 day 🟢 Debug 2
R7 1 day 🟢 Debug 2
R8 1 day 🟢 Debug 2

@jmv74211
Copy link
Contributor

jmv74211 commented Sep 7, 2022

The QA team has not been able to reproduce the bug as such. The development team has created unit tests that test similar cases and it is tested in this way. QA has manually tested that the bug does not occur, and FIM regression tests have been launched.

@jmv74211 jmv74211 closed this as completed Sep 7, 2022
@jmv74211 jmv74211 modified the milestones: Core PRs approval - 4.4.0, Core PRs approval - 4.5.0 Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants