SlideShare a Scribd company logo
BIG-IP v12.1 Application Security Manager
WebSocket
Created by ,
NPIE ASM
lior@f5.com
V1.0 March, 2016
@rotkovitch
© F5 Networks, Inc 2
• Intro to WebSocket
• ASM and WebSocket
• WebSocket violations
• WebSocket URL setting
• WebSocket in the request log
• WebSocket Learning and policy building
• Demo flow
Index
© F5 Networks, Inc 3
Intro to WebSocket
http://demo.kaazing.com/forex/
http://www.websocket.org/echo.html
© F5 Networks, Inc 4
• WebSocket provide simple framing layer on top of HTTP
• Key Benefits :
• Two-way communication
• Connections that are persistent
• Full-duplex.
• Low HTTP and TCP overhead
• WebSocket protocol is RFC 6455
WebSocket intro
© F5 Networks, Inc 5
WebSocket intro – Handshake and frames exchange
CLIENT SERVER
GET /chat HTTP/1.1
Host: server.example.com
Upgrade: Websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Origin: http://example.com
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13
HTTP/1.1 101 Switching Protocols
Upgrade: Websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
Sec-WebSocket-Protocol: chat
Websocket frame
Websocket frame
Websocket frame
Websocket close frame
Websocket close frame
© F5 Networks, Inc 6
WebSocket Demo
1
2
WS filter
http://www.websocket.org/echo.html
© F5 Networks, Inc 7
ASM is WebSocket aware
1. Can enforce the WebSocket handshake – RFC checks
2. Can enforce the payload of type :
• Plain text – signatures
• JSON – structure & signatures
• Binary - enforce length of frame size
And:
• Enforce fragmentation
• Allows WS and WSS
Note: must have WebSocket Profile on the Virtual IP
ASM & WebSocket
© F5 Networks, Inc 8
Enforcement Threat Prevented Mitigation
1 Handshake protocol correctness Server stack abuse. Enforce the mandatory headers and their well-formedness in request.
2 Cross-origin access Session riding/ CSRF Deny access to all requests coming from origins not in the
configured whitelist.
3 HTTP upgrade flood prevention Exhausting server socket
resources
Limit the RPS per WS/WSS URLs. We will use the same
limits as for all URLs in a VS, HTTP and WS alike.
4 Login enforcement Information leakage Enforce login session also for WS/WSS URLs.
Requires adding protocol (HTTP/S, WS/S) to the protected URLs
5 Attack signature detection XSS, SQL injection, command shell
injection and all other threats
signatures prevent
Look for parameter content attack signatures in each textual WS
message. If found, close the WebSocket with a Close message.
Request log will show the sent message
6 Illegal encoding and meta
characters
Exploit server stack Perform the following checks per textual message: Check UTF-8
encoding (mandated by RFC, no other encoding is allowed). Check for
illegal meta-characters. Check for null character
7 Enforce message masking Cache poisoning Enforce message masking for client textual messages in order to
avoid cache poisoning.
8 Limit message and frame size and
correctness of framing
Buffer overflow Limit message size, frame size and enforce correctness of framing
9 Enforce message structure in JSON
format
Exploit server stack
Buffer overflow
Apply JSON content profile per WS message with all possible
defenses including signatures and metacharacters.
10 Slow send/receive Exhaust server socket resources Limit the time for sending a message and time between messages.
© F5 Networks, Inc 9
WebSocket violations – Protocol compliance
© F5 Networks, Inc 10
WebSocket violations – Protocol compliance
Security ›› Application Security ›› Policy Building ›› Learning and Blocking Settings
© F5 Networks, Inc 11
WebSocket violations – Protocol compliance
• Bad WebSocket handshake request
• Failure in WebSocket framing protocol
• Mask not found in client frame
• Null character found in WebSocket text massage
© F5 Networks, Inc 12
WebSocket violations – Protocol compliance
• Bad WebSocket handshake request
• HTTP Version is 1.1
• “Upgrade” header appears once
• "Sec-WebSocket-Key“ has one occurrence and is base 64 encoded
• "Sec-WebSocket-Version“ has once occurrence and value of 13
• Evasion technique
© F5 Networks, Inc 13
WebSocket violations – Protocol compliance
• Failure in WebSocket framing protocol
• Continuing frame without start frame.
• Start frame without ending the previous message fragmentation (interleaving
fragmentation is not allowed!)
• Control frame with FIN flag off (i.e. attempt to fragment them).
• Control frame payload size is greater than 125.
© F5 Networks, Inc 14
WebSocket violations – Protocol compliance
• Mask not found in client frame
• Each frame should have a bit mask according to the RFC.
• Enforce the continuity of the frames by verifying the bit mask exists
• Client side
• Null character found in WebSocket text massage
• Null character inside message payload of type JSON and Text will be
enforce.
• Indifferent to “check message payload”
© F5 Networks, Inc 15
WebSocket URL Entities
Security ›› Application Security ›› Policy
Building ›› Learning and Blocking Settings
Policy Type Learn New WebSocket URL’s
Fundamental Never
Enhance Selective
Comprehensive Add all entities
© F5 Networks, Inc 16
1. Binary content found in text only WebSocket
2. Illegal WebSocket binary message length
3. Illegal WebSocket extension
4. Illegal WebSocket frame length
5. Illegal number of frame per message
6. Text content found in binary only WebSocket
WebSocket Violations - Payload
© F5 Networks, Inc 17
• Binary content found in text only WebSocket
• The WebScoket payload is defined as text but the
payload contains binary payload.
WebSocket Violations - Payload
© F5 Networks, Inc 18
• Illegal WebSocket binary message length
• Binary message size enforce of 10000 bytes (default)
WebSocket Violations - Payload
© F5 Networks, Inc 19
• Illegal WebSocket extension
• Protocol extensions: Per-message compression, Interleaved
message fragmentation, etc
• ASM can do the following for WebScoket extension :
o Remove headers – remove the extension header (default)
o Ignore – ignore the extension header (let then pass)
o Block – block request with WebSocket extension
WebSocket Violations - Payload
© F5 Networks, Inc 20
• Illegal WebSocket frame length
WebSocket Violations - Payload
© F5 Networks, Inc 21
• Illegal number of frames per message
WebSocket Violations - Payload
© F5 Networks, Inc 22
• Text content found in binary only WebSocket
WebSocket Violations - Payload
© F5 Networks, Inc 23
WebSocket URL configuration
© F5 Networks, Inc 24
WebSocket URL configuration
© F5 Networks, Inc 25
WebSocket URL configuration
© F5 Networks, Inc 26
Reviewing WebSocket message in the request log
© F5 Networks, Inc 27
Reviewing WebSocket message in the request log
Security ›› Event Logs ›› Application ›› Requests
1
2
3
© F5 Networks, Inc 28
WebSocket - Request log filtering
Security ›› Event Logs ›› Application ›› Requests
© F5 Networks, Inc 29
WebSocket - Request log filtering
© F5 Networks, Inc 30
WebSocket Handshake
© F5 Networks, Inc 31
WebSocket Handshake
© F5 Networks, Inc 32
WebSocket - Ping Pong
© F5 Networks, Inc 33
WebSocket - Close
© F5 Networks, Inc 34
WebSocket Demo
© F5 Networks, Inc 35
Leaning page for WebSocket
© F5 Networks, Inc 36
WebSocket URL
© F5 Networks, Inc 37
Leaning page for WebSocket
© F5 Networks, Inc 38
“Sec-WebSocket-Extensions”
WebSocket URL
© F5 Networks, Inc 39
WebSocket URL
© F5 Networks, Inc 40
Policy builder classification
© F5 Networks, Inc 41
JSON facts
© F5 Networks, Inc 42
Attack signatures on Web Socket
© F5 Networks, Inc 43
Web Sokcet Learning and attack signature
© F5 Networks, Inc 44
Override attack signature – false positive
© F5 Networks, Inc 45
• ASM support WebSocket protocol
• Enforce protocol compliance
• Enforce payload –
• Plane Text – attack signature , null
• JSON – structure and attack signature
• Binary – length
• New violations and setting for Web Scoket
• Policy builder can learn the URL and classify the WebSocket payload types.
• Request log display the communication between client and server
Summary

