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

API 4.0 Refactor lists, decoders and rules #4567

Merged
merged 15 commits into from
Mar 5, 2020

Conversation

davidjiglesias
Copy link
Member

@davidjiglesias davidjiglesias commented Feb 6, 2020

Related issue
#4565

Description

Hello team,

This PR closes #4565. It fixes the behaviour of new API endpoints GET /lists/files and GET /rules. It also refactors all decoders, lists and rules endpoints and framework modules.

API Call Examples

GET /rules:

curl -X GET "http://localhost:55000/rules?pretty=false&wait_for_complete=false&offset=0&limit=500&q=id%3D184678" -H  "accept: application/json" -H  "Authorization: Bearer {JWT_TOKEN}"
{
  "data": {
    "affected_items": [
      {
        "description": "Sysmon - Suspicious Process - lsm.exe is a Parent Image",
        "details": {
          "if_group": "sysmon_event1",
          "sysmon.parentImage": "lsm.exe"
        },
        "file": "0330-sysmon_rules.xml",
        "gdpr": [
          "IV_35.7.d"
        ],
        "gpg13": [],
        "groups": [
          "sysmon",
          "sysmon_process-anomalies"
        ],
        "hipaa": [
          "164.312.b"
        ],
        "id": 184678,
        "level": 12,
        "nist_800_53": [
          "AU.6",
          "SI.4"
        ],
        "path": "ruleset/rules",
        "pci": [
          "10.6.1",
          "11.4"
        ],
        "status": "enabled"
      }
    ],
    "failed_items": [],
    "total_affected_items": 2859,
    "total_failed_items": 0
  },
  "message": "All selected rules were shown"
}

GET /lists/files:

curl -X GET "http://localhost:55000/lists/files?pretty=false&wait_for_complete=false&offset=0&limit=500" -H  "accept: application/json" -H  "Authorization: Bearer {JWT_TOKEN}"
{
  "data": {
    "affected_items": [
      {
        "name": "audit-keys",
        "path": "etc/lists"
      },
      {
        "name": "security-eventchannel",
        "path": "etc/lists"
      },
      {
        "name": "aws-sources",
        "path": "etc/lists/amazon"
      },
      {
        "name": "aws-eventnames",
        "path": "etc/lists/amazon"
      }
    ],
    "failed_items": [],
    "total_affected_items": 4,
    "total_failed_items": 0
  },
  "message": "All specified paths were shown"
}

Tests

Rule unit test updated results:

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-5.3.2, py-1.8.1, pluggy-0.13.1
rootdir: /home/davidjiglesias/git/wazuh/framework
collected 22 items                                                                                                                                                                                                                           

wazuh/core/tests/test_rule.py ......................                                                                                                                                                                                   [100%]

======================================================================================================= 22 passed, 1 warning in 0.18s ========================================================================================================

Name                 Stmts   Miss  Cover   Missing
--------------------------------------------------
wazuh/core/rule.py     123      0   100%


============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-5.3.2, py-1.8.1, pluggy-0.13.1
rootdir: /home/davidjiglesias/git/wazuh/framework
collected 45 items                                                                                                                                                                                                                           

wazuh/tests/test_rule.py .............................................                                                                                                                                                                 [100%]

======================================================================================================= 45 passed, 1 warning in 0.44s ========================================================================================================

Name            Stmts   Miss  Cover   Missing
---------------------------------------------
wazuh/rule.py      90      0   100%

API rule integration test updated results:

Regular tests:

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collected 11 items                                                                                                                                                                                                                           

