posted by 은이종 2012. 4. 17. 17:01

OSSEC (http://www.ossec.net/)

 

앞의 체크루트킷 프로그램과 달리 시스템상  데몬으로 동작하면서 지속적으로 시스템주요 파일 및 로그들을 확인하고, 외부공격에 바로 대응(active-response) 할 수 있도록 설정이 가능하다. 관리자에게 실시간으로 메일을 전송한다.

 

 


다운로드 및 설치

www.ossec.net에서 다운받을수 있다.


http://www.ossec.net/files/ossec-hids-2.5.1.tar.gz 파일 주소 확인


# wget http://www.ossec.net/files/ossec-hids-2.5.1.tar.gz


# tar -zxf ossec-hids-2.5.1.tar.gz

# cd ossec-hids-2.5.1

# ./install.sh

 

  (en/br/cn/de/el/es/fr/it/jp/nl/pl/ru/sr/tr) [en]: en


 OSSEC HIDS v2.5.1 Installation Script - http://www.ossec.net

 

 

1- What kind of installation do you want (server, agent, local or help)?

è  원격서버에 agent 옵션으로 설치하고, agent로 설치된 서버의 정보를 포워딩할 서버에 server로 설치하면 agent로 설치되어 있는 서버의 정보를 server 옵션으로 설치한 리눅스 서버시스템으로 agent 서버의 로그검사 정보를 포워딩하여 server측에서agent 서버의 정보를 얻어올수 있다.



2- Setting up the installation environment.

 

 - Choose where to install the OSSEC HIDS [/var/ossec]: /var/ossec

 

    - Installation will be made at  /var/ossec .

 



3- Configuring the OSSEC HIDS.

 

  3.1- Do you want e-mail notification? (y/n) [y]: y

   - What's your e-mail address? kmg0113@hotmail.com

 

   - We found your SMTP server as: mx2.hotmail.com.

   - Do you want to use it? (y/n) [y]: y

 

   --- Using SMTP server:  mx2.hotmail.com.

 

  3.2- Do you want to run the integrity check daemon? (y/n) [y]: y -> 무결성 체크 데몬을 실행

 

   - Running syscheck (integrity check daemon).

 

  3.3- Do you want to run the rootkit detection engine? (y/n) [y]: y -> 루트킷 검출 엔진을 실행

 

   - Running rootcheck (rootkit detection).

 

  3.4- Active response allows you to execute a specific

       command based on the events received. For example,

       you can block an IP address or disable access for

       a specific user.

       More information at:

http://www.ossec.net/en/manual.html#active-response

 

   - Do you want to enable active response? (y/n) [y]: y -> 실시간 응답 사용

 

     - Active response enabled.

 

   - By default, we can enable the host-deny and the

     firewall-drop responses. The first one will add

     a host to the /etc/hosts.deny and the second one

     will block the host on iptables (if linux) or on

     ipfilter (if Solaris, FreeBSD or NetBSD).

   - They can be used to stop SSHD brute force scans,

     portscans and some other forms of attacks. You can

     also add them to block on snort events, for example.

 

   - Do you want to enable the firewall-drop response? (y/n) [y]: y -> 방화벽이 중지되었을 때 응답 사용

 

     - firewall-drop enabled (local) for levels >= 6

 

   - Default white list for the active response:

      - 168.126.63.1

      - 168.126.63.2

      - 211.234.118.50

      - 121.78.117.39

 

   - Do you want to add more IPs to the white list? (y/n)? [n]: n -> 화이트리스트IP를 추가

 


  3.6- Setting the configuration to analyze the following logs:

    -- /var/log/messages

    -- /var/log/secure

    -- /var/log/xferlog

    -- /var/log/maillog

    -- /var/log/squid/access.log -> 분석할 로그파일들을 보여준다.

 

 - If you want to monitor any other file, just change

   the ossec.conf and add a new localfile entry.

   Any questions about the configuration can be answered

   by visiting us online at http://www.ossec.net .


설정이 끝났으면 인스톨을 시작후 완료된다.

 



실행


# /var/ossec/bin/ossec-control start


자동시작 데몬 등록

# cat /etc/rc.d/rc.local

/var/ossec/bin/ossec-control start 



host.allow

host.deny

selinux 확인


iptables 1514 UDP port 열어줘야함 



======================================


테스트 결과, 실시간  반영이 잘 되지 않는 경향이 있어서

tripwire로 변경해서 작업


참고

https://www.linux.co.kr/security/tripwire/



 



'관리툴 > OSSEC' 카테고리의 다른 글

OSSEC agentless 설정하기  (0) 2012.05.16
OSSEC conf  (0) 2012.04.20
OSSEC agent 설정  (0) 2012.04.19
OSSEC WUI 설정  (0) 2012.04.18