top
logo


Untangle - установка ntop, phpsysinfo, imspector, squid, monit, rsyslog, sqstat, sarg PDF Печать E-mail
Автор: Administrator   
28.09.10 10:14

Установка ntop, phpsysinfo, imspector, squid, monit, rsyslog, sqstat, sarg на Untangle

(перевод с дополнениями)

 

Оф. инструкция по настройке Untangle ТУТ

 

  1. Start SSH (start SSH Service) Открываем SSH доступ.

rm /etc/ssh/sshd_not_to_be_run && /etc/init.d/ssh start

/etc/init.d/ssh restart

ssh 192.168.0.15

Настройка – Сеть - Advanced - Packat Filter - Accept SSH traffic from all interfaces - ставим галочку

После этих манипуляций, на сервер Untangle можно "заходить" по SSH

 

  1. Logs de Boot (Logs all boot errors and information) Логи загрузки всех ошибках и информация

a. Правим
/etc/default/bootlogd

меняем
BOOTLOGD_ENABLE=No

на
BOOTLOGD_ENABLE=Yes


b. Логи хроняться: /var/log/boot.

 

  1. Устанавливаем NTOP

a) можно промустить

b) Раскоментировать все репозитарии в /etc/apt/sources.list

c) Очищаем и обновляем кэш
apt-get clean
apt-get update

d) Загружаем и устанавливаем NTOP
apt-get install ntop

e) Вводим пароль администратора: admin password

ntop -A

 

f) Cконфигурируем nTOP интерфейсы (Я использовал два интерфейса)

echo 'USER="ntop"\nINTERFACES="eth0,eth1"' >| /var/lib/ntop/init.cfg

 

g) Сконфигурируем nTOP TCP port 4000

echo 'GETOPT="-w 4000"' >> /etc/default/ntop

 

h) Стартуем nTOP

/etc/init.d/ntop start

 

i) Проверяем nTOP I, слушает ли он TCP port 4000

lsof -i | grep ntop

Видим результат:

~ # lsof -i | grep ntop

ntop 16337 ntop 1u IPv4 105625 TCP *:4000 (LISTEN)

 

j) Конфигурируем "Pcket Filter" для nTOP (Packet Filter)

Config - Networking - Advanced - Packet Filter

Port:4000 & Destination Local

 

Ниже снимаем галку с «Block all local traffic» С этой галкой не работает форвардиг пакетов для SQUID

k) Проверяем NTOP

http://192.168.0.15:4000


4. Устанавливаем PHPSYSINFO

  1. Правим файл

/etc/apache2/sites-available/uvm

 

Разрешаем PHP and CGI файлы.

Меняем:

<Directory /var/www>

FileETag MTime Size

</Directory>

на

<Directory /var/www>

Options +ExecCGI

AddHandler cgi-script .cgi

AddHandler fcgid-script .php

FCGIWrapper /usr/lib/cgi-bin/php5 .php

FileETag Mtime Size

</Directory>

 

b) Устанавливаем PhpSysInfo

apt-get install phpsysinfo

 

  1. Проверяем PhpMyInfo: http://192.168.0.15/phpsysinfo

В правом верхнем углу можно изменить локализацию на русскую.

 

5.Установка Imspector  У меня не заработал.

a) Загружаем и устанавливаем

apt-get install make build-essential openssl libssl-dev

  1. Загружаем и устанавливаем Imspector

cd /tmp
wget http://www.imspector.org/downloads/imspector-0.9.tar.gz
tar zxf imspector-0.9.tar.gz
cd imspector-0.9
make
make install
make install-cert

c) Создаем директорию

mkdir /etc/imspector

 

d) создаем Dependency files

Создаем скрипт для старта:

/etc/init.d/imspector

и добовляем в него:

 

#! /bin/sh

# IMspector startup

PATH=/sbin:/bin:/usr/sbin:/usr/bin

echo "Starting IMspector..."

 

Далее:

imspector -c /etc/imspector/imspector.conf
cp /tmp/imspector-0.9/contrib/imspector.cgi /usr/share/phpsysinfo/imspector.cgi

chmod 755 /etc/init.d/imspector

chmod +x imspector

update-rc.d imspector defaults

