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 RBAC group_id matching #9192

Merged
merged 2 commits into from
Jul 6, 2021
Merged

Conversation

vicferpoy
Copy link
Contributor

Related issue
closes #9068

Description

Hello team,

This PR fixes the RBAC group_id matching issue and adds new unit tests to catch it, as we did not have any related test.

More information about this can be found in the issue: #9068 (comment)

Tests performed

Unit tests

==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.9.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/vicferpoy/Desktop/Git/wazuh/framework
plugins: cov-2.12.0, asyncio-0.15.1
collected 1582 items                                                                                                                                                                        

wazuh/core/cluster/dapi/tests/test_dapi.py .......................                                                                                                                    [  1%]
wazuh/core/cluster/tests/test_cluster.py ...................                                                                                                                          [  2%]
wazuh/core/cluster/tests/test_common.py .......                                                                                                                                       [  3%]
wazuh/core/cluster/tests/test_control.py .....                                                                                                                                        [  3%]
wazuh/core/cluster/tests/test_local_client.py .                                                                                                                                       [  3%]
wazuh/core/cluster/tests/test_utils.py .......                                                                                                                                        [  3%]
wazuh/core/cluster/tests/test_worker.py .................                                                                                                                             [  4%]
wazuh/core/tests/test_active_response.py ..............                                                                                                                               [  5%]
wazuh/core/tests/test_agent.py ...................................................................................................................................................... [ 15%]
................                                                                                                                                                                      [ 16%]
wazuh/core/tests/test_cdb_list.py ......................................                                                                                                              [ 18%]
wazuh/core/tests/test_common.py .......                                                                                                                                               [ 19%]
wazuh/core/tests/test_configuration.py ....................................                                                                                                           [ 21%]
wazuh/core/tests/test_decoder.py ................                                                                                                                                     [ 22%]
wazuh/core/tests/test_input_validator.py ...                                                                                                                                          [ 22%]
wazuh/core/tests/test_logtest.py ..                                                                                                                                                   [ 22%]
wazuh/core/tests/test_manager.py ...............                                                                                                                                      [ 23%]
wazuh/core/tests/test_mitre.py .............                                                                                                                                          [ 24%]
wazuh/core/tests/test_pyDaemonModule.py .....                                                                                                                                         [ 24%]
wazuh/core/tests/test_results.py ........................................                                                                                                             [ 27%]
wazuh/core/tests/test_rootcheck.py ..........                                                                                                                                         [ 28%]
wazuh/core/tests/test_rule.py ......................                                                                                                                                  [ 29%]
wazuh/core/tests/test_stats.py ....                                                                                                                                                   [ 29%]
wazuh/core/tests/test_syscollector.py ...                                                                                                                                             [ 29%]
wazuh/core/tests/test_utils.py ...................................................................................................................................................... [ 39%]
.........................................................................                                                                                                             [ 43%]
wazuh/core/tests/test_vulnerability.py .                                                                                                                                              [ 44%]
wazuh/core/tests/test_wazuh_queue.py ..................                                                                                                                               [ 45%]
wazuh/core/tests/test_wazuh_socket.py ....................                                                                                                                            [ 46%]
wazuh/core/tests/test_wdb.py ......................                                                                                                                                   [ 47%]
wazuh/rbac/tests/test_auth_context.py ..                                                                                                                                              [ 47%]
wazuh/rbac/tests/test_decorators.py .........................................................................................................                                         [ 54%]
wazuh/rbac/tests/test_default_configuration.py .......................................................                                                                                [ 58%]
wazuh/rbac/tests/test_orm.py ......................................................                                                                                                   [ 61%]
wazuh/rbac/tests/test_preprocessor.py ...........                                                                                                                                     [ 62%]
wazuh/tests/test_active_response.py ............                                                                                                                                      [ 62%]
wazuh/tests/test_agent.py .............................................................................................................                                               [ 69%]
wazuh/tests/test_cdb_list.py .....................................................                                                                                                    [ 73%]
wazuh/tests/test_ciscat.py .................................                                                                                                                          [ 75%]
wazuh/tests/test_cluster.py .......                                                                                                                                                   [ 75%]
wazuh/tests/test_decoder.py ...................................                                                                                                                       [ 77%]
wazuh/tests/test_group.py ........                                                                                                                                                    [ 78%]
wazuh/tests/test_logtest.py ......                                                                                                                                                    [ 78%]
wazuh/tests/test_manager.py ..................................                                                                                                                        [ 80%]
wazuh/tests/test_mitre.py .......                                                                                                                                                     [ 81%]
wazuh/tests/test_rootcheck.py ..................................................                                                                                                      [ 84%]
wazuh/tests/test_rule.py ........................................................                                                                                                     [ 88%]
wazuh/tests/test_sca.py .......                                                                                                                                                       [ 88%]
wazuh/tests/test_security.py ............................................................................                                                                             [ 93%]
wazuh/tests/test_stats.py ................                                                                                                                                            [ 94%]
wazuh/tests/test_syscheck.py .......................                                                                                                                                  [ 95%]
wazuh/tests/test_syscollector.py ............                                                                                                                                         [ 96%]
wazuh/tests/test_task.py ............................                                                                                                                                 [ 98%]
wazuh/tests/test_vulnerability.py ..........................                                                                                                                          [100%]

======================================================================= 1582 passed, 14 warnings in 251.58s (0:04:11) =======================================================================

Regards,
Víctor

@vicferpoy vicferpoy self-assigned this Jul 5, 2021
@mcarmona99 mcarmona99 self-requested a review July 5, 2021 10:13
Copy link
Contributor

@mcarmona99 mcarmona99 left a comment

Choose a reason for hiding this comment

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

LGTM!

@davidjiglesias davidjiglesias merged commit 1a35921 into master Jul 6, 2021
@davidjiglesias davidjiglesias deleted the fix/9068-group-id-matching-rbac branch July 6, 2021 08:15
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.

Incorrect group_id matching in API RBAC
3 participants