scieee AI-readable full text Open interactive document viewer

Cybersecurity Incident Response in eHealth

Donadoni Santos, Diogo

Abstract

The thesis highlights the concept of Cybersecurity Incident Response, which involves preparing for and responding to cybersecurity breaches or attacks. It emphasizes the importance of timely and effective response to security incidents, with the goals of minimizing damage and preventing future incidents. The main objective of the thesis, which is to design a system specifically for responding to cyber attacks in a specific eHealth use case. The system will have the capability to identify potential cyber attacks in the critical assets, evaluate the impact of such attacks, and create mitigation strategies (automated response) focused on maintaining business continuity. Overall, the thesis aims to enhance the incident response capabilities of organizations operating in the eHealth sector, providing them with a systematic approach to handle cyber threats and ensure the smooth functioning of their infrastructures.

Full text

Cybersecurity Incident Response in eHealth A Master's Thesis Submitted to the Faculty of the Escola Tècnica d'Enginyeria de Telecomunicació de Barcelona Universitat Politècnica de Catalunya by Diogo Donadoni Santos In partial fulfillment of the requirements for the degree of MASTER IN CYBERSECURITY Advisor: Eva Rodriguez Luna Barcelona, May 2023 1 Title of the thesis: Cybersecurity Incident Response in eHealth Author: Diogo Donadoni Santos Advisor: Eva Rodriguez Luna Abstract The thesis highlights the concept of Cybersecurity Incident Response, which involves preparing for and responding to cybersecurity breaches or attacks. It emphasizes the importance of timely and effective response to security incidents, with the goals of minimizing damage and preventing future incidents. The main objective of the thesis, which is to design a system specifically for responding to cyber attacks in a specific eHealth use case. The system will have the capability to identify potential cyber attacks in the critical assets, evaluate the impact of such attacks, and create mitigation strategies (automated response) focused on maintaining business continuity. Overall, the thesis aims to enhance the incident response capabilities of organizations operating in the eHealth sector, providing them with a systematic approach to handle cyber threats and ensure the smooth functioning of their infrastructures. Acknowledgements I want to acknowledge Eva Rodriguez Luna (TFM Supervisor and Master Coordinator) for her support, guidance and feedback on this project but also for being the tutor for the Master in Cybersecurity. I want to acknowledge the Consortium for Continuing Education of Catalonia and the SEPE (Public State Employment Service) for subsidizing the cost of the Cybersecurity Incident Response training (86 hours). I also want to acknowledge Genís Margarit (Teacher and Cybersecurity consultant) and Tomàs Roy Català (Teacher and Director Cybersecurity Agency of Catalonia) for their knowledge sharing and support during the training where we discussed real cyber attacks that help me better understand this topic and conclude this thesis. Finally, I want to also give thanks to my family for their comprehension during these tough months that I could not give them all the attention that they deserve. 1 Revision history and approval record Revision Date Purpose 0 18/02/2023 Document creation 1 Weekly Document revision with Eva Rodriguez Luna 2 22/05/2023 Final Document revision with Eva Rodriguez Luna Written by: Reviewed and approved by: Date 15/05/2023 Date 22/05/2023 Name Diogo Donadoni Santos Name Eva Rodriguez Luna Position Project Author Position Project Supervisor 2 Table of contents Acknowledgements............................................................................................................. 1 Revision history and approval record..................................................................................2 Table of contents................................................................................................................. 3 List of Figures......................................................................................................................5 List of Tables....................................................................................................................... 6 Glossary.............................................................................................................................. 7 1. Introduction......................................................................................................................8 1.1. Objectives...............................................................................................................8 1.2. Methodology...........................................................................................................8 1.3. Planning: phases and tasks................................................................................... 9 1.4. Thesis Structure..................................................................................................... 9 2. State of the art of the technology applied in this thesis.................................................10 2.1. SIEM.....................................................................................................................10 2.1.1. SIEM alternatives and selection.............................................................11 2.2. IDS........................................................................................................................12 2.2.1. Host Intrusion Detection Systems (HIDS)..............................................12 2.2.2. Network Intrusion Detection Systems (NIDS)........................................13 2.2.3. IDS/IPS alternatives and selection........................................................ 13 2.3. EDR/XDR............................................................................................................. 14 2.3.1. XDR Front-End Components.................................................................15 2.3.2. XDR Back-End Components................................................................. 16 2.3.3. EDR/XDR alternatives and selection.....................................................17 2.4. Incident Response................................................................................................18 2.4.1. Incident response life cycle....................................................................19 2.5. Incident Response automation.............................................................................20 2.5.1. Wazuh Active Response........................................................................21 3. Problem statement........................................................................................................ 24 3.1. Critical Assets.......................................................................................................24 4. Design Overview........................................................................................................... 27 4.1. High level design.................................................................................................. 27 4.2. Low level design...................................................................................................29 5. Implementation..............................................................................................................30 5.1. eHealth Use Case................................................................................................ 30 5.2. Use case Implementation.....................................................................................31 5.2.1. VM information and software versions installed.................................... 31 5.2.2. Wazuh Server - Suricata........................................................................32 5.2.3. Extending the JSON decoder for Suricata.............................................33 5.2.4. Creating custom correlation rules from Suricata alerts..........................34 5.2.5. Active response configuration................................................................35 6. Evaluation and testing...................................................................................................36 3 6.1. Attack emulation 1: DDoS attack at Healthcare System web portal.....................36 6.2. Attack emulation 2: NMAP at Healthcare System web portal.............................. 40 7. Conclusions and future development............................................................................44 7.1. Future Works........................................................................................................45 Bibliography.......................................................................................................................46 Appendix........................................................................................................................... 48 Implementation prerequisites...................................................................................... 48 Install all the necessary packages:..............................................................................48 Installing Elasticsearch................................................................................................48 Elasticsearch installation and configuration.....................................................48 Certificates creation and deployment.............................................................. 49 Installing Wazuh server............................................................................................... 51 Installing Filebeat.........................................................................................................51 Filebeat installation and configuration............................................................. 51 Kibana installation and configuration...........................................................................53 Disabling repositories.................................................................................................. 54 Next steps - Agent Installation.....................................................................................55 Network IDS integration - Suricata.............................................................................. 55 Prerequisites....................................................................................................55 Configuration................................................................................................... 55 Attack emulation.............................................................................................. 57 Visualize the alerts...........................................................................................57 Apache web server - (Health Care System web portal).............................................. 58 4 List of Figures Figure 01 - Gantt Chart: Project Milestones 9 Figure 02 - Gartner Magic Quadrant for Intrusion Detection and Prevention Systems 11 Figure 03 - Wazu Security Events Module 12 Figure 04 - Gartner Magic Quadrant for Intrusion Detection and Prevention Systems 13 Figure 05 - XDR Overview 15 Figure 06 - Gartner - Magic Quadrant for Endpoint Protection Platforms 17 Figure 07 - Wazuh Incident Response Module 18 Figure 08 - Incident response life cycle 19 Figure 09 - Wazuh active response workflow 22 https://documentation.wazuh.com/current/_images/active-response-workflow1.png 22 Figure 10 - System High Level Design 27 Figure 11 - Wazuh Solution (Agent and Components) 28 https://documentation.wazuh.com/current/_images/wazuh-components-and-data-flow1.pn g 28 Figure 12 - Wazuh Low level design 29 Figure 13 - eHealth Use Case 30 Figure 14 - Wazuh Suricata Group 33 Figure 15 - Wazuh DDoS - GoldenEye command options 36 Figure 16 - Wazuh DDoS - GoldenEye command to attack at Healthcare System web portal 36 Figure 17 -Wazuh DDoS - Active response alert that blocked the DDoS attack 37 Figure 18 - Wazuh DDoS - GoldenEye DDoS attack event log 37 Figure 19 - Wazuh DDoS - Host Blocked by firewall-drop Active Response event log 38 Figure 20 - Wazuh DDoS - Host Blocked by firewall-drop Active Response event log (agent active-response.log) 38 Figure 21 - Wazuh DDoS - Host Unblocked by firewall-drop Active Response event log 39 Figure 22 - Wazuh DDoS - Host Unblocked by firewall-drop Active Response event log (agent active-response.log) 39 Figure 23 - Nmap command to scan the Healthcare System web portal 40 Figure 24 - Wazuh NMAP - Active response alert that blocked the NMAP 40 Figure 25 - Wazuh NMAP attack event log 41 Figure 26 - Wazuh NMAP - Host Blocked by firewall-drop Active Response event log 41 Figure 27 - Wazuh NMAP - Host Blocked by firewall-drop Active Response event log (agent active-response.log) 42 Figure 28 - Wazuh NMAP - Host Unblocked by firewall-drop Active Response event log42 Figure 29 - Wazuh NMAP- Host Unblocked by firewall-drop Active Response event log (agent active-response.log) 43 Figure 30 - Wazuh Virus Total Integration 45 5 List of Tables Table 01 - Critical assets and potential cyber-attacks of eHealth sector 6 2.2.2. Network Intrusion Detection Systems (NIDS) NIDS is a network-level intrusion detection system that monitors network traffic and detects anomalies. Unlike HIDS, it cannot inspect encrypted traffic. However, some NIDSs can take action as a result of generating an alert, which is a feature that distinguishes them from Network Intrusion Prevention Systems (NIPS). 2.2.3. IDS/IPS alternatives and selection If we look at the Gartner Magic Quadrant for 2018 in figure 04, the leaders in IDS/IPS systems are: Cisco, TrendMicro and McAfee Figure 04 - Gartner Magic Quadrant for Intrusion Detection and Prevention Systems 13 These IDS/IPS do not meet the two fundamental requirements that are free software (open source) and that have no associated cost, so they are rejected. I have considered the following open source IDS/IPS: ● Snort ● Suricata At present, there are no major significant differences between the two technologies. There are small differences pertaining to rulesets, new releases. The selected tool was Suricata due to the feature of being multi-threaded, able to take advantage of all available CPUs. It also has built-in hardware acceleration technology that can leverage the power of graphic cards to inspect network traffic and there are more documents on how to integrate it with Wazuh (SIEM). 2.3. EDR/XDR Endpoint Detection and Response (EDR) is a cybersecurity solution that collects and analyzes data from various endpoints to detect behavioral deviations and identify potential threats to the endpoint and connected information systems. EDR helps teams respond quickly by neutralizing threats and sorting alerts that could indicate a threat. According to Anton Chuvakin of Gartner [23] , EDR is "a category of tools and solutions that focus on detecting suspicious activity directly on the hosts of the information system." In other words, EDR is a new generation of anti-malware that doesn't rely solely on signature-based detection systems. Instead, EDR incorporates behavioral process analysis capabilities to identify deviations from normal behavior. According to Gartner [24]: ‘XDR is cloud-delivered technology that includes multipoint solutions and advanced analytics to correlate alerts from multiple sources into incidents from individual weaker signals to create more accurate detections. It aims to reduce product sprawl, alert fatigue, integration challenges and operational expenses, and will especially appeal to security operations teams that struggle to manage a portfolio of best-of-breed solutions or leverage a SIEM or SOAR solution.” Unlike EDR, which focuses on detecting suspicious activity at the endpoint level, XDR (Extended Detection and Response) goes beyond that by collecting and detecting potentially malicious activity across a wide range of sources such as servers, cloud, and networks. In addition to a wider range of sources, XDR also offers advanced functionalities such as increased contextualization by connecting to Cyber Threat Intelligence (CTI), greater anticipation capacity by cross-referencing detected technical information with external content, and more refined possibilities for response automation by providing even finer granularity to intervention. 14 Figure 05 - XDR Overview A credible XDR needs to have two primary components and they need to be able to be identified and evaluated by security leaders. These are described as XDR front end and XDR back end in Figure 05. 2.3.1. XDR Front-End Components To create a comprehensive XDR solution, the front-end should include at least three different components or sensors that focus on threat detection and response. These components may include but are not limited to: ● Endpoint Detection and Response (EDR): An endpoint security solution that collects and analyzes data from endpoints to identify potential security threats. ● Endpoint Protection Platforms (EPP): Security software that is deployed on endpoint devices to prevent malware infections, detect and block malicious activity, and provide threat intelligence. ● Network-based security solutions: Firewalls, Intrusion Detection and Prevention Systems (IDPS), Network Detection and Response (NDR), and other security tools that monitor network traffic for suspicious behavior and detect potential threats. ● Identity-based security: Solutions that manage user identities, authenticate users, and enforce access control policies to prevent unauthorized access. 15 ● Email security: Solutions that protect email systems from phishing attacks, malware, and other email-based threats. ● Mobile threat detection: Solutions that protect mobile devices from malicious applications and other mobile-based threats. ● Security Services Edge (SSE): A security solution that provides secure access to cloud applications and services. ● Cloud workload protection: Solutions that protect cloud-based workloads from unauthorized access, malware, and other cloud-based threats. ● Deception: Solutions that create decoys or traps that can lure attackers away from critical assets, enabling organizations to detect and respond to attacks more effectively. These front-end components work together to provide a comprehensive XDR solution that can detect and respond to threats across a wide range of sources. 2.3.2. XDR Back-End Components The back-end of an XDR system should include features such as: ● Predominantly cloud-delivered solutions, reducing the need for on-premises components to a minimum. ● Machine learning and artificial intelligence algorithms to analyze and correlate large amounts of data in real-time and identify potential threats before they escalate. ● Threat intelligence feeds and integrations with third-party security tools to enrich the data and improve threat detection. ● Dashboards and reporting tools provide to security teams the visibility into the security posture of the organization, including threat trends, incidents, and response times. ● Integration with ticketing systems, allowing security incidents to be automatically opened and assigned to the appropriate team member for resolution. ● Compliance and regulatory reporting capabilities to assist with audits and compliance requirements. ● Continuous monitoring and auditing of system configurations and changes to identify potential vulnerabilities or unauthorized access. ● Role-based access controls to ensure that only authorized users have access to sensitive data and security controls. ● Scalability and flexibility to accommodate growth and changing security requirements. 16 2.3.3. EDR/XDR alternatives and selection If we look at the Gartner Magic Quadrant for 2022 in figure 06, the leaders in EDR/XDR systems are: Microsoft, CrowdStrike, SentinelOne, Cybereason, Trend Micro and Sophos Figure 06 - Gartner - Magic Quadrant for Endpoint Protection Platforms These EDR/XDR do not meet the two fundamental requirements that are free software (open source) and that have no associated cost, so they are rejected. I selected Wazuh as the SIEM solution and this tool also provides the XDR capability so I will also take advantage of SIEM integration. Wazuh provides analysts real-time correlation and context. Active responses are granular, encompassing on-device remediation so endpoints are kept clean and operational. 17 Figure 07 - Wazuh Incident Response Module 2.4. Incident Response The security landscape has witnessed significant transformations due to the rise in the complexity of threats and the exploration of new security management techniques. The prime objective in all security-related discussions is to avoid incidents that may harm crucial assets or lead to unfavorable outcomes. According to the National Institute of Standards and Technology (NIST), a security incident can be described as "a violation or imminent threat of violation of computer security policies, acceptable use policies, or standard security practices." In other words, a security incident refers to any activity or event that violates or poses a threat to an organization's security policies, practices, or infrastructure. While threats may ultimately result in incidents that impact resources, services, and other assets, it is important to note that the steps and methodologies involved in handling these incidents should not be limited to incident response. Effective incident management requires a series of actions to be taken both before and after the incident has occurred, which can be grouped into different stages. 18 Structured operations are essential for incident handling tasks at all stages. It is imperative to establish protocols well in advance of any malicious events. Organizations should structure themselves to create appropriate teams and facilities that can handle all stages of incident response, from prevention to post-incident activities, in a seamless manner. The NIST [25] defines incident response as a continuous cycle of operations that occur before, during, and after an incident. These operations are grouped into four stages, each targeting different tasks, with the moment of detection and containment as a central reference point. Different teams may be responsible for each stage, with specialized skills and appropriate tools provided. The stages are summarized with brief descriptions of their activities and recommendations for handling them well. Using this methodology allows for timely incident response through predefined playbooks and reduces costs and service disruption. It also facilitates compliance by requiring extensive incident documentation and continuous improvement of procedures. Figure 08 represents the incident response life cycle stages. 2.4.1. Incident response life cycle The incident response life cycle consists of four stages: Figure 08 - Incident response life cycle ● Preparation: In this stage, the organization prepares for potential incidents by creating an incident response plan, establishing incident response teams, and providing training to personnel. This stage also includes conducting risk assessments and implementing appropriate security controls. ● Detection and Analysis: In this stage, incidents are detected and analyzed to determine the scope and nature of the incident. This includes identifying the affected assets, evaluating the severity of the incident, and determining the root cause. 19 ● Containment, Eradication, and Recovery: In this stage, the incident is contained to prevent further damage, eradicated to remove the threat, and the affected systems are recovered to normal operations. This stage also includes implementing corrective actions to prevent similar incidents from occurring in the future. ● Post-Incident Activity: In this stage, a thorough review of the incident response process is conducted to identify areas for improvement. This includes analyzing the effectiveness of the incident response plan, evaluating the performance of incident response teams, and updating policies and procedures based on lessons learned. It is important for organizations to have a structured approach to incident handling and to regularly review and update the incident response plan and procedures. This helps to ensure a timely and effective response to incidents, minimize the impact of incidents on business operations, and improve overall security posture. 2.5. Incident Response automation There is a growing belief that security teams are inundated with alerts, and while some of them may be inaccurate, they may miss legitimate alerts. If these alerts accumulate and are not addressed promptly or at all, critical problems may go unnoticed and worsen, resulting in a significant security breach. Detecting and responding to security incidents should occur as quickly as possible to minimize the window in which an attacker can execute an attack. Automating incident response processes using a Security Information and Event Management (SIEM) solution involves four key steps that can be highly effective. By automating repetitive tasks, security teams can free up their time to focus on more complex issues. These four steps include identifying the incident types to automate, defining response workflows and actions, integrating and testing the automation, and finally, monitoring and updating the automation to ensure its effectiveness over time. ●Creating a correlation rule : a mechanism in a SIEM solution that enables the detection of patterns and the triggering of alerts on any unusual or abnormal activity. ●Creating a custom workflow: designing a set of predefined actions and procedures to be executed when an alert is triggered. These workflows can include a sequence of automated actions, such as isolating the affected system, collecting relevant information, notifying the appropriate personnel, and initiating a targeted response to contain the attack. The goal is to automate the incident response process and reduce the time it takes to detect and respond to an incident. By creating a custom workflow, security teams can ensure that the right steps are taken promptly to minimize the impact of the attack. 20 ●Configuring an incident rule: setting up rules for incident categorization, prioritization, and assignment. Once the rule is established, incidents are automatically generated for the alerts that meet the rule's criteria, and they are assigned to the relevant security administrator for timely resolution. This ensures that security incidents are tracked, monitored, and addressed promptly, reducing the risk of a security breach. ●Managing tickets effectively: is an important step in incident response automation. By creating tickets for further investigation, security teams can prioritize and track incidents, assign them to the appropriate personnel, and ensure that they are resolved in a timely manner. This can be achieved by integrating the SIEM solution with third-party ticketing or help desk tools, which can automate the ticket creation process and ensure that all necessary information is included. This helps reduce the time it takes to resolve incidents and ensures that nothing falls through the cracks. Automated incident response capabilities can significantly enhance the effectiveness of Security Operations Centers (SOCs). By automating incident response, SOCs can detect patterns and correlate suspicious events, prioritize alerts based on severity, and trigger immediate actions through automated response workflows. This allows the first line of defense to respond to incidents quickly and effectively, reducing the time it takes to detect and respond to security incidents. Additionally, automated incident response allows SOCs to manage incidents centrally, ensuring that they are tracked and resolved efficiently. 2.5.1. Wazuh Active Response Security teams can face several challenges in incident response, including responding to high-severity incidents promptly and implementing complete mitigation actions. Gathering relevant information in real-time can also be a challenge, making it harder to understand the full extent of an incident. These issues can ultimately lead to difficulty in containing and mitigating the impact of a cyberattack. Wazuh SIEM and XDR platform improves incident response by: ● Providing real-time visibility into security events. ● Reducing alert fatigue. ● Automating response actions to threats. ● Providing out-of-the-box response scripts. The active response module of Wazuh provides security teams with the capability to automate response actions triggered by specific events, thus allowing them to efficiently handle security incidents. 21 Automating response actions ensures that high-priority incidents are addressed and remediated in a timely and consistent manner. This is especially valuable in environments where security teams are resource constrained and need to prioritize their response efforts. The active response module in Wazuh offers pre-built response scripts that can be used to quickly respond to and mitigate threats. These scripts include blocking malicious network access and deleting malicious files on monitored endpoints. This helps alleviate the workload on security teams and allows them to efficiently manage security incidents The Wazuh active response module triggers scripts on monitored endpoints based on the alert level, rule ID, or rule group. Security teams can configure multiple scripts to respond to specific triggers, but caution must be exercised to avoid vulnerabilities resulting from poorly implemented rules and responses. Figure 09 - Wazuh active response workflow https://documentation.wazuh.com/current/_images/active-response-workflow1.png Active response can be divided into two types: stateless and stateful. ●Stateless active response refers to a one-time action that doesn't have an event definition to revert or stop it. For instance, blocking an IP address in response to a security alert is a stateless response because the IP remains blocked indefinitely, even after the alert has been resolved. ●Stateful active response, on the other hand, refers to actions that are reversible or stoppable after a certain period of time. For example, quarantining a compromised endpoint in response to an alert is a stateful response because the endpoint can be released from quarantine after a period of time or after the threat has been neutralized. 22 4.2. Low level design It is feasible to run the Wazuh process in an environment with root or with an unprivileged user depending on the situation. The service in linux is executed either with systemctl, service or initctl, in the case of windows C:\Program Files (x86)\ossec-agent\win32ui.exe is used. A diagram of the network communications flow is shown in figure 12. Figure 12 - Wazuh Low level design https://lh4.googleusercontent.com/qQeVUQWREoQfmpO9RECalTM3w9moy636 M5aA4x7Z8bRf_3GWed4wgBSEmrtZLhqUGcpgQj4LJeYp5HAtxU6_YWW4VnK9 mOcP2KkMFd7aUKfN6TMZChkbkusfn73ySeW28RH32yp5 Connections between agents and managers in Wazuh are secured using pre-shared keys (AES) and encrypted using compression. This occurs via TCP or UDP 1514. Additionally, Wazuh's Remote Daemon is capable of accepting TCP and/or UDP port 514 messages directly from syslog-sending devices. For more robust centralized syslog collection, syslog servers can be installed on agents. Wazuh employs authentication and encryption to ensure secure communication. All communications between Wazuh components are encrypted using either AES or TLS encryption. The Wazuh manager worker nodes utilize TLS to synchronize configuration and status data with the manager master node. Each agent is assigned a unique cryptographic key, which is used to report to the manager securely. Despite the significant privilege separation and isolation implemented in the Wazuh server, it is still recommended to implement additional security measures, particularly if remote commands are enabled, as other systems may depend on and be affected by it. 29 5. Implementation In this chapter, we will cover the eHealth use case and details regarding the implementation of the architecture proposed in the previous chapter The framework architecture is based on the one discussed in the previous chapter and will be focused on the automated response to incidents by means of mitigation or remediation strategies packaged into correlation, incident rules and custom workflow. 5.1. eHealth Use Case We will consider a generic scenario where we have a public hospital with local infrastructure. In this use case, we have identified the Healthcare System web portal as a critical asset that requires protection using incident response automation. The primary objective is to quickly respond to DDos attacks to ensure that the portal remains functional and operational, thereby ensuring business continuity. Figure 13 - eHealth Use Case 30 5.2. Use case Implementation The installation of Wazuh, ElasticSearch, Filebeat, Kibana, Suricata, Apache Server (Health Care System web portal) and attacker machine was done in my personal computer, which has the following characteristics: • Windows 11 Pro 64-bit • Lenovo X1 Yoga 3rd Generation, i7-8650U CPU 1.90GHz with 8 GB of RAM • 256 GB SSD hard drive These virtual machines have been created in Oracle VM Virtualbox and the software was installed following the instructions in Appendix. 5.2.1. VM information and software versions installed Wazuh/ElasticSearch/Filebeat/Kibana Server ● hostname : ubuntuwazuh ● IP : 10.0.12.4 ● Operating System: Ubuntu 22.04 LTS ● Kernel: Linux 5.19.0-38-generic ● Wazuh Server version 4.3.10 ●Wazuh Server revision 40323 ● ElasticSearch version 7.17.9 ● Filebeat version 7.17.9 ● Kibana version 7.17.9 Suricata/Apache Server (Health Care System web portal) ● hostname : osboxes ● IP : 10.0.12.6 ● Operating System: Ubuntu 22.04 LTS ● Kernel: Linux 5.19.0-38-generic ● Suricata version 6.0.10 ● Apache Server version 2.4.41 ● Wazuh client version 4.3.10 ● Wazuh client revision 40323 Attacker Machine ● hostname : ca ● IP : 10.0.12.20 ● Operating System: Kali GNU/Linux Rolling ● Kernel: Linux 5.18.0-kali7-amd64 31 5.2.2. Wazuh Server - Suricata In order to centrally manage the configuration of all endpoints with Suricata installed, create a new agent group called Suricata and add the Ubuntu agent where suricata is installed. Creating an agent group and adding an agent 1. Create an agent group called Suricata: sudo /var/ossec/bin/agent_groups -a -g Suricata -q 2. Get the ID of all agents you want to add to this category: sudo /var/ossec/bin/manage_agents -l 3. Include the agent ID using the command below: sudo /var/ossec/bin/agent_groups -a -i <AGENT_ID> -g Suricata -q Where: AGENT_ID is the ID of the agent you want to add to the Suricata group. 4. Add the following configuration to the Suricata group shared agent configuration file /var/ossec/etc/shared/Suricata/agent.conf: <agent_config> <localfile> <log_format>json</log_format> <location>/var/log/suricata/eve.json</location> </localfile> </agent_config> 32 Figure 14 - Wazuh Suricata Group 5.2.3. Extending the JSON decoder for Suricata In Suricata logs, the src_ip field holds the IP address of the malicious actor. The Wazuh firewall-drop active response script expects the field srcip in the alert that triggers the active response. To ensure that the field src_ip is processed by the active response scripts, we configure a custom decoder to map the src_ip field to srcip. To do this, perform the following steps: 1. Add the decoders below to the local decoders file /var/ossec/etc/decoders/local_decoder.xml: <decoder name="json"> <prematch>^{\s*"</prematch> </decoder> <decoder name="json_child"> <parent>json</parent> <regex type="pcre2">"src_ip":"([^"]+)"</regex> <order>srcip</order> </decoder> <decoder name="json_child"> <parent>json</parent> <plugin_decoder>JSON_Decoder</plugin_decoder> </decoder> 2. Restart the Wazuh manager for the changes to apply: sudo systemctl restart wazuh-manager 33 5.2.4. Creating custom correlation rules from Suricata alerts On the Wazuh server, we added custom rules to detect the use of the GoldenEye DoS attack and Nmap scripting engine from Suricata alerts. These rules will be used by the active response module to trigger the firewall-drop script on the Ubuntu agent where Health Care System web portal is installed 1. Add the following rules to the /var/ossec/etc/rules/local_rules.xml file: <group name="custom_active_response_rules,"> <rule id="100200" level="12"> <if_sid>86601</if_sid> <field name="event_type">^alert$</field> <match>ET DOS Inbound GoldenEye DoS attack</match> <description>GoldenEye DoS attack has been detected. </description> <mitre> <id>T1498</id> </mitre> </rule> <rule id="100201" level="12"> <if_sid>86601</if_sid> <field name="event_type">^alert$</field> <match>ET SCAN Nmap Scripting Engine User-Agent Detected (Nmap Scripting Engine)</match> <description>Nmap scripting engine detected. </description> <mitre> <id>T1595</id> </mitre> </rule> </group> 34 5.2.5. Active response configuration Wazuh includes an out-of-box firewall-drop script that adds the IP address extracted from an alert to the monitored endpoints firewall block list. Configure the firewall-drop active response on the Wazuh server using the following step 1. Open the Wazuh server configuration file /var/ossec/etc/ossec.conf and confirm the command section for firewall-drop exists. Add the configuration block below if it does not: <ossec_config> <command> <name>firewall-drop</name> <executable>firewall-drop</executable> <timeout_allowed>yes</timeout_allowed> </command> </ossec_config> 2. Edit the Wazuh server configuration file /var/ossec/etc/ossec.conf and add the following section: <ossec_config> <active-response> <command>firewall-drop</command> <location>local</location> <rules_id>100200, 100201</rules_id> <timeout>180</timeout> </active-response> </ossec_config> The firewall-drop script adds the malicious IP address to the firewall block list on the monitored agent. location: This specifies where the active response command is executed. To execute the script on the Wazuh agent, we use local. rules_id: This limits the execution of the active response script to when rules 100200 and 100201 fire. Rules can be separated with the use of a comma. timeout: This specifies the time in seconds, taken before the active response command is reversed. 3. Restart the Wazuh manager for the configuration changes to apply: sudo systemctl restart wazuh-manager 35 6. Evaluation and testing In order to evaluate the performance on the proof of concept of the proposed use case a series of tests have been conducted. These aim at testing various aspects, or components, of the proposed architecture implementation, along the whole workflow, from the reception of alert to the automated response through the deployment of custom workflow. 6.1. Attack emulation 1: DDoS attack at Healthcare System web portal Denial of service attacks aims to render system resources unavailable to users. In this scenario, we used the GoldenEye tool installed on the Kali Linux endpoint to perform a DDoS attack against the web server (Healthcare System web portal) on the Ubuntu endpoint. GoldenEye is a HTTP DoS Test Tool. This tool can be used to test if a site is susceptible to Distributed Denial of Service (DDoS) attacks. It is possible to open several parallel connections against a URL to check if the web server can be compromised. The program tests the security in networks and uses ‘HTTP Keep Alive ● NoCache’ as attack vector. Figure 15 - Wazuh DDoS - GoldenEye command options Navigate to the folder where the GoldenEye repository was cloned. Run the following command to launch the attack: ./goldeneye.py http://<Ubuntu_IP> Figure 16 - Wazuh DDoS - GoldenEye command to attack at Healthcare System web portal 36 We can see in the figure 17 the Wazuh active response alert that blocked the DDoS attack. Figure 17 -Wazuh DDoS - Active response alert that blocked the DDoS attack We can see in the figure 18 the event log of the Wazuh active response alert that blocked the DDoS attack. Figure 18 - Wazuh DDoS - GoldenEye DDoS attack event log 37 We can see in the figure 19 the Wazuh active response alert that blocked in the Wazuh agent the DDoS attack. Figure 19 - Wazuh DDoS - Host Blocked by firewall-drop Active Response event log We can see in the figure 20 the agent active-response.log of the Wazuh client with the active response alert that blocked the DDoS attack. Figure 20 - Wazuh DDoS - Host Blocked by firewall-drop Active Response event log (agent active-response.log) 38 7.1. Future Works Some improvements can be made to the proposed system, with some regarding the usage of additional Wazuh modules or integration of external features. One of the improvements would be including the additional Wazuh module called Malware detection, it uses a non-signature-based approach and is capable of detecting anomalies and the possible presence of rootkits. Also, it looks for hidden processes, hidden files, and hidden ports while monitoring system calls. As part of the external features would be including the integration VirusTotal, as it aggregates many antivirus products and online scan engines, offering an API that can be queried by using either URLs, IPs, domains or file hashes. The Wazuh integration can automatically perform a request to VirusTotal API with the hashes of files that are created or changed in any folder monitored with FIM. If VirusTotal’s response is positive Wazuh will generate an alert in the system: Figure 30 - Wazuh Virus Total Integration https://wazuh.com/uploads/2020/07/virustotal-flow-diagram.png (1)File monitoring. The FIM module detects a file change and triggers an alert (2). (3) VirusTotal request. After FIM triggers an alert, the Wazuh manager queries VirusTotal with the hash of the file. (4) Alerting. If positive matches are found, the Wazuh manager generates a VirusTotal alert. 45 Bibliography [1] Dorri, Ali, Salil S. Kanhere, Raja Jurdak, and Praveen Gauravaram. "Blockchain for IoT security and privacy: The case study of a smart home." In 2017 IEEE international conference on pervasive computing and communications workshops (PerCom workshops), pp. 618-623. IEEE, 2017. [2] Deng, Zhiliang, Yongjun Ren, Yepeng Liu, Xiang Yin, Zixuan Shen, and Hye-Jin Kim. "Blockchain-based trusted electronic records preservation in cloud storage." Comput. Mater. Continua 58, no. 1 (2019): 135-151. [3] Vankamamidi S, Naresh, Suryateja, S. Pericherla, Pilla Sita Rama, Murty, Sivaranjani Reddy, “Internet of Things in Healthcare: Architecture, Applications, Challenges, and Solutions”, Comput Syst Sci & Eng (2020) 6: 411–421 © 2020 Tech Science Press [4] Wang, J, Chen, W, Wang, L, Ren, Y, and Sherratt, R, “Blockchain-based data storage mechanism for the industrial internet of things”, Intelligent Automation and Soft Computing, 26 (5). pp. 1157-1172. ISSN 2326-005X [5] Pranav Ratta, Amanpreet Kaur, Sparsh Sharma, Mohammad Shabaz, and Gaurav Dhiman, “Application of Blockchain and Internet of Things in Healthcare and Medical Sector: Applications, Challenges, and Future Perspectives”, Hindawi Journal of Food Quality Volume 2021, Article ID 7608296, 20 pages [6] Luis Fernandes, “Data security and privacy in times of pandemic”, Proceedings of the digital Privacy and security conference, 2021. [7] Bhosale, Karuna S., Maria Nenova, and Georgi Iliev. "A study of cyber-attacks: In the healthcare sector." In 2021 Sixth Junior Conference on Lighting (Lighting), pp. 1-6. IEEE, 2021. [8] Chen, Hao, Xueqin Jia, and Heng Li. "A brief introduction to IoT gateway." In IET international conference on communication technology and application (ICCTA 2011), pp. 610-613. IET, 2011. [9] José Luis, Fernández-Alemán, Inmaculada Carrión Señor, Pedro Ángel Oliver Lozoya, Ambrosio Toval “Security and privacy in electronic health records: A systematic literature review”, Journal of Biomedical Informatics 46 (2013) 541–562 [10] Mohammad Zarour, Mamdouh Alenezi, Md Tarique Jamal Ansari, Abhishek Kumar Pandey, Masood Ahmad, Alka Agrawal, Rajeev Kumar, Raees Ahmad Khan, “Ensuring data integrity of healthcare information in the era of digital health”, Healthcare Technology Letters, 23 March 2021 [11] Delia Ioana Dogaru, I. D. (2017). Cyber Security in Healthcare Networks. International Conference on E-Health and Bioengineering (pp. 414-417). Sinaia,Romania: IEEE. [12] Zheng, Zibin, Shaoan Xie, Hongning Dai, Xiangping Chen, and Huaimin Wang. "An overview of blockchain technology: Architecture, consensus, and future trends." In 2017 IEEE international congress on big data (BigData congress), pp. 557-564. Ieee, 2017. [13] M. Scott, N. Wingfield, Hacking attack has security experts scrambling to contain fallout, New York Times, (2017) https://www.nytimes.com/2017/05/13/world/asia/cyberattacks-online-security-.html . 46 [14] S. Mansfield-Devine, Ransomware: taking businesses hostage, Netw. Secur. 2016, (2016), pp. 8–17, http://dx.doi.org/10.1016/S1353-4858(16)30096-4. [15] R. Winton, Hollywood hospital pays $17,000 in bitcoin to hackers; FBI investigating, Los Angeles Times, (2016) https://www.latimes.com/business/technology/la-me-ln-hollywood-hospital-bitcoin-201602 17-story.html. (Accessed 19 February 2018). [16] A. Morse - National Audit Office Investigation: WannaCry cyber attack and the NHS https://www.nao.org.uk/wp-content/uploads/2017/10/Investigation-WannaCry-cyber-attack -and-the-NHS.pdf . (Accessed 19 February 2018). [17] D. Storm, MEDJACK, Hackers hijacking medical devices to create backdoors in hospital networks, Comput. World, (2015), p. 8 https://www.computerworld.com/article/2932371/medjack-hackers-hijacking-medical-devi ces-to-create-backdoors-in-hospital-networks.html . (Accessed 19 February 2018). [18] Zhou, Zhili, Akshat Gaurav, B. B. Gupta, Hedi Hamdi, and Nadia Nedjah. "A statistical approach to secure health care services from DDoS attacks during COVID-19 pandemic." Neural Computing and Applications (2021): 1-14. [19] Ray, Soumya, and Sandip Dutta. "DDoS Detection and Prevention of Attacks on M-Health Sensitive Data: A novel approach." (2022). [20] [12] S. Stein and J. Jacobs, “Cyber-Attack Hits U.S. Health Agency Amid Covid-19 Outbreak,” 2020. [Online]. Available: https://www.bloomberg.com/news/articles/2020-03-16/u-s-health-agency-suffers-cyber-att ack-during-covid-19-response . [Accessed: 04-May-2020]. [21] A. Mercader / S. Cid, “The Ransomexx gang claims responsibility for the cyberattack against Catalan hospitals and leaks patient data,” 2022. [Online]. Available: https://cronicaglobal.elespanol.com/vida/ransomexx-ciberataque-hospitales-catalanes-filtr a-datos-pacientes_728849_102.html. [Accessed: 17-Feb-2023]. [22] N. Portella, “The cyberattack that has paralysed Barcelona's Hospital Clínic: "No ransom will be paid"” 2023. [Online]. Available: https://www.elnacional.cat/en/news/cyberattack-paralysed-barcelona-hospital-clinic-no-ra nsom-paid_982914_102.html. [Accessed: 06-Mar-2023]. [23] A.Chuvakin, Gartner “Named Endpoint Threat Detection & Response-Anton Chuvakin” Gartner [Online] Available: http://blogs.gartner.com/anton-chuvakin/2013/07/26/named-endpoint-threat-detection-res ponse/ [Accessed: 26 July 2013]. [24] C.Lawson, P. Firstbrook, P. WebberA.Chuvakin, Gartner “Market Guide for Extended Detection and Response” Gartner [Online] Available: https://www.gartner.com/doc/reprints?id=1-283MGU5C&ct=211115&st=sb [Accessed: 8 November 2021]. [25] P. Cichonski, T. Millar, T. Grance, and K. Scarfone, “Computer security incident handling guide”, tech. rep., NIST, August 2012 https://nvlpubs.nist.gov/nistpubs/specialpublications/nist.sp.800-61r2.pdf 47 Appendix In this chapter some information regarding how to run the proof of concept implementation discussed in chapter 5 is provided. The commands provided were used to deploy it in an Ubuntu 22.04 environment. Implementation prerequisites Some extra packages are needed for the installation, such as curl or unzip, which will be used in further steps. However, this step can be skipped if curl and unzip are already installed on the server. Install all the necessary packages: apt-get install apt-transport-https zip unzip lsb-release curl gnupg Installing Elasticsearch Elasticsearch is a highly scalable full-text search and analytics engine. 1 - Install the GPG key: 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 2 - Add the repository 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 3 - Update the package information: apt-get update Elasticsearch installation and configuration 1 - Install the Elasticsearch package: apt-get install elasticsearch=7.17.9 48 2- Download the configuration file /etc/elasticsearch/elasticsearch.yml as follows: curl -so /etc/elasticsearch/elasticsearch.yml https://packages.wazuh.com/4.4/tpl/elastic-basic/elasticsearch_all_in_one.yml Certificates creation and deployment 1 - Download the configuration file for creating the certificates: curl -so /usr/share/elasticsearch/instances.yml https://packages.wazuh.com/4.4/tpl/elastic-basic/instances_aio.yml In the following steps, a file that contains a folder named after the instance defined here will be created. This folder will contain the certificates and the keys necessary to communicate with the Elasticsearch node using SSL. 2 - The certificates can be created using the elasticsearch-certutil tool: /usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --in instances.yml --keep-ca-key --out ~/certs.zip 3 - Extract the generated /usr/share/elasticsearch/certs.zip file from the previous step. unzip ~/certs.zip -d ~/certs 4 - The next step is to create the directory /etc/elasticsearch/certs, and then copy the CA file, the certificate and the key there: 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 5 - Enable and start the Elasticsearch service: systemctl daemon-reload systemctl enable elasticsearch systemctl start elasticsearch 49 6 - Generate credentials for all the Elastic Stack pre-built roles and users: /usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto The command above will prompt an output like this. Save the password of the elastic user for further steps: Output Changed password for user elastic PASSWORD elastic = AN4UeQGA7HGl5iHpMla7 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 Output { "name" : "elasticsearch", "cluster_name" : "elasticsearch", "cluster_uuid" : "CFw_rkxnR7avI7pBv9MvtQ", "version" : { "number" : "7.17.9", "build_flavor" : "default", "build_type" : "rpm", "build_hash" : "ef48222227ee6b9e70e502f0f0daa52435ee634d", "build_date" : "2023-01-31T05:34:43.305517834Z", "build_snapshot" : false, "lucene_version" : "8.11.1", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" } 50 Installing Wazuh server 1 - Install the Wazuh manager package: apt-get install wazuh-manager 2 - Enable and start the Wazuh manager service: systemctl daemon-reload systemctl enable wazuh-manager systemctl start wazuh-manager 3 - Run the following command to check if the Wazuh manager is active: systemctl status wazuh-manager Installing Filebeat Filebeat is the tool on the Wazuh server that securely forwards alerts and archived events to Elasticsearch. Filebeat installation and configuration 1 - Install the Filebeat package: apt-get install filebeat=7.17.9 2 - Download the pre-configured Filebeat config file used to forward Wazuh alerts to Elasticsearch: curl -so /etc/filebeat/filebeat.yml https://packages.wazuh.com/4.4/tpl/elastic-basic/filebeat_all_in_one.yml 3 - Download the alerts template for Elasticsearch: curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/4.4/extensions/elasticsearch/7.x/wazuh-t emplate.json chmod go+r /etc/filebeat/wazuh-template.json 4 - Download the Wazuh module for Filebeat: curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.2.tar.gz | tar -xvz -C /usr/share/filebeat/module 51 5 - Edit the file /etc/filebeat/filebeat.yml and add the following line: output.elasticsearch.password: <elasticsearch_password> Values to be replaced: <elasticsearch_password>: the password generated during the Elasticsearch installation and configuration for the elastic user. Replace elasticsearch_password with the previously generated password for elastic user. 6 - Copy the certificates into /etc/filebeat/certs/ 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 7 - Enable and start the Filebeat service: systemctl daemon-reload systemctl enable filebeat systemctl start filebeat To ensure that Filebeat has been successfully installed, run the following command: filebeat test output Output elasticsearch: https://127.0.0.1:9200... parse url... OK connection... parse host... OK dns lookup... OK addresses: 127.0.0.1 dial up... OK TLS... security: server's certificate chain verification is enabled handshake... OK 52 TLS version: TLSv1.3 dial up... OK talk to server... OK version: 7.17.9 Kibana installation and configuration Kibana is a flexible and intuitive web interface for mining and visualizing the events and archives stored in Elasticsearch. 1 - Install the Kibana package: apt-get install kibana=7.17.9 2 - Copy the Elasticsearch certificates into the Kibana configuration folder: 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 chown -R kibana:kibana /etc/kibana/ chmod -R 500 /etc/kibana/certs chmod 440 /etc/kibana/certs/ca/ca.* /etc/kibana/certs/kibana.* Edit the /etc/kibana/kibana.yml file: elasticsearch.password: <elasticsearch_password> Values to be replaced: <elasticsearch_password>: the password generated during the Elasticsearch installation and configuration for the elastic user. 4 - Create the /usr/share/kibana/data directory: mkdir /usr/share/kibana/data chown -R kibana:kibana /usr/share/kibana 53 5 - Install the Wazuh Kibana plugin. The installation of the plugin must be done from the Kibana home directory as follows: 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.4.1_7.17.9-1.zip 6 - Link Kibana's socket to privileged port 443: setcap 'cap_net_bind_service=+ep' /usr/share/kibana/node/bin/node 7 - Enable and start the Kibana service: systemctl daemon-reload systemctl enable kibana systemctl start kibana 8 - Access the web interface using the password generated during the Elasticsearch installation process: URL: https://<wazuh_server_ip> user: elastic password: <PASSWORD_elastic> Upon the first access to Kibana, the browser shows a warning message stating that the certificate was not issued by a trusted authority. An exception can be added in the advanced options of the web browser or, for increased security, the ca.crt file previously generated can be imported to the certificate manager of the browser. Alternatively, a certificate from a trusted authority can be configured. Disabling repositories This installation guide describes how to install and configure Wazuh and Elastic Stack by first configuring their repositories. With each new release of Wazuh or Elastic Stack, the development team at Wazuh thoroughly tests the compatibility of each component and performs necessary adjustments before releasing a new Wazuh Kibana plugin. We recommend disabling the repositories so that the individual packages will not be updated unintentionally, which could potentially lead to having a version of the Elastic Stack for which the Wazuh integration has not been released yet. sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/elastic-7.x.list apt-get update 54