mv /usr/etc/imspector/imspector.conf /etc/imspector/imspector.conf

mv /usr/etc/imspector/badwords.txt /etc/imspector/badwords.txt

mv /usr/etc/imspector/acl.txt /etc/imspector/acl.txt

/etc/init.d/imspector

Копируем

/tmp/imspector-0.9/contrib.imspector.cgi

в

/usr/share/phpsysinfo/

 

e) Рестартуем Apache: /etc/init.d/apache2 restart

f) Проверяем работу Imspector: http://192.168.0.15/phpsysinfo/imspector.cgi

g) Cоздаем правило доступа и правило переадресации для Imspector

Configure a port forwarding in UT for all or users you want to monitor

фильтр пакетов

Port:1863 & Destination Local

Port:16667 & Destination Local


Source: Any or IP that you want.

Destination Port: 1863 (For MSN, Yahoo, Gmail, etc)

Protocol:TCP

New Destination: UT Internal eth1 IP

New Port. 16667

 

6. Усатанавливаем Squid Проблема в том, что трафик идущий через Squid не фильтруеться веб фильтром! Все политики по запрету сайтов, видео, музыки, работать не будут. Я поставил Squid и SARG для сбора статистики.

a) Усанавливаме squid

apt-get install squid

b) Конфигурируем squid
правим /etc/squid/squid.conf with

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8

#(define users who could use squid here)
http_access allow all
acl_uses_indirect_client off

#(uses no standar port so users can't find it)
http_port 55555 transparent
cache_mem 32 MB
cache_dir ufs /var/spool/squid 5000 16 256
access_log /var/log/squid/access.log squid
cache_mgr Данный адрес e-mail защищен от спам-ботов, Вам необходимо включить Javascript для его просмотра.
httpd_suppress_version_string on

c) Рестартуем squid: /etc/init.d/squid reestart
d) Делаем переадресацию портов и настройку Packet Filter для Squid

Configure a port forwarding in UT for all or users you want to monitor
Source Address: any or IP you want to pass thru squid
Destination Port. 80
Protocol:TCP
New Address: INTERNALUTADDRESS
New Port. 55555
Configure a packet filter for squid (Packet Filter)
Port:55555& Destination Local

 

На примере IP 192.168.0.18 вместо 192.168.0.15

 

7. Установка Monit (настройка доп. параметров для уведомления)

a)  Добавить в файл /etc/untangle/monit.d/monit-base_all.conf

 

set daemon 120

set logfile /var/log/uvm/monit.log

set mailserver domine.lan port 25 username " Данный адрес e-mail защищен от спам-ботов, Вам необходимо включить Javascript для его просмотра. " password " PaSsWoRd "

set alert Данный адрес e-mail защищен от спам-ботов, Вам необходимо включить Javascript для его просмотра. only on { timeout, nonexist, connection }

set alert Данный адрес e-mail защищен от спам-ботов, Вам необходимо включить Javascript для его просмотра. only on { timeout, nonexist, connection }

set httpd port 2812 and use address localhost

allow 192.168.0.0/24

allow root:PaSsWoRd

allow localhost

#MONITOR APACHE

check process apache with pidfile /var/run/apache2.pid

start program = "/etc/init.d/apache2 start"

stop program = "/etc/init.d/apache2 stop"

if failed host 192.168.0.18 port 80 protocol http for 2 cycles then restart

if 5 restarts within 10 cycles then timeout

 

#MONITOR NTOP

check process ntop with pidfile /var/run/ntop.pid

start program = "/etc/init.d/ntop start"

stop program = "/etc/init.d/ntop stop"

if failed host 192.168.0.15 port 4000 then restart

# if 5 restarts within 5 cycles then timeout

 

#MONITOR SSHD

check process sshd with pidfile /var/run/sshd.pid

start program "/etc/init.d/ssh start"

stop program "/etc/init.d/ssh stop"

if failed port 22 protocol ssh for 2 cycles then restart

if 5 restarts within 10 cycles then timeout

 

#MONITOR SQUID

check process squid with pidfile /var/run/squid.pid

start program "/etc/init.d/squid start"

stop program "/etc/init.d/squid stop"

if failed host 192.168.0.15 port 55555 then restart

