Microsoft Word - Tripwire 파일 무결성 구현.doc

Similar documents
본문서는 초급자들을 대상으로 최대한 쉽게 작성하였습니다. 본문서에서는 설치방법만 기술했으며 자세한 설정방법은 검색을 통하시기 바랍니다. 1. 설치개요 워드프레스는 블로그 형태의 홈페이지를 빠르게 만들수 있게 해 주는 프로그램입니다. 다양한 기능을 하는 플러그인과 디자인

<31332DB9E9C6AEB7A2C7D8C5B72D3131C0E528BACEB7CF292E687770>

LXR 설치 및 사용법.doc

Chapter 1

Solaris Express Developer Edition

Sena Technologies, Inc. HelloDevice Super 1.1.0

untitled

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

<32B1B3BDC32E687770>

28 THE ASIAN JOURNAL OF TEX [2] ko.tex [5]

APOGEE Insight_KR_Base_3P11

DE1-SoC Board

본교재는수업용으로제작된게시물입니다. 영리목적으로사용할경우저작권법제 30 조항에의거법적처벌을받을수있습니다. [ 실습 ] 스위치장비초기화 1. NVRAM 에저장되어있는 'startup-config' 파일이있다면, 삭제를실시한다. SWx>enable SWx#erase sta

K7VT2_QIG_v3

01Àå

Copyright 2004 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A..,,. Sun. Sun. Berkeley BSD. UNIX X/Open Company, Ltd.. Sun, Su

Remote UI Guide

Microsoft Word - ntasFrameBuilderInstallGuide2.5.doc

Copyright 2012, Oracle and/or its affiliates. All rights reserved.,.,,,,,,,,,,,,.,...,. U.S. GOVERNMENT END USERS. Oracle programs, including any oper

1) 인증서만들기 ssl]# cat > // 설명 : 발급받은인증서 / 개인키파일을한파일로저장합니다. ( 저장방법 : cat [ 개인키

CD-RW_Advanced.PDF

s SINUMERIK 840C Service and User Manual DATA SAVING & LOADING & & /

1) 인증서만들기 ssl]# cat > // 설명 : 발급받은인증서 / 개인키파일을한파일로저장합니다. ( 저장방법 : cat [ 개인키

Copyright 0, Oracle and/or its affiliates. All rights reserved.,.,,,,,,,,,,,,.,...,. U.S. GOVERNMENT RIGHTS Programs, software, databases, and related

토익S-채용사례리플렛0404

2008

Microsoft PowerPoint - comp_prac_081223_2.pptx

Microsoft Word - enterprise-linux-1-2.doc

chapter1,2.doc

1. efolder 시스템구성 A. DB B. apache - mod-perl - PHP C. SphinxSearch ( 검색서비스 ) D. File Storage 2. efolder 설치순서 A. DB (MySQL) B. efolder Service - efolder

Microsoft Word ARM_ver2_0a.docx

PowerChute Personal Edition v3.1.0 에이전트 사용 설명서

A B C D E F RRC350 RRC Roteo 35

사용시 기본적인 주의사항 경고 : 전기 기구를 사용할 때는 다음의 기본적인 주의 사항을 반드시 유의하여야 합니다..제품을 사용하기 전에 반드시 사용법을 정독하십시오. 2.물과 가까운 곳, 욕실이나 부엌 그리고 수영장 같은 곳에서 제품을 사용하지 마십시오. 3.이 제품은

휠세미나3 ver0.4

PRO1_04E [읽기 전용]

Dropbox Forensics

Mango220 Android How to compile and Transfer image to Target

/chroot/lib/ /chroot/etc/

슬라이드 1

MAX+plus II Getting Started - 무작정따라하기

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh

PowerPoint 프레젠테이션

Stage 2 First Phonics

슬라이드 1

H3050(aap)

ISP and CodeVisionAVR C Compiler.hwp

Copyright 2012, Oracle and/or its affiliates. All rights reserved.,,,,,,,,,,,,,.,..., U.S. GOVERNMENT END USERS. Oracle programs, including any operat

[ 컴퓨터시스템 ] 3 주차 1 차시. 디렉토리사이의이동 3 주차 1 차시디렉토리사이의이동 학습목표 1. pwd 명령을사용하여현재디렉토리를확인할수있다. 2. cd 명령을사용하여다른디렉토리로이동할수있다. 3. ls 명령을사용하여디렉토리내의파일목록을옵션에따라다양하게확인할수