More Related Content

What's hot (20)

PPTX
F5 SIRT - F5 ASM WAF - DDoS protection
Lior Rotkovitch
 
PPTX
Eventlog
Shashi Kanth
 
PPSX
Web application security
Akhil Raj
 
PDF
Kinh nghiệm triển khai Microservices tại Sapo.vn
Dotnet Open Group
 
PPTX
Asm bot mitigations v3 final- lior rotkovitch
Lior Rotkovitch
 
PDF
5 Important Secure Coding Practices
Thomas Kurian Ambattu,CRISC,ISLA-2011 (ISC)²
 
PPTX
Attacking thru HTTP Host header
Sergey Belov
 
PPTX
Beginner's Guide to SIEM
AlienVault
 
PDF
Practical Malware Analysis: Ch 11: Malware Behavior
Sam Bowne
 
PPTX
Web Cache Poisoning
KuldeepPandya5
 
PDF
Linux Hardening
Michael Boelen
 
PDF
Web Application Security
MarketingArrowECS_CZ
 
PDF
sqlmap internals
Miroslav Stampar
 
PDF
Rà soát Malware bằng SysInternal Suite
Phạm Trung Đức
 
PDF
Bao cao atbmhttt
Huu Uoc Nguyen
 
PDF
Hacking identity: A Pen Tester's Guide to IAM
Jerod Brennen
 
