wazuh / wazuh-documentation

Wazuh - Project documentation
https://wazuh.com
195 stars 354 forks source link

4.3.0 Splunk installation steps doesn't finish with a successfully Splunk-Wazuh environment #5024

Closed alberpilot closed 2 years ago

alberpilot commented 2 years ago

After following the guide we noticed that something is not working on the guide. The following issue comment https://github.com/wazuh/wazuh/issues/12913#issuecomment-1084742999 shows the problems encountered:

rauldpm commented 2 years ago

Update report

xrisbarney commented 2 years ago

Documentation update

  1. The Splunk documentation has been updated to use the format that works V3.0 here.
  2. I believe the failure to download Splunk may be as a result of country embargoes. (Do we need to mention this in the documentation?)
  3. See wazuh alerts: Trying to replicate this issue. I will provide update.
xrisbarney commented 2 years ago

Update on issue 6. See wazuh alerts:

It looks like splunk is unable to retrieve the alerts when port 9997 is unreachable, occupied or has not been opened.

I am adding an instruction line to advise users to switch to an alternative port for forwarding.

xrisbarney commented 2 years ago

Update on issue 6. See wazuh alerts:

Included a troubleshooting section to ask users to check if port 9997 is open and listening, or switch to a new port from the forwarding and receiving section of Splunk.

rauldpm commented 2 years ago

Update report - 8.1.4 single node (debian)

ERROR: mgmt port [8089] - port is already bound. Splunk needs to use this port.

root@ubuntu20:/vagrant# netstat -an | grep 8089
tcp        0      0 0.0.0.0:8089            0.0.0.0:*               LISTEN   
root@ubuntu20:/vagrant# fuser 8089/tcp
8089/tcp:            41817
root@ubuntu20:/vagrant# ls -l /proc/41817/exe 
lrwxrwxrwx 1 root root 0 Apr  7 18:22 /proc/41817/exe -> /opt/splunk/bin/splunkd

AutoLoadBalancedConnectionStrategy [46723 TcpOutEloop] - Found currently active indexer. Connected to idx=192.168.57.118:12000, reuse=1.

Before config change

1

After config change

2

xrisbarney commented 2 years ago

Docu update

I have found that the change of the indexer port (troubleshooting) is mandatory in all test i have done. We need to change the default 9997 port since the beginning to avoid this.

I have moved the troubleshooting section to the install and configure splunk indexer instructions as items 4-8. This way, once Splunk is configured before the forwarder is configured with the indexer port, we are already using an unused port and there should be no conflicts in outputs.conf.

rauldpm commented 2 years ago

Update report

` Unable to retrieve results. It may be due to a connection problem with the Splunk forwarder, please try restarting this service `

rauldpm commented 2 years ago

Update report

AIO deployment for centos (should work using the apt simils) ``` 1. yum install curl -y 2. rpm --import https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH 3. cat > /etc/yum.repos.d/wazuh.repo << EOF [wazuh] gpgcheck=1 gpgkey=https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH enabled=1 name=EL-\$releasever - Wazuh baseurl=https://packages-dev.wazuh.com/pre-release/yum/ protect=1 EOF 4. yum install -y wazuh-manager 5. systemctl start wazuh-manager 6. yum install splunk-8.2.2.rpm -y 7. curl -so /opt/splunk/etc/system/local/indexes.conf https://raw.githubusercontent.com/wazuh/wazuh-splunk/v4.3.0-8.2.2/setup/indexer/indexes.conf 8. curl -so /opt/splunk/etc/system/local/inputs.conf https://raw.githubusercontent.com/wazuh/wazuh-splunk/v4.3.0-8.2.2/setup/indexer/inputs.conf 9. /opt/splunk/bin/splunk start (in AIO deplyment its seems mandatory change the default 9997 port) 10. add new port in UI -> eg: 1025 ``` ![image](https://user-images.githubusercontent.com/14913942/162537527-9bf523e0-560e-4c4d-8e24-fe30ef1f9b72.png) ``` 11. /opt/splunk/bin/splunk login 12. /opt/splunk/bin/splunk restart 13. yum install splunkforwarder-8.2.2.rpm -y 14. curl -so /opt/splunkforwarder/etc/system/local/props.conf https://raw.githubusercontent.com/wazuh/wazuh-splunk/v4.3.0-8.2.2/setup/forwarder/props.conf 15. curl -so /opt/splunkforwarder/etc/system/local/inputs.conf https://raw.githubusercontent.com/wazuh/wazuh-splunk/v4.3.0-8.2.2/setup/forwarder/inputs.conf 16. sed -i "s:MANAGER_HOSTNAME:$(hostname):g" /opt/splunkforwarder/etc/system/local/inputs.conf 17. /opt/splunkforwarder/bin/splunk start 18. /opt/splunkforwarder/bin/splunk add forward-server 192.168.57.102:1025 19. /opt/splunkforwarder/bin/splunk restart 20. curl -o SplunkAppForWazuh.tar.gz https://packages-dev.wazuh.com/pre-release/ui/splunk/wazuh_splunk-4.3.0_8.2.2-1.tar.gz 21. /opt/splunk/bin/splunk install app SplunkAppForWazuh.tar.gz 22. /opt/splunk/bin/splunk restart 23. /opt/splunkforwarder/bin/splunk restart 24. Configure API (sing in UI) (Go wazuh plugin) --> username and passwords seems to be already saved with the splunk values (password must be changed to wazuh. Maybe related to splunk login) (save api configuration) (access overview -> security events) (The message Unable to retrieve results. It may be due to a connection problem with the Splunk forwarder, please try restarting this service will pop up, but we should get events) ``` ![f](https://user-images.githubusercontent.com/14913942/162537455-7ad69564-1bb1-454b-b9d3-02884304813f.png)

image

image

04-08-2022 22:40:31.155 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.156 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.157 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.157 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.159 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.533 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.535 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.536 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.538 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.540 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.551 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.553 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.555 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.557 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.567 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
04-08-2022 22:40:31.569 +0000 WARN  SearchResultsFiles - Unable to parse site_label, label=invalid due to err="Invalid site id: invalid"
rauldpm commented 2 years ago

TODO

xrisbarney commented 2 years ago

Update

TODO

Guides

xrisbarney commented 2 years ago

Update

@rauldpm's Steps worked for the all-in-one architecture.

We now have 3 methods of installing Wazuh with Splunk:

okynos commented 2 years ago

Hello,

Following the documentation guide I have to remark some points that sounds bad for me:

Considerations: I have set up two nodes:

  1. Splunk indexer
  2. Wazuh manager + Splunk forwarder. The forwarder needs specific configuration.
okynos commented 2 years ago
okynos commented 2 years ago

RBAC successfully configured and tested.

xrisbarney commented 2 years ago

Update

TODO

Guides

rauldpm commented 2 years ago

Update report