4. 스위치재부팅을실시한다. ( 만약, Save 질문이나오면 'no' 를실시한다.) SWx#reload System configuration has been modified. Save? [yes/no]: no Proceed with reload? [confirm] (

PowerPoint 프레젠테이션

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

본문01

B _02-M_Korean.indd

Snort Install Manual Ad2m VMware libnet tar.gz DebianOS libpcap tar.gz Putty snort tar.gz WinSCP snort rules 1. 첫번째로네트워크설정 1) ifconf

0125_ 워크샵 발표자료_완성.key

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

지난시간에... 우리는 kernel compile을위하여 cross compile 환경을구축했음. UBUNTU 12.04에서 arm-2009q3를사용하여 간단한 c source를빌드함. 한번은 intel CPU를위한 gcc로, 한번은 ARM CPU를위한 gcc로. AR

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

¹Ìµå¹Ì3Â÷Àμâ

MySQL-Ch10

B _01_M_Korea.indb

Mentor_PCB설계입문

Mango-AM335x LCD Type 커널 Module Parameter에서 변경하기

FreeBSD Handbook

#KM-235(110222)

¿ÀǼҽº°¡À̵å1 -new

DocsPin_Korean.pages

<31325FB1E8B0E6BCBA2E687770>

09김정식.PDF

슬라이드 제목 없음

untitled

작성자 : 기술지원부 김 삼 수

목차 1. 시스템구성 개요 정의 목적 환경 준비사항 Oracle Install configuration Xshell 에

06_±è¼öö_0323

DBPIA-NURIMEDIA

PowerPoint Presentation

<C5EBC0CFB0FA20C6F2C8AD2E687770>

Apache( 단일도메인 ) SSL 인증서갱신설치가이드 본문서는주식회사한국기업보안에서 SSL 보안서버인증서설치를위해작성된문서로 주식회사한국기업보안의동의없이무단으로사용하실수없습니다. [ 고객센터 ] 한국기업보안. 유서트기술팀 Copyright 201

1217 WebTrafMon II

Eclipse 와 Firefox 를이용한 Javascript 개발 발표자 : 문경대 11 년 10 월 26 일수요일

Main Title

Interstage5 SOAP서비스 설정 가이드

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,

Sena Device Server Serial/IP TM Version

PRO1_09E [읽기 전용]

05Àå

10X56_NWG_KOR.indd


<B3EDB9AEC1FD5F3235C1FD2E687770>

06_ÀÌÀçÈÆ¿Ü0926

PowerPoint 프레젠테이션

문서 대제목

Sun Java System Messaging Server 63 64

메일서버등록제(SPF) 인증기능적용안내서 (AIX - sendmail) OS Mail Server SPF 적용모듈 (Perl 기반) 작성기준 AIX 5.3 sendmail spf-filter 년 6 월

UNIST_교원 홈페이지 관리자_Manual_V1.0

DBPIA-NURIMEDIA

#Ȳ¿ë¼®

UI TASK & KEY EVENT

Transcription:

[Tripwire 파일무결성구현 ] [01] 개론 [02] 다운로드 & 설치 [03] 환경설정및활용 [01] 개론 tripwire는파일시스템무결성점검을하는서버보안도구로서파일들의변경사항유무를체크할수있는대표적인보안유틸리티이다. - 파일변조여부를모니터링하는프로그램 - 파일속성및디렉토리정보를데이터베이스화하여변조여부비교 - 변경으로인한데이터손상에대한피해를최소화 - policy 파일은자신시스템중어느파일 / 디렉토리를감시할것인가를설정 [02] 다운로드 & 설치공식사이트 : http://sourceforge.net/projects/tripwire/ 다운로드 : http://downloads.sourceforge.net/tripwire/tripwire-2.4.1.2- src.tar.bz2?use_mirror=jaist [ 참고 ] tripwire는 rpm 파일과소스파일둘다제공한다. [root@localhost ~]# mkdir /tripware [root@localhost ~]# cd /tripware/ [root@localhost tripware]# ls tripwire-2.4.1.2-src.tar.bz2 [root@localhost tripware]# tar xvfl tripwire-2.4.1.2-src.tar.bz2 tar: Semantics of -l option will change in the future releases. tar: Please use --one-file-system option instead. tripwire-2.4.1.2-src/ tripwire-2.4.1.2-src/src/... 중간생략... tripwire-2.4.1.2-src/install/ tripwire-2.4.1.2-src/install/install.cfg tripwire-2.4.1.2-src/install/install.sh [root@localhost tripware]# ls -F tripwire-2.4.1.2-src/ tripwire-2.4.1.2-src.tar.bz2 [root@localhost tripware]# cd tripwire-2.4.1.2-src [root@localhost tripwire-2.4.1.2-src]# ls COMMERCIAL Makefile.am config.guess contrib missing