PDF
Cybersecurity Incident Management Powerpoint Presentation Slides
SlideTeam
 
PPTX
Threat Hunting Web Shells Using Splunk
jamesmbower
 
PPTX
SIEM - Activating Defense through Response by Ankur Vats
OWASP Delhi
 
PPTX
Microsoft Defender for Endpoint Overview.pptx
BenAissaTaher1
 
F5 SIRT - F5 ASM WAF - DDoS protection
Lior Rotkovitch
 
Eventlog
Shashi Kanth
 
Web application security
Akhil Raj
 
Kinh nghiệm triển khai Microservices tại Sapo.vn
Dotnet Open Group
 
Asm bot mitigations v3 final- lior rotkovitch
Lior Rotkovitch
 
5 Important Secure Coding Practices
Thomas Kurian Ambattu,CRISC,ISLA-2011 (ISC)²
 
Attacking thru HTTP Host header
Sergey Belov
 
Beginner's Guide to SIEM
AlienVault
 
Practical Malware Analysis: Ch 11: Malware Behavior
Sam Bowne
 
Web Cache Poisoning
KuldeepPandya5
 
Linux Hardening
Michael Boelen
 
Web Application Security
MarketingArrowECS_CZ
 
sqlmap internals
Miroslav Stampar
 
Rà soát Malware bằng SysInternal Suite
Phạm Trung Đức
 
Bao cao atbmhttt
Huu Uoc Nguyen
 
Hacking identity: A Pen Tester's Guide to IAM
Jerod Brennen
 
Cybersecurity Incident Management Powerpoint Presentation Slides
SlideTeam
 
Threat Hunting Web Shells Using Splunk
jamesmbower
 
SIEM - Activating Defense through Response by Ankur Vats
OWASP Delhi
 
Microsoft Defender for Endpoint Overview.pptx
BenAissaTaher1
 

Similar to Web Socket ASM support lior rotkovitch (20)

PDF
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
 
PPT
Top Ten Web Hacking Techniques – 2008
Jeremiah Grossman
 
PPTX
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Peter Lubbers
 
PPT
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Charles Moulliard
 
PPT
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Jeremiah Grossman
 
PDF
Introduction to WebSockets
Gunnar Hillert
 