test/integration/test_rules_endpoints.tavern.yaml::GET /rules PASSED                                                                                                                                                                   [  9%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules filters PASSED                                                                                                                                                           [ 18%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules/requirement/pci PASSED                                                                                                                                                   [ 27%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules/requirement/gdpr PASSED                                                                                                                                                  [ 36%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules/requirement/gpg13 PASSED                                                                                                                                                 [ 45%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules/requirement/hipaa PASSED                                                                                                                                                 [ 54%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules/requirement/nist-800-53 PASSED                                                                                                                                           [ 63%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules/groups PASSED                                                                                                                                                            [ 72%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules/files PASSED                                                                                                                                                             [ 81%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules/files/{file}/download PASSED                                                                                                                                             [ 90%]
test/integration/test_rules_endpoints.tavern.yaml::GET /rules?rule_ids PASSED                                                                                                                                                          [100%]

============================================================================================================== warnings summary ==============================================================================================================
test/integration/test_rules_endpoints.tavern.yaml::GET /rules
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

test/integration/test_rules_endpoints.tavern.yaml::GET /rules
test/integration/test_rules_endpoints.tavern.yaml::GET /rules filters
  /home/davidjiglesias/.local/lib/python3.7/site-packages/tavern/util/dict_util.py:189: FutureWarning: In a future version of Tavern, selecting for values to save in nested objects will have to be done as a JMES path query - see http://jmespath.org/ for more information
    warnings.warn(msg, FutureWarning)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
================================================================================================== 11 passed, 3 warnings in 130.04 seconds ===================================================================================================

RBAC Black tests:

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collected 5 items                                                                                                                                                                                                                            

test/integration/test_rbac_black_rules_endpoints.tavern.yaml::GET RULES RBAC PASSED                                                                                                                                                    [ 20%]
test/integration/test_rbac_black_rules_endpoints.tavern.yaml::GET RULES FILES RBAC PASSED                                                                                                                                              [ 40%]
test/integration/test_rbac_black_rules_endpoints.tavern.yaml::GET RULES FILES RBAC (Download) PASSED                                                                                                                                   [ 60%]
test/integration/test_rbac_black_rules_endpoints.tavern.yaml::GET RULES GROUPS RBAC PASSED                                                                                                                                             [ 80%]
test/integration/test_rbac_black_rules_endpoints.tavern.yaml::GET PCI REQUIREMENT RBAC PASSED                                                                                                                                          [100%]

============================================================================================================== warnings summary ==============================================================================================================
test/integration/test_rbac_black_rules_endpoints.tavern.yaml::GET RULES RBAC
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================================================================================================== 5 passed, 1 warnings in 44.59 seconds ====================================================================================================

RBAC White tests:

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collected 5 items                                                                                                                                                                                                                            

test/integration/test_rbac_white_rules_endpoints.tavern.yaml::GET RULES RBAC PASSED                                                                                                                                                    [ 20%]
test/integration/test_rbac_white_rules_endpoints.tavern.yaml::GET RULES FILES RBAC PASSED                                                                                                                                              [ 40%]
test/integration/test_rbac_white_rules_endpoints.tavern.yaml::GET RULES FILES RBAC (Download) PASSED                                                                                                                                   [ 60%]
test/integration/test_rbac_white_rules_endpoints.tavern.yaml::GET RULES GROUPS RBAC PASSED                                                                                                                                             [ 80%]
test/integration/test_rbac_white_rules_endpoints.tavern.yaml::GET PCI REQUIREMENT RBAC PASSED                                                                                                                                          [100%]

============================================================================================================== warnings summary ==============================================================================================================
test/integration/test_rbac_white_rules_endpoints.tavern.yaml::GET RULES RBAC
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================================================================================================== 5 passed, 1 warnings in 40.93 seconds ====================================================================================================

Cdb_list unit test updated results:

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-5.3.2, py-1.8.1, pluggy-0.13.1
rootdir: /home/davidjiglesias/git/wazuh/framework
collected 47 items                                                                                                                                                                                                                           

wazuh/tests/test_cdb_list.py ...............................................                                                                                                                                                           [100%]

======================================================================================================= 47 passed, 1 warning in 0.23s ========================================================================================================

Name                Stmts   Miss  Cover   Missing
-------------------------------------------------
wazuh/cdb_list.py      25      0   100%

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-5.3.2, py-1.8.1, pluggy-0.13.1
rootdir: /home/davidjiglesias/git/wazuh/framework
collected 22 items                                                                                                                                                                                                                           

wazuh/core/tests/test_cdb_list.py ......................                                                                                                                                                                               [100%]

============================================================================================================= 22 passed in 0.08s =============================================================================================================

Name                     Stmts   Miss  Cover   Missing
------------------------------------------------------
wazuh/core/cdb_list.py      50      0   100%

API cdb_lists integration test updated results:

Regular tests:

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collected 2 items                                                                                                                                                                                                                            

test/integration/test_lists_endpoints.tavern.yaml::GET /lists PASSED                                                                                                                                                                   [ 50%]
test/integration/test_lists_endpoints.tavern.yaml::GET /lists/files PASSED                                                                                                                                                             [100%]

============================================================================================================== warnings summary ==============================================================================================================
test/integration/test_lists_endpoints.tavern.yaml::GET /lists
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

test/integration/test_lists_endpoints.tavern.yaml::GET /lists
test/integration/test_lists_endpoints.tavern.yaml::GET /lists/files
  /home/davidjiglesias/.local/lib/python3.7/site-packages/tavern/util/dict_util.py:189: FutureWarning: In a future version of Tavern, selecting for values to save in nested objects will have to be done as a JMES path query - see http://jmespath.org/ for more information
    warnings.warn(msg, FutureWarning)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================================================================================================== 2 passed, 3 warnings in 79.46 seconds ====================================================================================================

RBAC Black:

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collected 2 items                                                                                                                                                                                                                            

test/integration/test_rbac_black_lists_endpoints.tavern.yaml::GET LISTS RBAC PASSED                                                                                                                                                    [ 50%]
test/integration/test_rbac_black_lists_endpoints.tavern.yaml::GET LISTS FILES RBAC PASSED                                                                                                                                              [100%]

============================================================================================================== warnings summary ==============================================================================================================
test/integration/test_rbac_black_lists_endpoints.tavern.yaml::GET LISTS RBAC
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================================================================================================== 2 passed, 1 warnings in 39.42 seconds ====================================================================================================

RBAC White:

============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collected 2 items                                                                                                                                                                                                                            

test/integration/test_rbac_white_lists_endpoints.tavern.yaml::GET LISTS RBAC PASSED                                                                                                                                                    [ 50%]
test/integration/test_rbac_white_lists_endpoints.tavern.yaml::GET LISTS FILES RBAC PASSED                                                                                                                                              [100%]

============================================================================================================== warnings summary ==============================================================================================================
test/integration/test_rbac_white_lists_endpoints.tavern.yaml::GET LISTS RBAC
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================================================================================================== 2 passed, 1 warnings in 40.55 seconds ====================================================================================================

@davidjiglesias davidjiglesias self-assigned this Feb 6, 2020
framework/wazuh/core/tests/test_cdb_list.py Outdated Show resolved Hide resolved
framework/wazuh/core/tests/test_cdb_list.py Outdated Show resolved Hide resolved
@davidjiglesias
Copy link
Member Author

Updated Rule integration test results:

Rule normal tests: (The one failing is due to wazuh/wazuh-ruleset#562)

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 11 items

test_rules_endpoints.tavern.yaml::GET /rules PASSED                      [  9%]
test_rules_endpoints.tavern.yaml::GET /rules filters PASSED              [ 18%]
test_rules_endpoints.tavern.yaml::GET /rules/requirement/pci_dss PASSED  [ 27%]
test_rules_endpoints.tavern.yaml::GET /rules/requirement/gdpr PASSED     [ 36%]
test_rules_endpoints.tavern.yaml::GET /rules/requirement/gpg13 FAILED    [ 45%]
test_rules_endpoints.tavern.yaml::GET /rules/requirement/hipaa PASSED    [ 54%]
test_rules_endpoints.tavern.yaml::GET /rules/requirement/nist-800-53 PASSED [ 63%]
test_rules_endpoints.tavern.yaml::GET /rules/groups PASSED               [ 72%]
test_rules_endpoints.tavern.yaml::GET /rules/files PASSED                [ 81%]
test_rules_endpoints.tavern.yaml::GET /rules/files/{filename}/download PASSED [ 90%]
test_rules_endpoints.tavern.yaml::GET /rules?rule_ids PASSED             [100%]

============== 1 failed, 10 passed, 3 warnings in 133.49 seconds ===============

Rule black rbac:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 5 items

test_rbac_black_rules_endpoints.tavern.yaml::GET RULES RBAC PASSED       [ 20%]
test_rbac_black_rules_endpoints.tavern.yaml::GET RULES FILES RBAC PASSED [ 40%]
test_rbac_black_rules_endpoints.tavern.yaml::GET RULES FILES RBAC (Download) PASSED [ 60%]
test_rbac_black_rules_endpoints.tavern.yaml::GET RULES GROUPS RBAC PASSED [ 80%]
test_rbac_black_rules_endpoints.tavern.yaml::GET pci_dss REQUIREMENT RBAC PASSED [100%]

=============================== warnings summary ===============================
test/integration/test_rbac_black_rules_endpoints.tavern.yaml::GET RULES RBAC
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================== 5 passed, 1 warnings in 43.50 seconds =====================

Rule white rbac:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 5 items

test_rbac_white_rules_endpoints.tavern.yaml::GET RULES RBAC PASSED       [ 20%]
test_rbac_white_rules_endpoints.tavern.yaml::GET RULES FILES RBAC PASSED [ 40%]
test_rbac_white_rules_endpoints.tavern.yaml::GET RULES FILES RBAC (Download) PASSED [ 60%]
test_rbac_white_rules_endpoints.tavern.yaml::GET RULES GROUPS RBAC PASSED [ 80%]
test_rbac_white_rules_endpoints.tavern.yaml::GET pci_dss REQUIREMENT RBAC PASSED [100%]

=============================== warnings summary ===============================
test/integration/test_rbac_white_rules_endpoints.tavern.yaml::GET RULES RBAC
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================== 5 passed, 1 warnings in 39.55 seconds =====================

@davidjiglesias
Copy link
Member Author

Updated Rule unit test results:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/framework
plugins: tavern-0.34.0
collecting ... collected 21 items

==================== 21 passed, 1 warnings in 0.14 seconds =====================

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/framework
plugins: tavern-0.34.0
collecting ... collected 45 items

==================== 45 passed, 1 warnings in 0.33 seconds =====================

@davidjiglesias davidjiglesias changed the title Fix API 4.0 bugs for GET /lists/files y GET /rules Refactor lists, decoders and rules in the new API Feb 18, 2020
@davidjiglesias davidjiglesias changed the title Refactor lists, decoders and rules in the new API API 4.0 Refactor lists, decoders and rules Feb 18, 2020
@davidjiglesias
Copy link
Member Author

davidjiglesias commented Feb 18, 2020

Updated Decoder integration test results:

Decoder normal tests:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 23 items

test_decoders_endpoints.tavern.yaml::GET /decoders PASSED                [  4%]
test_decoders_endpoints.tavern.yaml::GET /decoders[filename] PASSED      [  8%]
test_decoders_endpoints.tavern.yaml::GET /decoders[relative_path] PASSED [ 13%]
test_decoders_endpoints.tavern.yaml::GET /decoders[name] PASSED          [ 17%]
test_decoders_endpoints.tavern.yaml::GET /decoders[position] PASSED      [ 21%]
test_decoders_endpoints.tavern.yaml::GET /decoders[status] PASSED        [ 26%]
test_decoders_endpoints.tavern.yaml::GET /decoders/{decoder_name} PASSED [ 30%]
test_decoders_endpoints.tavern.yaml::GET /decoders/{decoder_name}[filename] PASSED [ 34%]
test_decoders_endpoints.tavern.yaml::GET /decoders/{decoder_name}[relative_path] PASSED [ 39%]
test_decoders_endpoints.tavern.yaml::GET /decoders/{decoder_name}[name] PASSED [ 43%]
test_decoders_endpoints.tavern.yaml::GET /decoders/{decoder_name}[position] PASSED [ 47%]
test_decoders_endpoints.tavern.yaml::GET /decoders/{decoder_name}[status] PASSED [ 52%]
test_decoders_endpoints.tavern.yaml::GET /decoders/files PASSED          [ 56%]
test_decoders_endpoints.tavern.yaml::GET /decoders/files[filename] PASSED [ 60%]
test_decoders_endpoints.tavern.yaml::GET /decoders/files[relative_path] PASSED [ 65%]
test_decoders_endpoints.tavern.yaml::GET /decoders/files[status] PASSED  [ 69%]
test_decoders_endpoints.tavern.yaml::GET /decoders/parents PASSED        [ 73%]
test_decoders_endpoints.tavern.yaml::GET /decoders/parents[filename] PASSED [ 78%]
test_decoders_endpoints.tavern.yaml::GET /decoders/parents[name] PASSED  [ 82%]
test_decoders_endpoints.tavern.yaml::GET /decoders/parents[relative_path] PASSED [ 86%]
test_decoders_endpoints.tavern.yaml::GET /decoders/parents[position] PASSED [ 91%]
test_decoders_endpoints.tavern.yaml::GET /decoders/parents[status] PASSED [ 95%]
test_decoders_endpoints.tavern.yaml::GET /decoders/files/{file}/download PASSED [100%]

=================== 23 passed, 5 warnings in 790.18 seconds ====================

Decoder black rbac:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 4 items

test_rbac_black_decoders_endpoints.tavern.yaml::GET DECODERS RBAC PASSED [ 25%]
test_rbac_black_decoders_endpoints.tavern.yaml::GET DECODERS FILES RBAC PASSED [ 50%]
test_rbac_black_decoders_endpoints.tavern.yaml::GET DECODERS FILES RBAC (Download) PASSED [ 75%]
test_rbac_black_decoders_endpoints.tavern.yaml::GET DECODERS PARENTS RBAC PASSED [100%]

==================== 4 passed, 1 warnings in 41.43 seconds =====================

Decoder white rbac:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 4 items

test_rbac_white_decoders_endpoints.tavern.yaml::GET DECODERS RBAC PASSED [ 25%]
test_rbac_white_decoders_endpoints.tavern.yaml::GET DECODERS FILES RBAC PASSED [ 50%]
test_rbac_white_decoders_endpoints.tavern.yaml::GET DECODERS FILES RBAC (Download) PASSED [ 75%]
test_rbac_white_decoders_endpoints.tavern.yaml::GET DECODERS PARENTS RBAC PASSED [100%]

==================== 4 passed, 1 warnings in 41.47 seconds =====================

@davidjiglesias
Copy link
Member Author

Updated Decoder unit test results:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/framework
plugins: tavern-0.34.0
collecting ... collected 31 items

==================== 31 passed, 1 warnings in 0.32 seconds =====================
============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/framework
plugins: tavern-0.34.0
collecting ... collected 15 items

========================== 15 passed in 0.06 seconds ===========================

@davidjiglesias
Copy link
Member Author

davidjiglesias commented Feb 18, 2020

Updated Lists integration test results:

Lists normal tests:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 2 items

test_lists_endpoints.tavern.yaml::GET /lists PASSED                      [ 50%]
test_lists_endpoints.tavern.yaml::GET /lists/files PASSED                [100%]

=============================== warnings summary ===============================
test/integration/test_lists_endpoints.tavern.yaml::GET /lists
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

test/integration/test_lists_endpoints.tavern.yaml::GET /lists
test/integration/test_lists_endpoints.tavern.yaml::GET /lists/files
  /home/davidjiglesias/.local/lib/python3.7/site-packages/tavern/util/dict_util.py:189: FutureWarning: In a future version of Tavern, selecting for values to save in nested objects will have to be done as a JMES path query - see http://jmespath.org/ for more information
    warnings.warn(msg, FutureWarning)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================== 2 passed, 3 warnings in 856.48 seconds ====================

Lists black rbac:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 2 items

test_rbac_black_lists_endpoints.tavern.yaml::GET LISTS RBAC PASSED       [ 50%]
test_rbac_black_lists_endpoints.tavern.yaml::GET LISTS FILES RBAC PASSED [100%]

=============================== warnings summary ===============================
test/integration/test_rbac_black_lists_endpoints.tavern.yaml::GET LISTS RBAC
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================== 2 passed, 1 warnings in 40.07 seconds =====================

Lists white rbac:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/api
plugins: tavern-0.34.0
collecting ... collected 2 items

test_rbac_white_lists_endpoints.tavern.yaml::GET LISTS RBAC PASSED       [ 50%]
test_rbac_white_lists_endpoints.tavern.yaml::GET LISTS FILES RBAC PASSED [100%]

=============================== warnings summary ===============================
test/integration/test_rbac_white_lists_endpoints.tavern.yaml::GET LISTS RBAC
  /home/davidjiglesias/.local/lib/python3.7/site-packages/jwt/api_jwt.py:81: DeprecationWarning: It is strongly recommended that you pass in a value for the "algorithms" argument when calling decode(). This argument will be mandatory in a future version.
    DeprecationWarning

-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================== 2 passed, 1 warnings in 39.69 seconds =====================

@davidjiglesias
Copy link
Member Author

davidjiglesias commented Feb 18, 2020

Updated Lists unit test results:

============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/framework
plugins: tavern-0.34.0
collecting ... collected 22 items


========================== 22 passed in 0.09 seconds ===========================
============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-4.5.0, py-1.8.1, pluggy-0.13.1 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/davidjiglesias/git/wazuh/framework
plugins: tavern-0.34.0
collecting ... collected 47 items

==================== 47 passed, 1 warnings in 0.23 seconds =====================

@crd1985 crd1985 merged commit c0c0e44 into dev-flask-poc Mar 5, 2020
@crd1985 crd1985 deleted the dev-flask-poc-4565-fix-app-bugs branch March 5, 2020 11:30
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.

None yet

2 participants