• DevOps
    Case Study

    How we built a resilient multi-account, multi-cloud solution for a Health Tech service provider!

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How we built a scalable Odoo solution for a Travel Tech service provider!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    How we built a scalable Odoo solution for TravelTech service provider!

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Contact Us

Connect with us!


LinkedInFacebookXInstagramYouTube

aws partneraws advanced partner
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

Monitor Kubernetes nodes with Wazuh

Abhiram Thejas

  • 8 min read
Monitor Kubernetes nodes with Wazuh

Generating audio, please wait...

This document guides you through an installation of the Wazuh server and Elastic Stack components in an all-in-one configuration

What is Wazuh

Wazuh is an open-source security information and event management (SIEM) platform that aids in monitoring and managing security events within an IT environment. It integrates essential security components, including intrusion detection, vulnerability detection, log analysis, vulnerability detection, and more, into a centralized system. Wazuh provides real-time monitoring and alerting for security incidents, allowing organizations to promptly respond to potential threats. It offers advanced features like log analysis, vulnerability detection, intrusion detection, security information, and event management, as well as threat detection and incident response capabilities. With its flexible architecture and scalable design, Wazuh is widely used to enhance the security posture of various systems and networks, making it a valuable tool for proactive threat detection and mitigation. Comprehensive documentation and resources are available to guide users through installation, configuration, and effective utilization of the platform to enhance their security infrastructure.

Here we are going to install Wazuh as an elastic stack installation by installing Wazuh, Elasticsearch, Kibana and Filebeat in a standalone Ubuntu system and install the Wazuh agents in the kubernetes Nodes to push the data to the elastic search

What is Elasticsearch

Elasticsearch is a highly scalable full-text search and analytics engine it is an open-source, distributed search and analytics engine designed for real-time search, analysis, and visualization of large volumes of structured and unstructured data. It is part of the Elastic Stack, which includes other components like Kibana, Beats, and Logstash, collectively providing a comprehensive platform for various data processing and visualization needs.

Installing Elasticsearch

Install all the necessary packages:

apt-get install apt-transport-https zip unzip lsb-release curl gnupg

add the elastic stack repository

curl -s https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/elasticsearch.gpg --import && chmod 644 /usr/share/keyrings/elasticsearch.gpg
echo "deb [signed-by=/usr/share/keyrings/elasticsearch.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-7.x.list
apt-get update

Install Elasticsearch (version 7.17.12):

apt-get install elasticsearch=7.17.12

configuration file /etc/elasticsearch/elasticsearch.yml using the predefined values from their official packages https://packages.wazuh.com/4.5/tpl/elastic-basic/elasticsearch_all_in_one.yml

Download the Elasticsearch configuration templates from the Wazuh repository and save them to the appropriate locations we can modify it as per our requirements.

curl -so /etc/elasticsearch/elasticsearch.yml https://packages.wazuh.com/4.5/tpl/elastic-basic/elasticsearch_all_in_one.yml
curl -so /usr/share/elasticsearch/instances.yml https://packages.wazuh.com/4.5/tpl/elastic-basic/instances_aio.yml

Generate and Set Up SSL Certificates:

Generate SSL certificates using elasticsearch-certutil, and then copy them to the Elasticsearch certificates directory.

/usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --in instances.yml --keep-ca-key --out ~/certs.zip
unzip ~/certs.zip -d ~/certs
mkdir /etc/elasticsearch/certs/ca -p
cp -R ~/certs/ca/ ~/certs/elasticsearch/* /etc/elasticsearch/certs/
chown -R elasticsearch: /etc/elasticsearch/certs
chmod -R 500 /etc/elasticsearch/certs
chmod 400 /etc/elasticsearch/certs/ca/ca.* /etc/elasticsearch/certs/elasticsearch.*
rm -rf ~/certs/ ~/certs.zip

Configure systemd and Start Elasticsearch:

systemctl daemon-reload
systemctl enable elasticsearch
systemctl start elasticsearch

These steps install Elasticsearch, configure it using provided templates, set up SSL certificates, and start the Elasticsearch service using systemd. Make sure to adjust configurations and paths based on your specific setup and requirements.

The command elasticsearch-setup-passwords auto is used in Elasticsearch to automatically set passwords for built-in users like elastic, kibana, logstash_system, beats_system, etc. This is an important step for securing Elasticsearch and its components with proper authentication.

/usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto

When you run this command, Elasticsearch will generate and set passwords for the built-in users and display them. It’s essential to securely store these passwords as they are crucial for authenticating and securing your Elasticsearch cluster and associated components.

To check that the installation was made successfully, run the following command replacing <elastic_password> with the password generated in the previous step for elastic user:

curl -XGET https://localhost:9200 -u elastic:<elastic_password> -k

Installing Wazuh server

curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && chmod 644 /usr/share/keyrings/wazuh.gpg
echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list
apt-get update
apt-get install wazuh-manager
systemctl daemon-reload
systemctl enable wazuh-manager

These steps ensure the proper installation and configuration of the Wazuh Manager, enabling you to utilize its features for security event management and monitoring.

Installing Filebeat

Filebeat is an open-source lightweight data shipping agent developed by Elastic. It is part of the Elastic Stack (formerly known as the ELK Stack), which also includes Elasticsearch, Logstash, and Kibana. Filebeat is designed to efficiently collect, ship, and centralize log and event data from various sources for further processing, analysis, and visualization.Filebeat is commonly used in various use cases such as application monitoring, server log monitoring, security event monitoring, and more. Its ability to collect data from diverse sources and efficiently forward it to Elasticsearch for further analysis makes it a valuable tool for organizations looking to gain insights from their log data.

Install Filebeat (version 7.17.12):

apt-get install filebeat=7.17.12

Download Filebeat Configuration and Wazuh Template: Download the Filebeat configuration file and the Wazuh Elasticsearch template from the specified URLs and save them to their respective locations.

curl -so /etc/filebeat/filebeat.yml https://packages.wazuh.com/4.5/tpl/elastic-basic/filebeat_all_in_one.yml
curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.5/extensions/elasticsearch/7.x/wazuh-template.json
chmod go+r /etc/filebeat/wazuh-template.json

Download Wazuh Filebeat Module: Download the Wazuh Filebeat module and extract it to the appropriate location.

curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.2.tar.gz | tar -xvz -C /usr/share/filebeat/module

Edit Filebeat Configuration: Edit the Filebeat configuration file to include the Elasticsearch password.

echo "output.elasticsearch.password: <elasticsearch_password>" >> /etc/filebeat/filebeat.yml

Replace <elasticsearch_password> with the actual password for connecting to Elasticsearch.

Copy SSL Certificates: Copy the SSL certificates from the Elasticsearch directory to the Filebeat directory for secure communication.

cp -r /etc/elasticsearch/certs/ca/ /etc/filebeat/certs/
cp /etc/elasticsearch/certs/elasticsearch.crt /etc/filebeat/certs/filebeat.crt
cp /etc/elasticsearch/certs/elasticsearch.key /etc/filebeat/certs/filebeat.key

Reload systemd to recognize the changes and enable Filebeat to start on boot.

systemctl daemon-reload
systemctl enable filebeat
systemctl start filebeat

To ensure that Filebeat has been successfully installed, run the following command:

filebeat test output

Kibana installation and configuration

Kibana is an open-source data visualization and exploration tool designed for use with Elasticsearch

Kibana is widely used by data analysts, IT operations teams, business intelligence professionals, and developers to monitor systems, analyze logs, track performance metrics, and create visually appealing dashboards to aid in decision-making processes. Its versatility and integration with Elasticsearch make it a powerful tool for gaining insights from data and improving operational efficiency.

Install Kibana (version 7.17.12):

apt-get install kibana=7.17.12

Create Kibana Certificates Directory and Copy Certificates: Create a directory for Kibana certificates, and copy the necessary SSL certificates from the Elasticsearch directory.

mkdir /etc/kibana/certs/ca -p
cp -R /etc/elasticsearch/certs/ca/ /etc/kibana/certs/
cp /etc/elasticsearch/certs/elasticsearch.key /etc/kibana/certs/kibana.key
cp /etc/elasticsearch/certs/elasticsearch.crt /etc/kibana/certs/kibana.crt

Set Permissions for Kibana Certificates Directory: Set appropriate permissions for the Kibana certificates directory and files.

chown -R kibana:kibana /etc/kibana/
chmod -R 500 /etc/kibana/certs
chmod 440 /etc/kibana/certs/ca/ca.* /etc/kibana/certs/kibana.*

Download and Configure Kibana YAML Configuration File: Download the Kibana YAML configuration file and edit it to include the Elasticsearch password.

curl -so /etc/kibana/kibana.yml https://packages.wazuh.com/4.5/tpl/elastic-basic/kibana_all_in_one.yml
# Edit the file and add the Elasticsearch password
# elasticsearch.password: <elasticsearch_password>

Create Kibana Data Directory: Create the Kibana data directory and set appropriate ownership.

mkdir /usr/share/kibana/data
chown -R kibana:kibana /usr/share/kibana

Install Wazuh Plugin for Kibana: Install the Wazuh plugin for Kibana using the provided URL.

cd /usr/share/kibana
sudo -u kibana /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/4.x/ui/kibana/wazuh_kibana-4.5.2_7.17.12-1.zip

Link Kibana’s socket to privileged port 443:

setcap 'cap_net_bind_service=+ep' /usr/share/kibana/node/bin/node

Reload systemd to recognize the changes and enable/start Kibana.

systemctl daemon-reload
systemctl enable kibana
systemctl start kibana

Now you can access the web console of the Wazuh dashboard by accessing
https://<wazuh_server_ip/domain>

user: elastic
password: <PASSWORD_elastic>

wazuh agent installation

You can also deploy a new agent following the instructions in the Wazuh dashboard. Go to Wazuh > Agents, and click on Deploy new agent. Then the Wazuh dashboard will show you the steps to deploy a new agent

This will generate the command you need to run on the system you need to monitor with the wazuh by providing the details such as the OS of the agent system you need to install.

To monitor the Kubernetes nodes using the Wazuh agent install the agent in the Kubernetes nodes

For example if you are using Amazon linux machine as you kubernetes nodes your installation command will be like

WAZUH_MANAGER="10.0.0.2" yum install wazuh-agent

You can use different installation variable as per your requirement while installing the agent

the full list can be found from here https://documentation.wazuh.com/current/user-manual/deployment-variables/deployment-variables-linux.html

provide your server IP of FQDN instead of 10.0.0.2

systemctl daemon-reload
systemctl enable wazuh-agent
systemctl start wazuh-agent

Now your Kubernetes nodes can be monitored using Wazuh

Secure your Kubernetes nodes with Wazuh! This comprehensive DevOps guide shows you how to install and configure Wazuh for complete monitoring and threat detection. Take control of your cluster’s security today!

  • AWS
  • DevOps

Continue Your Journey With…

DevOps as a Service

DevOps as a Service

Let us do the heavy lifting for you

Promotional banner
Promotional banner

AWS EKS EBS volume attach issue in Kubernetes: Persistence Volume Attach issue fix EKS

AWS EKS EBS volume attach issue in Kubernetes: Persistence Volume Attach issue fix EKS
  • AWS
  • DevOps
logo

Kubernetes runtime security tool: Falco

Kubernetes runtime security tool: Falco
  • AWS
  • DevOps
logo
Monitor Kubernetes nodes with Wazuh

Posts by Abhiram Thejas