COPYING Makefile.in config.h.in install mkinstalldirs ChangeLog TRADEMARK config.sub install-sh policy INSTALL aclocal.m4 configure lib src MAINTAINERS bin configure.in man [root@localhost tripwire-2.4.1.2-src]#./configure -- prefix=/usr/local/tripwire [root@localhost tripwire-2.4.1.2-src]# make && make install LICENSE AGREEMENT for Tripwire(R) 2.4 Open Source Please read the following license agreement. You must accept the agreement to continue installing Tripwire. Press ENTER to view the License Agreement. // ENTER 키누른다. Please type "accept" to indicate your acceptance of this license agreement. [do not accept] accept [SpaceBar] 계속누르면마지막에 (100%) accept 키보드로친다. Verifying existence of binaries..../bin/siggen found./bin/tripwire found./bin/twprint found./bin/twadmin found This program will copy Tripwire files to the following directories: TWBIN: /usr/local/tripwire/sbin TWMAN: /usr/local/tripwire/man TWPOLICY: /usr/local/tripwire/etc TWREPORT: /usr/local/tripwire/lib/tripwire/report TWDB: /usr/local/tripwire/lib/tripwire TWSITEKEYDIR: /usr/local/tripwire/etc TWLOCALKEYDIR: /usr/local/tripwire/etc CLOBBER is false. Continue with installation? [y/n] y Creating directories...

/usr/local/tripwire/sbin: already exists /usr/local/tripwire/etc: created /usr/local/tripwire/lib/tripwire/report: created /usr/local/tripwire/lib/tripwire: already exists /usr/local/tripwire/etc: already exists /usr/local/tripwire/etc: already exists /usr/local/tripwire/man: created /usr/local/tripwire/doc/tripwire: created Copying files... /usr/local/tripwire/doc/tripwire/copying: copied /usr/local/tripwire/doc/tripwire/trademark: copied /usr/local/tripwire/doc/tripwire/policyguide.txt: copied /usr/local/tripwire/etc/twpol-linux.txt: copied The Tripwire site and local passphrases are used to sign a variety of files, such as the configuration, policy, and database files. Passphrases should be at least 8 characters in length and contain both letters and numbers. See the Tripwire manual for more information. Creating key files... (When selecting a passphrase, keep in mind that good passphrases typically have upper and lower case letters, digits and punctuation marks, and are at least 8 characters in length.) Enter the site keyfile passphrase: itbank Verify the site keyfile passphrase: itbank [ 참고 ] passphrase 키파일이라는것으로 tripwire에관한중요한설정변경과초기화등을시킬때사용되는패스워드역할을하는것이다. 아래에계속 localkey와 sitekey로사용할패스워드를입력하자.

Generating key (this may take several minutes)...key generation complete. (When selecting a passphrase, keep in mind that good passphrases typically have upper and lower case letters, digits and punctuation marks, and are at least 8 characters in length.) Enter the local keyfile passphrase: itbank Verify the local keyfile passphrase: itbank Generating key (this may take several minutes)...key generation complete. Generating Tripwire configuration file... Creating signed configuration file... Please enter your site passphrase: itbank Wrote configuration file: /usr/local/tripwire/etc/tw.cfg A clear-text version of the Tripwire configuration file /usr/local/tripwire/etc/twcfg.txt has been preserved for your inspection. It is recommended that you delete this file manually after you have examined it. Customizing default policy file... Creating signed policy file... Please enter your site passphrase: itbank Wrote policy file: /usr/local/tripwire/etc/tw.pol A clear-text version of the Tripwire policy file /usr/local/tripwire/etc/twpol.txt has been preserved for your inspection. This implements a minimal policy, intended only to test essential Tripwire functionality. You should edit the policy file to describe your system, and then use twadmin to generate a new signed copy of the Tripwire policy. The installation succeeded. Please refer to for release information and to the printed user documentation

