Manager 설치
Manager 설치 사전 안내 사항
• DeepFinder Manager 설치 순서는 DFServer -> DFDB(elastic, postgres) -> DFAPI -> DFAPPS 순으로 진행됩니다.
• Manager 설치는 일반 계정이 읽고 쓰기 할 수 있는 디렉토리에서 진행해야 합니다. ex) /usr/local/src
• 라이선스 등록 후 DB가 동작중일 때 Server를 실행할 수 있습니다. 기타 프로그램은 설치 이후 자동 실행됩니다.
• DB는 기본 값으로 설치되며 향후 튜닝이 필요할 수 있습니다.
Server 설치
1) 설치 파일 다운로드
Repository에서 DeepFinder Manager Server 설치파일을 다운로드 합니다.
[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFServer.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost~]# tar xvfz DFServer.tar.gz
3) 스크립트 실행
설치 스크립트 실행압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
[root@localhost~]# cd DFServer
[root@localhost~]# ./setup.sh
라이선스 등록
인성디지탈에 라이선스 발급을 요청하여 라이선스 키를 전달 받습니다.
전달받은 키는 /usr/local/dfserver/license/license.txt로 저장합니다.
[root@localhost~]# cd /usr/local/dfserver/license
[root@localhost~]# echo "License Key" >> license.txt
설정파일 확인
설정 변경이 필요한 경우 “/usr/local/dfserver/conf” 경로에 있는 config.xml 파일을 수정합니다.
(GUI 에서도 변경이 가능합니다.)
※ 설정 변경이 필요 없는 경우 생략
[root@localhost~]# vi /usr/local/dfserver/conf/config.xml
<Server>
server_id="101"
license_file="license.txt" // license 디렉토리
myip="192.168.1.51" // redirect 처리용 IP - 없을 경우 agent의 svrip 로 재 접속
myport="10012" // 기본 포트
tcp_workers="4" // tcp 용 워커 개수 - cpu 개수에 따라 설정
ssl_wrokers="4" // ssl 용 워커 개수
logformat="" // 로그전송 포맷 (syslog define 참조)
detail_log_address="https://192.168.1.51/common/logdetailext?seqno="
// detail log view address
ssl_pemfile="deepfinder.pem" // certs 디렉토리
ssl_password="****"
systemlogheader="deepfinder: SystemLog"
auditlogheader="deepfinder: AuditLog"
agentlistheader="deepfinder250: AgentList"
sysinfo_checktime="15" // sysinfo 체크 간격 (15초)
default_charset="EUC-KR" // 문자 형식
db_type="pgsql" // db type pgsql/mysql (default pgsql)
write_db_ip="127.0.0.1" // db ip (hostname 가능)
write_db_port="5432" // db port
write_db_user="***"
write_db_passwd="***"
write_db_name="****"
read_db_ip="127.0.0.1"
read_db_port="5432"
read_db_user="****"
read_db_passwd="****"
read_db_name="****"
elastic_address="127.0.0.1" // elastic search 주소(루프백 주소)
elastic_port="9200" // elastic search 포트
debug="0"
update_time="30" // db 업데이트 체크시간 (30초)
logfilesize="20" // log 파일 최대 사이즈 (20메가 - default)
log_merge="0" // 중복 헤더/쿠키 로그를 단일 로그로 축약
>
<logserver // SYSLOG 받을 서버 정보
No="0" // No 0 ~ 4 까지 최대 5개
address="52.78.61.134"
port="10514" // UDP전송 포트
/>
<logserver
No="1"
address="52.78.61.135"
port="10515"
/>
</Server>
<MailAlert // 메일 알람 설정
read_db_ip="127.0.0.1"
read_db_port="5432"
read_db_user="****"
read_db_passwd="****"
read_db_name="****"
mailto="" // 메일주소
mailcc=""
update_time="1800"
check_interval="3"
/>
<ProcessWatch> // CPU, Memory 임계치 도달 시 Syslog 전송
<process cmd="nginx" match="master" />
<process cmd="java" match="elastic" cpulimit="0" memlimit="50" />
</ProcessWatch>
설정 예시) config.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Server
server_id="101"
myip=""
myport="10012"
tcp_workers="4"
ssl_workers="4"
ssl_pemfile="deepfinder.pem"
ssl_password="****"
logformat="deepfinder: AlertLog|logDate:%T|Agent IP:%X|CompanyName:%C|Attack IP:%I|Domain:%D|Log Type:%L|Pattern Grp:%G|Pattern Nm:%P|Action:%A|Risk Level:%R|URL:%U|Parameters:%E|Detect Msg:%M|Httpbody:%B|Httpheader:%H"
detail_log_address="https://serverip/common/logdetailext?seqno="
systemlogheader="deepfinder: SystemLog"
auditlogheader="deepfinder: AuditLog"
agentlistheader="deepfinder250: AgentList"
sysinfo_checktime="15"
license_file="license.txt"
default_charset="EUC-KR"
db_type="pgsql"
write_db_ip="127.0.0.1"
write_db_port="5432"
write_db_user="****"
write_db_passwd="****"
write_db_name="****"
read_db_ip="127.0.0.1"
read_db_port="5432"
read_db_user="****"
read_db_passwd="****"
read_db_name="****"
elastic_address="127.0.0.1"
elastic_port="9200"
debug="0"
update_time="5"
log_merge="0"
>
<logserver
No="0"
address="10.10.10.10"
port="10514"
/>
<ProcessWatch>
<process cmd="nginx" match="master" />
<process cmd="java" match="elastic" cpulimit="0" memlimit="50" />
</ProcessWatch>
</Server>
SYSLOG 정의
SYSLOG 설정 후에는 dfserver를 재시작해야 적용 됩니다.
case 'A': case 'a': // Action
case 'B': // HttpBody
case 'b': // HttpBody (Encoded)
case 'C': // Company Name
case 'c': // Company Name (Encoded)
case 'D': // Domain
case 'd': // Domain (Encoded)
case 'E': // parameter
case 'e': // parameter (Encoded)
case 'G': // Pattern Group
case 'g': // Pattern Group (Encoded)
case 'H': // HttpHeader
case 'h': // HttpHeader (Encoded)
case 'I': case 'i': // Attack IP
case 'J': case 'j': // Agent ID
case 'k': // ISO country code (not K)
case 'L': // LogType
case 'l': // LogType (Encoded)
case 'M': // Detect Msg
case 'm': // Detect Msg (Encoded)
case 'N': case 'n': // Instance ID
case 'O': // DomainGroup ID
case 'o': // Company ID
case 'P': // Pattern Name
case 'p': // Pattern Name (Encoded)
case 'R': case 'r': // RiskLevel
case 'S': case 's': // Manager IP (Agent only)
case 'T': case 't': // logDate
case 'U': // URL
case 'u': // URL (Encoded)
case 'X': case 'x': // Agent IP (Server only)
case 'Z': case 'z': // Detail Log URL (Server only)
설정 예) deepfinder: AlertLog|logDate:%T|Manager IP:%S|CompanyName:%C|AID:%J|InstanceID:%N|Attack IP:%I|Domain:%D|Log Type:%L|Pattern Grp:%G|Pattern Nm:%P|Action:%A|Risk Level:%R|URL:%U|Parameters:%E|Detect Msg:%M|Httpbody:%B|Httpheader:%H
DB설치
1) 설치 파일 다운로드
Repository에서 DeepFinder DB 설치파일을 다운로드 합니다.
[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFDB.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost~]# tar xvfz DFDB.tar.gz
3) 스크립트 실행
설치 스크립트 압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
[root@localhost~]# cd DFDB
[root@localhost DFDB]# ./setup_elastic.sh
[root@localhost DFDB]# ./setup_postgres.sh
정상적으로 설치가 완료되면 Elasticsearch와 postgres 프로세스가 구동됩니다.
APPS 설치
1) 설치 파일 다운로드
Repository에서 DeepFinder APPS 설치파일을 다운로드 합니다.
[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFAPPS.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost~]# tar xvfz DFAPPS.tar.gz
3) 스크립트 실행
설치 스크립트 실행압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
[root@localhost~]# cd DFAPPS
[root@localhost DFAPPS]# ./setup.sh
정상적으로 설치가 완료되면 Tomcat 프로세스가 구동됩니다.
API 설치
1) 설치 파일 다운로드
Repository에서 DeepFinder API 설치파일을 다운로드 합니다.
[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFAPI.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost~]# tar xvfz DFAPI.tar.gz
3) 스크립트 실행
설치 스크립트 실행압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
[root@localhost~]# cd DFAPI
[root@localhost DFAPI]# ./setup.sh
정상적으로 설치가 완료되면 uwsgi와 nginx 프로세스가 구동됩니다.
Server 실행
라이선스 등록 및 DB설치항목이 완료되면 Server를 실행합니다.
- Server 기동 명령어
service dfserver start
DeepFinder Manager HA 구성
DeepFinder 에서는 HA를 3가지 방식으로 지원하고 있습니다. 1. Agent 이중화 2. 서버 이중화 3. DB 이중화
DeepFinder HA 구성은 Active - Standby 형태로 구성이 가능합니다.
구성 하기 위해서는 사전에 Active-Standby 서버 간 네트워크 통신이 원활해야 합니다.
구성 완료 후 Active 서버의 모든 DB데이터가 실시간으로 Standby 서버에 복제됩니다.
Active 서버 장애 발생 시, 모든 Agent는 Standby 서버로 자동 전환(Failover)됩니다.
Active - Server 설치
1) 설치 파일 다운로드
Repository에서 DeepFinder Manager Server 설치파일을 다운로드 합니다.
[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFServer.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost~]# tar xvfz DFServer.tar.gz
3) 스크립트 실행
설치 스크립트 실행압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
스크립트 실행과 함께 구성하고자 하는 HA서버의 IP를 입력합니다.
[root@localhost~]# cd DFServer
[root@localhost~]# ./setup.sh ha $SlaveIP
Active - DB 설치
1) 설치 파일 다운로드
Repository에서 DeepFinder DB 설치파일을 다운로드 합니다.
[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFDB.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost~]# tar xvfz DFDB.tar.gz
3) 스크립트 실행
설치 스크립트 압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
[root@localhost~]# cd DFDB
// Master 서버 설치 시
[root@localhost DFDB]# ./setup_postgres.sh master
// Slave 서버 설치 시
[root@localhost DFDB]# ./setup_postgres.sh slave $slaveIP
정상적으로 설치가 완료되면 postgres 프로세스가 구동됩니다.
Standby - Server 설치
1) 설치 파일 다운로드
Repository에서 DeepFinder Manager Server 설치파일을 다운로드 합니다.
[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFServer.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost~]# tar xvfz DFServer.tar.gz
3) 스크립트 실행
설치 스크립트 실행압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
스크립트 실행과 함께 구성하고자 하는 HA서버의 IP를 입력합니다.
[root@localhost~]# cd DFServer
[root@localhost~]# ./setup.sh ha $MasterIP
Standby - DB 설치
1) 설치 파일 다운로드
Repository에서 DeepFinder DB 설치파일을 다운로드 합니다.
[root@localhost~]# wget http://download.deepfinder.co.kr/DeepFinder/dfServer/DFDB.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost~]# tar xvfz DFDB.tar.gz
3) 스크립트 실행
설치 스크립트 압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
[root@localhost~]# cd DFDB
[root@localhost DFDB]# ./setup_postgres.sh slave $slaveIP
정상적으로 설치가 완료되면 postgres 프로세스가 구동됩니다.
이후에는 일반적인 Manager 설치방법을 참고하여 Elasticsearch, UWSGI, Nginx 등을 설치합니다.
Agent HA 설치
1) 설치 파일 다운로드
Repository에서 DeepFinder Agent 설치파일을 다운로드 합니다.
[root@localhost ~]# wget download.deepfinder.co.kr/DeepFinder/1.0/DeepFinder.tar.gz
2) 압축 해제
다운로드 된 설치파일의 압축을 해제합니다.
[root@localhost ~]# tar xvfz DeepFinder.tar.gz
3) Agent 설치 진행
압축이 해제된 디렉토리에 진입하여 설치 스크립트를 실행합니다.
[root@localhost ~]# cd DeepFinder
// Apache Install -> setup.sh $Active_IP,$Standby_IP 인증정보
// Nginx Install -> nginx.sh $Active_IP,$Standby_IP 인증정보
[root@localhost DeepFinder]# ./nginx.sh 1.1.1.1,2.2.2.2 c8b34ff005611dd4300b9141xxxxx
************************************
SERVER IP : 1.1.1.1
SERVER IP2 : 2.2.2.2
AUTH KEY : c8b34ff005611dd4300b91412e89xxxxxxxxxxxxxxxxxxxxxxxxxxxx
SYSTEM KERNEL : 2.6
CHECK OS : Linux
CHECK LINUX : CentOS Linux
CHECK SELinux : Disabled
CHECK OS BIT : x86_64 (64 bit)
4) Agent config 확인
설치가 완료되면 아래와 같이 Agent config에 매니저 IP가 잘 들어가있는지 확인 합니다.
[root@localhost ~]# /usr/local/deepfinder/conf/config.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Agent
aid="1"
authdata="1a2b**"
ssl_pemfile="deepfinder.pem"
ssl_password2="aXNkd2ViY29ueA=="
svrip="1.1.1.1" // HA Active IP
svrip2="2.2.2.2" // HA StandBy IP
svrproto="tcp"
svrport="10012"
filter_check_url="http://localhost/"
debug="0"
/>