Skip to content

Commit

Permalink
deactivate tests and update config
Browse files Browse the repository at this point in the history
  • Loading branch information
mauromalara committed Dec 20, 2023
1 parent 829d685 commit c5879d2
Show file tree
Hide file tree
Showing 42 changed files with 75 additions and 252 deletions.
28 changes: 2 additions & 26 deletions provisioning/roles/wazuh/ansible-wazuh-manager/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,32 +173,8 @@ wazuh_manager_sca:
## Vulnerability Detector
wazuh_manager_vulnerability_detector:
enabled: 'no'
interval: '5m'
run_on_start: 'yes'
providers:
- enabled: 'no'
os:
- 'trusty'
- 'xenial'
- 'bionic'
update_interval: '1h'
name: '"canonical"'
- enabled: 'no'
os:
- 'wheezy'
- 'stretch'
- 'jessie'
- 'buster'
update_interval: '1h'
name: '"debian"'
- enabled: 'no'
update_from_year: '2010'
update_interval: '1h'
name: '"redhat"'
- enabled: 'no'
update_from_year: '2010'
update_interval: '1h'
name: '"nvd"'
index_status: 'yes'
feed_update_interval: '60m'

## Syscheck
wazuh_manager_syscheck:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,31 +262,11 @@
{% if wazuh_manager_config.vulnerability_detector.enabled is defined %}
<enabled>{{ wazuh_manager_config.vulnerability_detector.enabled }}</enabled>
{% endif %}
{% if wazuh_manager_config.vulnerability_detector.interval is defined %}
<interval>{{ wazuh_manager_config.vulnerability_detector.interval }}</interval>
{% if wazuh_manager_config.vulnerability_detector.index_status is defined %}
<index-status>{{ wazuh_manager_config.vulnerability_detector.index_status }}</index-status>
{% endif %}
{% if wazuh_manager_config.vulnerability_detector.run_on_start is defined %}
<run_on_start>{{ wazuh_manager_config.vulnerability_detector.run_on_start }}</run_on_start>
{% endif %}
{% if wazuh_manager_config.vulnerability_detector.providers is defined %}
{% for provider_ in wazuh_manager_config.vulnerability_detector.providers %}
<provider name={{ provider_.name }}>
{% if provider_.enabled is defined %}
<enabled>{{ provider_.enabled }}</enabled>
{% endif %}
{% if provider_.os is defined %}
{% for os_ in provider_.os %}
<os>{{ os_ }}</os>
{% endfor %}
{% endif %}
{% if provider_.update_from_year is defined %}
<update_from_year>{{ provider_.update_from_year }}</update_from_year>
{% endif %}
{% if provider_.update_interval is defined %}
<update_interval>{{ provider_.update_interval }}</update_interval>
{% endif %}
</provider>
{% endfor %}
{% if wazuh_manager_config.vulnerability_detector.feed_update_interval is defined %}
<feed-update-interval>{{ wazuh_manager_config.vulnerability_detector.feed_update_interval }}</feed-update-interval>
{% endif %}
</vulnerability-detector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,8 @@
config_block: |
<vulnerability-detector>
<enabled>yes</enabled>
<interval>60s</interval>
<min_full_scan_interval>60s</min_full_scan_interval>
<run_on_start>yes</run_on_start>
<!-- Ubuntu OS vulnerabilities -->
<provider name="canonical">
<enabled>yes</enabled>
<os>jammy</os>
<update_interval>1h</update_interval>
</provider>
<!-- Aggregate vulnerabilities -->
<provider name="nvd">
<enabled>yes</enabled>
<update_interval>1h</update_interval>
</provider>
<index-status>yes</index-status>
<feed-update-interval>60m</feed-update-interval>
</vulnerability-detector>
os: linux

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,8 @@
config_block: |
<vulnerability-detector>
<enabled>yes</enabled>
<interval>60s</interval>
<min_full_scan_interval>60s</min_full_scan_interval>
<run_on_start>yes</run_on_start>
<!-- Windows OS vulnerabilities -->
<provider name="msu">
<enabled>yes</enabled>
<update_interval>1h</update_interval>
</provider>
<!-- Aggregate vulnerabilities -->
<provider name="nvd">
<enabled>yes</enabled>
<update_interval>1h</update_interval>
</provider>
<index-status>yes</index-status>
<feed-update-interval>60m</feed-update-interval>
</vulnerability-detector>
os: linux

