SlideShare una empresa de Scribd logo
1 de 19
warden
wardenequipping yourself to better understand devise
any love for devise?
okay, so what is warden?
a mechanism for authentication in rack based ruby applications
Warden is upstream of some session middleware Creates an env[‘warden’] proxy Authentication can be shared between several Rack apps
sweet, why should I learn more about it?
create custom light-weight authentication middleware share authentication between multiple Rack apps (rails & sinatra) better understand higher level libraries that use it (i.e. devise) and, well…
Because it’s way awesome!
Mission Debriefing user strategy failure app scope
user – any object that can be serialized into the session marking a request authenticated.
strategy – a place to keep logic for a certain method of authenticating a request
failure app – a specified rack endpoint after all authentication strategies have failed
scope – a grouping of warden configuration settings. WARNING! This is very oversimplified
env[‘warden’].user(:api)env[‘warden’].authenticated?(:admin)
Demo! *crosses fingers*
Surprisingly nice…

Más contenido relacionado

Similar a Demystifying Warden

Webscarab demo @ OWASP Belgium
Webscarab demo @ OWASP BelgiumWebscarab demo @ OWASP Belgium
Webscarab demo @ OWASP BelgiumPhilippe Bogaerts
 
Cloud Foundry a Developer's Perspective
Cloud Foundry a Developer's PerspectiveCloud Foundry a Developer's Perspective
Cloud Foundry a Developer's PerspectiveDave McCrory
 
Rohit yadav cloud stack internals
Rohit yadav   cloud stack internalsRohit yadav   cloud stack internals
Rohit yadav cloud stack internalsShapeBlue
 
Virtualization and Open Virtualization Format (OVF)
Virtualization and Open Virtualization Format (OVF)Virtualization and Open Virtualization Format (OVF)
Virtualization and Open Virtualization Format (OVF)rajsandhu1989
 
EAP-TLS (extended version)
EAP-TLS (extended version)EAP-TLS (extended version)
EAP-TLS (extended version)Karri Huhtanen
 
Pervasive Web Application Architecture
Pervasive Web Application ArchitecturePervasive Web Application Architecture
Pervasive Web Application ArchitectureUC San Diego
 
040711 webcast securing vmachine
040711 webcast securing vmachine 040711 webcast securing vmachine
040711 webcast securing vmachine Erin Banks
 
Managing Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the CloudManaging Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the CloudCloudBees
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .NetRichard Banks
 
Cloud inventory analytics Maestro server
Cloud inventory analytics   Maestro serverCloud inventory analytics   Maestro server
Cloud inventory analytics Maestro serverFelipe Klerk Signorini
 
De 03 Introduction To V Cloud Api V1
De 03 Introduction To V Cloud Api V1De 03 Introduction To V Cloud Api V1
De 03 Introduction To V Cloud Api V1ikewu83
 
DevSecOps in Baby Steps
DevSecOps in Baby StepsDevSecOps in Baby Steps
DevSecOps in Baby StepsPriyanka Aash
 
DevSecOps in Baby Steps
DevSecOps in Baby StepsDevSecOps in Baby Steps
DevSecOps in Baby StepsPriyanka Aash
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with DockerMariaDB plc
 
WSO2Con EU 2015: Understanding the API Management Platform
WSO2Con EU 2015: Understanding the API Management PlatformWSO2Con EU 2015: Understanding the API Management Platform
WSO2Con EU 2015: Understanding the API Management PlatformWSO2
 
Security DevOps: Wie Sie in agilen Projekten trotzdem sicher bleiben // JAX 2015
Security DevOps: Wie Sie in agilen Projekten trotzdem sicher bleiben // JAX 2015Security DevOps: Wie Sie in agilen Projekten trotzdem sicher bleiben // JAX 2015
Security DevOps: Wie Sie in agilen Projekten trotzdem sicher bleiben // JAX 2015Christian Schneider
 
DPD:AWS Developer Training
DPD:AWS Developer TrainingDPD:AWS Developer Training
DPD:AWS Developer TrainingJosh Curtis
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantMitchell Hashimoto
 
AWS Summit 2011: Application Security Best Practices
AWS Summit 2011: Application Security Best PracticesAWS Summit 2011: Application Security Best Practices
AWS Summit 2011: Application Security Best PracticesAmazon Web Services
 

Similar a Demystifying Warden (20)

Webscarab demo @ OWASP Belgium
Webscarab demo @ OWASP BelgiumWebscarab demo @ OWASP Belgium
Webscarab demo @ OWASP Belgium
 
