{"id":5290,"date":"2020-04-03T21:51:15","date_gmt":"2020-04-03T18:51:15","guid":{"rendered":"https:\/\/kifarunix.com\/?p=5290"},"modified":"2023-05-30T23:15:09","modified_gmt":"2023-05-30T20:15:09","slug":"install-ossec-agent-on-centos-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-ossec-agent-on-centos-8\/","title":{"rendered":"Install OSSEC Agent on CentOS 8"},"content":{"rendered":"\n<p>This guide presents a step-by-step tutorial on how to install OSSEC Agent on CentOS 8. <a href=\"https:\/\/www.ossec.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">OSSEC<\/a> is an Open Source Host based Intrusion Detection System that performs log analysis, integrity checking, Windows registry monitoring, rootkit detection, real-time alerting and active response. It runs across multiple platforms including Linux, OpenBSD, FreeBSD, Mac OS X, Solaris and Windows etc.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#install-ossec-agent-on-cent-os-8\">Install OSSEC Agent on CentOS 8<\/a><ul><li><a href=\"#run-system-update\">Run system Update<\/a><\/li><li><a href=\"#install-required-build-tools\">Install Required Build Tools<\/a><\/li><li><a href=\"#download-latest-ossec-source-code\">Download Latest OSSEC Source Code<\/a><\/li><li><a href=\"#extract-ossec-source-code\">Extract OSSEC Source Code<\/a><\/li><li><a href=\"#install-ossec-agent-on-cent-os-8-1\">Install OSSEC Agent on CentOS 8<\/a><\/li><li><a href=\"#connect-the-ossec-agent-to-ossec-server\">Connect the OSSEC Agent to OSSEC Server<\/a><\/li><li><a href=\"#running-ossec-agent\">Running OSSEC Agent<\/a><\/li><li><a href=\"#further-reading\">Further Reading<\/a><\/li><li><a href=\"#related-tutorials\">Related Tutorials<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-ossec-agent-on-cent-os-8\">Install OSSEC Agent on CentOS 8<\/h2>\n\n\n\n<p>In this demo, we are going learn how to install OSSEC agent on CentOS 8 from source file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"run-system-update\">Run system Update<\/h3>\n\n\n\n<p>Before you proceed with installation, run system update.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-required-build-tools\">Install Required Build Tools<\/h3>\n\n\n\n<p>A successful installation of OSSEC on CentOS 8 requires quite a number of dependencies to be installed on the system. Run the command below to install these dependencies.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install gcc make libevent-devel zlib-devel openssl-devel pcre2-devel wget tar -y<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"download-latest-ossec-source-code\">Download Latest OSSEC Source Code<\/h3>\n\n\n\n<p>OSSEC 3.6 is the latest stable release as of this writing. Check the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/ossec\/ossec-hids\/releases\" target=\"_blank\">releases page<\/a> for the latest releases.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/github.com\/ossec\/ossec-hids\/archive\/3.6.0.tar.gz<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"extract-ossec-source-code\">Extract OSSEC Source Code<\/h3>\n\n\n\n<p>Once the OSSEC source download is completed, extract it as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tar xzf 3.6.0.tar.gz<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-ossec-agent-on-cent-os-8-1\">Install OSSEC Agent on CentOS 8<\/h3>\n\n\n\n<p>To install OSSEC agent, navigate to the source code directory and run the installation script.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cd ossec-hids-3.6.0\/<\/code><\/pre>\n\n\n\n<p>Execute the installation group;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>.\/install.sh<\/code><\/pre>\n\n\n\n<p>Select you installation language. In this case, we choose the default install language, English.<\/p>\n\n\n\n<p>Press ENTER to choose default installation options.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>(en\/br\/cn\/de\/el\/es\/fr\/hu\/it\/jp\/nl\/pl\/ru\/sr\/tr) [en]: ENTER<\/code><\/pre>\n\n\n\n<p>Again, press ENTER to continue.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>-- Press ENTER to continue or Ctrl-C to abort. --<\/code><\/pre>\n\n\n\n<p>Specify the type of installation. In our case, we are installing ossec-hids&nbsp;<code>agent<\/code>, hence select agent.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1- What kind of installation do you want (server, agent, local, hybrid or help)? agent\n\n  - Agent(client) installation chosen.<\/code><\/pre>\n\n\n\n<p>Choose the installation path. We go with the default, <code>\/var\/ossec<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2- Setting up the installation environment.\n\n - Choose where to install the OSSEC HIDS &#91;\/var\/ossec]: \n\n    - Installation will be made at  \/var\/ossec .<\/code><\/pre>\n\n\n\n<p>Enter the OSSEC-HIDs Server IP address or hostname. Replace the IP used here accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>3- Configuring the OSSEC HIDS.\n\n  3.1- What's the IP Address or hostname of the OSSEC HIDS server?: 192.168.56.11                  \n\n   - Adding Server IP 192.168.56.11\n<\/code><\/pre>\n\n\n\n<p>Enable system integrity check<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  3.2- Do you want to run the integrity check daemon? (y\/n) &#91;y]: y\n\n   - Running syscheck (integrity check daemon).<\/code><\/pre>\n\n\n\n<p>Enable rootkit detection engine.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  3.3- Do you want to run the rootkit detection engine? (y\/n) &#91;y]: \n\n   - Running rootcheck (rootkit detection).<\/code><\/pre>\n\n\n\n<p>Disable active response. Otherwise, you can enable it if you an understanding of the type and number of alerts you want.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  3.4 - Do you want to enable active response? (y\/n) &#91;y]: n\n\n   - Active response disabled.<\/code><\/pre>\n\n\n\n<p>The agent installer then displays the log files that are read by default. You can add more later on <code>ossec.conf<\/code> file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  3.5- Setting the configuration to analyze the following logs:\n    -- \/var\/log\/messages\n    -- \/var\/log\/secure\n    -- \/var\/log\/maillog\n...<\/code><\/pre>\n\n\n\n<p>Once you are done defining the default options, proceed to install OSSEC agent on CentOS 8 by pressing ENTER.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"connect-the-ossec-agent-to-ossec-server\">Connect the OSSEC Agent to OSSEC Server<\/h3>\n\n\n\n<p>For the agent to communicate with the server, you can need to first add it to the server.<\/p>\n\n\n\n<p>After that extract the agent authentication key from the server.<\/p>\n\n\n\n<p>Once you have extracted the key, Import the key on the agent by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/var\/ossec\/bin\/manage_agents<\/code><\/pre>\n\n\n\n<p>Enter option<strong>&nbsp;I<\/strong>,&nbsp;<strong>paste the key<\/strong>&nbsp;and<strong>&nbsp;confirm adding the key<\/strong>. Then type&nbsp;<strong>Q<\/strong>&nbsp;and&nbsp;<strong>press enter<\/strong>&nbsp;to exit.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"running-ossec-agent\">Running OSSEC Agent<\/h3>\n\n\n\n<p>Once the installation completes, the installer displays how to run OSSEC agent.<\/p>\n\n\n\n<p>To start the agent;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/var\/ossec\/bin\/ossec-control start<\/code><\/pre>\n\n\n\n<p>Or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl start ossec<\/code><\/pre>\n\n\n\n<p>To stop the agent;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/var\/ossec\/bin\/ossec-control stop<\/code><\/pre>\n\n\n\n<p>Or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl stop ossec<\/code><\/pre>\n\n\n\n<p>Other unit service control commands;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/var\/ossec\/bin\/ossec-control {start|stop|reload|restart|status}<\/code><\/pre>\n\n\n\n<p>You have successfully installed OSSEC agent on CentOS 8 and that marks the end of our guide on how to install OSSEC agent on CentOS 8. Stay connected for more similar tutorials.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"further-reading\">Further Reading<\/h3>\n\n\n\n<p><a href=\"https:\/\/www.ossec.net\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">OSSEC Documentation<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"related-tutorials\">Related Tutorials<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-ossec-agent-on-debian-10-buster\/\" target=\"_blank\">Install OSSEC Agent on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/how-to-install-ossec-agent-on-mac-os-x\/\" target=\"_blank\">How to Install OSSEC Agent on Mac OS<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/how-to-install-ossec-agent-on-solaris-11-4\/\" target=\"_blank\">How to Install OSSEC Agent on Solaris 11.4<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-install-and-setup-ossec-agent-on-ubuntu-18-04-centos-7\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install and Setup OSSEC agent on Ubuntu 18.04\/CentOS 7<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide presents a step-by-step tutorial on how to install OSSEC Agent on CentOS 8. OSSEC is an Open Source Host based Intrusion Detection System<\/p>\n","protected":false},"author":1,"featured_media":16886,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[34,121,72,273],"tags":[1142,1398,1397,1396],"class_list":["post-5290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-howtos","category-monitoring","category-ossec","tag-centos-8","tag-centos-8-ossec-agent","tag-install-ossec-agent-centos-8","tag-latest-ossec-agent","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5290"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=5290"}],"version-history":[{"count":6,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5290\/revisions"}],"predecessor-version":[{"id":16898,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5290\/revisions\/16898"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/16886"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=5290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=5290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=5290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}