Filesystem Type Size Used Avail Use% Mounted on\n\/dev\/mapper\/ubuntu--vg-ubuntu--lv ext4 98G 7.6G 86G 9% \/\n<\/code><\/pre>\n\n\n\nNext, proceed to install Wazuh SIEM server. As already mentioned, we will install a single node deployment with Wazuh indexer, Wazuh siem and Wazuh dashboard.<\/p>\n\n\n\n
Install Wazuh Indexer on Ubuntu 24.04<\/h3>\n\n\n\nInstall Wazuh Repository on Ubuntu 24.04<\/h4>\n\n\n\n
To smoothly run the installation of Wazuh SIEM components on Ubuntu 24.04, you need to install Wazuh repository.<\/p>\n\n\n\n
Thus, to begin with, install Wazuh repository GPG signing key on Ubuntu 24.04.<\/p>\n\n\n\n
sudo su -<\/code><\/pre>\n\n\n\napt install gnupg apt-transport-https<\/code><\/pre>\n\n\n\ncurl -s https:\/\/packages.wazuh.com\/key\/GPG-KEY-WAZUH | \\\ngpg --dearmor > \/etc\/apt\/trusted.gpg.d\/wazuh.gpg<\/code><\/pre>\n\n\n\nInstall the Wazuh 4.x repository;<\/p>\n\n\n\n
echo \"deb https:\/\/packages.wazuh.com\/4.x\/apt stable main\" > \/etc\/apt\/sources.list.d\/wazuh.list<\/code><\/pre>\n\n\n\nInstall Wazuh Indexer on Ubuntu 24.04<\/h4>\n\n\n\n
Update the package cache;<\/p>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\nNext, install Wazuh SIEM server.<\/p>\n\n\n\n
apt install wazuh-indexer<\/code><\/pre>\n\n\n\nGenerate Wazuh SSL\/TLS Certificates<\/h4>\n\n\n\n
Generate SSL\/TLS certificates that will be used to encrypt communication between the Wazuh SIEM components.<\/p>\n\n\n\n
Wazuh provides some tools that can be used to generate the certificates.<\/p>\n\n\n\n
Replace the value of the VER<\/strong> below with the current major release version of Wazuh;<\/p>\n\n\n\nVER=4.7<\/code><\/pre>\n\n\n\nThen, download the tools required to generate the certificates;<\/p>\n\n\n\n
wget https:\/\/packages.wazuh.com\/${VER}\/wazuh-certs-tool.sh<\/code><\/pre>\n\n\n\nDownload a configuration file that helps you to define the IP address and name of each Wazuh node.<\/p>\n\n\n\n
wget https:\/\/packages.wazuh.com\/${VER}\/config.yml<\/code><\/pre>\n\n\n\nBy default, this is how the configuration looks like;<\/p>\n\n\n\n
cat config.yml<\/code><\/pre>\n\n\n\nnodes:\n # Wazuh indexer nodes\n indexer:\n - name: node-1\n ip: \"<indexer-node-ip>\"\n #- name: node-2\n # ip: \"<indexer-node-ip>\"\n #- name: node-3\n # ip: \"<indexer-node-ip>\"\n\n # Wazuh server nodes\n # If there is more than one Wazuh server\n # node, each one must have a node_type\n server:\n - name: wazuh-1\n ip: \"<wazuh-manager-ip>\"\n # node_type: master\n #- name: wazuh-2\n # ip: \"<wazuh-manager-ip>\"\n # node_type: worker\n #- name: wazuh-3\n # ip: \"<wazuh-manager-ip>\"\n # node_type: worker\n\n # Wazuh dashboard nodes\n dashboard:\n - name: dashboard\n ip: \"<dashboard-node-ip>\"\n<\/code><\/pre>\n\n\n\nYou can edit the configuration file and replace the nodes names and IP addresses with your respective names and IP\/hostnames based on your architecture.<\/p>\n\n\n\n
Since we are running a single node cluster of Wazuh SIEM server, this how our final config.yml<\/strong> looks like<\/p>\n\n\n\ncat config.yml<\/code><\/pre>\n\n\n\nnodes:\n # Wazuh indexer nodes\n indexer:\n - name: indexer\n ip: \"192.168.122.149\"\n # Wazuh server nodes\n server:\n - name: wazuh\n ip: \"192.168.122.149\"\n\n # Wazuh dashboard nodes\n dashboard:\n - name: dash\n ip: \"192.168.122.149\"\n<\/code><\/pre>\n\n\n\nSave the updated configuration file and generate the SSL\/TLS certificates for Wazuh components using the wazuh-certs-tool.sh<\/strong> script. <\/p>\n\n\n\nbash .\/wazuh-certs-tool.sh -A<\/code><\/pre>\n\n\n\nOption -A<\/strong> or –all<\/strong> allows generation of all commands.<\/p>\n\n\n\nSample output;<\/p>\n\n\n\n
29\/02\/2024 17:06:03 INFO: Admin certificates created.\n29\/02\/2024 17:06:03 INFO: Wazuh indexer certificates created.\n29\/02\/2024 17:06:04 INFO: Wazuh server certificates created.\n29\/02\/2024 17:06:04 INFO: Wazuh dashboard certificates created.\n<\/code><\/pre>\n\n\n\nYou can see other options using;<\/p>\n\n\n\n
bash wazuh-certs-tool.sh --help<\/code><\/pre>\n\n\n\nThe generated certs are placed under wazuh-certificates directory created in the current working directory.<\/p>\n\n\n\n
ls -1 wazuh-certificates<\/code><\/pre>\n\n\n\nadmin-key.pem\nadmin.pem\ndash-key.pem\ndash.pem\nindexer-key.pem\nindexer.pem\nroot-ca.key\nroot-ca.pem\nwazuh-key.pem\nwazuh.pem\n<\/code><\/pre>\n\n\n\nSince we are running a single node Wazuh, there are only a few things we will update on the Wazuh indexer configuration.<\/p>\n\n\n\n
The default Wazuh indexer configuration is \/etc\/wazuh-indexer\/opensearch.yml<\/code><\/strong>.<\/p>\n\n\n\nThis is how it looks like by default;<\/p>\n\n\n\n
cat \/etc\/wazuh-indexer\/opensearch.yml<\/code><\/pre>\n\n\n\nnetwork.host: \"0.0.0.0\"\nnode.name: \"node-1\"\ncluster.initial_master_nodes:\n- \"node-1\"\n#- \"node-2\"\n#- \"node-3\"\ncluster.name: \"wazuh-cluster\"\n#discovery.seed_hosts:\n# - \"node-1-ip\"\n# - \"node-2-ip\"\n# - \"node-3-ip\"\nnode.max_local_storage_nodes: \"3\"\npath.data: \/var\/lib\/wazuh-indexer\npath.logs: \/var\/log\/wazuh-indexer\n\nplugins.security.ssl.http.pemcert_filepath: \/etc\/wazuh-indexer\/certs\/indexer.pem\nplugins.security.ssl.http.pemkey_filepath: \/etc\/wazuh-indexer\/certs\/indexer-key.pem\nplugins.security.ssl.http.pemtrustedcas_filepath: \/etc\/wazuh-indexer\/certs\/root-ca.pem\nplugins.security.ssl.transport.pemcert_filepath: \/etc\/wazuh-indexer\/certs\/indexer.pem\nplugins.security.ssl.transport.pemkey_filepath: \/etc\/wazuh-indexer\/certs\/indexer-key.pem\nplugins.security.ssl.transport.pemtrustedcas_filepath: \/etc\/wazuh-indexer\/certs\/root-ca.pem\nplugins.security.ssl.http.enabled: true\nplugins.security.ssl.transport.enforce_hostname_verification: false\nplugins.security.ssl.transport.resolve_hostname: false\n\nplugins.security.authcz.admin_dn:\n- \"CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US\"\nplugins.security.check_snapshot_restore_write_privileges: true\nplugins.security.enable_snapshot_restore_privilege: true\nplugins.security.nodes_dn:\n- \"CN=node-1,OU=Wazuh,O=Wazuh,L=California,C=US\"\n#- \"CN=node-2,OU=Wazuh,O=Wazuh,L=California,C=US\"\n#- \"CN=node-3,OU=Wazuh,O=Wazuh,L=California,C=US\"\nplugins.security.restapi.roles_enabled:\n- \"all_access\"\n- \"security_rest_api_access\"\n\nplugins.security.system_indices.enabled: true\nplugins.security.system_indices.indices: [\".plugins-ml-model\", \".plugins-ml-task\", \".opendistro-alerting-config\", \".opendistro-alerting-alert*\", \".opendistro-anomaly-results*\", \".opendistro-anomaly-detector*\", \".opendistro-anomaly-checkpoints\", \".opendistro-anomaly-detection-state\", \".opendistro-reports-*\", \".opensearch-notifications-*\", \".opensearch-notebooks\", \".opensearch-observability\", \".opendistro-asynchronous-search-response*\", \".replication-metadata-store\"]\n\n### Option to allow Filebeat-oss 7.10.2 to work ###\ncompatibility.override_main_response_version: true\n<\/code><\/pre>\n\n\n\nAs already mentioned, for a single node, there are only a changes we will make here:<\/p>\n\n\n\n
\n- network.host<\/strong>: We will leave default setting to allow Wazuh indexer to listen on all interfaces for both HTTP and Transport (if we had a cluster) connections.<\/li>\n\n\n\n
- node.name<\/strong>: Set to the name of the indexer as defined config.yml<\/strong> used in generating the SSL\/TLS certs.<\/li>\n\n\n\n
- cluster.initial_master_nodes<\/strong>: used during the initial setup of a cluster to identify the master-eligible nodes. It is more relevant when running a multi-node cluster. The value of this setting must exactly match the node.name<\/strong> value(s) based on your cluster architecture.<\/li>\n\n\n\n
- cluster.name<\/strong>: defines cluster name. You can leave default or define your own.<\/li>\n\n\n\n
- plugins.security.nodes_dn<\/strong>: This setting is used to specify the Distinguished Names (DN) of the nodes that are allowed to join the cluster. You can obtain the value using openssl command;<\/li>\n<\/ul>\n\n\n\n
You can get DN using the command below;<\/p>\n\n\n\n
openssl x509 -noout -subject -in wazuh-certificates\/indexer.pem<\/code><\/pre>\n\n\n\nsubject=C = US, L = California, O = Wazuh, OU = Wazuh, CN = indexer<\/code><\/pre>\n\n\n\nThis is how our updated Wazuh indexer configuration looks like;<\/p>\n\n\n\n
cat \/etc\/wazuh-indexer\/opensearch.yml<\/code><\/pre>\n\n\n\nnetwork.host: \"0.0.0.0\"\nnode.name: \"indexer\"\ncluster.initial_master_nodes:\n- \"indexer\"\ncluster.name: \"wazuh-cluster\"<\/strong>\nnode.max_local_storage_nodes: \"3\"\npath.data: \/var\/lib\/wazuh-indexer\npath.logs: \/var\/log\/wazuh-indexer\n\nplugins.security.ssl.http.pemcert_filepath: \/etc\/wazuh-indexer\/certs\/indexer.pem\nplugins.security.ssl.http.pemkey_filepath: \/etc\/wazuh-indexer\/certs\/indexer-key.pem\nplugins.security.ssl.http.pemtrustedcas_filepath: \/etc\/wazuh-indexer\/certs\/root-ca.pem\nplugins.security.ssl.transport.pemcert_filepath: \/etc\/wazuh-indexer\/certs\/indexer.pem\nplugins.security.ssl.transport.pemkey_filepath: \/etc\/wazuh-indexer\/certs\/indexer-key.pem\nplugins.security.ssl.transport.pemtrustedcas_filepath: \/etc\/wazuh-indexer\/certs\/root-ca.pem\nplugins.security.ssl.http.enabled: true\nplugins.security.ssl.transport.enforce_hostname_verification: false\nplugins.security.ssl.transport.resolve_hostname: false\n\nplugins.security.authcz.admin_dn:\n- \"CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US\"\nplugins.security.check_snapshot_restore_write_privileges: true\nplugins.security.enable_snapshot_restore_privilege: true\nplugins.security.nodes_dn:\n- \"CN=indexer,OU=Wazuh,O=Wazuh,L=California,C=US\"<\/strong>\nplugins.security.restapi.roles_enabled:\n- \"all_access\"\n- \"security_rest_api_access\"\n\nplugins.security.system_indices.enabled: true\nplugins.security.system_indices.indices: [\".plugins-ml-model\", \".plugins-ml-task\", \".opendistro-alerting-config\", \".opendistro-alerting-alert*\", \".opendistro-anomaly-results*\", \".opendistro-anomaly-detector*\", \".opendistro-anomaly-checkpoints\", \".opendistro-anomaly-detection-state\", \".opendistro-reports-*\", \".opensearch-notifications-*\", \".opensearch-notebooks\", \".opensearch-observability\", \".opendistro-asynchronous-search-response*\", \".replication-metadata-store\"]\n\ncompatibility.override_main_response_version: true\n<\/code><\/pre>\n\n\n\nNext, copy the generated SSL\/TLS certs for Wazuh indexer<\/strong> as well as the Admin certs\/key<\/strong> to certs directory as defined in the \/etc\/wazuh-indexer\/opensearch.yml<\/strong> configuration file.<\/p>\n\n\n\nSee;<\/p>\n\n\n\n
plugins.security.ssl.http.pemcert_filepath: \/etc\/wazuh-indexer\/certs\/indexer.pem\nplugins.security.ssl.http.pemkey_filepath: \/etc\/wazuh-indexer\/certs\/indexer-key.pem\nplugins.security.ssl.http.pemtrustedcas_filepath: \/etc\/wazuh-indexer\/certs\/root-ca.pem\nplugins.security.ssl.transport.pemcert_filepath: \/etc\/wazuh-indexer\/certs\/indexer.pem\nplugins.security.ssl.transport.pemkey_filepath: \/etc\/wazuh-indexer\/certs\/indexer-key.pem\nplugins.security.ssl.transport.pemtrustedcas_filepath: \/etc\/wazuh-indexer\/certs\/root-ca.pem\n<\/code><\/pre>\n\n\n\nThus, create the directory and copy certs;<\/p>\n\n\n\n
mkdir \/etc\/wazuh-indexer\/certs\/<\/code><\/pre>\n\n\n\ncp wazuh-certificates\/{root-ca.pem,indexer.pem,indexer-key.pem,admin.pem,admin-key.pem} \/etc\/wazuh-indexer\/certs\/<\/code><\/pre>\n\n\n\nShould now look like;<\/p>\n\n\n\n
ls -1 \/etc\/wazuh-indexer\/certs\/*<\/code><\/pre>\n\n\n\n\/etc\/wazuh-indexer\/certs\/admin-key.pem\n\/etc\/wazuh-indexer\/certs\/admin.pem\n\/etc\/wazuh-indexer\/certs\/indexer-key.pem\n\/etc\/wazuh-indexer\/certs\/indexer.pem\n\/etc\/wazuh-indexer\/certs\/root-ca.pem\n<\/code><\/pre>\n\n\n\nUpdate the permissions and set the ownership of the SSL\/TLS certs to wazuh-indexer;<\/p>\n\n\n\n
chmod 500 \/etc\/wazuh-indexer\/certs<\/code><\/pre>\n\n\n\nchmod 400 \/etc\/wazuh-indexer\/certs\/*<\/code><\/pre>\n\n\n\nchown -R wazuh-indexer: \/etc\/wazuh-indexer\/certs<\/code><\/pre>\n\n\n\nStart and Initialize Wazuh Indexer Cluster<\/h4>\n\n\n\n
You can now start and enable Wazuh indexer to run on system boot. Ensure there is no service listening in port 9200\/tcp.<\/p>\n\n\n\n
systemctl enable --now wazuh-indexer<\/code><\/pre>\n\n\n\nsystemctl status wazuh-indexer<\/code><\/pre>\n\n\n\n\u25cf wazuh-indexer.service - Wazuh-indexer\n Loaded: loaded (\/usr\/lib\/systemd\/system\/wazuh-indexer.service; enabled; preset: enabled)\n Active: active (running) since Thu 2024-02-29 17:45:06 UTC; 25s ago\n Docs: https:\/\/documentation.wazuh.com\n Main PID: 5400 (java)\n Tasks: 90 (limit: 18952)\n Memory: 1.3G (peak: 1.3G)\n CPU: 23.804s\n CGroup: \/system.slice\/wazuh-indexer.service\n \u2514\u25005400 \/usr\/share\/wazuh-indexer\/jdk\/bin\/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+Alway>\n\nFeb 29 17:44:59 elk.kifarunix-demo.com systemd[1]: Starting wazuh-indexer.service - Wazuh-indexer...\nFeb 29 17:45:00 elk.kifarunix-demo.com systemd-entrypoint[5400]: WARNING: A terminally deprecated method in java.lang.System has been called\nFeb 29 17:45:00 elk.kifarunix-demo.com systemd-entrypoint[5400]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.OpenSearch (file:\/usr\/share>\nFeb 29 17:45:00 elk.kifarunix-demo.com systemd-entrypoint[5400]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.OpenSearch\nFeb 29 17:45:00 elk.kifarunix-demo.com systemd-entrypoint[5400]: WARNING: System::setSecurityManager will be removed in a future release\nFeb 29 17:45:00 elk.kifarunix-demo.com systemd-entrypoint[5400]: WARNING: A terminally deprecated method in java.lang.System has been called\nFeb 29 17:45:00 elk.kifarunix-demo.com systemd-entrypoint[5400]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.Security (file:\/usr\/share\/w>\nFeb 29 17:45:00 elk.kifarunix-demo.com systemd-entrypoint[5400]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.Security\nFeb 29 17:45:00 elk.kifarunix-demo.com systemd-entrypoint[5400]: WARNING: System::setSecurityManager will be removed in a future release\nFeb 29 17:45:06 elk.kifarunix-demo.com systemd[1]: Started wazuh-indexer.service - Wazuh-indexer.\n<\/code><\/pre>\n\n\n\nNext, execute the “\/usr\/share\/wazuh-indexer\/bin\/indexer-security-init.sh<\/strong>” script on a Wazuh indexer node to apply the updated certificate information and start the single-node cluster.<\/p>\n\n\n\n\/usr\/share\/wazuh-indexer\/bin\/indexer-security-init.sh<\/code><\/pre>\n\n\n\n**************************************************************************\n** This tool will be deprecated in the next major release of OpenSearch **\n** https:\/\/github.com\/opensearch-project\/security\/issues\/1755 **\n**************************************************************************\nSecurity Admin v7\nWill connect to 127.0.0.1:9200 ... done\nConnected as \"CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US\"\nOpenSearch Version: 2.8.0\nContacting opensearch cluster 'opensearch' and wait for YELLOW clusterstate ...\nClustername: wazuh-cluster\nClusterstate: GREEN\nNumber of nodes: 1\nNumber of data nodes: 1\n.opendistro_security index does not exists, attempt to create it ... done (0-all replicas)\nPopulate config from \/etc\/wazuh-indexer\/opensearch-security\/\nWill update '\/config' with \/etc\/wazuh-indexer\/opensearch-security\/config.yml \n SUCC: Configuration for 'config' created or updated\nWill update '\/roles' with \/etc\/wazuh-indexer\/opensearch-security\/roles.yml \n SUCC: Configuration for 'roles' created or updated\nWill update '\/rolesmapping' with \/etc\/wazuh-indexer\/opensearch-security\/roles_mapping.yml \n SUCC: Configuration for 'rolesmapping' created or updated\nWill update '\/internalusers' with \/etc\/wazuh-indexer\/opensearch-security\/internal_users.yml \n SUCC: Configuration for 'internalusers' created or updated\nWill update '\/actiongroups' with \/etc\/wazuh-indexer\/opensearch-security\/action_groups.yml \n SUCC: Configuration for 'actiongroups' created or updated\nWill update '\/tenants' with \/etc\/wazuh-indexer\/opensearch-security\/tenants.yml \n SUCC: Configuration for 'tenants' created or updated\nWill update '\/nodesdn' with \/etc\/wazuh-indexer\/opensearch-security\/nodes_dn.yml \n SUCC: Configuration for 'nodesdn' created or updated\nWill update '\/whitelist' with \/etc\/wazuh-indexer\/opensearch-security\/whitelist.yml \n SUCC: Configuration for 'whitelist' created or updated\nWill update '\/audit' with \/etc\/wazuh-indexer\/opensearch-security\/audit.yml \n SUCC: Configuration for 'audit' created or updated\nWill update '\/allowlist' with \/etc\/wazuh-indexer\/opensearch-security\/allowlist.yml \n SUCC: Configuration for 'allowlist' created or updated\nSUCC: Expected 10 config types for node {\"updated_config_types\":[\"allowlist\",\"tenants\",\"rolesmapping\",\"nodesdn\",\"audit\",\"roles\",\"whitelist\",\"internalusers\",\"actiongroups\",\"config\"],\"updated_config_size\":10,\"message\":null} is 10 ([\"allowlist\",\"tenants\",\"rolesmapping\",\"nodesdn\",\"audit\",\"roles\",\"whitelist\",\"internalusers\",\"actiongroups\",\"config\"]) due to: null\nDone with success\n<\/code><\/pre>\n\n\n\nThe Wazuh indexer (opensearch) should now be running. Confirm the ports;<\/p>\n\n\n\n
ss -atlnp | grep -E \"92|93\"<\/code><\/pre>\n\n\n\nLISTEN 0 4096 *:9200 *:* users:((“java”,pid=5400,fd=565)) \nLISTEN 0 4096 *:9300 *:* users:((“java”,pid=5400,fd=563))\n\n\n\nOr;<\/p>\n\n\n\n
curl -k -XGET https:\/\/localhost:9200 -u admin<\/code><\/pre>\n\n\n\nWhen prompted for password, default is admin<\/strong>.<\/p>\n\n\n\nEnter host password for user 'admin':\n{\n \"name\" : \"indexer\",\n \"cluster_name\" : \"wazuh-cluster\",\n \"cluster_uuid\" : \"m5qZ7M3xRdaJ-t9X5AlL0Q\",\n \"version\" : {\n \"number\" : \"7.10.2\",\n \"build_type\" : \"rpm\",\n \"build_hash\" : \"db90a415ff2fd428b4f7b3f800a51dc229287cb4\",\n \"build_date\" : \"2023-06-03T06:24:25.112415503Z\",\n \"build_snapshot\" : false,\n \"lucene_version\" : \"9.6.0\",\n \"minimum_wire_compatibility_version\" : \"7.10.0\",\n \"minimum_index_compatibility_version\" : \"7.0.0\"\n },\n \"tagline\" : \"The OpenSearch Project: https:\/\/opensearch.org\/\"\n}\n<\/code><\/pre>\n\n\n\nInstall Wazuh Server\/Manager on Ubuntu 24.04<\/h3>\n\n\n\n
Since you already have the Wazuh repository installed, simply execute the command below to install Wazuh server on Ubuntu 24.04.<\/p>\n\n\n\n
apt install wazuh-manager<\/code><\/pre>\n\n\n\nOnce the installation is complete, you can start and enable Wazuh-manager to run on system boot;<\/p>\n\n\n\n
systemctl enable --now wazuh-manager<\/code><\/pre>\n\n\n\nOpen Wazuh Manager Port on Firewall. Usually, the Wazuh agents is set to communicate with Wazuh manager via TCP port 1514 by default.<\/p>\n\n\n\n
ss -alnptu | grep -i wazuh<\/code><\/pre>\n\n\n\ntcp LISTEN 0 128 0.0.0.0:1514 0.0.0.0:* users:((\"wazuh-remoted\",pid=49410,fd=4)) \ntcp LISTEN 0 128 0.0.0.0:1515 0.0.0.0:* users:((\"wazuh-authd\",pid=49236,fd=3))\n<\/code><\/pre>\n\n\n\nThus, open port 1514\/tcp on Wazuh manager.<\/p>\n\n\n\n
iptables -A INPUT -p tcp --dport 1514 -j ACCEPT<\/code><\/pre>\n\n\n\nOr<\/p>\n\n\n\n
ufw allow 1514\/tcp<\/code><\/pre>\n\n\n\nAlso, allow port 1515\/tcp for agent registration;<\/p>\n\n\n\n
iptables -A INPUT -p tcp --dport 1515 -j ACCEPT<\/code><\/pre>\n\n\n\nOr<\/p>\n\n\n\n
ufw allow 1515\/tcp<\/code><\/pre>\n\n\n\nRead more on required ports<\/a>.<\/p>\n\n\n\nFilebeat is required to ship logs and event data to the Wazuh indexer, where they are indexed and stored for efficient searching and analysis.<\/p>\n\n\n\n
As of this writing, Wazuh indexer v4.7.2 is compatible<\/a> with Filebeat-OSS 7.10.2, which is provided by the Wazuh repository.<\/p>\n\n\n\napt-cache policy filebeat<\/code><\/pre>\n\n\n\nfilebeat:\n Installed: (none)\n Candidate: 7.10.2\n Version table:\n 7.10.2 500\n 500 https:\/\/packages.wazuh.com\/4.x\/apt stable\/main amd64 Packages\n 7.10.0 500\n 500 https:\/\/packages.wazuh.com\/4.x\/apt stable\/main amd64 Packages\n 7.9.1 500\n 500 https:\/\/packages.wazuh.com\/4.x\/apt stable\/main amd64 Packages\n<\/code><\/pre>\n\n\n\nThus, install Filebeat using the command below;<\/p>\n\n\n\n
apt install filebeat<\/code><\/pre>\n\n\n\nConfigure Filebeat<\/h4>\n\n\n\n
Once the installation is done, make a backup of the default configuration file<\/p>\n\n\n\n
mv \/etc\/filebeat\/filebeat.yml{,.stock}<\/code><\/pre>\n\n\n\nRun the command below to create new Filebeat configuration file with the following configs.<\/p>\n\n\n\n
cat > \/etc\/filebeat\/filebeat.yml << 'EOL'\noutput.elasticsearch:\n hosts: [\"192.168.122.149:9200\"]\n protocol: https\n username: admin\n password: admin\n ssl.certificate_authorities: \"\/etc\/filebeat\/certs\/root-ca.pem\"\n ssl.certificate: \"\/etc\/filebeat\/certs\/filebeat.pem\"\n ssl.key: \"\/etc\/filebeat\/certs\/filebeat-key.pem\"\nsetup.template.json.enabled: true\nsetup.template.json.path: '\/etc\/filebeat\/wazuh-template.json'\nsetup.template.json.name: 'wazuh'\nsetup.ilm.overwrite: true\nsetup.ilm.enabled: false\n\nfilebeat.modules:\n - module: wazuh\n alerts:\n enabled: true\n archives:\n enabled: false\nlogging.level: info\nlogging.to_files: true\nlogging.files:\n path: \/var\/log\/filebeat\n name: filebeat\n keepfiles: 7\n permissions: 0644\nlogging.metrics.enabled: false\n\nseccomp:\n default_action: allow\n syscalls:\n - action: allow\n names:\n - rseq\nEOL\n<\/code><\/pre>\n\n\n\nNote, IP address used on the hosts setting should match the one defined while generating ssl certs.<\/p>\n\n\n\n
If you want, you can use Filebeat keystore to store the credentials in variables rather than plain text as in above configuration.<\/p>\n\n\n\n
To store credentials in keystore, create the keystore;<\/p>\n\n\n\n
filebeat keystore create<\/code><\/pre>\n\n\n\nThe store the username and password in keystore using variables;<\/p>\n\n\n\n
Both of the commands will prompt you to type the values of each variable.<\/p>\n\n\n\n
filebeat keystore add USERNAME<\/code><\/pre>\n\n\n\nfilebeat keystore add PASS<\/code><\/pre>\n\n\n\nYou can then update the credentials on filebeat.yml<\/strong> by changing;<\/p>\n\n\n\n username: admin\n password: admin\n<\/code><\/pre>\n\n\n\nto;<\/p>\n\n\n\n