if 5 restarts within 10 cycles then timeout

 

#MONITOR IMSPECTOR

check process imspector with pidfile /var/run/imspector.pid

start program "/etc/init.d/imspector start"

stop program "/etc/init.d/imspector stop"

if failed host 192.168.0.15 port 16667 then restart

if 5 restarts within 10 cycles then timeout

 

b) Рестартуем монитор /etc/init.d/untangle-vm

 

8. Устанваливаем TCPTRACK & DSNIFF

apt-get install tcptrack

apt-get install dsniff

a) UT 7.3 уже имеються iftop & jnettop

9.Устанавливаем Rsyslog оповещения (Настравиваем нужную для нас информацию в оповещениях)

Credits for Bigdessert

a) Вносим изменения в /etc/rsyslog.conf


Под #### MODULES ####

Добавляем:
$ ModLoad ommail

 

Под # provides UDP syslog reception, раскоментировать следующие файлы:

#$ModLoad imudp

#$UDPServerRun 514


Под #### GLOBAL DIRECTIVES ####, добавим какие действия совершать


####ACTIONS####

##Обратите внимание, SMTP-сервер должен иметь возможность ретрансляции почты! ##

 

$ActionMailSMTPServer localhost

$ActionMailSMTPPort 25

$ActionMailFrom Данный адрес e-mail защищен от спам-ботов, Вам необходимо включить Javascript для его просмотра.

$ActionMailTo Данный адрес e-mail защищен от спам-ботов, Вам необходимо включить Javascript для его просмотра.

$template mailSubject,"Untangle Alert On Server"

$template mailBody,"RSYSLOG Alert\r\nmsg='%msg%'"

$ActionMailSubject mailSubject

if $syslogtag contains 'Intrusion_Prevention' then :ommail:;mailBody

 

b) Рестартуем rsyslog: /etc/init.d/rsyslog restart

  1. Изменяем в Настройка — Администрирование — Мониторинг -


Change in admin panel, under monitoring tab, enable syslog to localhost and port 514.

В административной панели вкдючаем Монитор и вписываем localhost , port 514

 

10. Устанавливаме Sqstat for Squid (Live Stats) Просмотр акривных сессий в реальном времени через Squid

сd /tmp
wget http://samm.kiev.ua/sqstat/sqstat-1.20.tar.gz
tar xvzf sqstat-1.20.tar.gz
cd /tmp/sqstat-1.20
cp config.inc.php.defaults config.inc.php
Правим - config.inc.php
меняем
Squid IP:127.0.0.1
Port: 55555
cd /tmp/
mv sqstat-1.20 /usr/share/phpsysinfo/sqstat
Смотрим логи SQUID http://192.168.0.15/phpsysinfo/sqstat/sqstat.php


 

11. Удаленный доступ к базе данных Untangle

(Allow remote access to UT database)

Credits Sky-Knight


b) Add a packet filter rule with this:

Description: Pass Postgres
Action: Pass
Source Interface: Internal
Destined Local
Protocol: TCP
Destination Port: 5432

c) Stop postgress services:

/etc/init.d/untangle-vm stop
/etc/init.d/postgresql-8.3 stop

d) Edit file: /etc/postgresql/8.3/main/postgresql.conf with

listen_addresses = '*'

e) Edit file: /etc/postgresql/8.3/main/pg_hba.conf with

host all all 0.0.0.0/0 trust

f) Just restart the services.

/etc/init.d/postgresql-8.3 start
/etc/init.d/untangle-vm start

g) Get a copy of pgAdmin from www.pgadmin.org and connect using the following:

Name: Untangle
Host: Internal IP of your Untangle here
Port: 5432
SSL: allow
Maintenance DB: postgres
Username: postgres
Password: uvm


12. Установка SARG (статистика посещаемости)
Установим SARG
apt-get install sarg
Готовый конфиг /etc/squid/sarg.conf    ТУТ
По SARG читаем  ТУТ
проверяем  http://192.168.0.15/squid-reports/
{jcomments on}

оригинал: ТУТ

Последнее обновление 04.12.10 15:58
 
Интересная статья? Поделись ей с другими:

bottom

 

Unreal Commander PfSense по русски Яндекс.Метрика