AWS-VPC-Flowlog-Athena

VPC에서 아웃바운드로 향하는 모든포트를 확인해야하는 일이 생겼다. 그래서 이전 포스팅에서 먼저 과거의 방법을 이용해서 확인했고 이번에는 S3로 전송하여 보려한다. 아래는 이전의 방법으로 확인한 포스팅이다. https://linuxer.name/2020/06/aws-vpc-flowlog-kinesis-athena/ 현재에는 이런 방법을 사용하지 않는다. 위에 작성한 방법은 ETL 과정을 거치는건데 사실 이렇게 할필요가 전혀없다. https://docs.aws.amazon.com/ko_kr/athena/latest/ug/vpc-flow-logs.html 그냥 이거 따라하면 된다. VPC-Flowlog 활성화 -S3 -athena 이렇게 간소화 되었다. S3로 보내도록 로그를 생성한다. S3 버킷 생성하는 부분은 생략한다. CREATE EXTERNAL TABLE IF NOT EXISTS vpc_flow_logs ( version int, account string, interfaceid string, sourceaddress string, destinationaddress string, sourceport int, destinationport int, protocol int, numpackets int, numbytes bigint, starttime int, endtime int, action string, logstatus string ) PARTITIONED BY (date date) ROW FORMAT DELIMITED FIELDS TERMINATED BY ’ ' LOCATION ‘s3://your_log_bucket/prefix/AWSLogs/{subscribe_account_id}/vpcflowlogs/{region_code}/’ TBLPROPERTIES (“skip.header.line.count”=“1”); ...

June 4, 2020 · 1 min · 📁 AWS · 🏷️ athena, flowlog