SlideShare uma empresa Scribd logo
1 de 21
Packet Capture on AWS
Teri Radichel | @teriradichel
https://www.sans.org/reading-room/whitepapers/detection/packet-capture-aws-37905
(A SANS Gold Paper)
Largest Security Training Organization in World…
SANS.org
What’s a packet?
• Data is split into packets or small pieces to send over the network
• Follows a protocol – the devices on both ends must understand
• Packets are reassembled at the destination, if protocol requires
• Some protocols resend failed packets (TCP) others do not (UDP)
Source DestinationNetwork
What Is Packet Capture?
• Capture the details about packets as they traverse the network.
• For example, if you have tcpdump installed can run this on mac/linux:
sudo tcpdump –x -n
• You’ll get a number of packets rolling by on your screen like this:
23:56:50.183837 ARP, Reply 192.168.1.95 is-at f4:5c:89:b6:7b:7f, length 28
0x0000: 1491 829a 0b62 f45c 89b6 7b7f 0806 0001
0x0010: 0800 0604 0002 f45c 89b6 7b7f c0a8 015f
0x0020: 1491 829a 0b62 c0a8 0101
• That’s a packet displayed in hex format (-x), and with IPs instead of
domain names (-n)
• http://www.tcpdump.org/tcpdump_man.html
Network Layers and Headers
• OSI or TCP model – network layers
• Different headers for each layer
• Example – IPv4 header
• Devices at source wrap the packet
in a headers
• Devices at the destination unwrap
the headers
http://websitenotebook.blogspot.com/2014/05/decoding-ip-header-example.html
Decoding Packets
• Packets are sent over the network in hex
• Decoding a packet header:
http://websitenotebook.blogspot.com/2014/05/decoding-ip-header-
example.html
• Hex to Binary Cheat Sheet:
• http://websitenotebook.blogspot.com/2014/05/hexadecimal-to-
binary-to-decimal-cheat.html
• Note that on AWS there are some AWS specific headers you don’t see
• https://www.youtube.com/watch?v=St3SE4LWhKo
Why do we care about packets?
• VPC Flow Logs only capture source, destination, protocol, timestamp
and a few other things; Web traffic logs only capture certain details
pertaining to web requests.
• A full packet has much more data that a other types of network logs
• Sometimes the full packet is required to resolve network issues
• Attackers obfuscate packet data to pass through security appliances
undetected – some of these attacks are only visible at packet level
• Data hidden in unused packet fields can exfiltrate data on channels in
undetected manner only visible when looking at raw packets
Captured packets can be stored and analyzed
• Many programs store packets in a format call “pcap” files
• Programs such as Wireshark can read these files and help security
professionals analyze the data
• An IDS/IPS can alert on or block packets that match nefarious
patterns (Snort, Bro, Suricata)
• Yara files can be used to match packet capture patterns and alert or
block malicious traffic
• Some devices like a WatchGuard Firebox with security services
provide this service so you don’t have to do it yourself
Typical Way to Capture Packets
• Span port on switch
“mirrors” the data
• Send packets to IDS/IPS
and/or logs
• So…how do we do this on
AWS?
• Can’t plug into the
switch…
https://wiki.wireshark.org/CaptureSetup/Ethernet
Tcpdump on every machine < 
instances
bucket
A better way…
• Route All the Packets Through Packet Capture Host(s)
• Capture host(s) must be able to receive the traffic, log it, and forward
the traffic to the destination
• Network configuration must force all packets through the capture
host(s)
• Any extraneous routes let packets bypass capture host(s)
AWS NAT Example
http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html
Note that the web server
traffic would not pass
through the NAT instance
and this is typically only for
outbound traffic. We want
to capture all traffic…
NAT Architecture
Security groups
and route tables
can force all
traffic through
the NAT. NAT
instance can be
modified to
handle all traffic,
in and out.
Proxy Architecture with Load Balancing
This shows
architecture for
Squid proxy.
Squid proxy
would only
handle layer 7
traffic but we
could modify
these instances
to capture all
traffic. Load
balancing
provides scaling.
Would need to
handle inbound
and outbound. https://aws.amazon.com/articles/6463473546098546
Proxy Architecture – Peered VPCs
Instances can only talk to other instances in a directly peered VPC. A proxy will allow traffic to pass
through one VPC to another. This can be used for nefarious purposes but in our case we can
leverage this to capture as it crosses network boundaries, which could be useful. More on that in
an upcoming slide.
Packet Capture Via Security Appliance
A security appliance
designed to capture and
pass through network
traffic after analyzing it
might be a good way to
capture packets as they
traverse network
boundaries. Noticed the
network design which
separates the packet
capture functionality and
storage from the rest of
the network.
Transit VPC
We could use a transit
VPC to capture all traffic
coming into and leaving
AWS, or traversing the
network from one
account to another. This is
a very interesting idea
because not only does it
make managing
connections between
different networks easier,
it provides a way to
ensure all packets must
pass through our packet
capture architecture. https://aws.amazon.com/blogs/aws/aws-solution-transit-vpc/
POC – Capture Packets in Lambda Function
https://github.com/tradichel/PacketCaptureAWS
Here’s the POC using
WatchGuard Firebox Cloud’s
CLI command to capture
packets. Clone the code,
execute the run file and it will
ask a couple questions. You
will get this…
Note the protection of the key
in S3 with stringent bucket
policy. Could make it even
more stringent by creating the
key on the fly in AWS with no
access to it outside the AWS
network.
Packets!
Please read the paper for details. Must have packets flowing when you run the lambda to capture.
What Next? Suggestions?
• This was a POC Only!
• Lambda is short lived – would want a source that stays online
• Need to test performance over time of this solution and others
• Scalability
• Storage
• Potentially set up an open source IDS/IPS to analyze packets
• Store as PCAP
• Or store to CloudWatch and use some other type of parser to pull the
data out into PCAP or desired format
Teri Radichel |@teriradichel
https://secplicity.org