for further instructions on using Tripwire 2.4 Open Source. make[3]: Leaving directory `/tripware/tripwire-2.4.1.2-src' make[2]: Leaving directory `/tripware/tripwire-2.4.1.2-src' make[1]: Leaving directory `/tripware/tripwire-2.4.1.2-src' [root@localhost tripwire-2.4.1.2-src]# 위에서 tripwire의정책파일을생성하는것으로설치의마지막과정이다. 정책파일이란 tripwire가파일시스템무결성점검실행시에참조하게되는설정파일이다. 이파일을 /usr/local/tripwire/etc/tw.pol 디렉토리에 tw.pol 이라는파일로저장했음을알리고있다. [root@localhost tripwire-2.4.1.2-src]# cd ~ [root@localhost ~]# [root@localhost ~]# ls /usr/local/tripwire/etc/* /usr/local/tripwire/etc/localhost.localdomain-local.key /usr/local/tripwire/etc/site.key /usr/local/tripwire/etc/tw.cfg /usr/local/tripwire/etc/tw.pol /usr/local/tripwire/etc/twcfg.txt /usr/local/tripwire/etc/twpol.txt [03] 환경설정및활용 작업의편의성을위해서 PATH 걸어두자. [root@localhost ~]# vi ~/.bash_profile #.bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then. ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin:/usr/local/server/mysql/bin:/usr/local/tripwire /sbin export PATH unset USERNAME [root@localhost ~]# source ~/.bash_profile

데이터베이스생성하기 (tripwire 초기화 ) 초기화하기전에불필요한디렉토리를제거하자! [root@localhost ~]# cd /usr/local/tripwire/etc [root@localhost etc]# ls localhost.localdomain-local.key tw.cfg twcfg.txt site.key tw.pol twcfg.txt_old [root@localhost etc]# cp twpol.txt twpol.txt_old [root@localhost etc]# [root@localhost etc]# vi twpol.txt 위 twpol.txt 문서에서아래를찾아 # 주석문을걸어두자! /etc/mail/statistics // 149 Line : vi Line /cdrom // 169 Line /floppy // 170 Line /initrd // 186 Line /var/lost+found // 189 Line /home/lost+found // 190 Line /usr/x11r6/lib // 213 Line /usr/local/doc // 229 Line /usr/local/man // 235 Line /usr/local/sysinfo // 239 Line twpol.txt [root@localhost ~]# tripwire --init 여기서초기화란마지막으로점검했던파일들의무결성점검결과를저장하고있던 DB를초기화한다는것이다. 즉, 초기화시키기전의변동사항은이후에적용되지않는다는의미이기대문에중요하다. Please enter your local passphrase: itbank Parsing policy file: /usr/local/tripwire/etc/tw.pol Generating the database... *** Processing Unix File System *** The object: "/misc" is on a different file system...ignoring. The object: "/net" is on a different file system...ignoring. The object: "/sys" is on a different file system...ignoring.... 중간생략... ### \xec\x97\x86\xec\x9d\x8c ### Continuing... Wrote database file: /usr/local/tripwire/lib/tripwire/localhost.localdomain.twd The database was successfully generated.

[root@localhost ~]# [root@localhost ~]# ls -al /usr/local/tripwire/lib/tripwire/localhost.localdomain.twd -rw-r--r-- 1 root root 10563588 4월 1 04:23 /usr/local/tripwire/lib/tripwire/localhost.localdomain.twd 5~10분이상의시간이걸린다. 파일생성 / 변조 / 삭제유무점검하기 [root@localhost ~]# tripwire --check Parsing policy file: /usr/local/tripwire/etc/tw.pol *** Processing Unix File System *** Performing integrity check...... 중간생략... *** End of report *** Open Source Tripwire 2.4 Portions copyright 2000 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. This software comes with ABSOLUTELY NO WARRANTY; for details use --version. This is free software which may be redistributed or modified only under certain conditions; see COPYING for details. All rights reserved. Integrity check complete. [root@localhost ~]# tripwire --check 명령어는 tripwire 로써서버에사용중인파일들의무결성을체크하여보고서를만들게되는명령어이다. 적용되는정책파일 /usr/local/tripwire/etc/tw.pol 이고결과보고서는 /usr/local/tripwire/lib/tripwire/report 이곳에저장된다. [root@localhost ~]# cd /usr/local/tripwire/lib/tripwire/report [root@localhost report]# ls localhost.localdomain-20090401-042713.twr twr 파일은암호화되어있기때문에 twprint를이용해 txt 파일로변환하자. [root@localhost report]# twprint -m r --twrfile localhost.localdomain- 20090401-042713.twr > 2009.04.01.txt [root@localhost report]# [root@localhost report]# ls 2009.04.01.txt localhost.localdomain-20090401-042713.twr [root@localhost report]# cat 2009.04.01 결과를눈으로확인해보자!

