đŸ•šī¸
Ghoulsec Vault
Website Toolbase
  • Welcome !
  • đŸ—ƒī¸Exam Prep Notes
    • 📔CEH V13 (Master Edition)
      • Module 02: Footprinting and Reconnaissance
      • Module 03: Scanning Networks
      • Module 04: Enumeration
      • Module 05: Vulnerability Analysis
      • Module 06: System Hacking
      • Module 07: Malware Threats
      • Module 08: Sniffing
      • Module 09 : Social Engineering
      • Module 10: Denial of Service
      • Module 11: Session Hijacking
      • Module 12: Evading IDS, Firewalls , Honeypots
      • Module 13: Hacking web servers
      • Module 14: Hacking Web Applications
      • Module 15:SQL Injection
      • Module 16: Wireless Attacks
      • Module 17: Hacking Mobile Platforms
      • Module 18: IoT & OT Hacking
      • Module 19 : Cloud Computing
      • Module 20 : Cryptography
    • 📘ISC2 -Certified in Cyber Security
      • Chapter -1 Security Principals
      • Chapter -2 Disaster Recovery,Business Continuity & Incident Response
      • Chapter -3 Access Control Concepts
      • Chapter -4 Network Security
      • Chapter -5 Security Operations
    • 📗AZ - 900
      • Basics of Cloud Computing
        • Economic of Scale
        • CapEx & OpEx
        • Consumption based model
        • Cloud Deployment Models
        • Shared Responsibility Model
        • Data centers, Regions & Availability Zones & Geographyies in Azure
        • Resources & Resource Group
        • Azure Access Tools
        • Azure Service Lifecycle
        • Azure SLAs
        • Azure Cloud Adoption Framework
      • Azure Services
        • Azure Computing Services
        • Azure Networking Services
        • Azure Storage Services
        • Azure Database Service
        • Azure Marketplace
        • Big Data & Azure
        • Azure Serverless Computing
        • IoT & Azure
        • Other Azure Services
        • Azure Resource Locks & Resource Tags
        • Azure Security Services
          • Security Groups
          • Routing Tables
          • Azure Firewall
          • Azure DDOS Protection
          • Azure Identity & Access Management (Azure AD)
          • Azure RBAC
          • Azure Security Center
          • Azure Key Vault
      • Azure policies & Blueprints
      • Azure Cost Management
      • Azure Core Tenents
    • 📗SC - 900
      • Zero Trust Model
      • Shared Responsibility Model
      • Defense in Depth
      • Security Controls
      • CIA Triad
      • Encryption / Hashing / Signing
      • Microsoft Security & Compliance Principals
      • Common Identity Attacks
      • Microsoft Identity as Primary Security Perimeter
      • Modern Authentication with Azure AD
      • Azure AD Identity Types
      • Azure External Identities
      • Hybrid Identities
      • Authentication Methods & Password Protection
      • Conditional Access
      • Azure AD Roles & RBAC
      • Governance in Azure AD
      • Azure Identity Protection
      • Azure NSG, DDOS, Firewall
      • Azure Bastion & Keyvault
      • Azure Encryption
      • Azure CSPM
      • Azure Security Center
      • Azure Defender
        • Microsoft O365 Defender
        • Azure Sentinel
      • Microsoft Cloud App Security
      • Microsoft Intune
      • Microsoft Complaince Manager
      • Information Protection
      • Microsoft insider risk capabilities
    • 📔AWS Cloud Practitioner
      • Cloud Deployment
        • AWS Global Infrastructure
      • AWS Cloud Essentials
        • AWS SNS
          • AWS SQS
      • AWS Compute & Container Services
        • AWS EC2
          • Elasticity & Agility
        • AWS Serverless Computing
        • AWS Container Services
        • AWS Beanstalk
        • AWS Load Balancing
      • AWS Storage & Databases
      • AWS Networking
      • AWS Security
        • AWS Organisation
        • AWS Compliance
        • AWS DDOS
        • Additional Security Services
      • AWS Monitoring & Analytics
        • Other Analytics Services
      • AWS Pricing & Support
      • AWS Migration & Innovation
        • Migration Statergies
        • AWS Snow Family
        • AWS Transfer Family
        • Innovation on AWS
      • AWS Well Architecture Framework
      • Other AWS Services
  • 🧑‍đŸ’ģCyber Security Base
    • Ghoul's Den
    • Cheatsheets
    • SSL Handbook
      • Installing OpenSSL
      • Encrypting Web Servers using SSL
      • Compiling .pfx file using openssl
      • De-compiling .pfx file
      • Zimbra Mail Server SSL renew
      • SSL Certificates
    • â˜ī¸Cloud Security
      • Amazon Web Services (AWS)
        • AWS - IAM & Policy Management
        • AWS Organization
        • AWS - Roles (Assume Role)
        • AWS - EC2 (Elastic Computing)
        • AWS - VPC
        • AWS - Bastion Host
        • AWS Application Load Balancer
        • AWS Auto Scaling Group
        • AWS WAF
        • AWS - VPC Peering
        • AWS Transit Gateway
        • AWS NAT Gateway
        • AWS - Route 53
        • AWS Certificates Manager
        • AWS Network Load Balancer (NLB)
    • đŸ•¸ī¸Network Security
      • Firewalls
        • Sophos - Security Suite
          • Sophos Firewalls
      • VPN
        • VPNs
          • Wireguard Tunneling
          • StrongSwan Gateway VPN Server on Ubuntu
      • IP Address and IP Subnetting
      • Basic to Advance Networking Materials
    • 🧑‍đŸ’ģVAPT
      • Sample Report Templete
      • OWASP
        • OWASP Web Application Security & WebGoat
      • Web Application testing checklist
        • Client Side Penetration Testing
          • Clickjacking
          • Websockets
          • CSRF
          • XSS Filters
        • Server Side Penetration Testing
        • Advanced Web Application Pentesting
          • OAuth
          • JWT Injection
          • Server Side Templete Injection
    • â˜„ī¸GRC
      • ISMS AUDIT PLAN
      • CIS Compliance Windows
    • 🔍Forensic
      • Forensic Tools
      • EMAIL Forensics
      • File header forensics
    • Trend Micro
      • Deep Security
        • Installation & Prerequisite
          • Microsoft SQL server 2022
          • Postgres 16 Core
          • Installation
    • Practical Malware Analysis & API Threats
  • đŸ•šī¸Server are fun !
    • Securing Linux
      • Securing SSH
      • Sudoers
      • UFW (Uncomplicated FW)
      • Unattended Upgrades
      • Password Complexiety
      • Auditing Linux
      • Samba - SMB
      • NFS - Network File System
      • FTP
      • AIDE
    • Servers
      • Linux Sever
        • OpenLDAP Server Setup
          • ldap-account-manager
          • Securing OpenLDAP
          • OpenLDAP client setup
          • Checking LDAP setup
        • Users & Groups
        • Password Policy
        • File & File Permissions
        • Automatic Updates
        • Adding GUI to Ubuntu Server
        • DNS Server
        • NTP Server
      • Windows Sever
        • Deep dive into Windows Server
        • Windows server Installation
        • Disable IPv6
        • Disable Server Manager on startup
        • Promoting OS to AD server
        • AD DNS
        • AD DHCP
        • AD Activation
        • AD Users & Groups
        • AD FileServer
        • Adding Users into AD
        • Bulk Importing users into Domain
        • Windows AD Resources
        • Group Policy Editor
          • Creating First Policy
          • Restricting CMD & Powershell
          • Password Policies
          • Audit Policies
          • Log Retention Policy
          • Windows Defender Firewall
          • Patch Management & Window Updates
        • Setting Up local accounts for windows hosts
    • Hacking Systems
      • Linux Systems
        • Battery Charge Threshold (Linux)
        • Metasploitable OS Complete Solved
      • Tricking Windows
        • Bitlocker & Time based policy bypass
    • Monitoring HeartBeats
    • RAID Technology
    • Managing Partitions
      • Parted
      • Fdisk
      • LVM
        • Re-claiming unused disk space
        • Adding physical volume into VG
        • Removing physical volume from VG
      • SWAP Memory
    • Virtualization
      • Proxmox
        • Proxmox VE Installation
        • Default Storage Expansion
        • Proxmox Network Link Aggegration
        • NAT Interface Configuration
        • Importing disk into proxmox
        • Creating an LVM Thin Pool
        • Proxmox IAM
  • đŸ™â€â™‚ī¸Dan the AI Expert
    • Ollama Ollama ...
      • Ollama
        • Ollama models
        • Open Web UI & Ollama Integration
    • Microsoft Presentation using AI
  • đŸ›Ąī¸Security Operations
    • Wazuh - Open Source XDR. Open Source SIEM.
      • Components
      • Deployment Methods
      • Installation
        • Single Node Installation
          • Wazuh Indexer Installation
          • Wazuh Server Installation
          • Wazuh Dashboard Installation
          • Single node deployment with Script
        • Managing multiple Wazuh clusters with Cross-Cluster Search
          • Cluster Configuration
          • Set up Cross-Cluster Search
        • Upgrading Wazuh Central Components
        • Uninstalling Wazuh
      • Custom Decoder & Rules
        • Pfsense Decoders
        • Pfsense Rules
      • Security Operations Center Tools (Wazuh)
    • IRIS-DFIR / Case Management
    • Graylog & ElasticSearch
    • Zabbix NMS
      • Zabbix Installation
      • Zabbix Database Management
        • Zabbix Database backup
        • Zabbix Database restore
        • MySQL Replication (M-M)
        • MySQL Replication (M-W)
      • Zabbix Geomap Setup
      • Adding Hosts into Zabbix
      • Zabbix Hostgroups
      • Auto Registration Hosts Zabbix
      • Zabbix Globalscrips
      • Zabbix HA Cluster
      • Zabbix Proxy
      • Zabbix Notifications
      • Zabbix Maintainance
      • Zabbix User Management & Authentication
      • Zabbix Housekeeping
      • Scheduled Reporting
      • Service Monitoring using Zabbix
  • Git the master!!
    • Configuring git
    • Git Branches
    • Undoing changes
    • Git - Cheat sheet
    • My first git...