Expand Down
22 changes: 3 additions & 19 deletions tests/integration/test_fim/test_files/test_audit/data/ossec.conf
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,9 @@
</policies>
</sca>

<wodle name="vulnerability-detector">
<disabled>yes</disabled>
<interval>5m</interval>
<ignore_time>6h</ignore_time>
<run_on_start>yes</run_on_start>
<feed name="ubuntu-18">
<disabled>yes</disabled>
<update_interval>1h</update_interval>
</feed>
<feed name="redhat">
<disabled>yes</disabled>
<update_from_year>2010</update_from_year>
<update_interval>1h</update_interval>
</feed>
<feed name="debian-9">
<disabled>yes</disabled>
<update_interval>1h</update_interval>
</feed>
</wodle>
<vulnerability-detector>
<enabled>no</enabled>
</vulnerability-detector>

<!-- File integrity monitoring -->
<syscheck>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
- disabled:
value: 'yes'

- section: wodle
attributes:
- name: vulnerability-detector
- section: vulnerability-detector
elements:
- disabled:
value: 'yes'
- enabled:
value: 'no'

- section: rootcheck
elements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@
- disabled:
value: 'yes'

- section: wodle
attributes:
- name: vulnerability-detector
- section: vulnerability-detector
elements:
- disabled:
value: 'yes'
- enabled:
value: 'no'

- section: rootcheck
elements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
- disabled:
value: 'yes'

- section: wodle
attributes:
- name: vulnerability-detector
- section: vulnerability-detector
elements:
- disabled:
value: 'yes'
- enabled:
value: 'no'

- section: rootcheck
elements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@
- disabled:
value: 'yes'

- section: wodle
attributes:
- name: vulnerability-detector
- section: vulnerability-detector
elements:
- disabled:
value: 'yes'
- enabled:
value: 'no'

