<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.itcollege.ee/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Malyhass</id>
	<title>ICO wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.itcollege.ee/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Malyhass"/>
	<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php/Special:Contributions/Malyhass"/>
	<updated>2026-05-07T03:19:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=131001</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=131001"/>
		<updated>2018-05-31T11:33:22Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎31 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the password for the administrator user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;verystrongpassword&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zabbixpassword.png|thumb|center| Zabbix setting the password]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordCraked.png|thumb|center| Zabbix password hash cracked]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Avoiding the issue by using strong complex password and administrator must update it every week&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;VeryComplexp@ss0rd&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attacker will not be able to obtain the password or even to crack it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another issue could cause a problem that when the solution administrator will enable the LDAP authentication the password will be saved in the Zabbix database as a plain text&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordPlaintext.png|thumb|center| Zabbix Enable LDAP]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordPlaintext2.png|thumb|center| Zabbix LDAP passwords saved as a plain text]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Downright dangerous, system administrator need  to be aware when enable the  LDAP in Zabbix server.&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=131000</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=131000"/>
		<updated>2018-05-31T11:33:02Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the password for the administrator user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;verystrongpassword&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zabbixpassword.png|thumb|center| Zabbix setting the password]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordCraked.png|thumb|center| Zabbix password hash cracked]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Avoiding the issue by using strong complex password and administrator must update it every week&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;VeryComplexp@ss0rd&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attacker will not be able to obtain the password or even to crack it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another issue could cause a problem that when the solution administrator will enable the LDAP authentication the password will be saved in the Zabbix database as a plain text&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordPlaintext.png|thumb|center| Zabbix Enable LDAP]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordPlaintext2.png|thumb|center| Zabbix LDAP passwords saved as a plain text]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Downright dangerous, system administrator need  to be aware when enable the  LDAP in Zabbix server.&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:ZabbixpasswordPlaintext2.png&amp;diff=130999</id>
		<title>File:ZabbixpasswordPlaintext2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:ZabbixpasswordPlaintext2.png&amp;diff=130999"/>
		<updated>2018-05-31T11:30:36Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130998</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130998"/>
		<updated>2018-05-31T11:30:25Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the password for the administrator user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;verystrongpassword&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zabbixpassword.png|thumb|center| Zabbix setting the password]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordCraked.png|thumb|center| Zabbix password hash cracked]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Avoiding the issue by using strong complex password and administrator must update it every week&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;VeryComplexp@ss0rd&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attacker will not be able to obtain the password or even to crack it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another issue could cause a problem that when the solution administrator will enable the LDAP authentication the password will be saved in the Zabbix database as a plain text&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordPlaintext.png|thumb|center| Zabbix Enable LDAP]]&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordPlaintext2.png|thumb|center| Zabbix LDAP passwords saved as a plain text]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:ZabbixpasswordPlaintext.png&amp;diff=130997</id>
		<title>File:ZabbixpasswordPlaintext.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:ZabbixpasswordPlaintext.png&amp;diff=130997"/>
		<updated>2018-05-31T11:28:24Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130996</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130996"/>
		<updated>2018-05-31T11:28:03Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the password for the administrator user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;verystrongpassword&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zabbixpassword.png|thumb|center| Zabbix setting the password]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordCraked.png|thumb|center| Zabbix password hash cracked]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Avoiding the issue by using strong complex password and administrator must update it every week&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;VeryComplexp@ss0rd&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attacker will not be able to obtain the password or even to crack it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another issue could cause a problem that when the solution administrator will enable the LDAP authentication the password will be saved in the Zabbix database as a plain text&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordPlaintext.png|thumb|center| Zabbix LDAP passwords saved as a plain text]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130993</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130993"/>
		<updated>2018-05-31T11:12:26Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the password for the administrator user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;verystrongpassword&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zabbixpassword.png|thumb|center| Zabbix setting the password]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordCraked.png|thumb|center| Zabbix password hash cracked]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Avoiding the issue by using strong complex password and administrator must update it every week&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;VeryComplexp@ss0rd&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attacker will not be able to obtain the password or even to crack it&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:ZabbixpasswordCraked.png&amp;diff=130991</id>
		<title>File:ZabbixpasswordCraked.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:ZabbixpasswordCraked.png&amp;diff=130991"/>
		<updated>2018-05-31T11:04:05Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130990</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130990"/>
		<updated>2018-05-31T11:03:56Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the password for the administrator user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;verystrongpassword&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zabbixpassword.png|thumb|center| Zabbix setting the password]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ZabbixpasswordCraked.png|thumb|center| Zabbix password hash cracked]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130988</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130988"/>
		<updated>2018-05-31T11:02:23Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the password for the administrator user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;verystrongpassword&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zabbixpassword.png|thumb|center| Zabbix setting the password]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Zabbixpassword.png&amp;diff=130987</id>
		<title>File:Zabbixpassword.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Zabbixpassword.png&amp;diff=130987"/>
		<updated>2018-05-31T11:02:00Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130986</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130986"/>
		<updated>2018-05-31T11:01:07Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the password for the administrator user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; update zabbix.users set passwd=md5(&#039;verystrongpassword&#039;) where alias=&#039;Admin&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot|thumb|center| Zabbix setting the password]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130980</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130980"/>
		<updated>2018-05-31T10:48:19Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Screenshot_from.png&amp;diff=130979</id>
		<title>File:Screenshot from.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Screenshot_from.png&amp;diff=130979"/>
		<updated>2018-05-31T10:47:23Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130978</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130978"/>
		<updated>2018-05-31T10:47:05Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from |thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130977</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130977"/>
		<updated>2018-05-31T10:46:50Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130976</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130976"/>
		<updated>2018-05-31T10:46:31Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security VS Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:|thumb|right| Zabbix MySQL database]]&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130971</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130971"/>
		<updated>2018-05-31T10:45:03Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Solution Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Security VS Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