PDF
Mulesoft Pune Meetup Deck - Apr 2020
Santosh Ojha
 
PPTX
Basic security and Barracuda VRS
Aravindan A
 
PDF
Jetty 9 – The Next Generation Servlet Container
Codemotion
 
PDF
Realizzare applicazioni Web con WebSocket, by Simone Bordet
Codemotion
 
PPTX
WebRCT
Mark Daniel Galvez
 
PPTX
Brocade vADC Portfolio Overview 2016
Scott Sims
 
PPTX
Websocket technology for XPages
Csaba Kiss
 
PDF
Http requesting smuggling
Apijay Kumar
 
PDF
Http requesting smuggling
Apijay Kumar
 
PDF
Why Traditional Web Security Technologies no Longer Suffice to Keep You Safe
Philippe De Ryck
 
PDF
Programming WebSockets - OSCON 2010
sullis
 
PDF
Dev con kolkata 2012 websockets
SANKARSAN BOSE
 
PPTX
Websocket
charmin_pansuriya
 
ZIP
Websockets at tossug
clkao
 
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
 
Top Ten Web Hacking Techniques – 2008
Jeremiah Grossman
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Peter Lubbers
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Charles Moulliard
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Jeremiah Grossman
 
Introduction to WebSockets
Gunnar Hillert
 
Mulesoft Pune Meetup Deck - Apr 2020
Santosh Ojha
 
Basic security and Barracuda VRS
Aravindan A
 
Jetty 9 – The Next Generation Servlet Container
Codemotion
 
Realizzare applicazioni Web con WebSocket, by Simone Bordet
Codemotion
 
Brocade vADC Portfolio Overview 2016
Scott Sims
 
Websocket technology for XPages
Csaba Kiss
 
Http requesting smuggling
Apijay Kumar
 
Http requesting smuggling
Apijay Kumar
 
Why Traditional Web Security Technologies no Longer Suffice to Keep You Safe
Philippe De Ryck
 
Programming WebSockets - OSCON 2010
sullis
 
Dev con kolkata 2012 websockets
SANKARSAN BOSE
 
Websockets at tossug
clkao
 
Ad

More from Lior Rotkovitch (17)

PDF
Software management, the seasonal return of DDoS - This Week in Security.pdf
Lior Rotkovitch
 
PDF
HTTP Brute Force Mitigation Playbook Bot Profile for Brute Force Mitigations ...
Lior Rotkovitch
 
PDF
Bots mitigations overview with Advance WAF - Anti ... - DevCentral.pdf
Lior Rotkovitch
 
PDF
The 1B Data Leak, TrickBot Gang Shift and Cyber Espionage - F5 SIRT This Week...
Lior Rotkovitch
 
PDF
A Day in the Life of a Security Engineer from Tel Aviv- clean.pdf
Lior Rotkovitch
 
PDF
The WAF book (Web App Firewall )
Lior Rotkovitch
 
PDF
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Lior Rotkovitch
 
PDF
The WAF book intro protection elements v1.0 lior rotkovitch
Lior Rotkovitch
 
PDF
The waf book intro waf elements v1.0 lior rotkovitch
Lior Rotkovitch
 
PDF
The waf book intro v1.0 lior rotkovitch
Lior Rotkovitch
 
PDF
The waf book intro attack elements v1.0 lior rotkovitch
Lior Rotkovitch
 
PPTX
Advance WAF bot mitigations V13.1
Lior Rotkovitch
 
PDF
Bots mitigations overview with advance waf anti bot engine
Lior Rotkovitch
 
PDF
ASM 11.6 DDoS profile- lior rotkovitch
Lior Rotkovitch
 
PDF
Html cors- lior rotkovitch
Lior Rotkovitch
 
PDF
הדרכה מבוססת אינטרנט Wbt - Web based training
Lior Rotkovitch
 
PDF
פיתוח הדרכה מתוקשבת
Lior Rotkovitch
 
