InfoSec / / 2024. 6. 28. 16:55

Linux 무결성 점검 도구 설치

Tripwire 설치 및 사용하기

Tripwire는 현재 리눅스의 상태를 저장해

차이점이 생길 경우 보고, 관리해주는 프로그램입니다.

dnf install -y epel-release

dnf install -y tripwire

 

/usr/sbin/tripwire-setup-keyfiles

 

Enter the site keyfile passphrase: 첫번째 암호 생성

Enter the local keyfile passphrase: 두번째 암호 생성

 

Please enter your site passphrase: 첫번째 암호 입력

Please enter your site passphrase: 첫번째 암호 입력

# config파일을 생성 및 정책파일 사인을 위해 위해 site keyfile을 두번 물어봅니다.

 

mv /etc/tripwire/twpol.txt /etc/tripwire/twpol.txt.bak

 

gedit /etc/tripwire/twpol.txt

 

 

# 테스트를 위해 세 폴더만 모니터링하기 위해

# 기존 정의 파일을 백업하고 새로운 정의를 만들어줍니다.

 

twpol.txt)
/bin -> $(ReadOnly);

/etc -> $(IgnoreNone)-SHa;
/var -> +pug;

 

twadmin --create-polfile /etc/tripwire/twpol.txt

site 암호 입력

# 새로 만든 정의 파일을 적용

 

tripwire --init

local 암호 입력

# 데이터베이스 생성

 

tripwire --check

# 무결성을 점검하고 보고서를 출력해주는 명령어

# 현재는 아무것도 하지 않았으므로 아무런 변동사항이 없는 보고서가 출력됩니다.

 

이제 tripwire의 적용이 완료되었습니다.

 

 

테스트를 위해 모니터링 하는 세 폴더에서 파일을 만들어 봅시다.

cd /bin
touch korea.txt
cd /etc
touch korea.txt
cd /var
touch korea.txt

 

tripwire --check

 

 

추가된 파일, 수정된 파일들의 목록이 출력됩니다.

  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유