DAY11 미션3:syslogd를 사용한 로그기록 참고
서버 설정
su
nano /etc/rsyslog.conf
$IncludeConfig /etc/rsyslog.d/*.conf
nano /etc/rsyslog.d/50-default.conf (밑에 붙이기)
action(type="omfwd"
queue.filename="IP214.jeonjucom.kr"
queue.maxdiskspace="1g"
queue.saveonshutdown="on"
queue.type="LinkedList"
action.resumeRetryCount="-1"
Target="10.10.10.252" Port="514" Protocol="tcp")
192.168.0.117
백업서버 설정
sudo passwd root
nano /etc/hostname
LOG
nano /etc/rsyslog.conf
module(load="imtcp")
input(type="imtcp" port="514")
$AllowedSender TCP,10.0.2.0/24, *.st.kr
서버는 포트(514)를 열고 3대 서버로부터 데이터가 전송되는 것을 기다림
apt -y install net-tools
netstat -ant | grep 514 (rsyslog 확인)
systemctl restart rsyslog
*로그를 데이터베이스에 저장하기
apt -y install mariadb-server
apt -y install rsyslog-mysql
yes/123456
mysql
use Syslog;
desc SystemEvents;
select * from SystemEvents;
select FromHost, Message from SystemEvents where FromHost='IP004';
*서버에 tripwire 설치하기(못했음!)