많은 보안 가이드라인에서 Audit 시스템이 발생시키는 로그의 취합, 보관 및 분석을 권장하고 있습니다. (ISO/IEC 27001:2013 http://blog.plura.io/?p=5700 )
하지만 audit 데몬은 따로 하위 폴더를 생성해 로그를 기록(디폴트 경로 /var/log/audit/audit.log )하는 등 audit 과 syslog 의 여러 차이들로 인해 기존 syslog 를 취합, 관리하고 있던 시스템에서의 통합관리에 번거로움이 있습니다.
때문에 audit 로그를 syslog 를 통해 중앙집중관리를 할 수 있도록 audit 시스템에서는 플러그인을 제공하고 있습니다. 이를 통해 기존 syslog 와 통합조회가 가능하며 편리하게 통제할 수 있습니다.

 

< 로그 집중 관리를 위한 audit 로그 설정>

아래 과정은 모두 root 권한을 필요로 하기에 root 권한 사용을 전제로 설명하겠습니다.

 

1. Audit 시스템 설치 확인
Audit 시스템은 Redhat 계열(RHEL, CentOS, Fedora)의 경우 기본 설치되어 있으며 Ubuntu 의 경우 설치되어 있지 않을 가능성이 있습니다.
설치하기 위한 명령어는 다음과 같습니다.

Ubuntu
~ # sudo apt-get install auditd audispd-plugins
CentOS / RHEL
~ # yum install audit

 

2. Audit 디스패칭 플러그인 활성화
Audit 데몬이 발생시키는 로그를 rsyslog 로 중앙집중화하기 위해 만들어진 플러그인을 활성화하기 위해 관련 설정 파일을 편집합니다.

~ # vi /etc/audisp/plugins.d/syslog.conf
# This file controls the configuration of the syslog plugin.
# It simply takes events and writes them to syslog. The
# arguments provided can be the default priority that you
# want the events written with. And optionally, you can give
# a second argument indicating the facility that you want events
# logged to. Valid options are LOG_LOCAL0 through 7.
active = no
direction = out
path = builtin_syslog
type = builtin
args = LOG_INFO
format = string

설정파일 안의 ‘active = no’ 부분을 ‘active = yes’ 로 바꾸어 줍니다.
혹은 그냥 stream editor 를 사용하셔도 됩니다.

~ # sed -i -e ‘s/active = no/active = yes/g’ /etc/audisp/plugins.d/syslog.conf

위 명령어 또한 동일하게 플러그인 파일에서 active 부분을 yes 로 수정하는 역할을 합니다.

 

3. rsyslog, audit 데몬 재시작 혹은 리로드
바뀐 설정을 적용하기 위해 관련된 데몬을 restart 혹은 reload 합니다.
audit 데몬 재시작 시에 systemd 를 지원하는 OS 라도 (RHEL7/CentOS7, Ubuntu16.04 등) systemctl 명령어가 아닌, service 명령어를 사용하는 것이 권장됩니다. (관련링크)
명령어는 다음과 같습니다.

~ # service rsyslog restart && service auditd restart

혹은

~ # service rsyslog reload && service auditd reload

 

4. PLURA V5 에서 내용 확인
취합된 로그는 PLURA V5 에서도 다음과 같이 key/value 형식으로 바로 확인이 가능합니다.


audit dispatcher가 syslog 데몬을 통해 업로드하므로 채널은 Auditlog 로, 주요개체는 audisp(audit dispatcher) 로 나타납니다.

 

 

References:
(1) Redhat Inc. RHEL7 System Administrator’s Guide. November 03, 2016. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/System_Administrators_Guide/Red_Hat_Enterprise_Linux-7-System_Administrators_Guide-en-US.pdf (Accessed 2016-11-28).
(2) Redhat Inc. RHEL7 Security Guide. November 01, 2016. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/Security_Guide/Red_Hat_Enterprise_Linux-7-Security_Guide-en-US.pdf (Accessed 2016-11-28).
(3) Redhat Inc. RHEL7 SELinux User and Administrator’s Guide. November 02, 2016. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/SELinux_Users_and_Administrators_Guide/Red_Hat_Enterprise_Linux-7-SELinux_Users_and_Administrators_Guide-en-US.pdf (Accessed 2016-11-28).
(4) Linux man page. auditd.conf(8). https://linux.die.net/man/8/auditd.conf (Accessed 2016-11-28).
(5) Linux man page. audispd.conf(5). https://linux.die.net/man/5/audispd.conf (Accessed 2016-11-28).
(6) Michael Boelen. Configuring and auditing Linux systems with Audit daemon. https://linux-audit.com/configuring-and-auditing-linux-systems-with-audit-daemon/ (Accessed 2016-11-28).
(7) RSyslog WIKI. Centralizing the audit log. http://wiki.rsyslog.com/index.php/Centralizing_the_audit_log (Accessed 2016-11-28).