Mais conteúdo relacionado

Mais procurados

다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
Amazon Web Services Korea
 

Mais procurados (20)

다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
 
Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트
 
Aws VPC
Aws VPCAws VPC
Aws VPC
 
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
(DEV203) Amazon API Gateway & AWS Lambda to Build Secure APIs
 
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
AWS Summit Seoul 2023 | 다중 계정 및 하이브리드 환경에서 안전한 IAM 체계 만들기
 
AWS Cloud9
AWS Cloud9AWS Cloud9
AWS Cloud9
 
Amazon Personalize 소개 (+ 실습 구성)::김영진, 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon Personalize 소개 (+ 실습 구성)::김영진, 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나Amazon Personalize 소개 (+ 실습 구성)::김영진, 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon Personalize 소개 (+ 실습 구성)::김영진, 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
 
AWS와 함께 하는 클라우드 컴퓨팅 - 홍민우 AWS 매니저
AWS와 함께 하는 클라우드 컴퓨팅 - 홍민우 AWS 매니저AWS와 함께 하는 클라우드 컴퓨팅 - 홍민우 AWS 매니저
AWS와 함께 하는 클라우드 컴퓨팅 - 홍민우 AWS 매니저
 
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 GamingCloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
 
AWS Finance Symposium_국내 메이저 증권사의 클라우드 글로벌 로드밸런서 활용 사례 (gslb)
AWS Finance Symposium_국내 메이저 증권사의 클라우드 글로벌 로드밸런서 활용 사례 (gslb)AWS Finance Symposium_국내 메이저 증권사의 클라우드 글로벌 로드밸런서 활용 사례 (gslb)
AWS Finance Symposium_국내 메이저 증권사의 클라우드 글로벌 로드밸런서 활용 사례 (gslb)
 
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
Behind the Scenes: Exploring the AWS Global Network (NET305) - AWS re:Invent ...
 
AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용
AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용
AWS Summit Seoul 2023 | 삼성전자/쿠팡의 대규모 트래픽 처리를 위한 클라우드 네이티브 데이터베이스 활용
 
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive [2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive
 
AWS 시작하기 및 Amazon S3 살펴보기 (윤석찬) - AWS 웨비나 시리즈
AWS 시작하기 및 Amazon S3 살펴보기 (윤석찬) - AWS 웨비나 시리즈AWS 시작하기 및 Amazon S3 살펴보기 (윤석찬) - AWS 웨비나 시리즈
AWS 시작하기 및 Amazon S3 살펴보기 (윤석찬) - AWS 웨비나 시리즈
 
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
 
Amazon Route 53 - Webinar Presentation 9.16.2015
Amazon Route 53 - Webinar Presentation 9.16.2015Amazon Route 53 - Webinar Presentation 9.16.2015
Amazon Route 53 - Webinar Presentation 9.16.2015
 
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
 
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인
AWS Control Tower를 통한 클라우드 보안 및 거버넌스 설계 - 김학민 :: AWS 클라우드 마이그레이션 온라인
 
AWS Summit Seoul 2023 | 롯데면세점이 고객에게 차별화된 경험을 제공하는 방법: AWS Native 서비스를 활용한 초개인...
AWS Summit Seoul 2023 | 롯데면세점이 고객에게 차별화된 경험을 제공하는 방법: AWS Native 서비스를 활용한 초개인...AWS Summit Seoul 2023 | 롯데면세점이 고객에게 차별화된 경험을 제공하는 방법: AWS Native 서비스를 활용한 초개인...
AWS Summit Seoul 2023 | 롯데면세점이 고객에게 차별화된 경험을 제공하는 방법: AWS Native 서비스를 활용한 초개인...
 
(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep Dive(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep Dive
 

Semelhante a Packet Capture on AWS

Experiment 7 traffic analysis
Experiment 7 traffic analysisExperiment 7 traffic analysis
Experiment 7 traffic analysis
nikitaa25
 
CloudStack - LinuxFest NorthWest
CloudStack - LinuxFest NorthWestCloudStack - LinuxFest NorthWest
CloudStack - LinuxFest NorthWest
ke4qqq
 
Apache Stratos tutorial WSO2Con Europe-2014
Apache Stratos tutorial WSO2Con Europe-2014Apache Stratos tutorial WSO2Con Europe-2014
Apache Stratos tutorial WSO2Con Europe-2014
Lakmal Warusawithana
 
Advanced use cases and approaches with stratos paa s
Advanced use cases and approaches with stratos paa sAdvanced use cases and approaches with stratos paa s
Advanced use cases and approaches with stratos paa s
WSO2
 

Semelhante a Packet Capture on AWS (20)

Common Infrastructure Exploits in AWS/GCP/Azure Servers and Containers
Common Infrastructure Exploits in AWS/GCP/Azure Servers and ContainersCommon Infrastructure Exploits in AWS/GCP/Azure Servers and Containers
Common Infrastructure Exploits in AWS/GCP/Azure Servers and Containers
 
Experiment 7 traffic analysis
Experiment 7 traffic analysisExperiment 7 traffic analysis
Experiment 7 traffic analysis
 
Cassandra To Infinity And Beyond
Cassandra To Infinity And BeyondCassandra To Infinity And Beyond
Cassandra To Infinity And Beyond
 
CloudStack - LinuxFest NorthWest
CloudStack - LinuxFest NorthWestCloudStack - LinuxFest NorthWest
CloudStack - LinuxFest NorthWest
 
Securing management, control & data plane
Securing management, control & data planeSecuring management, control & data plane
Securing management, control & data plane
 
(SEC403) Diving into AWS CloudTrail Events w/ Apache Spark on EMR
(SEC403) Diving into AWS CloudTrail Events w/ Apache Spark on EMR(SEC403) Diving into AWS CloudTrail Events w/ Apache Spark on EMR
(SEC403) Diving into AWS CloudTrail Events w/ Apache Spark on EMR
 
Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
 
Apache Stratos tutorial WSO2Con Europe-2014
Apache Stratos tutorial WSO2Con Europe-2014Apache Stratos tutorial WSO2Con Europe-2014
Apache Stratos tutorial WSO2Con Europe-2014
 
Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...
Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...
Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentation
 
IDS Evasion Techniques
IDS Evasion TechniquesIDS Evasion Techniques
IDS Evasion Techniques
 
Cloud Networking is not Virtual Networking - London VMUG 20130425
Cloud Networking is not Virtual Networking - London VMUG 20130425Cloud Networking is not Virtual Networking - London VMUG 20130425
Cloud Networking is not Virtual Networking - London VMUG 20130425
 
Wireshark
WiresharkWireshark
Wireshark
 
Advanced use cases and approaches with stratos paa s
Advanced use cases and approaches with stratos paa sAdvanced use cases and approaches with stratos paa s
Advanced use cases and approaches with stratos paa s
 
Reach: Solving AWS Networking Problems Faster
Reach: Solving AWS Networking Problems FasterReach: Solving AWS Networking Problems Faster
Reach: Solving AWS Networking Problems Faster
 
AWS BaseCamp: AWS Architecture Fundamentals
AWS BaseCamp: AWS  Architecture FundamentalsAWS BaseCamp: AWS  Architecture Fundamentals
AWS BaseCamp: AWS Architecture Fundamentals
 
Securing & Enforcing Network Policy and Encryption with Weave Net
Securing & Enforcing Network Policy and Encryption with Weave NetSecuring & Enforcing Network Policy and Encryption with Weave Net
Securing & Enforcing Network Policy and Encryption with Weave Net
 
AWS Best Practices Version 2
AWS Best Practices Version 2AWS Best Practices Version 2
AWS Best Practices Version 2
 
Introduction to ns3
Introduction to ns3Introduction to ns3
Introduction to ns3
 
AWS Best Practices
AWS Best PracticesAWS Best Practices
AWS Best Practices
 

Mais de Teri Radichel

Mais de Teri Radichel (20)

So You Want a Job in Cybersecurity
So You Want a Job in CybersecuritySo You Want a Job in Cybersecurity
So You Want a Job in Cybersecurity
 
Cloud Offense Informs Cloud Defense.pptx
Cloud Offense Informs Cloud Defense.pptxCloud Offense Informs Cloud Defense.pptx
Cloud Offense Informs Cloud Defense.pptx
 
Underrated AWS Security Controls ~ AWS Atlanta Summit 2022
Underrated AWS Security Controls ~ AWS Atlanta Summit 2022Underrated AWS Security Controls ~ AWS Atlanta Summit 2022
Underrated AWS Security Controls ~ AWS Atlanta Summit 2022
 
Real World Cloud Compromise
Real World Cloud CompromiseReal World Cloud Compromise
Real World Cloud Compromise
 
Serverless Attack Vectors
Serverless Attack VectorsServerless Attack Vectors
Serverless Attack Vectors
 
Top Priorities for Cloud Application Security
Top Priorities for Cloud Application SecurityTop Priorities for Cloud Application Security
Top Priorities for Cloud Application Security
 
Azure for Auditors
Azure for AuditorsAzure for Auditors
Azure for Auditors
 
How the Cloud Changes Cyber Security
How the Cloud Changes Cyber SecurityHow the Cloud Changes Cyber Security
How the Cloud Changes Cyber Security
 
Are you ready for a cloud pentest? AWS re:Inforce 2019
Are you ready for a cloud pentest? AWS re:Inforce 2019Are you ready for a cloud pentest? AWS re:Inforce 2019
Are you ready for a cloud pentest? AWS re:Inforce 2019
 
Are You Ready for a Cloud Pentest?
Are You Ready for a Cloud Pentest?Are You Ready for a Cloud Pentest?
Are You Ready for a Cloud Pentest?
 
Red Team vs. Blue Team on AWS ~ re:Invent 2018
Red Team vs. Blue Team on AWS ~ re:Invent 2018Red Team vs. Blue Team on AWS ~ re:Invent 2018
Red Team vs. Blue Team on AWS ~ re:Invent 2018
 
Top 5 Priorities for Cloud Security
Top 5 Priorities for Cloud SecurityTop 5 Priorities for Cloud Security
Top 5 Priorities for Cloud Security
 
Red Team vs Blue Team on AWS - RSA 2018
Red Team vs Blue Team on AWS - RSA 2018Red Team vs Blue Team on AWS - RSA 2018
Red Team vs Blue Team on AWS - RSA 2018
 
Crypto Miners in the Cloud
Crypto Miners in the CloudCrypto Miners in the Cloud
Crypto Miners in the Cloud
 
Locking Down Your Cloud
Locking Down Your CloudLocking Down Your Cloud
Locking Down Your Cloud
 
The Threat Is Real. Protect Yourself.
The Threat Is Real. Protect Yourself.The Threat Is Real. Protect Yourself.
The Threat Is Real. Protect Yourself.
 
Security for Complex Networks on AWS
Security for Complex Networks on AWSSecurity for Complex Networks on AWS
Security for Complex Networks on AWS
 
AWS Security Ideas - re:Invent 2016
AWS Security Ideas - re:Invent 2016AWS Security Ideas - re:Invent 2016
AWS Security Ideas - re:Invent 2016
 
Critical Controls Might Have Prevented the Target Breach
Critical Controls Might Have Prevented the Target BreachCritical Controls Might Have Prevented the Target Breach
Critical Controls Might Have Prevented the Target Breach
 
Automated Intrusion Detection and Response on AWS
Automated Intrusion Detection and Response on AWSAutomated Intrusion Detection and Response on AWS
Automated Intrusion Detection and Response on AWS
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Packet Capture on AWS

  • 1. Packet Capture on AWS Teri Radichel | @teriradichel https://www.sans.org/reading-room/whitepapers/detection/packet-capture-aws-37905 (A SANS Gold Paper)
  • 2. Largest Security Training Organization in World… SANS.org
  • 3. What’s a packet? • Data is split into packets or small pieces to send over the network • Follows a protocol – the devices on both ends must understand • Packets are reassembled at the destination, if protocol requires • Some protocols resend failed packets (TCP) others do not (UDP) Source DestinationNetwork
  • 4. What Is Packet Capture? • Capture the details about packets as they traverse the network. • For example, if you have tcpdump installed can run this on mac/linux: sudo tcpdump –x -n • You’ll get a number of packets rolling by on your screen like this: 23:56:50.183837 ARP, Reply 192.168.1.95 is-at f4:5c:89:b6:7b:7f, length 28 0x0000: 1491 829a 0b62 f45c 89b6 7b7f 0806 0001 0x0010: 0800 0604 0002 f45c 89b6 7b7f c0a8 015f 0x0020: 1491 829a 0b62 c0a8 0101 • That’s a packet displayed in hex format (-x), and with IPs instead of domain names (-n) • http://www.tcpdump.org/tcpdump_man.html
  • 5. Network Layers and Headers • OSI or TCP model – network layers • Different headers for each layer • Example – IPv4 header • Devices at source wrap the packet in a headers • Devices at the destination unwrap the headers http://websitenotebook.blogspot.com/2014/05/decoding-ip-header-example.html
  • 6. Decoding Packets • Packets are sent over the network in hex • Decoding a packet header: http://websitenotebook.blogspot.com/2014/05/decoding-ip-header- example.html • Hex to Binary Cheat Sheet: • http://websitenotebook.blogspot.com/2014/05/hexadecimal-to- binary-to-decimal-cheat.html • Note that on AWS there are some AWS specific headers you don’t see • https://www.youtube.com/watch?v=St3SE4LWhKo
  • 7. Why do we care about packets? • VPC Flow Logs only capture source, destination, protocol, timestamp and a few other things; Web traffic logs only capture certain details pertaining to web requests. • A full packet has much more data that a other types of network logs • Sometimes the full packet is required to resolve network issues • Attackers obfuscate packet data to pass through security appliances undetected – some of these attacks are only visible at packet level • Data hidden in unused packet fields can exfiltrate data on channels in undetected manner only visible when looking at raw packets
  • 8. Captured packets can be stored and analyzed • Many programs store packets in a format call “pcap” files • Programs such as Wireshark can read these files and help security professionals analyze the data • An IDS/IPS can alert on or block packets that match nefarious patterns (Snort, Bro, Suricata) • Yara files can be used to match packet capture patterns and alert or block malicious traffic • Some devices like a WatchGuard Firebox with security services provide this service so you don’t have to do it yourself
  • 9. Typical Way to Capture Packets • Span port on switch “mirrors” the data • Send packets to IDS/IPS and/or logs • So…how do we do this on AWS? • Can’t plug into the switch… https://wiki.wireshark.org/CaptureSetup/Ethernet
  • 10. Tcpdump on every machine <  instances bucket
  • 11. A better way… • Route All the Packets Through Packet Capture Host(s) • Capture host(s) must be able to receive the traffic, log it, and forward the traffic to the destination • Network configuration must force all packets through the capture host(s) • Any extraneous routes let packets bypass capture host(s)
  • 12. AWS NAT Example http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html Note that the web server traffic would not pass through the NAT instance and this is typically only for outbound traffic. We want to capture all traffic…
  • 13. NAT Architecture Security groups and route tables can force all traffic through the NAT. NAT instance can be modified to handle all traffic, in and out.
  • 14. Proxy Architecture with Load Balancing This shows architecture for Squid proxy. Squid proxy would only handle layer 7 traffic but we could modify these instances to capture all traffic. Load balancing provides scaling. Would need to handle inbound and outbound. https://aws.amazon.com/articles/6463473546098546
  • 15. Proxy Architecture – Peered VPCs Instances can only talk to other instances in a directly peered VPC. A proxy will allow traffic to pass through one VPC to another. This can be used for nefarious purposes but in our case we can leverage this to capture as it crosses network boundaries, which could be useful. More on that in an upcoming slide.
  • 16. Packet Capture Via Security Appliance A security appliance designed to capture and pass through network traffic after analyzing it might be a good way to capture packets as they traverse network boundaries. Noticed the network design which separates the packet capture functionality and storage from the rest of the network.
  • 17. Transit VPC We could use a transit VPC to capture all traffic coming into and leaving AWS, or traversing the network from one account to another. This is a very interesting idea because not only does it make managing connections between different networks easier, it provides a way to ensure all packets must pass through our packet capture architecture. https://aws.amazon.com/blogs/aws/aws-solution-transit-vpc/
  • 18. POC – Capture Packets in Lambda Function https://github.com/tradichel/PacketCaptureAWS Here’s the POC using WatchGuard Firebox Cloud’s CLI command to capture packets. Clone the code, execute the run file and it will ask a couple questions. You will get this… Note the protection of the key in S3 with stringent bucket policy. Could make it even more stringent by creating the key on the fly in AWS with no access to it outside the AWS network.
  • 19. Packets! Please read the paper for details. Must have packets flowing when you run the lambda to capture.
  • 20. What Next? Suggestions? • This was a POC Only! • Lambda is short lived – would want a source that stays online • Need to test performance over time of this solution and others • Scalability • Storage • Potentially set up an open source IDS/IPS to analyze packets • Store as PCAP • Or store to CloudWatch and use some other type of parser to pull the data out into PCAP or desired format