Powered by GitBook
On this page
  • Installing MongoDB Database (Community Edition)
  • Installing Elastic Search
  • Installing Graylog-datanode & Graylog Server
  • Configuring Graylog-server
  • Configuring datanode
  • Accessing the Greylog UI
  • Troubleshooting
  1. Security Operations

Graylog & ElasticSearch

PreviousIRIS-DFIR / Case ManagementNextZabbix NMS

Last updated 2 months ago

Graylog is an open-source log management system that collects, indexes, and analyzes log data from various sources, providing real-time monitoring and alerting. Elasticsearch is a distributed search and analytics engine that efficiently indexes and queries large volumes of structured and unstructured data. Graylog often uses Elasticsearch as its storage and indexing backend for fast log searching and analysis. We will be installing the Graylog & Elastic Search on the Ubuntu 24.04LTS


Installing MongoDB Database (Community Edition)

Mongodb is the database system service which can be integrated by the graylog and which can be installed from the below given URL

Installation Steps :

  1. Importing the key pairs :

sudo apt-get install gnupg curl
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \
   --dearmor
  1. Creating the list file

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
  1. Reloading the packages database & installing mongodb

sudo apt-get update
sudo apt-get install -y mongodb-org
  1. Registering services & enabling on startup

sudo systemctl start mongod
sudo systemctl enable mongod

