보안 공부/System 보안

Linux 로그설정 노트(2)_KISA 배포자료

H.J.World 2019. 1. 18. 14:54
728x90
반응형

1. btmp 로그 설정

 -  /etc/logrotate.d/btmp 생성 
   # touch /etc/logrotate.d/btmp
 - /etc/logrotate.d/btmp 설정 (항목 작성)

 - /var/log/bmtp {
   monthly
   create 0640 root btmp
   rotate 6
   missingok
   dateext

 

 - 로그 파일은 파일별 1개월의 로그 저장 로그 파일 생성 시, 0640의 권한, root 소유, btmp 그룹으로 설정 로그 파일은 6개월 분량 보관
   로그 파일이 존재하지 않아도 오류 발생하지 않음로그 파일명에 YYYYMMDD 형식의 문자열을 추가

 

 

2. message 로그 설정

 - /etc/logrotate.d/messages 생성
   # touch /etc/logrotate.d/messages
 - /etc/logrotate.d/messages 설정 (항목 작성)
   : <권장 설정 값> 참조

 

 - /var/log/messages {
   monthly
   create 0640 root
   rotate 6
   missingok
   dateext
  }

 

 - 로그 파일은 파일별 1개월의 로그 저장 로그 파일 생성 시, 0640의 권한, root 소유, root 그룹으로 설정 로그 파일은 6개월 분량 보관
   로그 파일이 존재하지 않아도 오류 발생하지 않음 로그 파일명에 YYYYMMDD 형식의 문자열을 추가

 

3. secure 로그 설정

 - /etc/logrotate.d/secure 생성
   # touch /etc/logrotate.d/secure
 - /etc/logrotate.d/secure 설정 (항목 작성)
   : <권장 설정 값> 참조

 

 - /var/log/secure {
   monthly
   create 0640 root secure
   rotate 6
   missingok
   dateext
  }

 

- 로그 파일은 파일별 1개월의 로그 저장 로그 파일 생성 시, 0640의 권한, root 소유, root 그룹으로 설정 로그 파일은 6개월 분량 보관

  로그 파일이 존재하지 않아도 오류 발생하지 않음 로그 파일명에 YYYYMMDD 형식의 문자열을 추가

 

4. dmesg 로그 설정

- /etc/logrotate.d/dmesg 생성
  # touch /etc/logrotate.d/dmesg
 - /etc/logrotate.d/dmesg 설정 (항목 작성)
  : <권장 설정 값> 참조

 

 - /var/log/dmesg {
   monthly
   create 0640 root dmesg
   rotate 6
   missingok
   dateext
  }

 

- 로그 파일은 파일별 1개월의 로그 저장 로그 파일 생성 시, 0640의 권한, root 소유, root 그룹으로 설정 로그 파일은 6개월 분량 보관

  로그 파일이 존재하지 않아도 오류 발생하지 않음 로그 파일명에 YYYYMMDD 형식의 문자열을 추가

728x90
반응형