First of all Securing the database necessary. Starting with the issue Zabbix  server  using  MySQL  database  and  using  MD5  hash.  The  first  step  is  to  use  the strong password because the hash can be cracked by effortless way.&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130965</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130965"/>
		<updated>2018-05-31T10:36:39Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Solution Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130964</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130964"/>
		<updated>2018-05-31T10:34:40Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Vulnerabilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Vulnerabilities =&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The following information about the solution vulnerabilities and how to avoid them.&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130963</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130963"/>
		<updated>2018-05-31T10:33:20Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Enable the encryption Front-end Web */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Vulnerabilities =&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130607</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130607"/>
		<updated>2018-05-15T06:07:29Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Zabbix-Agent */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130606</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130606"/>
		<updated>2018-05-15T06:07:07Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Setting up Zabbix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130510</id>
		<title>Security monitoring solution Nagios</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130510"/>
		<updated>2018-05-07T06:04:02Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
Nagios encryption by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;t=506s How to secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130509</id>
		<title>Security monitoring solution Nagios</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130509"/>
		<updated>2018-05-07T06:03:53Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
Nagios encryption by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;t=506s How to secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130508</id>
		<title>Security monitoring solution Nagios</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130508"/>
		<updated>2018-05-07T06:03:38Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Installing the prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
Nagios encryption by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;t=506s How to secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130494</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130494"/>
		<updated>2018-05-06T10:08:03Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security part */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130493</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130493"/>
		<updated>2018-05-06T10:07:53Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security part */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=HPopknSctVc&amp;amp;t=121s LDAP authentication]&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MCsI0R1q0sE&amp;amp;t=75s Reset the password]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130492</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130492"/>
		<updated>2018-05-06T10:06:46Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130491</id>
		<title>Security monitoring solution Zabbix</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Zabbix&amp;diff=130491"/>
		<updated>2018-05-06T10:06:04Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: Created page with &amp;quot; Zabbix monitoring system  Author:  Mohanad Aly   Cyber Security Engineering (C21)  Page Created: 06 May 2017  ‎Last modified: ‎06 May...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130490</id>
		<title>Security monitoring solution Nagios</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130490"/>
		<updated>2018-05-06T10:04:27Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Security part */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
