OSSEC Wazuh Documentation Release 0.1
Total Page:16
File Type:pdf, Size:1020Kb
OSSEC Wazuh documentation Release 0.1 Wazuh, Inc. Oct 30, 2017 Contents 1 About this documentation 1 2 Installation guide 3 2.1 OSSEC HIDS..............................................3 2.2 Wazuh HIDS............................................... 12 2.3 First steps................................................. 13 3 Integration with ELK Stack 17 3.1 Components and architecture...................................... 17 3.2 Java 8 JRE................................................ 20 3.3 Logstash................................................. 21 3.4 Elasticsearch............................................... 26 3.5 Kibana.................................................. 29 4 OSSEC Wazuh Reference 35 4.1 Manage agents.............................................. 35 4.2 OSSEC Authd.............................................. 36 4.3 Integrator................................................. 37 4.4 Agent ID reusage............................................. 39 5 OSSEC Wazuh RESTful API 41 5.1 Installation................................................ 42 5.2 Reference................................................. 45 5.3 Examples................................................. 65 6 OSSEC Wazuh Ruleset 69 6.1 Introduction............................................... 69 6.2 Manual installation............................................ 70 6.3 Automatic installation.......................................... 71 6.4 Wazuh rules............................................... 72 6.5 Contribute to the ruleset......................................... 77 6.6 What’s next................................................ 77 7 OSSEC Docker container 79 7.1 Docker installation............................................ 79 7.2 OSSEC-ELK Container......................................... 80 7.3 OSSEC HIDS Container......................................... 81 i 8 OSSEC deployment with Puppet 83 8.1 Puppet master installation........................................ 83 8.2 PuppetDB installation.......................................... 84 8.3 Puppet agents installation........................................ 86 8.4 Puppet certificates............................................ 86 8.5 OSSEC Puppet module.......................................... 87 9 OSSEC for Amazon AWS 93 9.1 OSSEC integration with Amazon AWS................................. 93 9.2 Use Cases................................................. 97 9.3 Contribute to the ruleset......................................... 113 9.4 What’s next................................................ 113 10 OSSEC for PCI DSS 115 10.1 Introduction............................................... 115 10.2 Log analysis............................................... 115 10.3 Rootcheck - Policy monitoring...................................... 118 10.4 Rootcheck - Rootkits detection..................................... 120 10.5 File Integrity Monitoring......................................... 121 10.6 Active response.............................................. 124 10.7 ELK................................................... 124 10.8 What’s next................................................ 124 ii CHAPTER 1 About this documentation Welcome to Wazuh documentation. Here you will find instructions to install and deploy OSSEC HIDS, both the official version and our forked one. Please note that this documentation is not intended to substitute OSSEC HIDS documentation, or the reference manual, which are currently maintained by the project team members and external contributors. Wazuh team is currently supporting OSSEC enterprise users, and decided to develop and publish additional capabilities as a way to contribute back to the Open Source community. Find below a list and description of our main projects, that have been released under the terms of GPLv2 license. • OSSEC Wazuh Ruleset: Includes new rootchecks, decoders and rules, increasing OSSEC monitoring and de- tection capabilities. Those have also been tagged for PCI Data Security Standard, allowing users to monitor compliance for each of the standard requirements. Users can contribute to this ruleset by submitting pull re- quests to our Github repository. Our team will continue to maintain and update it periodically. • Wazuh HIDS: Our OSSEC fork. Implements bug fixes and new features. It provides extended JSON logging ca- pabilities, for easy integration with ELK Stack and third party log management tools. It also includes compliance support, and modifications in OSSEC binaries needed by the OSSEC RESTful API. • Wazuh RESTful API: Used to monitor and control your OSSEC deployment, providing an interface to interact with the manager from anything that can send an HTTP request. • Pre-compiled installation packages, both for OSSEC agent and manager: Including repositories for RedHat, CentOS, Fedora, Debian, Ubuntu and Windows. • Puppet scripts for automatic OSSEC deployment and configuration. • Docker containers to virtualize and run your OSSEC manager and an all-in-one integration with ELK Stack. Note: If you want to contribute to this documentation or our projects please head over to our Github repositories. You can also join our users mailing list, by sending an email to [email protected], to ask questions and participate in discussions. 1 OSSEC Wazuh documentation, Release 0.1 2 Chapter 1. About this documentation CHAPTER 2 Installation guide Two different installation options: OSSEC HIDS and Wazuh HIDS. Please read carefully below to learn the dif- ferencies between these two options since it might be key for the utilization of further items of your interest in this documentation. OSSEC HIDS installers contain the latest stable version as stated at OSSEC project Github repository. Wazuh creates and maintains OSSEC installers for the Open Source community, and you can find the instructions on how to use them in this documentation section. Wazuh HIDS is an OSSEC fork, that contains additional features for the OSSEC manager, such as compliance support and extended JSON logging capabilities, that allow the integration with ELK Stack (Elasticsearch, Logstash and Kibana) and other log management tools. As well, this installation is ready for the utilization of the Wazuh RESTful API. OSSEC HIDS OSSEC HIDS Latest Stable Release (2.8.3) OSSEC is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response. It runs on most operating systems, including Linux, MacOS, Solaris, HP-UX, AIX and Windows. You can find more information at OSSEC HIDS project documentation, or the reference manual. Note: For the OSSEC manager, this version doesn’t allow the integration with ELK Stack neither the use of Wazuh RESTFUL API. If you plan to use either of these two, or both, follow the Wazuh HIDS installation guide instead. Debian packages 3 OSSEC Wazuh documentation, Release 0.1 Apt-get repository key If it is the first installation from Wazuh repository you need to import the GPG key: $ wget -qO - https://ossec.wazuh.com/repos/apt/conf/ossec-key.gpg.key | sudo apt-key ,!add - Debian repositories To add your Debian repository, depending on your distribution, run these commands: For Wheezy: $ echo -e "deb https://ossec.wazuh.com/repos/apt/debian wheezy main" >> /etc/apt/ ,!sources.list.d/ossec.list For Jessie: $ echo -e "deb https://ossec.wazuh.com/repos/apt/debian jessie main" >> /etc/apt/ ,!sources.list.d/ossec.list For Stretch: $ echo -e "deb https://ossec.wazuh.com/repos/apt/debian stretch main" >> /etc/apt/ ,!sources.list.d/ossec.list For Sid: $ echo -e "deb https://ossec.wazuh.com/repos/apt/debian sid main" >> /etc/apt/sources. ,!list.d/ossec.list Ubuntu repositories To add your Ubuntu repository, depending on your distribution, run these commands: For Precise: $ echo -e "deb https://ossec.wazuh.com/repos/apt/ubuntu precise main" >> /etc/apt/ ,!sources.list.d/ossec.list For Trusty: $ echo -e "deb https://ossec.wazuh.com/repos/apt/ubuntu trusty main" >> /etc/apt/ ,!sources.list.d/ossec.list For Vivid: $ echo -e "deb https://ossec.wazuh.com/repos/apt/ubuntu vivid main" >> /etc/apt/ ,!sources.list.d/ossec.list For Wily: $ echo -e "deb https://ossec.wazuh.com/repos/apt/ubuntu wily main" >> /etc/apt/ ,!sources.list.d/ossec.list For Xenial: 4 Chapter 2. Installation guide OSSEC Wazuh documentation, Release 0.1 $ echo -e "deb https://ossec.wazuh.com/repos/apt/ubuntu xenial main" >> /etc/apt/ ,!sources.list.d/ossec.list For Yakkety: $ echo -e "deb https://ossec.wazuh.com/repos/apt/ubuntu yakkety main" >> /etc/apt/ ,!sources.list.d/ossec.list Update the repository Type the next command to update the repository: $ apt-get update OSSEC manager installation To install the OSSEC manager debian package, from our repository, run this command: $ apt-get install ossec-hids OSSEC agent installation To install the OSSEC agent debian package, from our repository, run this command: $ apt-get install ossec-hids-agent RPM packages Yum repository To add the Wazuh yum repository, depending on your Linux distribution, create a file named /etc/yum.repos. d/wazuh.repo with the following content: For Amazon Linux AMI: [wazuh] name= WAZUH OSSEC Repository- www.wazuh.com baseurl= http://ossec.wazuh.com/el/7/x86_64 gpgcheck=1 gpgkey= http://ossec.wazuh.com/key/RPM-GPG-KEY-OSSEC enabled=1 For RHEL and CentOS (version EL5): [wazuh] name = WAZUH OSSEC Repository - www.wazuh.com baseurl = http://ossec.wazuh.com/el/$releasever/$basearch gpgcheck = 1 gpgkey = http://ossec.wazuh.com/key/RPM-GPG-KEY-OSSEC-RHEL5