Added: /root/.mysql_history /root/.ssh 새로생성된파일을확인한결과 Removed: /root/.backup.sh.swp 파일이삭제되었음을알려주는결과 Modified: /root/bin 변조된파일이있음을알려주는결과 그리고종합적인결과로 Security Level Added Removed Modified 항목을표로 만들어서보여준다. 설정파일확인및변경 /usr/local/tripwire/etc/twcfg.txt 이파일은 tripwire가어떤환경으로실행될것인가를정의해둔파일이다. [root@localhost ~]# cat /usr/local/tripwire/etc/twcfg.txt ROOT =/usr/local/tripwire/sbin POLFILE =/usr/local/tripwire/etc/tw.pol DBFILE =/usr/local/tripwire/lib/tripwire/$(hostname).twd REPORTFILE =/usr/local/tripwire/lib/tripwire/report/$(hostname)- $(DATE).twr SITEKEYFILE =/usr/local/tripwire/etc/site.key LOCALKEYFILE =/usr/local/tripwire/etc/localhost.localdomain-local.key EDITOR =/bin/vi LATEPROMPTING =false LOOSEDIRECTORYCHECKING =false MAILNOVIOLATIONS =true EMAILREPORTLEVEL =3 REPORTLEVEL =3 MAILMETHOD =SENDMAIL SYSLOGREPORTING =false MAILPROGRAM =/usr/sbin/sendmail -oi -t [root@localhost ~]# 실행파일의위치, 정책파일 (tw.pol) 의위치, tripwire 데이터베이스파일의위치등을모두이파일에서정의하고있다.

만약 tripwire 의실행환경이변경된다면이파일의내용을수정해주면된다. ( 예 ) sendmail의위치가맞지않다면 MAILPROGRAM 지시자에 sendmail의실제위치를설정해주면된다. 참고로이파일에설정된내용들은모두 /usr/local/tripwire/etc/tw.cfg 파일 ( 바이너리파일 ) 에적용되어 tripwire에사사용하게된다. 정책파일수정및변경 [root@localhost ~]# cd /usr/local/tripwire/etc [root@localhost etc]# ls localhost.localdomain-local.key tw.cfg twcfg.txt twpol.txt site.key tw.pol twcfg.txt_old twpol.txt_old [root@localhost etc]# 위 twpol.txt 파일에서 # 으로주석문을하면점검대상을제외시킬수도있고물론추가시킬수도있다. cron을이용한 tripwire 서버점검활용 [ 조건 ] tripwire 설치되어있어야한다. tripwire를실행시키는간단한쉘스크립트작성 ( 예 ) tripwire.sh 이때실행된결과를웹으로확인할수있도록한다. 웹서비스가되어야한다. [root@localhost ~]# cd /usr/local/tripwire/sbin/ [root@localhost sbin]# ls siggen tripwire twadmin twprint [root@localhost sbin]# vi tripwire.sh #!/bin/bash echo "============ $HOSTNAME System Check Start ============" echo "=================== `date` =====================" echo "" echo "tripwire File Check" tripwire --check echo "" echo "============== $HOST System Check End ===============" [root@localhost sbin]# chmod 700 tripwire.sh [root@localhost sbin]# ls -al 합계 5520 drwxr-xr-x 2 root root 4096 4월 1 05:02.

drwxr-xr-x 8 root root 4096 4 월 1 03:40.. -rwxr-xr-x 1 root root 1196420 4 월 1 03:36 siggen -rwxr-xr-x 1 root root 1663638 4 월 1 03:36 tripwire -rwx------ 1 root root 279 4 월 1 05:02 tripwire.sh -rwxr-xr-x 1 root root 1452021 4 월 1 03:36 twadmin -rwxr-xr-x 1 root root 1301572 4 월 1 03:36 twprint [root@localhost sbin]# crontab e */10 * * * * /usr/bin/rdate -s time.bora.net && /sbin/clock -w 00 05 * * * su - root -c '/usr/local/tripwire/sbin/tripwire.sh' > /usr/local/se rver/apache/htdocs/tripwire_result [root@localhost sbin]#./tripwire.sh 실행하면웹서비스하고있는 /usr/local/server/apache/htdocs/tripwire_result 파일로저장이되서웹에서확인할수있다. 우리는직접확인하기위해위 cron 설정값을 5 분후로해보자. http://cafe.naver.com/linuxlog krintiz@naver.com