Cloud Foundry a Developer's Perspective
Cloud Foundry a Developer's PerspectiveCloud Foundry a Developer's Perspective
Cloud Foundry a Developer's Perspective
 
Rohit yadav cloud stack internals
Rohit yadav   cloud stack internalsRohit yadav   cloud stack internals
Rohit yadav cloud stack internals
 
Virtualization and Open Virtualization Format (OVF)
Virtualization and Open Virtualization Format (OVF)Virtualization and Open Virtualization Format (OVF)
Virtualization and Open Virtualization Format (OVF)
 
EAP-TLS (extended version)
EAP-TLS (extended version)EAP-TLS (extended version)
EAP-TLS (extended version)
 
Pervasive Web Application Architecture
Pervasive Web Application ArchitecturePervasive Web Application Architecture
Pervasive Web Application Architecture
 
040711 webcast securing vmachine
040711 webcast securing vmachine 040711 webcast securing vmachine
040711 webcast securing vmachine
 
Managing Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the CloudManaging Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the Cloud
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
 
Cloud inventory analytics Maestro server
Cloud inventory analytics   Maestro serverCloud inventory analytics   Maestro server
Cloud inventory analytics Maestro server
 
De 03 Introduction To V Cloud Api V1
De 03 Introduction To V Cloud Api V1De 03 Introduction To V Cloud Api V1
De 03 Introduction To V Cloud Api V1
 
Cloud Perspectives
Cloud PerspectivesCloud Perspectives
Cloud Perspectives
 
DevSecOps in Baby Steps
DevSecOps in Baby StepsDevSecOps in Baby Steps
DevSecOps in Baby Steps
 
DevSecOps in Baby Steps
DevSecOps in Baby StepsDevSecOps in Baby Steps
DevSecOps in Baby Steps
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 
WSO2Con EU 2015: Understanding the API Management Platform
WSO2Con EU 2015: Understanding the API Management PlatformWSO2Con EU 2015: Understanding the API Management Platform
WSO2Con EU 2015: Understanding the API Management Platform
 
Security DevOps: Wie Sie in agilen Projekten trotzdem sicher bleiben // JAX 2015
Security DevOps: Wie Sie in agilen Projekten trotzdem sicher bleiben // JAX 2015Security DevOps: Wie Sie in agilen Projekten trotzdem sicher bleiben // JAX 2015
Security DevOps: Wie Sie in agilen Projekten trotzdem sicher bleiben // JAX 2015
 
DPD:AWS Developer Training
DPD:AWS Developer TrainingDPD:AWS Developer Training
DPD:AWS Developer Training
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
 
AWS Summit 2011: Application Security Best Practices
AWS Summit 2011: Application Security Best PracticesAWS Summit 2011: Application Security Best Practices
AWS Summit 2011: Application Security Best Practices
 

Demystifying Warden

Notas del editor

  1. I know I’ve met a lot of you, but here is a bit of info about myself
  2. Today I’d like to talk a bit about Warden.
  3. So, I am going to talk about warden, but the goal of the talk is to understand just enough about warden so that Devise seems a little less magical.
  4. Who here has used Devise?Who here has used Warden directly?
  5. ON NEXT SLIDEWarden definition
  6. AFTER THIS SLIDELets take a look at how warden fits into the rack application stack
  7. First off, you are required to use some sort of session middleware upstream of warden. I’ve used Rack::Session for thisNext, warden is a piece of middleware that lazily places a warden proxy object into the rack environmentAll rack applications mounted after warden now have access to this warden object, allowing you to share authentication between any number of rack apps
  8. That’s all well and good, but you have to ask, why should I learn more?
  9. Now, before we go on, we need to define some terminology.You’ll have to forgive me for a bit of hand-waving, but hopefully it will become more clear after the demo
  10. Of course, you’ll need to provide the logic for serializing and deserializing your object into and out of the session. We’ll get to that a bit later
  11. Strategies typically define two methods: valid? : This normally just checks to see if the correct parameters are coming in, dismissing the request if they are wasting your time authenticate! : This method houses the logic for determining whether or not the parameters passed in pass or fail authenticationStrategies are cascading
  12. This can be any mounted rack app. For example, a Rails controller or Sinatra application.
  13. So you can assign which strategies to use for a specific scopeYou can define a default scopeWhen you call authenticate! You can specify which scope you’d like to authenticate against
  14. I’ve only scrapped the surface of how Warden worksBut, much like sleeping inside of a tauntaun, Warden isn’t so bad after all…I’ll be at rusty bucket afterwards, I’ll do my best to answer any questions you might haveThanks!