Here we have installed the mongoDB database and now we will be installing elastic search.


Installing Elastic Search

  1. Installing necessary packages

sudo apt install default-jdk apt-transport-https
  1. Installing the elastic search GPG Key

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
  1. Add the Elasticsearch repository to your sources list:

echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
  1. Updating the packages & installing Elastic search

sudo apt update 
sudo apt install elasticsearch

Now the elastic search is installed and now we will configure the elastic search to enable the nodes & clusters to integrate with the graylog server

The configuration file of elasticsearch is located at /etc/elasticsearch/elasticsearch.yml we will add the following lines at the end of config file to enable the cluster :

sudo nano /etc/elasticsearch/elasticsearch.yml
## END OF THE CONFIG FILE
---------------------------------------
## CLUSTER CONFIG 
cluster.name: graylog
action.auto_create_index: false

We will also set the value of parameter xpack.security.enabled: false to disable security pack feature as it might not give outputs as expected.

sudo nano /etc/elasticsearch/elasticsearch.yml
# Enable security features
xpack.security.enabled: false

Now we will restart the service of elastic search

sudo systemctl restart elasticsearch

Now we will be creating the new password for the user elastic so that we can manage it using the default credentials.

cd /usr/share/elasticsearch && sudo ./bin/elasticsearch-reset-password -u elastic

This will ask the option to display the password as plain text in the console then press y and note the password displayed at the terminal. Now we will check wheather our elastic node is working perfect or not :