Nagios encryption by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;t=506s How to secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130489</id>
		<title>Security monitoring solution Nagios</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130489"/>
		<updated>2018-05-06T10:02:30Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=Security part=&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130488</id>
		<title>Security monitoring solution Nagios</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130488"/>
		<updated>2018-05-06T10:00:42Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 06 May 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎06 May 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130487</id>
		<title>Security monitoring solution Nagios</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Security_monitoring_solution_Nagios&amp;diff=130487"/>
		<updated>2018-05-06T09:59:10Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: Created page with &amp;quot; Nagios monitoring system  Author:  Mohanad Aly   Cyber Security Engineering (C21)  Page Created: 25 November 2017  ‎Last modified: ‎07 Janu...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎07 January 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Zabbix-Monitor-Server&amp;diff=128874</id>
		<title>Improve security with Zabbix-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Zabbix-Monitor-Server&amp;diff=128874"/>
		<updated>2018-01-09T12:11:54Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Zabbix Monitoring system */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:zabbix_logo.png|thumb|300px| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 19 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Zabbix&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Zabbix Monitoring system===&lt;br /&gt;
Zabbix is an Open Source, high-level enterprise software designed to monitor and keep track of networks, servers and applications in real time. Build in a server-client model, Zabbix can collect different type of data than are used to create historical graphics and output performance or load trends of the monitored targets.&lt;br /&gt;
&lt;br /&gt;
Zabbix is based on the following components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| PHP modules: php-gd&lt;br /&gt;
| GD 2.0 or later &lt;br /&gt;
| PHP GD module must support PNG images. &lt;br /&gt;
|-&lt;br /&gt;
|PHP TrueType support &lt;br /&gt;
|&lt;br /&gt;
| with-ttf&lt;br /&gt;
|-&lt;br /&gt;
|PHP bc support&lt;br /&gt;
|&lt;br /&gt;
|php-bcmath, --enable-bcmath&lt;br /&gt;
|-&lt;br /&gt;
|PHP XML support&lt;br /&gt;
|&lt;br /&gt;
|php-xml or php5-dom, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP session support&lt;br /&gt;
|&lt;br /&gt;
|php-session, if provided as a separate package by the distributor&lt;br /&gt;
|-&lt;br /&gt;
|PHP socket support&lt;br /&gt;
|&lt;br /&gt;
|php-net-socket, --enable-sockets. Required for user script support.&lt;br /&gt;
|-&lt;br /&gt;
|PHP multibyte support&lt;br /&gt;
|&lt;br /&gt;
|php-mbstring, --enable-mbstring&lt;br /&gt;
|-&lt;br /&gt;
|IBM DB2 ibm_db2&lt;br /&gt;
|&lt;br /&gt;
|Required if IBM DB2 is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|Required if MySQL is used as Zabbix back end database.&lt;br /&gt;
|-&lt;br /&gt;
|Oracle oci8&lt;br /&gt;
|&lt;br /&gt;
|Required if Oracle is used as Zabbix back-end database.&lt;br /&gt;
|-&lt;br /&gt;
|PostgreSQL php-pgsql&lt;br /&gt;
|7.0.2 or later if Zabbix &amp;lt; 1.8.9, 7.4 or later if Zabbix &amp;gt;= 1.8.9&lt;br /&gt;
|Required if PostgreSQL is used as Zabbix back-end database. Consider using PostgreSQL 8.x or later for much better performance. It is suggested to use at least PostgreSQL 8.3, performance [https://www.postgresql.org/docs/8.3/static/release-8-3.html which introduced much better VACUUM].&lt;br /&gt;
|-&lt;br /&gt;
|SQLite php-sqlite3&lt;br /&gt;
|3.3.5 or later&lt;br /&gt;
|Required if SQLite is used as Zabbix back-end database.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Zabbix = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Monitor everything&lt;br /&gt;
*Network Security&lt;br /&gt;
*Performance&lt;br /&gt;
*Agentless Monitoring&lt;br /&gt;
*Hardware Monitoring&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Zabbix=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Zabbix.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install mysql-server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; dpkg -i zabbix-release_3.2-1+xenial_all.deb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; create database zabbix character set utf8 collate utf8_bin; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#039;zabbix&#039;; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/share/doc/zabbix-server-mysql/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; zcat create.sql.gz | mysql -u root -p zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mysql -u root -p your password &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show databases; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; use zabbix; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; show tables; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; exit; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*And copy evenhandler directory to the nagios directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; timedatectl list-timezones &amp;lt;/code&amp;gt; &lt;br /&gt;
Or&lt;br /&gt;
&amp;lt;code&amp;gt;timedatectl  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  nano apache.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano zabbix_server.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service zabbix-server restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd nagios-plugins-2.1.2/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;  service zabbis-server status &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ifconfig &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Open your web browser and YOURIPADDRESS/zabbix&lt;br /&gt;
[[File:Screenshot from 2017-11-25 21-26-14.png|thumb|center| Zabbix monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Zabbix-Agent=&lt;br /&gt;
&lt;br /&gt;
Before start to install the Zabbbix-agent update the machine&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get update &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zabbix-Agent is easy to install, just one command and it installed into the machine.&lt;br /&gt;
&amp;lt;code&amp;gt; apt-get install zabbix-agent &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User need to go to the configuration folder to start edit the agent config file&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/zabbix &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start to edit the file to make the correct configuration to send all the checks to Zabbix-server &lt;br /&gt;
&amp;lt;code&amp;gt; nano -c zabbix_agentd.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking the configuration file&lt;br /&gt;
&lt;br /&gt;
*Uncomment line 43&lt;br /&gt;
*If user need to enable the debugging mode uncomment line 57&lt;br /&gt;
*Enable the remote command uncomment line 73&lt;br /&gt;
*Enable the log remote command uncomment line 82&lt;br /&gt;
*Server IP address line 95&lt;br /&gt;
*Listen-port 10050 uncomment line 103&lt;br /&gt;
*Enable the server-active uncomment line 136 &lt;br /&gt;
*Hostname depends on the user configuration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Zabbix-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Zabbix is an open source application for monitoring a system. Zabbix has been widely used because of the ease of configuration. Zabbix also in support by various plugins. Look here for more information [https://www.zabbix.com/documentation/3.2/start zabbix-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Zabbix installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=-uxApkZ-K0w&amp;amp;t=1015s Zabbix-Server-Installation]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=AeNRo2P-6DY&amp;amp;t=1s&amp;amp;list=PLKAuFoXV02Volco2M8VEZxkKHOCcdHhWw&amp;amp;index=5 Zabbix-Agent]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://en.wikipedia.org/wiki/Zabbix System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.zabbix.com/monitor_everything Zabbix-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.zabbix.com/documentation/1.8/manual/installation/requirements Requirements table reference]&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128835</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128835"/>
		<updated>2018-01-07T09:16:07Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎07 January 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128834</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128834"/>
		<updated>2018-01-07T09:15:20Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=EpzTJH85y8Y&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios installation 4.2.0 (Ubuntu Server 16.04.1 LTS) - Step one]&lt;br /&gt;
&lt;br /&gt;
6- [https://www.youtube.com/watch?v=4vZELdYa7O4&amp;amp;index=2&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
7- [https://www.youtube.com/watch?v=TzlYyzj7BkQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=3 Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
8- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
9- [https://www.youtube.com/watch?v=jg_zan7f_YQ&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=6 How to send checks to Nagios-Server &amp;amp; How to create own script]&lt;br /&gt;
&lt;br /&gt;
10- [https://www.youtube.com/watch?v=MnG8Embgfgw&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=10 Secure the connection between Nagios (Server - Agent) NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
11- [https://www.youtube.com/watch?v=7En5kheIwOM SSL Handshake between Nagios (Server - Agent)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128833</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128833"/>
		<updated>2018-01-07T09:11:27Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Enable the encryption between the server and the agent */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
* To make the handshake:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /usr/local/nagios/etc/services &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following next to the chech_nrpe services &lt;br /&gt;
&amp;lt;code&amp;gt; -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl//client_certs/client_cert.pem -K /usr/local/nagios/etc/ssl/client_certs/client_cert.key &amp;lt;/code&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check the logs from the agent side&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tail -f /var/log/syslog &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that server IP address in the nrpe.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In line 106 &lt;br /&gt;
Put the server IP address&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128832</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128832"/>
		<updated>2018-01-07T09:09:12Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Setting up Nagios */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128831</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128831"/>
		<updated>2018-01-07T09:08:03Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
7- [https://support.nagios.com/kb/article/nrpe-check_nrpe-error-could-not-complete-ssl-handshake-615.html NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128830</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128830"/>
		<updated>2018-01-07T09:06:52Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
6- [https://support.nagios.com/kb/article.php?id=519 NRPE - v3 Enhanced Security]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128829</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128829"/>
		<updated>2018-01-07T09:05:52Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Enable the encryption between the server and the agent */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128828</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128828"/>
		<updated>2018-01-07T09:05:22Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Enable the encryption between the server and the agent */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
 &lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128827</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128827"/>
		<updated>2018-01-07T09:05:07Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Enable the encryption between the server and the agent */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
 &lt;br /&gt;
The connection need to be secure between the server and the agent, it&#039;s not easy and it&#039;s not hard to make it for the security.&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Setup Directories:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir  ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ca nagios_server_certs client_certs &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chown root:nagios * &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir ./demoCA/newcerts &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd ./demoCA &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; touch index.txt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; echo &#039;1000&#039; Angle brackets serial &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Create Certificate Authority&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -x509 -newkey rsa:4096 -keyout ca_key.pem -out ca_cert.pem -utf8 -days 3650 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* NRPE Client Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/client_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout client_cert.key -out client_cert.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sign this certificate request by our CA:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in client_certs/client_cert.csr -out client_certs/client_cert.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy NRPE Client Certificates to the agent:&lt;br /&gt;
&lt;br /&gt;
1- First you can make it with sftp://user@IP&lt;br /&gt;
&lt;br /&gt;
Or you can copy it with secure copy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/ca/ca_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.key /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; scp root@IP:/usr/local/nagios/etc/ssl/client_certs/client_cert.pem /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Next the NRPE client config file needs updating so it knows to use the new certificate. In the file /usr/local/nagios/etc/nrpe.cfg &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano nrpe.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In line 238 uncomment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
ssl_cacert_file=/usr/local/nagios/etc/ssl/ca/ca_cert.pem&lt;br /&gt;
ssl_cert_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.pem&lt;br /&gt;
ssl_privatekey_file=/usr/local/nagios/etc/ssl/client_certs/client_cert.key&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* restart nrpe:&lt;br /&gt;
&amp;lt;code&amp;gt; service nrpe restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t forgot to uncomment the follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
1- ssl_logging=0xff&lt;br /&gt;
2 ssl_client_certs=2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
check_nrpe Plugin Certificate&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/nagios_server_certs/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl req -new -newkey rsa:2048 -keyout nagios_server.key -out nagios_server.csr -nodes &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cd /usr/local/nagios/etc/ssl/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; openssl ca -days 365 -notext -md sha256 -keyfile ca/ca_key.pem -cert ca/ca_cert.pem -in nagios_server_certs/nagios_server.csr -out nagios_server_certs/nagios_server.pem &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Using Certificates With check_nrpe Plugin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/local/nagios/libexec/check_nrpe -A /usr/local/nagios/etc/ssl/ca/ca_cert.pem -C /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.pem -K /usr/local/nagios/etc/ssl/nagios_server_certs/nagios_server.key -H yourIPaddress &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128826</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=128826"/>
		<updated>2018-01-07T08:57:06Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Enable the encryption Front-end Web */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption between the server and the agent=&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Nagios-server-monitor.png&amp;diff=127175</id>
		<title>File:Nagios-server-monitor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Nagios-server-monitor.png&amp;diff=127175"/>
		<updated>2017-11-25T23:20:35Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=127174</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=127174"/>
		<updated>2017-11-25T23:20:18Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Setting up Nagios */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
[[File:Nagios-server-monitor.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=127173</id>
		<title>Improve security with Nagios-Monitor-Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=Improve_security_with_Nagios-Monitor-Server&amp;diff=127173"/>
		<updated>2017-11-25T23:09:30Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: /* Installing the prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:image.png|thumb|300px| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
Author: &lt;br /&gt;
Mohanad Aly &lt;br /&gt;
&lt;br /&gt;
Cyber Security Engineering (C21)&lt;br /&gt;
&lt;br /&gt;
Page Created: 25 November 2017&lt;br /&gt;
&lt;br /&gt;
‎Last modified: ‎25 November 2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This article introduces the Monitoring application called &#039;&#039;&#039;Nagios&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Monitoring===&lt;br /&gt;
Monitoring is the process of keep tracking of system resources.&lt;br /&gt;
&lt;br /&gt;
Monitoring is the process of observing and checking the progress or quality of something over a period of time; keep under systematic review.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/System_monitor]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Monitoring cannot be achieved without logging. That is the reason integrated solutions combine the two processes.&lt;br /&gt;
Monitoring is used to:&lt;br /&gt;
*Check performance&lt;br /&gt;
*Detect if something worth noticing happened&lt;br /&gt;
*Prevent something to happen&lt;br /&gt;
*Detect whether a system is under attack and that is the most important part for the cyber security &lt;br /&gt;
&lt;br /&gt;
===Nagios Monitoring system===&lt;br /&gt;
Nagios now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. &amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Nagios]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Monitoring is made of three components:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Software&lt;br /&gt;
! Version&lt;br /&gt;
|-&lt;br /&gt;
| Apache&lt;br /&gt;
| 1.3.12 or later&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| 5.0 or later&lt;br /&gt;
|-&lt;br /&gt;
|MySQL php-mysql&lt;br /&gt;
|3.22 or later&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= The main advantages of Nagios = &lt;br /&gt;
*Open-source&lt;br /&gt;
*Customized Dashboards&lt;br /&gt;
*Ease of Use&lt;br /&gt;
*Infinite Scalability&lt;br /&gt;
*Data in Real Time&lt;br /&gt;
*Network Security&lt;br /&gt;
&lt;br /&gt;
= Why monitoring is important for cyber security =&lt;br /&gt;
*First thing is important for the cyber security professional is the CIA (Confidentiality, Integrity and Availability)[https://en.wikipedia.org/wiki/Information_security What is CIA], and to get to the standards we need to implement the tools that provides the security for our data and servers that hosting the data.&lt;br /&gt;
*Second system administrator need tools to react when something happened to the server, so system administrator need real time checks to make sure that everything is working in order.&lt;br /&gt;
*Third Monitoring tools alerts should be readable for the administrator and fast, when something happened to the server or the service the monitoring tool should send the alerts in the exact time to give the administrator the time to fix it.&lt;br /&gt;
*Fourth the attacks and threats which is more difficult to the system administrator to figure out what is going in the server, and the monitoring tools should has the detection solution for the common attacks.  &lt;br /&gt;
*Fifth the debugging, when system have error the monitor tool should have a readable debugging.. &lt;br /&gt;
&lt;br /&gt;
= Setting up Nagios=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
In the following tutorial, Ubuntu 16.04 64-bit distribution will be used LTS.&lt;br /&gt;
&lt;br /&gt;
==== Prerequisites ====&lt;br /&gt;
Ubuntu Linux machine, sudo access and some Linux beginner skills are needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial describes the commands and configuration to make the services work together Nagios.&lt;br /&gt;
&lt;br /&gt;
*It is important to have the latest package lists to update them to get info on the newest versions of packages and their dependencies. So we need to run the following command to update them:&lt;br /&gt;
&lt;br /&gt;
Command &lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt update&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt upgrade&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the prerequisites ===&lt;br /&gt;
*The server has the ability to check standard networking services (HTTP, FTP, SMTP, IMAP etc) without the need to install extra software on the monitored hosts.&lt;br /&gt;
&lt;br /&gt;
Begin with the commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo apt install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev sendmail unzip &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
User and group configuration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; useradd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; groupadd nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagcmd nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; usermod -a -G nagios,nagcmd www-data &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Download and extract the Nagios core&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the file &lt;br /&gt;
&amp;lt;code&amp;gt;  tar -xzf nagios*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to configure it with the user and the group you have created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-group=nagios --with-command-group=nagcmd &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make all &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-commandmode &amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt; make install-init &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install-config &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy even-handler directory to the nagios directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the Nagios Plugins&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; tar -xzf nagios-plugins*.tar.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the Nagios plugin&#039;s with the commands below&lt;br /&gt;
&amp;lt;code&amp;gt; ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; make install &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can find the default configuration of Nagios in /usr/local/nagios/. to configure Nagios and Nagios contact. Edit default Nagios configuration with nano &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano -c /usr/local/nagios/etc/nagios.cfg &amp;lt;/code&amp;gt;&lt;br /&gt;
uncomment line 51 for the host monitor configuration.&lt;br /&gt;
Save and exit.&lt;br /&gt;
&lt;br /&gt;
Add a new folder named servers.&lt;br /&gt;
&amp;lt;code&amp;gt; mkdir -p /usr/local/nagios/etc/servers &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the user and group for the new folder to Nagios:&lt;br /&gt;
&amp;lt;code&amp;gt; chown nagios:nagios /usr/local/nagios/etc/server &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable Apache modules&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod rewrite &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod cgi &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator can use the htpasswd command to configure a user nagiosadmin for the Nagios web interface&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the Nagios virtualhost&lt;br /&gt;
&amp;lt;code&amp;gt; sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites-enable &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Apache &lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When Nagios starts, you may see the following error &lt;br /&gt;
Starting nagios (via systemctl): nagios.serviceFaile&lt;br /&gt;
System administrator can fix with the following &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; cd /etc/init.d/ &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; cp /etc/init.d/skeleton /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste this code at the end of the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DESC=&amp;quot;Nagios&amp;quot;&lt;br /&gt;
NAME=nagios&lt;br /&gt;
DAEMON=/usr/local/nagios/bin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;-d /usr/local/nagios/etc/nagios.cfg&amp;quot;&lt;br /&gt;
PIDFILE=/usr/local/nagios/var/$NAME.lock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make it executable and start Nagios&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; chmod +x /etc/init.d/nagios &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&lt;br /&gt;
Still it there is another process to fix the issue &lt;br /&gt;
&lt;br /&gt;
First we are going to create/change the nagios.service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; nano /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following code of the file &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Nagios&lt;br /&gt;
BindTo=network.target&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=nagios&lt;br /&gt;
Group=nagios&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System administrator need to enable created nagios.service config&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; systemctl enable /etc/systemd/system/nagios.service &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; service nagios start &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check the service is working &lt;br /&gt;
$ service nagios status&lt;br /&gt;
&lt;br /&gt;
*Open web browser and YOURIPADDRESS/nagios&lt;br /&gt;
&lt;br /&gt;
[[File:Nagios-server.png|thumb|center| Nagios monitoring system]]&lt;br /&gt;
&lt;br /&gt;
=Enable the encryption Front-end Web=&lt;br /&gt;
&lt;br /&gt;
SSL support actually comes standard in the Ubuntu 16.04 Apache package. We simply need to enable it to take advantage of SSL on our system.&lt;br /&gt;
&lt;br /&gt;
Enable the module by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2enmod ssl &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creating a subdirectory within Apache&#039;s configuration hierarchy to place the certificate files that we will be making&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /etc/apache2/ssl&lt;br /&gt;
&lt;br /&gt;
Now that we have a location to place our key and certificate, we can create them both in one step by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Country Name (2 letter code) [AU]:EE&lt;br /&gt;
 State or Province Name (full name) [Some-State]:Harjumaa&lt;br /&gt;
 Locality Name (eg, city) []:Tallinn&lt;br /&gt;
 Organization Name (eg, company) [Internet Widgits Pty Ltd]: Incorporated Company&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Head&lt;br /&gt;
 Common Name (e.g. server FQDN or YOUR name) []: domain.com&lt;br /&gt;
 Email Address []:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
&lt;br /&gt;
*openssl: This is the basic command line tool provided by OpenSSL to create and manage certificates, keys, signing requests, etc.&lt;br /&gt;
*req: This specifies a subcommand for X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL adheres to for its key and certificate managment. Since we are wanting to create a new X.509 certificate, this is what we want.&lt;br /&gt;
*-x509: This option specifies that we want to make a self-signed certificate file instead of generating a certificate request.&lt;br /&gt;
*-nodes: This option tells OpenSSL that we do not wish to secure our key file with a passphrase. Having a password protected key file would get in the way of Apache starting automatically as we would have to enter the password every time the service restarts.&lt;br /&gt;
*-days 365: This specifies that the certificate we are creating will be valid for one year.&lt;br /&gt;
*-newkey rsa:2048: This option will create the certificate request and a new private key at the same time. This is necessary since we didn&#039;t create a private key in advance. The rsa:2048 tells OpenSSL to generate an RSA key that is 2048 bits long.&lt;br /&gt;
*-keyout: This parameter names the output file for the private key file that is being created.&lt;br /&gt;
*-out: This option names the output file for the certificate that we are generating.&lt;br /&gt;
&lt;br /&gt;
Open the file with root privileges now:&lt;br /&gt;
&amp;lt;code&amp;gt; sudo nano /etc/apache2/sites-available/default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    &amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
        ServerAdmin admin@example.com&lt;br /&gt;
        ServerName your_domain.com&lt;br /&gt;
        ServerAlias www.your_domain.com&lt;br /&gt;
        DocumentRoot /var/www/html&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
----&amp;gt;   SSLCertificateFile /etc/apache2/ssl/apache.crt&lt;br /&gt;
----&amp;gt;   SSLCertificateKeyFile /etc/apache2/ssl/apache.key&lt;br /&gt;
        &amp;lt;FilesMatch &amp;quot;\.(cgi|shtml|phtml|php)$&amp;quot;&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /usr/lib/cgi-bin&amp;gt;&lt;br /&gt;
                        SSLOptions +StdEnvVars&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [2-6]&amp;quot; \&lt;br /&gt;
                        nokeepalive ssl-unclean-shutdown \&lt;br /&gt;
                        downgrade-1.0 force-response-1.0&lt;br /&gt;
        BrowserMatch &amp;quot;MSIE [17-9]&amp;quot; ssl-unclean-shutdown&lt;br /&gt;
    &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSL-enabled virtual host&lt;br /&gt;
&amp;lt;code&amp;gt; sudo a2ensite default-ssl.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Apache to load our new virtual host file&lt;br /&gt;
&amp;lt;code&amp;gt; service apache2 restart &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the configuration by visiting the server&#039;s domain name or public IP address after specifying the https:// protocol, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; https://server_domain_name_or_IP &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This to solve the problem to enable the ssl &lt;br /&gt;
&amp;lt;code&amp;gt; nano 000-default.conf &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Special virtulhost only for redirecting&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerName &lt;br /&gt;
        Redirect &amp;quot;/&amp;quot; &amp;quot;https://Nagios-server/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
Nagios is an open source application for monitoring a system. Nagios has been widely used because of the ease of configuration. Nagios in support by various plugins, and you can even create your own plugins. Look here for more information. [https://www.nagios.org/about/overview/ Nagios-main-documentation].&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
Nagios installation by Cyber-Tect-Tips&lt;br /&gt;
&lt;br /&gt;
1- [https://www.youtube.com/watch?v=EpzTJH85y8Y Nagios-Server-Installation Step one]&lt;br /&gt;
&lt;br /&gt;
2- [https://www.youtube.com/watch?v=4vZELdYa7O4  Nagios-Agent configuration using NRPE plugin - Step two]&lt;br /&gt;
&lt;br /&gt;
3- [https://www.youtube.com/watch?v=TzlYyzj7BkQ Nagios-Agent send checks to Nagios-Server - Step three]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/watch?v=Ci_FgH-dwr0 Nagios-Agent using NRPE plugin with the Monitor Server side (Full configuration)]&lt;br /&gt;
&lt;br /&gt;
5- [https://www.youtube.com/watch?v=Kz-Z-dL0T_U&amp;amp;list=PLKAuFoXV02VqeLyddX-CIMcMdqWcI2UoP&amp;amp;index=5 Customize Nagios (Agent - Server) adding new services check (Swap - SSH) Final step]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
1- [https://www.nagios.org/ Nagios System monitoring]&lt;br /&gt;
&lt;br /&gt;
2- [https://en.wikipedia.org/wiki/Information_security CIA]&lt;br /&gt;
&lt;br /&gt;
3- [https://en.wikipedia.org/wiki/Nagios Nagios-Information]&lt;br /&gt;
&lt;br /&gt;
4- [https://www.youtube.com/channel/UChHzqszXw_5edX-9DOK4JxA Cyber-Tech-Tips]&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Nagios-server.png&amp;diff=127172</id>
		<title>File:Nagios-server.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Nagios-server.png&amp;diff=127172"/>
		<updated>2017-11-25T23:08:30Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=File:Image.png&amp;diff=127171</id>
		<title>File:Image.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=File:Image.png&amp;diff=127171"/>
		<updated>2017-11-25T23:04:54Z</updated>

		<summary type="html">&lt;p&gt;Malyhass: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Malyhass</name></author>
	</entry>
</feed>