Skip to content

Commit

Permalink
fix: change VD E2E configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebits committed Feb 12, 2024
1 parent 4194f1c commit feb759f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@
elements:
- host:
value: 'https://INDEXER_SERVER:9200'
- username:
value: INDEXER_USERNAME
- password:
value: INDEXER_PASSWORD
- ssl:
elements:
- certificate_authorities:
elements:
- ca:
value: FILEBEAT_ROOT_CA
- certificate:
value: FILEBEAT_CERTIFICATE
- key:
value: FILEBEAT_KEY
certificate:
value: FILEBEAT_CERTIFICATE
key:
value: FILEBEAT_KEY
- section: sca
elements:
- enabled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
import time
import ast
import datetime
from typing import Generator, List

from wazuh_testing.end_to_end.configuration import backup_configurations, restore_configuration, configure_environment
from wazuh_testing.end_to_end.configuration import backup_configurations, restore_configuration, \
configure_environment, save_indexer_credentials_into_keystore
from wazuh_testing.end_to_end.logs import truncate_remote_host_group_files
from wazuh_testing.end_to_end.waiters import wait_until_vd_is_updated
from wazuh_testing.end_to_end.monitoring import generate_monitoring_logs, monitoring_events_multihost
Expand Down Expand Up @@ -91,13 +91,10 @@ def load_vulnerability_detector_configurations(host_manager):
configuration_template = load_configuration_template(configurations_paths['manager'], [{}], [{}])

# Replace placeholders by real values
manager_index = host_manager.get_group_hosts('manager').index(host) + 2
indexer_server = host_manager.get_group_hosts('indexer')[0]
indexer_server_variables = host_manager.get_host_variables(indexer_server)
manager_index = host_manager.get_group_hosts('manager').index(host) + 2

configuration_variables = {
'INDEXER_USERNAME': indexer_server_variables['indexer_user'],
'INDEXER_PASSWORD': indexer_server_variables['indexer_password'],
'INDEXER_SERVER': indexer_server_variables['ip'],
'FILEBEAT_ROOT_CA': '/etc/pki/filebeat/root-ca.pem',
'FILEBEAT_CERTIFICATE': f"/etc/pki/filebeat/node-{manager_index}.pem",
Expand Down Expand Up @@ -125,6 +122,10 @@ def setup_vulnerability_tests(host_manager: HostManager) -> Generator:
# Configure managers and agents
logger.error("Getting backup of current configurations")
hosts_configuration_backup = backup_configurations(host_manager)

logger.error("Save the Wazuh indexer username and password into the Wazuh manager keystore")
save_indexer_credentials_into_keystore(host_manager)

logger.error("Configuring environment")
configure_environment(host_manager, load_vulnerability_detector_configurations(host_manager))

Expand Down

0 comments on commit feb759f

Please sign in to comment.