curl --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic:<PASSWORD_GENERATED> http://localhost:9200

The output should look like :

{
  "name" : "Legion",
  "cluster_name" : "graylog",
  "cluster_uuid" : "HY1TK3vQRb6_wCpKPNFHlg",
  "version" : {
    "number" : "8.17.2",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "747663ddda3421467150de0e4301e8d4bc636b0c",
    "build_date" : "2025-02-05T22:10:57.067596412Z",
    "build_snapshot" : false,
    "lucene_version" : "9.12.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

Now we have successfully configured the elastic search node and now we will start configuring the graylog datanode & the graylog server.


Installing Graylog-datanode & Graylog Server

Firstly we will fetch the local repositories file from the graylog repo server

wget https://packages.graylog2.org/repo/packages/graylog-6.1-repository_latest.deb

Now we will install the .deb package which was downloaded above using

sudo dpkg -i <package_name_graylog>.deb

Once installed the debian package we will now update the repositories & install the necessary packages

sudo apt install -y graylog-server graylog-datanode

Once installed we will start configuring graylog server and integrate with the elastic search datanode which was deployed above.

To run Graylog Data Node, the value of the "vm.max_map_count" sysctl setting needs to be at least 262144 or more. Run the following commands to set and persist the value.

 sudo sysctl -w vm.max_map_count=262144

If the value is not the same we can do this by this command :

echo "vm.max_map_count = 262144" | sudo tee /etc/sysctl.d/99-graylog-datanode.conf

Configuring Graylog-server

The config file is located on /etc/graylog/server/server.conf , Firstly we will generate the 96 characters long random key and the encrypted password string to feed as input in the config file and then edit certian parameters to run the graylog server.

Generate a secret key for password hashing:

pwgen -N 1 -s 96

Generate an admin password hash:

echo -n 'YourPassword' | sha256sum

We will enter this vaules in the config files where the parameters are password_secret & root_password_sha2

## PASSWORD SECRET
password_secret = RPASN987AEGyMaatdfPRWQRXp5yTwhtDolY8UHxVA1wiNbzF5aaaaavruEBt0Bpz70356wMG30qRLO8SSAiUg8bza3t33vyr
## ROOT PASSWD
root_password_sha2 = 6f2cb9dd8f4b65e24e1c3f3fa5bc5aaaaa49237f11abceacd45bbcb74d621c25

Set Bind Address:

http_bind_address = 0.0.0.0:9000

Connect Graylog with Elasticsearch

elasticsearch_hosts = http://127.0.0.1:9200

Start & Enable services:

sudo systemctl daemon-reload
sudo systemctl enable --now graylog-server graylog-datanode
sudo systemctl restart graylog-server graylog-datanode

Configuring datanode

Create your password_secret with the following command:

< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-96};echo;

Edit the config file:

sudo nano /etc/graylog/datanode/datanode.conf

Enter the key just generated in the password_secret to enable the datanode otherwise the datanode might not initialize

password_secret =DvM-BWV8HEMmKtxtzkG1VnWtVEL9PX9WaFfAICkNDdELcKTMsFYbs18oWpzBFYv42zGz

Ensure the following parameters are configured properly :

elasticsearch_hosts = http://127.0.0.1:9200

Save and restart:

sudo systemctl restart graylog-datanode

Accessing the Greylog UI

http://localhost:9000

Troubleshooting

Elastic search version 8.x not supported , Downgrade to 7.10.2

Step 1: Uninstall Elasticsearch 8.x

sudo systemctl stop elasticsearch
sudo apt remove --purge elasticsearch -y
sudo rm -rf /var/lib/elasticsearch /etc/elasticsearch

Step 2: Install Elasticsearch 7.10.2

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.2-amd64.deb
sudo dpkg -i elasticsearch-7.10.2-amd64.deb

Step 3: Configure Elasticsearch

Edit the config file:

sudo nano /etc/elasticsearch/elasticsearch.yml

Modify:

cluster.name: graylog
network.host: 127.0.0.1
http.port: 9200
discovery.type: single-node

Save and restart:

sudo systemctl enable --now elasticsearch

Step 4: Verify Elasticsearch

curl -X GET "http://127.0.0.1:9200"

Now restart Graylog:

sudo systemctl restart graylog-server

đŸ›Ąī¸
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/