- section: rootcheck
elements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def prepare_environment(request, metadata, agent_system, agent_packages, mock_ag
write_json_file(CPE_HELPER_PATH, cpe_helper_backup_data)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata, agent_system, agent_packages',
zip(t1_configurations, t1_configuration_metadata, t1_systems, t1_agent_packages),
Expand Down Expand Up @@ -342,6 +343,7 @@ def test_cpe_indexing_wrong_tags(configuration, metadata, agent_system, agent_pa
raise AttributeError('Unexpected log')


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata, agent_system, agent_packages',
zip(t2_configurations, t2_configuration_metadata, t2_systems, t2_agent_packages),
Expand Down Expand Up @@ -432,6 +434,7 @@ def test_cpe_indexing_wrong_values(configuration, metadata, agent_system, agent_
raise AttributeError('Unexpected log')


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata, agent_system, agent_packages',
zip(t3_configurations, t3_configuration_metadata, t3_systems, t3_agent_packages),
Expand Down Expand Up @@ -521,6 +524,7 @@ def test_cpe_indexing_missing_field(configuration, metadata, agent_system, agent
evm.check_error_inserting_package(agent_id=prepare_environment)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=1)
@pytest.mark.parametrize('configuration, metadata, agent_system, agent_packages',
zip(t4_configurations, t4_configuration_metadata, t4_systems, t4_agent_packages),
Expand Down Expand Up @@ -601,6 +605,7 @@ def test_cpe_indexing_empty_fields(configuration, metadata, agent_system, agent_
package=metadata['values']['PRODUCT_T_VALUE_0'], cve=package['cveid'])


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=1)
@pytest.mark.parametrize('configuration, metadata, agent_system, agent_packages',
zip(t5_configurations, t5_configuration_metadata, t5_systems, t5_agent_packages),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def prepare_scan(request, metadata, agent_system, mock_agent_with_custom_system)
write_json_file(CPE_HELPER_PATH, cpe_helper_backup_data)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata, agent_system',
zip(t1_configurations, t1_configuration_metadata, t1_systems), ids=t1_test_case_ids)
Expand Down Expand Up @@ -196,6 +197,7 @@ def test_cpe_indexing_packages(configuration, metadata, agent_system, set_wazuh_
agent_id=prepare_scan)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata, agent_system',
zip(t2_configurations, t2_configuration_metadata, t2_systems), ids=t2_test_case_ids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
configurations = load_configuration_template(configurations_path, configuration_parameters, configuration_metadata)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata', zip(configurations, configuration_metadata), ids=case_ids)
def test_download_feeds(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def check_update_finish_logs(log_monitor=None, provider_name='', provider_json_n
return cve_db.get_provider_feeds_number()


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata', zip(configurations, configuration_metadata), ids=test_case_ids)
def test_duplicate_feeds(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
use_case['custom_feed_url']))


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata', zip(configurations, configuration_metadata), ids=case_ids)
def test_import_invalid_feed_type(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
patch_references = ['4465477', '5003711', '4470788']


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('configuration, metadata', zip(configurations, configuration_metadata), ids=case_ids)
def test_msu_catalog_patches(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def manage_file(metadata):
file.remove_file(file_path=metadata['decompressed_file'])


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('metadata', t1_configuration_metadata, ids=t1_case_ids)
def test_validate_json_feed_content(metadata, manage_file):
Expand Down Expand Up @@ -166,6 +167,7 @@ def test_validate_json_feed_content(metadata, manage_file):
assert file.validate_json_file(raw_feed_file), f"{metadata['provider_name']} file is not JSON 'parseable'"


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=2)
@pytest.mark.parametrize('metadata', t2_configuration_metadata, ids=t2_case_ids)
def test_validate_xml_feed_content(metadata, manage_file):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
t2_configuration_metadata)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration, metadata', zip(t1_configurations, t1_configuration_metadata), ids=t1_case_ids)
def test_enabled(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down Expand Up @@ -123,6 +124,7 @@ def test_enabled(configuration, metadata, set_wazuh_configuration_vdt, truncate_
evm.check_vulnerability_detector_disabled()


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration, metadata', zip(t2_configurations, t2_configuration_metadata), ids=t2_case_ids)
def test_disabled(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
configuration_metadata)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration, metadata', zip(configurations, configuration_metadata), ids=case_ids)
def test_interval_scan(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def prepare_full_scan_environment(mock_agent_function, mock_agent_packages):
yield mock_agent_function


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration, metadata', zip(configurations, configuration_metadata), ids=test_case_ids)
def test_min_full_scan_interval(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
configurations = update_configuration_template(configurations, tags_to_replace, new_tags_values)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration, metadata', zip(configurations, configuration_metadata), ids=test_case_ids)
def test_retry_interval(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down Expand Up @@ -173,6 +174,7 @@ def test_retry_interval(configuration, metadata, set_wazuh_configuration_vdt, tr
evm.check_analyzing_oval_vulnerabilities_log(agent_id=mock_agent_function)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration, metadata', zip(configurations, configuration_metadata), ids=test_case_ids)
def test_retry_interval_max_retries(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
[custom_nvd_json_feed_path])


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration', t1_configurations, ids=t1_case_ids)
def test_run_on_start_enabled(configuration, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down Expand Up @@ -132,6 +133,7 @@ def test_run_on_start_enabled(configuration, set_wazuh_configuration_vdt, trunca
evm.check_vulnerability_scan_start()


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration', t2_configurations, ids=t2_case_ids)
def test_run_on_start_disabled(configuration, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
t2_configuration_metadata)


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration, metadata', zip(t1_configurations, t1_configuration_metadata), ids=t1_case_ids)
def test_enabled(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down Expand Up @@ -134,6 +135,7 @@ def test_enabled(configuration, metadata, set_wazuh_configuration_vdt, truncate_
evm.check_provider_database_update_start_log(metadata['provider_name'])


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.tier(level=0)
@pytest.mark.parametrize('configuration, metadata', zip(t2_configurations, t2_configuration_metadata), ids=t2_case_ids)
def test_disabled(configuration, metadata, set_wazuh_configuration_vdt, truncate_monitored_files,
Expand Down
Loading

0 comments on commit c5879d2

Please sign in to comment.