VSFTPD 로그 수집
이 문서에서는 Bindplane을 사용하여 VSFTPD 로그를 Google Security Operations에 수집하는 방법을 설명합니다. 파서는 grok 패턴을 사용하여 로그에서 필드를 추출하고 UDM에 매핑합니다. 로그인, 업로드, 다운로드, 디렉터리 작업 등 다양한 로그 유형을 처리하여 SSL/TLS 정보 및 작업 (허용/차단)과 같은 추가 컨텍스트로 데이터를 보강합니다. 또한 응답 코드와 설명을 추출하고 파일 크기를 정수로 변환하는 등 다양한 로그 메시지 유형에 대해 특정 변환을 실행합니다.
시작하기 전에
다음 기본 요건이 충족되었는지 확인합니다.
- Google SecOps 인스턴스
- Windows 2016 이상 또는
systemd
가 설치된 Linux 호스트 - 프록시 뒤에서 실행하는 경우 방화벽 포트가 열려 있는지 확인
- VSFTPD를 사용한 호스트에 대한 액세스 권한
Google SecOps 수집 인증 파일 가져오기
- Google SecOps 콘솔에 로그인합니다.
- SIEM 설정 > 수집 에이전트로 이동합니다.
- 수집 인증 파일을 다운로드합니다. Bindplane이 설치될 시스템에 파일을 안전하게 저장합니다.
Google SecOps 고객 ID 가져오기
- Google SecOps 콘솔에 로그인합니다.
- SIEM 설정 > 프로필로 이동합니다.
- 조직 세부정보 섹션에서 고객 ID를 복사하여 저장합니다.
Bindplane 에이전트 설치
다음 안내에 따라 Windows 또는 Linux 운영체제에 Bindplane 에이전트를 설치합니다.
Windows 설치
- 명령 프롬프트 또는 PowerShell을 관리자로 엽니다.
다음 명령어를 실행합니다.
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
Linux 설치
- 루트 또는 sudo 권한으로 터미널을 엽니다.
다음 명령어를 실행합니다.
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
추가 설치 리소스
추가 설치 옵션은 설치 가이드를 참고하세요.
Syslog를 수집하여 Google SecOps로 전송하도록 Bindplane 에이전트 구성
- 구성 파일에 액세스합니다.
config.yaml
파일을 찾습니다. 일반적으로 Linux에서는/etc/bindplane-agent/
디렉터리에 있고 Windows에서는 설치 디렉터리에 있습니다.- 텍스트 편집기 (예:
nano
,vi
, 메모장)를 사용하여 파일을 엽니다.
다음과 같이
config.yaml
파일을 수정합니다.receivers: udplog: # Replace the port and IP address as required listen_address: "0.0.0.0:514" exporters: chronicle/chronicle_w_labels: compression: gzip # Adjust the path to the credentials file you downloaded in Step 1 creds_file_path: '/path/to/ingestion-authentication-file.json' # Replace with your actual customer ID from Step 2 customer_id: <customer_id> endpoint: malachiteingestion-pa.googleapis.com # Add optional ingestion labels for better organization log_type: 'VSFTPD' raw_log_field: body ingestion_labels: service: pipelines: logs/source0__chronicle_w_labels-0: receivers: - udplog exporters: - chronicle/chronicle_w_labels
- 인프라에 필요한 대로 포트와 IP 주소를 바꿉니다.
<customer_id>
를 실제 고객 ID로 바꿉니다.- Google SecOps 수집 인증 파일 가져오기 섹션에서 인증 파일이 저장된 경로로
/path/to/ingestion-authentication-file.json
를 업데이트합니다.
Bindplane 에이전트를 다시 시작하여 변경사항 적용
Linux에서 Bindplane 에이전트를 다시 시작하려면 다음 명령어를 실행합니다.
sudo systemctl restart bindplane-agent
Windows에서 Bindplane 에이전트를 다시 시작하려면 서비스 콘솔을 사용하거나 다음 명령어를 입력하면 됩니다.
net stop BindPlaneAgent && net start BindPlaneAgent
VSFTPD에서 Syslog 구성
- VSFTPD 호스트에 로그인합니다.
Ubuntu/Debian에 rsyslog를 설치하려면 다음 명령어를 실행하세요.
sudo apt install rsyslog
CentOS/RHEL에 rsyslog를 설치하려면 다음 명령어를 실행하세요.
sudo yum install rsyslog
Syslog를 사용하도록 vsftpd 구성을 수정합니다.
sudo vi /etc/vsftpd.conf
다음 매개변수가 설정되어 있는지 확인합니다.
syslog_enable=YES xferlog_enable=NO log_ftp_protocol=YES
저장 후 종료합니다.
vsftpd를 다시 시작합니다.
sudo systemctl restart vsftpd
로그를 Bindplane 에이전트로 전달하도록 rsyslog 구성을 수정합니다.
sudo nano /etc/rsyslog.d/90-vsftpd.conf
UDP
(기본 포트514
)를 사용하여 로그를 전달하려면 다음 줄을 추가합니다.if ($programname == 'vsftpd') then @@BINDPLANE_IP:514
BINDPLANE_IP
를 실제 Bindplane 에이전트 IP 주소로 바꿉니다.- UDP에는
@
를, TCP에는@@
를 사용합니다.
- UDP에는
rsyslog를 다시 시작합니다.
sudo systemctl restart rsyslog
UDM 매핑 테이블
로그 필드 | UDM 매핑 | 논리 |
---|---|---|
certificate |
security_result.detection_fields.key : 'cert'security_result.detection_fields.value : certificate 값 |
certificate 필드의 값은 키가 'cert'인 security_result.detection_fields 객체에 매핑됩니다. |
cipher |
network.tls.cipher |
cipher 필드의 값이 직접 매핑됩니다. |
client_ip |
principal.ip |
client_ip 필드의 값이 직접 매핑됩니다. |
date |
metadata.event_timestamp |
month , year , time 와 함께 사용하여 metadata.event_timestamp 를 구성합니다. 형식은 원시 로그의 timestamp 필드에서 파생되어 파싱되고 타임스탬프 객체로 변환됩니다. |
day |
metadata.event_timestamp |
month , year , time 와 함께 사용하여 metadata.event_timestamp 를 구성합니다. |
desc |
metadata.description |
desc 필드 값 (type 필드에서 추출됨)이 직접 매핑됩니다. 이는 'MKDIR', 'RMDIR', 'DELETE' 작업에 적용됩니다. |
description |
network.ftp.command security_result.description target.file.full_path |
type 이 'FTP 명령어'인 경우 값은 network.ftp.command 에 매핑됩니다. type 이 'DEBUG'이고 특정 SSL 패턴과 일치하지 않으면 security_result.description 에 매핑됩니다. type 이 'OK'로 시작하고 'OK LOGIN'이 아니며 로그에 파일 작업 (MKDIR, RMDIR, DELETE)이 설명되어 있으면 target.file.full_path 에 매핑됩니다. |
file_name |
target.file.full_path |
file_name 필드의 값이 직접 매핑됩니다. |
file_size |
network.received_bytes network.sent_bytes |
type 이 'OK DOWNLOAD' 또는 'FAIL DOWNLOAD'인 경우 값은 부호 없는 정수로 변환되고 network.received_bytes 에 매핑됩니다. type 이 'OK UPLOAD' 또는 'FAIL UPLOAD'이면 값이 부호 없는 정수로 변환되고 network.sent_bytes 에 매핑됩니다. type 이 'OK LOGIN'이면 'USER_LOGIN'으로 설정됩니다. type 이 파일 작업 ('OK UPLOAD', 'OK DOWNLOAD', 'FAIL DOWNLOAD', 'OK MKDIR', 'OK RMDIR', 'OK DELETE', 'FAIL UPLOAD')과 관련된 경우 'FILE_UNCATEGORIZED'로 설정됩니다. 다른 모든 type 값의 경우 'STATUS_UPDATE'로 설정합니다. 항상 'VSFTPD'로 설정됩니다. 항상 'VSFTPD'로 설정됩니다. 항상 'VSFTPD'로 설정됩니다. |
month |
metadata.event_timestamp |
day , year , time 와 함께 사용하여 metadata.event_timestamp 를 구성합니다. |
pid |
principal.process.pid |
pid 필드의 값이 직접 매핑됩니다. |
response_code |
network.http.response_code |
response_code 필드의 값이 정수로 변환되고 매핑됩니다. |
reused_status |
security_result.detection_fields.key : '재사용된 상태'security_result.detection_fields.value : reused_status 값 |
reused_status 필드의 값은 키가 '재사용된 상태'인 security_result.detection_fields 객체에 매핑됩니다. |
speed |
additional.fields.key : 'download_speed' 또는 'upload_speed'additional.fields.value.string_value : speed 값 |
type 가 'OK DOWNLOAD' 또는 'FAIL DOWNLOAD'인 경우 값은 키 'download_speed'와 함께 additional.fields 에 매핑됩니다. type 이 'OK UPLOAD' 또는 'FAIL UPLOAD'인 경우 값은 키 'upload_speed'와 함께 additional.fields 에 매핑됩니다. |
ssl_shutdown_state |
security_result.detection_fields.key : 'SSL 종료 상태'security_result.detection_fields.value : ssl_shutdown_state 값 |
ssl_shutdown_state 필드의 값은 키가 'SSL 종료 상태'인 security_result.detection_fields 객체에 매핑됩니다. |
ssl_version |
network.tls.version |
ssl_version 필드의 값이 직접 매핑됩니다. |
time |
metadata.event_timestamp |
day , month , year 와 함께 사용하여 metadata.event_timestamp 를 구성합니다. |
type |
metadata.description security_result.action_details |
type 필드의 값은 'OK LOGIN'인 경우를 제외하고 metadata.description 에 매핑됩니다. 허용 또는 차단 작업을 나타내는 경우('OK' 또는 'FAIL'로 시작) security_result.action_details 에도 매핑됩니다. |
userid |
principal.user.userid target.user.userid |
type 이 'OK LOGIN'이면 값이 target.user.userid 에 매핑됩니다. 그렇지 않으면 principal.user.userid 에 매핑됩니다. |
year |
metadata.event_timestamp |
day , month , time 와 함께 사용하여 metadata.event_timestamp 를 구성합니다. type 이 'OK LOGIN'인 경우 'NETWORK'로 설정됩니다. type 이 'OK LOGIN'이면 'MACHINE'으로 설정합니다. type 이 'OK'로 시작하는 경우 'ALLOW'로 설정합니다. type 이 'FAIL'로 시작하는 경우 'BLOCK'으로 설정합니다. |
도움이 더 필요하신가요? 커뮤니티 회원 및 Google SecOps 전문가로부터 답변을 받으세요.