'관리툴/OSSEC'에 해당되는 글 5건

  1. 2012.05.16 OSSEC agentless 설정하기
  2. 2012.04.20 OSSEC conf
  3. 2012.04.19 OSSEC agent 설정
  4. 2012.04.18 OSSEC WUI 설정
  5. 2012.04.17 OSSEC 설치
posted by 은이종 2012. 5. 16. 18:14


ossec 는 기본적으로 agent 방식이다.


허나 클라이언트쪽 사정으로 agent 설치가 불가할 경우,

agentless 방식으로 설정을 할 수 있다.



우선 


agentless 방식은 expect 패키지를 이용함으로


expect 패키지를 설치한다.


 yum install expect



1. 등록하기


/var/ossec/agentless/register_host.sh add host@ip password 




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

OSSEC conf  (0) 2012.04.20
OSSEC agent 설정  (0) 2012.04.19
OSSEC WUI 설정  (0) 2012.04.18
OSSEC 설치  (0) 2012.04.17
posted by 은이종 2012. 4. 20. 10:39

/var/ossec/etc

OSSEC HIDS가 사용하는 모든 구성 파일이 저장되어 있습니다.


/var/ossec/etc/ossec.conf

OSSEC HIDS의 기본 설정 파일입니다.


/var/ossec/etc/internal_options.conf

추가 설정을 설명하는 파일입니다.


/var/ossec/etc/decoders.xml

로그의 내용을 표준화하기위한 디코딩 설정 파일입니다.


/var/ossec/etc/client.keys

에이전트와 서버 사이에서 통신할 때 사용되는 인증 키입니다.


/var/ossec/logs

OSSEC HIDS에 관한 모든 로그가 저장되어 있습니다.


/var/ossec/logs/ossec.log

OSSEC HIDS 기본 로그입니다. (error, warn, info, 기타 포함)


/var/ossec/logs/alerts/alerts.log

OSSEC HIDS 경고 로그입니다.


/var/ossec/logs/active - responses.log

OSSEC HIDS의 활성 응답 로그입니다.


/var/ossec/queue

OSSEC HIDS 큐 파일이 저장되어 있습니다.


/var/ossec/queue/agent - info

에이전트에 특정 정보가 들어있는 디렉토리입니다. (OS, OSSEC HIDS 버전 등)


/var/ossec/queue/syscheck

에이전트마다 구별되었다 무결성 검사에 사용되는 데이터가 저장되는 디렉토리입니다.


/var/ossec/queue/rootcheck

각 에이전트에 대한 rootkit 정보와 정책 모니터링 데이터가 저장되는 디렉토리입니다.


/var/ossec/queue/rids

에이전트의 메시지 ID가 들어있는 디렉토리입니다.


/var/ossec/queue/fts

First Time Seen (FTS) 항목이 포함된 파일을 포함하는 디렉토리입니다. 


/var/ossec/rules

OSSEC HIDS의 모든 규칙이 저장되어있는 디렉토리입니다.


/var/ossec/stats

OSSEC HIDS의 통계 정보가 저장되는 디렉토리입니다. 통계 정보에는 초 단위로 측정한 로그 있습니다.

[출처] ossec-hids 의 설치|작성자 

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

OSSEC agentless 설정하기  (0) 2012.05.16
OSSEC agent 설정  (0) 2012.04.19
OSSEC WUI 설정  (0) 2012.04.18
OSSEC 설치  (0) 2012.04.17
posted by 은이종 2012. 4. 19. 15:08

OSSEC 설치하는 과정에서 특이점이


우선은 

1 . agent 방식

2.  agentless 방식이 있다는 점

3. 그리고 key값을 통한 인증이 필요하다는 점


TCP 1514 Port를 iptables에서 허용해야 함




agent 설치 과정



<server>

#./manage_agent


실행하여 

해당 클라이언트 정보 등록


key 값을 확인한다.





<client>

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


압축풀고


#./install.sh


실행


server에서 확인한 key값을 넣고


./ossec-agent 실행





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

OSSEC agentless 설정하기  (0) 2012.05.16
OSSEC conf  (0) 2012.04.20
OSSEC WUI 설정  (0) 2012.04.18
OSSEC 설치  (0) 2012.04.17
posted by 은이종 2012. 4. 18. 13:37

WUI 설정



다운

 wget http://www.ossec.net/files/ui/ossec-wui-0.3.tar.gz


압축 풀기

 $ tar -zxvf ossec-wui-0.3.tar.gz

웹페이지 경로로 이동
 # mv ossec-wui-0.3 /var/www/html/ossec-wui

 

셋업파일 실행
   # cd /var/www/html/ossec-wui
   # ./setup.sh



그룹지정-아파지유저 추가

  # vi /etc/group
   ..
   From:
       ossec:x:1002:
   To (if your web server user is www):
       ossec:x:1002:apache

인시폴더 권한설정
   # cd /var/ossec

   # chmod 770 tmp/
   # chgrp www tmp/ 

     www : 본인이 사용하는 user 계정
   # apachectl restart


php.ini  변경 설정값

    max_execution_time = 180
    max_input_time = 180
    memory_limit = 30M



*** ossec.conf 파일을 dir 경로를 ossec 설치경로로 맞춰준다. 본인같은 경우 /usr/local/ossec 에 설치됨  ***

마지막으로 웹에서 확인하면 됨.

http://localhost/ossec-wui



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

OSSEC agentless 설정하기  (0) 2012.05.16
OSSEC conf  (0) 2012.04.20
OSSEC agent 설정  (0) 2012.04.19
OSSEC 설치  (0) 2012.04.17
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