First, make sure that you have EPEL repository added. The easiest way to do this is using the following command (note, bold is what you type, the rest is what you get from the machine):
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmSecond, fetch necessary packages. I didn't want to install Atomicorp's repository, so I only fetched ossec packages using wget. ossec-hids and ossec-hids-client are what you need. Select the newest versions you can find. Next, install them using yum command:
Retrieving http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
warning: /var/tmp/rpm-tmp.7IMdWB: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ##################################### [100%]
1:epel-release ##################################### [100%]
# yum localinstall ossec-hids-client-2.6-15.el6.art.x86_64.rpm ossec-hids-2.6-15.el6.art.x86_64.rpmI assumed that yum is executed in the same directory where you placed downloaded packages. Also, if you downloaded some other versions, change names appropriately.
Open ossec's configuration file, /var/ossec/etc/ossec-agent.conf, and change the line that has <server-ip></server-ip> element. It has to point to your server's IP address. You can also add files to be monitored in addition to the existing ones, or remove some of the existing ones if they are not used on the machine you are installing ossec client.
Now, go to the OSSEC server and run there agent management tool. It is probably in /var/ossec/bin:
# ./manage_agentsNote that the tool doesn't display all the options you have on your disposal. Next what you need to do is to extract a key that you'll import into the client. This is also done using manage_clients tool, so either start it again, or in case you didn't exit after you added an agent just continue:
****************************************
* OSSEC HIDS v2.5-SNP-100907 Agent manager. *
* The following options are available: *
****************************************
(I)mport key from the server (I).
(Q)uit.
Choose your action: I or Q: A
- Adding a new agent (use '\q' to return to the main menu).
Please provide the following:
* A name for the new agent: centos6.domain.local
* The IP Address of the new agent: 192.168.10.41
* An ID for the new agent[030]: <just press ENTER>
Agent information:
ID:030
Name:centos6.domain.local
IP Address:192.168.10.41
Confirm adding it?(y/n): y
Agent added.
****************************************Again, option to export the key isn't listed in the help message! Anyway, copy the very long string that is printed (agent's key) and you can quit from the tool and logout from the OSSEC server.
* OSSEC HIDS v2.5-SNP-100907 Agent manager. *
* The following options are available: *
****************************************
(I)mport key from the server (I).
(Q)uit.
Choose your action: I or Q: e
Available agents:
ID: 002, Name: somehost, IP: 10.0.10.1
ID: 030, Name: centos6.domain.local, IP: 192.168.10.41
Provide the ID of the agent to extract the key (or '\q' to quit): 030
Agent key information for '030' is:
<here a very long string will be printed>
** Press ENTER to return to the main menu.
Go now to ossec client, change directory to /var/ossec/bin and run manage_client tool:
# ./manage_clientFinally, restart ossec client:
****************************************
* OSSEC HIDS v2.6 Agent manager. *
* The following options are available: *
****************************************
(I)mport key from the server (I).
(Q)uit.
Choose your action: I or Q: I
* Provide the Key generated by the server.
* The best approach is to cut and paste it.
*** OBS: Do not include spaces or new lines.
Paste it here (or '\q' to quit):
<very long string copied here!>
Agent information:
ID:030
Name:centos6.domain.local
IP Address:192.168.10.41
Confirm adding it?(y/n): y
Added.
# /etc/init.d/ossec-hids restartYou should see you new client in OSSEC's Web interface which should confirm that it is running OK.
Shutting down ossec-hids: [ OK ]
Starting ossec-hids: [ OK ]
No comments:
Post a Comment