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

Deactivate tests and update vulnerability-detector configuration #4784

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions deps/wazuh_testing/wazuh_testing/data/all_disabled_ossec.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
<enabled>no</enabled>
</sca>

<vulnerability-detector>
<vulnerability-detection>
<enabled>no</enabled>
</vulnerability-detector>
</vulnerability-detection>

<indexer>
<enabled>no</enabled>
</indexer>

<!-- File integrity monitoring -->
<syscheck>
Expand Down
32 changes: 6 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,11 @@ 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: 'no'
feed_update_interval: '60m'

wazuh_manager_indexer:
enabled: 'no'

## Syscheck
wazuh_manager_syscheck:
Expand Down Expand Up @@ -441,6 +420,7 @@ wazuh_manager_config_defaults:
syscollector: '{{ wazuh_manager_syscollector }}'
sca: '{{ wazuh_manager_sca }}'
vulnerability_detector: '{{ wazuh_manager_vulnerability_detector }}'
indexer: '{{ wazuh_manager_indexer }}'
log_level: '{{ wazuh_manager_log_level }}'
email_level: '{{ wazuh_manager_email_level }}'
localfiles: '{{ wazuh_manager_localfiles }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,37 +258,23 @@
{% endif %}
</sca>

<vulnerability-detector>
<vulnerability-detection>
{% 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>
{% 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 %}
{% 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 %}
</vulnerability-detection>

<indexer>
{% if wazuh_manager_config.indexer.enabled is defined %}
<enabled>{{ wazuh_manager_config.indexer.enabled }}</enabled>
{% endif %}
</vulnerability-detector>
</indexer>

<!-- File integrity monitoring -->
<syscheck>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,14 @@
tasks_from: write_wazuh_config.yaml
vars:
config_block: |
<vulnerability-detector>
<vulnerability-detection>
<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>
</vulnerability-detector>
<index-status>no</index-status>
<feed-update-interval>60s</feed-update-interval>
</vulnerability-detection>
<indexer>
<enabled>no</enabled>
</indexer>
os: linux

- name: Restart wazuh-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
pytestmark = [TIER0, LINUX]


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning')
@pytest.mark.parametrize('metadata', configuration_metadata, ids=cases_ids)
def test_vulnerability_detector_linux(configure_environment, metadata, get_indexer_credentials, get_manager_ip,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,14 @@
tasks_from: write_wazuh_config.yaml
vars:
config_block: |
<vulnerability-detector>
<vulnerability-detection>
<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>
</vulnerability-detector>
<index-status>no</index-status>
<feed-update-interval>60s</feed-update-interval>
</vulnerability-detection>
<indexer>
<enabled>no</enabled>
</indexer>
os: linux

- name: Restart wazuh-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
pytestmark = [TIER0, WINDOWS]


@pytest.mark.skip(reason="Vulnerability Detector was refactored. Some tests are deprecated.")
@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning')
@pytest.mark.parametrize('metadata', configuration_metadata, ids=cases_ids)
def test_vulnerability_detector_windows(configure_environment, metadata, get_indexer_credentials, get_manager_ip,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
- log_format:
value: syslog

- section: vulnerability-detector
- section: vulnerability-detection
elements:
- enabled:
value: 'no'

- section: indexer
elements:
- enabled:
value: 'no'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
- sections:
- section: vulnerability-detector
- section: vulnerability-detection
elements:
- enabled:
value: 'no'
- section: indexer
elements:
- enabled:
value: 'no'
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
- sections:
- section: vulnerability-detector
- section: vulnerability-detection
elements:
- enabled:
value: 'no'

- section: indexer
elements:
- enabled:
value: 'no'
Expand Down
26 changes: 7 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,13 @@
</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-detection>
<enabled>no</enabled>
</vulnerability-detection>

<indexer>
<enabled>no</enabled>
</indexer>

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

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

- section: indexer
elements:
- enabled:
value: 'no'

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

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

- section: indexer
elements:
- enabled:
value: 'no'

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

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

- section: indexer
elements:
- enabled:
value: 'no'

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

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

- section: indexer
elements:
- 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
Loading
Loading