Software management, the seasonal return of DDoS - This Week in Security.pdf
Lior Rotkovitch
 
HTTP Brute Force Mitigation Playbook Bot Profile for Brute Force Mitigations ...
Lior Rotkovitch
 
Bots mitigations overview with Advance WAF - Anti ... - DevCentral.pdf
Lior Rotkovitch
 
The 1B Data Leak, TrickBot Gang Shift and Cyber Espionage - F5 SIRT This Week...
Lior Rotkovitch
 
A Day in the Life of a Security Engineer from Tel Aviv- clean.pdf
Lior Rotkovitch
 
The WAF book (Web App Firewall )
Lior Rotkovitch
 
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Lior Rotkovitch
 
The WAF book intro protection elements v1.0 lior rotkovitch
Lior Rotkovitch
 
The waf book intro waf elements v1.0 lior rotkovitch
Lior Rotkovitch
 
The waf book intro v1.0 lior rotkovitch
Lior Rotkovitch
 
The waf book intro attack elements v1.0 lior rotkovitch
Lior Rotkovitch
 
Advance WAF bot mitigations V13.1
Lior Rotkovitch
 
Bots mitigations overview with advance waf anti bot engine
Lior Rotkovitch
 
ASM 11.6 DDoS profile- lior rotkovitch
Lior Rotkovitch
 
Html cors- lior rotkovitch
Lior Rotkovitch
 
הדרכה מבוססת אינטרנט Wbt - Web based training
Lior Rotkovitch
 
פיתוח הדרכה מתוקשבת
Lior Rotkovitch
 
Ad

Recently uploaded (20)

PDF
SG1-ALM-MS-EL-30-0008 (00) MS - Isolators and disconnecting switches.pdf
djiceramil
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
4 Tier Teamcenter Installation part1.pdf
VnyKumar1
 
PPTX
Inventory management chapter in automation and robotics.
atisht0104
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PDF
勉強会資料_An Image is Worth More Than 16x16 Patches
NABLAS株式会社
 
PPTX
Basics of Auto Computer Aided Drafting .pptx
Krunal Thanki
 
PPTX
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
PDF
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
PPTX
Ground improvement techniques-DEWATERING
DivakarSai4
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PDF
Air -Powered Car PPT by ER. SHRESTH SUDHIR KOKNE.pdf
SHRESTHKOKNE
 
PPTX
cybersecurityandthe importance of the that
JayachanduHNJc
 
PDF
Zero Carbon Building Performance standard
BassemOsman1
 
PDF
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
SG1-ALM-MS-EL-30-0008 (00) MS - Isolators and disconnecting switches.pdf
djiceramil
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
4 Tier Teamcenter Installation part1.pdf
VnyKumar1
 
Inventory management chapter in automation and robotics.
atisht0104
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
勉強会資料_An Image is Worth More Than 16x16 Patches
NABLAS株式会社
 
Basics of Auto Computer Aided Drafting .pptx
Krunal Thanki
 
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
Ground improvement techniques-DEWATERING
DivakarSai4
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Air -Powered Car PPT by ER. SHRESTH SUDHIR KOKNE.pdf
SHRESTHKOKNE
 
cybersecurityandthe importance of the that
JayachanduHNJc
 
Zero Carbon Building Performance standard
BassemOsman1
 
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 

