Shahid Akhter
5 min readAug 9, 2024

Enhancing Security with Wazuh and CriminalIP Integration: A Comprehensive Guide — By Shahid Akhter

Enhancing Security with Wazuh and CriminalIP Integration: A Comprehensive Guide

As cyber threats become increasingly sophisticated, integrating powerful tools for security monitoring and threat intelligence is critical. In this blog post, I will guide you through integrating Wazuh — an open-source security monitoring platform — with CriminalIP, a leading threat intelligence service. This integration not only enhances Wazuh’s capabilities but also provides actionable insights through detailed threat intelligence.

By the end of this post, you will have a clear understanding of how to set up the integration, interpret the results, and leverage this powerful combination to strengthen your security posture.

Why Choose Wazuh?

Wazuh is a robust, open-source platform that offers unified security monitoring, incident detection, and compliance management across diverse environments. It integrates various security functions into a single platform, making it easier to manage and secure your infrastructure.

Key Features of Wazuh:

- Real-time Threat Detection: Wazuh continuously monitors your infrastructure for potential threats and anomalies, ensuring timely detection and response.
- Compliance Management: Helps ensure compliance with regulations such as PCI DSS, HIPAA, and GDPR by providing the necessary monitoring and reporting tools.
- Incident Response: Automates responses to detected threats, such as blocking malicious IP addresses or sending alerts.
- Scalability: Capable of monitoring thousands of endpoints, making it suitable for large and complex environments.
- Integration: Easily integrates with other security tools like SIEM systems, cloud platforms, and, as we will explore, CriminalIP.

What is CriminalIP?

CriminalIP is a comprehensive threat intelligence service that provides detailed information about IP addresses, domains, and other network elements. It helps security teams identify and block potential threats by providing in-depth reports and risk assessments.

Features of CriminalIP:

- Risk Scoring: CriminalIP assigns both inbound and outbound risk scores to IP addresses, helping to gauge the threat level associated with them.
- Threat Indicators: CriminalIP detects whether an IP address is associated with VPNs, TOR networks, proxies, cloud services, hosting services, or dark web activities.
- Detailed Reports: Offers extensive reports on IP addresses, including WHOIS data, detected vulnerabilities, associated domains, and more.
- API Integration: Allows seamless integration with other security tools, enabling automated threat detection and response.

Understanding the Integration: Wazuh and CriminalIP

How It Works

This integration involves using a custom Python script and specific XML rules to query CriminalIP’s API for intelligence related to IP addresses detected by Wazuh. The returned data, including risk scores and threat indicators, is then used by Wazuh to automatically generate alerts, classify threats, or block IP addresses.

Key Data Points Analyzed

1. Risk Scores (Inbound and Outbound):
— Inbound Score: Indicates the potential threat level of an IP address targeting your systems. A higher score suggests a higher likelihood of malicious activity originating from that IP.
— Outbound Score: Reflects the potential threat of an IP address within your network targeting external systems. This score helps in identifying compromised assets within your infrastructure.

Types of Scores:
— Low: Minimal risk, often benign or safe IP addresses.
— Moderate: Potential risk, may require further investigation.
— High: Significant risk, likely associated with malicious activities.
— Critical: Highest risk, indicating known malicious activity or severe threats.

2. Threat Indicators:
— Is VPN: Identifies if the IP address is associated with a Virtual Private Network. Attackers often use VPNs to mask their true location.
— Is TOR: Indicates whether the IP address is part of the TOR network, often used to maintain anonymity.
— Is Proxy: Detects if the IP address is a proxy, which can be used to reroute traffic and hide the origin.
— Is Cloud: Identifies whether the IP address belongs to a cloud service provider, which could indicate either legitimate cloud-based services or compromised cloud resources.
— Is Hosting: Determines if the IP address is associated with hosting services, which can sometimes be used for hosting malicious content.
— Is Dark Web: Flags IP addresses that have been associated with dark web activities, indicating a high likelihood of involvement in illicit activities.
— Is Scanner: Detects if the IP address is linked to scanning activities, which may indicate reconnaissance efforts by attackers.
— Is Snort: Identifies whether the IP address has been flagged by Snort, a popular intrusion detection system, for malicious behavior.
— Is Anonymous VPN: Similar to the VPN indicator, but specifically flags VPN services known for enabling anonymity.

Configuring the Integration

Before configuring, you’ll need to get an API key from criminalIP website.

To implement the Wazuh and CriminalIP integration, follow these steps:

  1. Clone the Repository: Clone the repository from [GitHub]

(https://github.com/shahidakhter786/wazuh-criminalip-integration) to your Wazuh server.

2. Set Up the Python Script:
 — The `custom-criminalip.py` script needs to be configured with your CriminalIP API key. This script queries CriminalIP’s API and processes the data received. Add your API key in the ossec.conf integration block.
 — Place the script in the appropriate directory on your Wazuh server.

3. Deploy the Rules:
— The `rules.xml` file contains the necessary rules for Wazuh to parse and act upon the data received from CriminalIP.
— Copy this file into the Wazuh rules directory to enable the integration.

4. Update Wazuh Configuration:
— Use the provided `ossec.conf` to ensure that Wazuh is correctly configured to use the CriminalIP integration. This configuration file includes settings that direct Wazuh to trigger alerts based on CriminalIP data.

5. Test the Integration:
— After setting everything up, run test alerts through Wazuh to verify that the integration is functioning as expected. Check if Wazuh is generating alerts with enriched data from CriminalIP.

Analyzing Results: What to Expect

You’ll be seeing results like this:

When the integration is active, you will start receiving alerts enriched with data from CriminalIP. Here’s how to interpret some of the key fields:

- Inbound and Outbound Scores: Use these to prioritize incidents. For example, a high outbound score might indicate that an internal system is compromised and is attempting to attack external targets.
- Threat Indicators: Each indicator provides insights into the nature of the threat:
— Is VPN: If true, consider the possibility of an attacker masking their location.
— Is TOR: A true value here suggests the need for immediate attention, as TOR is often used for illicit activities.
— Is Scanner: Indicates that the IP might be performing reconnaissance, which is often a precursor to an attack.
— Is Dark Web: If true, the IP has a strong association with illegal activities, warranting a high-priority response.

Benefits of This Integration

By integrating Wazuh with CriminalIP, you unlock several key benefits:

- Enhanced Threat Detection: The combination of Wazuh’s monitoring capabilities and CriminalIP’s threat intelligence provides a more comprehensive view of potential threats.
- Automated Incident Response: With enriched data from CriminalIP, Wazuh can automatically block high-risk IPs or escalate alerts based on detailed threat indicators.
- Increased Contextual Awareness: The detailed data provided by CriminalIP, including risk scores and threat indicators, helps you better understand the nature and severity of threats, enabling more informed decision-making.

Conclusion

The integration of Wazuh and CriminalIP offers a powerful toolset for enhancing your cybersecurity defenses. By leveraging CriminalIP’s threat intelligence within Wazuh, you can gain deeper insights into potential threats, automate responses, and better protect your infrastructure.

For those interested in setting up this integration, all the necessary files and instructions are available in my [GitHub repository].

. Feel free to explore the repository, implement the integration, and enhance your security operations.

If you have any feedback or encounter any issues, don’t hesitate to reach out. Let’s continue to build a more secure cyberspace together!