SlideShare a Scribd company logo
Confidential & proprietary © Sqreen
We make products antifragile.
https://www.sqreen.io
Instrument Rack to visualize

Rails requests processing
© Sqreenhttps://www.sqreen.io
Jean-Baptiste Aviat
Sqreen CTO (https://sqreen.io)
Former Apple software security engineer
Former white hat hacker
Twitter: @JbAviat
Mail: jb@sqreen.io
© Sqreenhttps://www.sqreen.io
What is Rack ?
« Interface between webservers and frameworks »
Ruby framework: Rails, Sinatra…
Ruby server: Webrick, Puma, Mongrel…
require 'rack'
app = Proc.new do |env|
[‘200',
{'Content-Type' => ‘text/html'},
[Time.now.to_s]
]
end
Rack::Handler::WEBrick.run app
© Sqreenhttps://www.sqreen.io
Rails with Rack request processing
Around 6000 lines of code
No strict boundaries: frameworks rely on Rack for some
tasks
Need to instrument low level HTTP calls
Sinatra
Rails with Grape
Needed a clear and simple Rack knowledge
© Sqreenhttps://www.sqreen.io
Instrumentation: what is it?
Hooking into software to modify original behavior
Display Rack actions
x86 compiled code
3 engineers for 1 month work, databases, ASM
Ruby code
3 lines and 1 minute
© Sqreenhttps://www.sqreen.io
Ruby instrumentation capabilities
Kernel#set_trace_func
Arguments are:
1. An event name (call, line, return…)
2. A filename and a line number
3. An object id
4. A binding
5. The name of a class
set_trace_func proc { |*args|
puts args
}
© Sqreenhttps://www.sqreen.io
Find the needle in the haystack
The Binding class holds a block binding
You can inspect anything in any line of code
binding.local_variables.each do |var|
val = binding.local_variable_get var
if val.is_a? String and val.include? query
puts "#{classname}.#{event} (#{file}:#{line} - #{val}"
end
end
}
© Sqreenhttps://www.sqreen.io
Function identification example
Locate where the SqreenUA User-Agent is processed:
In Sinatra output:
$ curl -A SqreenUA localhost:4567/hi
Regexp.c-return (webrick/httprequest.rb:436) `User-Agent: SqreenUA`
Kernel.c-return (webrick/httputils.rb:140) `Host: localhost:4567
User-Agent: SqreenUA
Accept: */*`
[…]
String.c-return (webrick/httprequest.rb:403) - `SqreenUA`
Kernel.c-return (/rack/handler/webrick.rb:60) - `SqreenUA`
© Sqreenhttps://www.sqreen.io
Modules involved in request processing
© Sqreenhttps://www.sqreen.io
Instruction count (most used classes)
© Sqreenhttps://www.sqreen.io
Instruction count (exhaustive)
© Sqreenhttps://www.sqreen.io
Sqreen: you code, we protect
We automatically protect your apps
Strong and transparent
Beta program available:
Come and see me if you have Rails or Sinatra based
applications
Sqreen is growing…
jobs@sqreen.io

More Related Content

PDF
Ruby on Rails security in your Continuous Integration
PDF
Tune your App Perf (and get fit for summer)
PPTX
Signal r core workshop - netconf
PPTX
AWS Security Week | Getting to Continuous Security and Compliance Monitoring ...
PDF
Application Security in a Container World - Akash Mahajan - BCC 2017
PDF
DerbyCon 2019: Prepare to be Boarded! A Tale of Kubernetes, Plunder, and Cryp...
PPTX
Lacework | Top 10 Cloud Security Threats
PDF
Mitigate Security Threats with SIEM
Ruby on Rails security in your Continuous Integration
Tune your App Perf (and get fit for summer)
Signal r core workshop - netconf
AWS Security Week | Getting to Continuous Security and Compliance Monitoring ...
Application Security in a Container World - Akash Mahajan - BCC 2017
DerbyCon 2019: Prepare to be Boarded! A Tale of Kubernetes, Plunder, and Cryp...
Lacework | Top 10 Cloud Security Threats
Mitigate Security Threats with SIEM

What's hot (19)

PDF
Better Bug Stomping with Zend Studio and Zend Server
PPTX
Self Service for IT Infrastructure
PDF
All Your Containers Are Belong To Us
PPT
Automating security test using Selenium and OWASP ZAP - Practical DevSecOps
PDF
Manage Your Akamai-as-Code with Terraform
PDF
Set up a Development Environment in 5 Minutes
PDF
Deployment Automation & Self-Healing with Dynatrace & Ansible
PDF
Enforce compliance policy with model-driven automation
PDF
Principles Of Chaos Engineering - Chaos Engineering Hamburg
PDF
BSides Denver 2019 - Cloud Wars Episode V: The Cryptojacker Strikes Back
PDF
Infrastructure as Code
PPTX
Automated Intrusion Detection and Response on AWS
PDF
Ignite Denver - Robots!
PPTX
Programming for the Internet of Things
PPTX
Security as Code
PDF
Akamai-as-Code with The Washington Post
PDF
PayPal's History of Microservices Architecture
PPTX
D3NY17- Using IncapRules to Customize Security
PPTX
Syntribos API Security Test Automation
Better Bug Stomping with Zend Studio and Zend Server
Self Service for IT Infrastructure
All Your Containers Are Belong To Us
Automating security test using Selenium and OWASP ZAP - Practical DevSecOps
Manage Your Akamai-as-Code with Terraform
Set up a Development Environment in 5 Minutes
Deployment Automation & Self-Healing with Dynatrace & Ansible
Enforce compliance policy with model-driven automation
Principles Of Chaos Engineering - Chaos Engineering Hamburg
BSides Denver 2019 - Cloud Wars Episode V: The Cryptojacker Strikes Back
Infrastructure as Code
Automated Intrusion Detection and Response on AWS
Ignite Denver - Robots!
Programming for the Internet of Things
Security as Code
Akamai-as-Code with The Washington Post
PayPal's History of Microservices Architecture
D3NY17- Using IncapRules to Customize Security
Syntribos API Security Test Automation
Ad

Viewers also liked (20)

PPTX
How to-use-buffer-by-ella
PDF
From Second Screen to Multi-Screen: We Are Social's Guide to Social Screens
PDF
SteadyBudget's Seed Funding Pitch Deck
PDF
7 Tips to Beautiful PowerPoint by @itseugenec
PDF
The Minimum Loveable Product
PDF
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
PDF
The Seven Deadly Social Media Sins
PDF
Five Killer Ways to Design The Same Slide
PPTX
How People Really Hold and Touch (their Phones)
PDF
Upworthy: 10 Ways To Win The Internets
PDF
What 33 Successful Entrepreneurs Learned From Failure
PDF
Design Your Career 2018
PPTX
Why Content Marketing Fails
PDF
The History of SEO
PDF
How To (Really) Get Into Marketing
PDF
The What If Technique presented by Motivate Design
PDF
Displaying Data
PPTX
10 Powerful Body Language Tips for your next Presentation
PDF
Crap. The Content Marketing Deluge.
PDF
What Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
How to-use-buffer-by-ella
From Second Screen to Multi-Screen: We Are Social's Guide to Social Screens
SteadyBudget's Seed Funding Pitch Deck
7 Tips to Beautiful PowerPoint by @itseugenec
The Minimum Loveable Product
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
The Seven Deadly Social Media Sins
Five Killer Ways to Design The Same Slide
How People Really Hold and Touch (their Phones)
Upworthy: 10 Ways To Win The Internets
What 33 Successful Entrepreneurs Learned From Failure
Design Your Career 2018
Why Content Marketing Fails
The History of SEO
How To (Really) Get Into Marketing
The What If Technique presented by Motivate Design
Displaying Data
10 Powerful Body Language Tips for your next Presentation
Crap. The Content Marketing Deluge.
What Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
Ad

Similar to Instrument Rack to visualize
 Rails requests processing (20)

PDF
Rack
PPTX
Meetup callback
PDF
Sierra Wireless Developer Day 2013 - 11 - AirVantage M2M Cloud
PPTX
Iron.io Technical Overview
PDF
Hta t07-did-you-read-the-news-http-request-hijacking
PPTX
Owin and Katana
PDF
APIs for the Internet of Things
PDF
AWS Serverless 활용 네트워크 보안 아키텍처::함인용 실장, 이성현 매니저, 솔트웨어::AWS Summit Seoul 2018
PPTX
AirVantage M2M Cloud - A survival guide to newcomers
PDF
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
PDF
MesosCon - Be a microservices hero
PPTX
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
PPTX
Stups.io - an Open Source Cloud Framework for AWS
PDF
.NET Architects Day - DNAD 2011
PDF
09 - Fábio Akita - Além do rails
PPTX
COP_RoR_QuArrk_Session_Oct_2022.pptx
PDF
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
PDF
Ruby Conf Preso
PDF
Intro to Rack
PDF
Using Databases and Containers From Development to Deployment
Rack
Meetup callback
Sierra Wireless Developer Day 2013 - 11 - AirVantage M2M Cloud
Iron.io Technical Overview
Hta t07-did-you-read-the-news-http-request-hijacking
Owin and Katana
APIs for the Internet of Things
AWS Serverless 활용 네트워크 보안 아키텍처::함인용 실장, 이성현 매니저, 솔트웨어::AWS Summit Seoul 2018
AirVantage M2M Cloud - A survival guide to newcomers
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
MesosCon - Be a microservices hero
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
Stups.io - an Open Source Cloud Framework for AWS
.NET Architects Day - DNAD 2011
09 - Fábio Akita - Além do rails
COP_RoR_QuArrk_Session_Oct_2022.pptx
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
Ruby Conf Preso
Intro to Rack
Using Databases and Containers From Development to Deployment

More from Sqreen (6)

PDF
Protecting against injections at scale
PDF
Serverless security - how to protect what you don't see?
PDF
Writing a Python C extension
PDF
Api days 2018 - API Security by Sqreen
PDF
NoSQL Injections in Node.js - The case of MongoDB
PDF
Application Security from the Inside - OWASP
Protecting against injections at scale
Serverless security - how to protect what you don't see?
Writing a Python C extension
Api days 2018 - API Security by Sqreen
NoSQL Injections in Node.js - The case of MongoDB
Application Security from the Inside - OWASP

Recently uploaded (20)

PDF
Digital Strategies for Manufacturing Companies
PPTX
history of c programming in notes for students .pptx
PPT
Introduction Database Management System for Course Database
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
top salesforce developer skills in 2025.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Online Work Permit System for Fast Permit Processing
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
AI in Product Development-omnex systems
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administraation Chapter 3
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
Digital Strategies for Manufacturing Companies
history of c programming in notes for students .pptx
Introduction Database Management System for Course Database
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
top salesforce developer skills in 2025.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System
ISO 45001 Occupational Health and Safety Management System
Softaken Excel to vCard Converter Software.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Online Work Permit System for Fast Permit Processing
How Creative Agencies Leverage Project Management Software.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
AI in Product Development-omnex systems
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administraation Chapter 3
CHAPTER 2 - PM Management and IT Context
2025 Textile ERP Trends: SAP, Odoo & Oracle

Instrument Rack to visualize
 Rails requests processing