Web Socket ASM support lior rotkovitch

  • 1. BIG-IP v12.1 Application Security Manager WebSocket Created by , NPIE ASM [email protected] V1.0 March, 2016 @rotkovitch
  • 2. © F5 Networks, Inc 2 • Intro to WebSocket • ASM and WebSocket • WebSocket violations • WebSocket URL setting • WebSocket in the request log • WebSocket Learning and policy building • Demo flow Index
  • 3. © F5 Networks, Inc 3 Intro to WebSocket http://demo.kaazing.com/forex/ http://www.websocket.org/echo.html
  • 4. © F5 Networks, Inc 4 • WebSocket provide simple framing layer on top of HTTP • Key Benefits : • Two-way communication • Connections that are persistent • Full-duplex. • Low HTTP and TCP overhead • WebSocket protocol is RFC 6455 WebSocket intro
  • 5. © F5 Networks, Inc 5 WebSocket intro – Handshake and frames exchange CLIENT SERVER GET /chat HTTP/1.1 Host: server.example.com Upgrade: Websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Origin: http://example.com Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 13 HTTP/1.1 101 Switching Protocols Upgrade: Websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= Sec-WebSocket-Protocol: chat Websocket frame Websocket frame Websocket frame Websocket close frame Websocket close frame
  • 6. © F5 Networks, Inc 6 WebSocket Demo 1 2 WS filter http://www.websocket.org/echo.html
  • 7. © F5 Networks, Inc 7 ASM is WebSocket aware 1. Can enforce the WebSocket handshake – RFC checks 2. Can enforce the payload of type : • Plain text – signatures • JSON – structure & signatures • Binary - enforce length of frame size And: • Enforce fragmentation • Allows WS and WSS Note: must have WebSocket Profile on the Virtual IP ASM & WebSocket
  • 8. © F5 Networks, Inc 8 Enforcement Threat Prevented Mitigation 1 Handshake protocol correctness Server stack abuse. Enforce the mandatory headers and their well-formedness in request. 2 Cross-origin access Session riding/ CSRF Deny access to all requests coming from origins not in the configured whitelist. 3 HTTP upgrade flood prevention Exhausting server socket resources Limit the RPS per WS/WSS URLs. We will use the same limits as for all URLs in a VS, HTTP and WS alike. 4 Login enforcement Information leakage Enforce login session also for WS/WSS URLs. Requires adding protocol (HTTP/S, WS/S) to the protected URLs 5 Attack signature detection XSS, SQL injection, command shell injection and all other threats signatures prevent Look for parameter content attack signatures in each textual WS message. If found, close the WebSocket with a Close message. Request log will show the sent message 6 Illegal encoding and meta characters Exploit server stack Perform the following checks per textual message: Check UTF-8 encoding (mandated by RFC, no other encoding is allowed). Check for illegal meta-characters. Check for null character 7 Enforce message masking Cache poisoning Enforce message masking for client textual messages in order to avoid cache poisoning. 8 Limit message and frame size and correctness of framing Buffer overflow Limit message size, frame size and enforce correctness of framing 9 Enforce message structure in JSON format Exploit server stack Buffer overflow Apply JSON content profile per WS message with all possible defenses including signatures and metacharacters. 10 Slow send/receive Exhaust server socket resources Limit the time for sending a message and time between messages.
  • 9. © F5 Networks, Inc 9 WebSocket violations – Protocol compliance
  • 10. © F5 Networks, Inc 10 WebSocket violations – Protocol compliance Security ›› Application Security ›› Policy Building ›› Learning and Blocking Settings
  • 11. © F5 Networks, Inc 11 WebSocket violations – Protocol compliance • Bad WebSocket handshake request • Failure in WebSocket framing protocol • Mask not found in client frame • Null character found in WebSocket text massage
  • 12. © F5 Networks, Inc 12 WebSocket violations – Protocol compliance • Bad WebSocket handshake request • HTTP Version is 1.1 • “Upgrade” header appears once • "Sec-WebSocket-Key“ has one occurrence and is base 64 encoded • "Sec-WebSocket-Version“ has once occurrence and value of 13 • Evasion technique
  • 13. © F5 Networks, Inc 13 WebSocket violations – Protocol compliance • Failure in WebSocket framing protocol • Continuing frame without start frame. • Start frame without ending the previous message fragmentation (interleaving fragmentation is not allowed!) • Control frame with FIN flag off (i.e. attempt to fragment them). • Control frame payload size is greater than 125.
  • 14. © F5 Networks, Inc 14 WebSocket violations – Protocol compliance • Mask not found in client frame • Each frame should have a bit mask according to the RFC. • Enforce the continuity of the frames by verifying the bit mask exists • Client side • Null character found in WebSocket text massage • Null character inside message payload of type JSON and Text will be enforce. • Indifferent to “check message payload”
  • 15. © F5 Networks, Inc 15 WebSocket URL Entities Security ›› Application Security ›› Policy Building ›› Learning and Blocking Settings Policy Type Learn New WebSocket URL’s Fundamental Never Enhance Selective Comprehensive Add all entities
  • 16. © F5 Networks, Inc 16 1. Binary content found in text only WebSocket 2. Illegal WebSocket binary message length 3. Illegal WebSocket extension 4. Illegal WebSocket frame length 5. Illegal number of frame per message 6. Text content found in binary only WebSocket WebSocket Violations - Payload
  • 17. © F5 Networks, Inc 17 • Binary content found in text only WebSocket • The WebScoket payload is defined as text but the payload contains binary payload. WebSocket Violations - Payload
  • 18. © F5 Networks, Inc 18 • Illegal WebSocket binary message length • Binary message size enforce of 10000 bytes (default) WebSocket Violations - Payload
  • 19. © F5 Networks, Inc 19 • Illegal WebSocket extension • Protocol extensions: Per-message compression, Interleaved message fragmentation, etc • ASM can do the following for WebScoket extension : o Remove headers – remove the extension header (default) o Ignore – ignore the extension header (let then pass) o Block – block request with WebSocket extension WebSocket Violations - Payload
  • 20. © F5 Networks, Inc 20 • Illegal WebSocket frame length WebSocket Violations - Payload
  • 21. © F5 Networks, Inc 21 • Illegal number of frames per message WebSocket Violations - Payload
  • 22. © F5 Networks, Inc 22 • Text content found in binary only WebSocket WebSocket Violations - Payload
  • 23. © F5 Networks, Inc 23 WebSocket URL configuration
  • 24. © F5 Networks, Inc 24 WebSocket URL configuration
  • 25. © F5 Networks, Inc 25 WebSocket URL configuration
  • 26. © F5 Networks, Inc 26 Reviewing WebSocket message in the request log
  • 27. © F5 Networks, Inc 27 Reviewing WebSocket message in the request log Security ›› Event Logs ›› Application ›› Requests 1 2 3
  • 28. © F5 Networks, Inc 28 WebSocket - Request log filtering Security ›› Event Logs ›› Application ›› Requests
  • 29. © F5 Networks, Inc 29 WebSocket - Request log filtering
  • 30. © F5 Networks, Inc 30 WebSocket Handshake
  • 31. © F5 Networks, Inc 31 WebSocket Handshake
  • 32. © F5 Networks, Inc 32 WebSocket - Ping Pong
  • 33. © F5 Networks, Inc 33 WebSocket - Close
  • 34. © F5 Networks, Inc 34 WebSocket Demo
  • 35. © F5 Networks, Inc 35 Leaning page for WebSocket
  • 36. © F5 Networks, Inc 36 WebSocket URL
  • 37. © F5 Networks, Inc 37 Leaning page for WebSocket
  • 38. © F5 Networks, Inc 38 “Sec-WebSocket-Extensions” WebSocket URL
  • 39. © F5 Networks, Inc 39 WebSocket URL
  • 40. © F5 Networks, Inc 40 Policy builder classification
  • 41. © F5 Networks, Inc 41 JSON facts
  • 42. © F5 Networks, Inc 42 Attack signatures on Web Socket
  • 43. © F5 Networks, Inc 43 Web Sokcet Learning and attack signature
  • 44. © F5 Networks, Inc 44 Override attack signature – false positive
  • 45. © F5 Networks, Inc 45 • ASM support WebSocket protocol • Enforce protocol compliance • Enforce payload – • Plane Text – attack signature , null • JSON – structure and attack signature • Binary – length • New violations and setting for Web Scoket • Policy builder can learn the URL and classify the WebSocket payload types. • Request log display the communication between client and server Summary