SlideShare uma empresa Scribd logo
1 de 17
Web Security
• What is security in web app context?
• Authentication vs Authorization
• „Standard” way - Stateful
• „Modern” way - Stateless
• Cookies and Tokens
• Double and 2-step verification
• Useful libraries
• Summary
What
is
Security?
• practice of defending information from unauthorized access
• keeping away all valuable information from unprivileged users
• protecting data from leaking outside the company
• storing confidential informations only for provisioned roles
Authorization
vs
Authentication
Session
• Storing data on server side
• Client passes back only id
• Server knows what user it is talking to
• Lasts form first user's visit on the page and is kept some
time after his last activity (request)
• It almost impossible to know that user left the page
• In most servers session express after particular period
RESTful
• The whole state need to be held by the client, not the server
• State is being transfered in every request to release server
from remembering it
• An ideal RESTful service allows clients to perform any needed
task in one request
Stateless?
Actually, there is a state!
thentication, some information has to stay on the server side
And what about cookies?
• If cookies are used to maintain state at the client side, for the client, of the client
and by the client then they are restful.
• For clients besides browsers, managing cookies is a pretty big inconvenience
compared to query params
• However in browser, using cookies can make lots of things much simpler
• API should first look in the Authorization header for the authentication data (the
place for non-browser clients) and in case authentication data is missing then
may also check for a session cookie
• When we are the only developers who creating apps which can access to our
web service, we can depend on cookies and implement cookie mechanisms in
our applications
Login
Token
Request
Response
Data
DB
Use the new TLS!
• Asymmetric cryptography
• Secure data between connection endpoints
• Client encrypts data, Server decrypts it
• Protects from MITM
Multi-factor authentication
Token +
• IP
• User Agent
• SMS
• Biometric
• Face
• Electronic signature
• Codes from card
Cross-Site Scripting
https://xss-game.appspot.com/
https://github.com/gbirke/Sanitize.js
2-step verification
Useful GEMs for Rails
• the_role | https://github.com/the-teacher/the_role
Which resources are available for what role (group of users)
Roles and permissions are declared with JSON and stored in DB
Access can be managed from administrative panel within our web app
• declarative_authorization | https://github.com/stffn/declarative_authorization
The developer needs to specify which roles are allowed to access a specific
controller action or a part of a view
Authorization at controller, model or view level
DSL for specifying Authorization rules
• devise | https://github.com/plataformatec/devise
Complete MVC solution based on modularity concept
Offers complete session model for authentication
Provide generators for scaffolding authorization skeleton
$ npm install jsonwebtoken
$ bower install jsjws
http://jwt.io/#
https://oauth.io/home
https://auth0.com/

Mais conteúdo relacionado

Mais procurados

RESTful API Authentication
RESTful API AuthenticationRESTful API Authentication
RESTful API AuthenticationUttom Akash
 
Rest API Authentication - Uttom Akash
Rest API Authentication - Uttom AkashRest API Authentication - Uttom Akash
Rest API Authentication - Uttom AkashCefalo
 
Identity Access and Management with Globus
Identity Access and Management with GlobusIdentity Access and Management with Globus
Identity Access and Management with GlobusGlobus
 
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018Easy Auth Overview - Tokyo Azure Meetup - Feb 2018
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018Chris Gillum
 
Grey tower technical capablities
Grey tower  technical capablitiesGrey tower  technical capablities
Grey tower technical capablitiesWilliam Brant
 
Mobile Authentication for iOS Applications - Stormpath 101
Mobile Authentication for iOS Applications - Stormpath 101Mobile Authentication for iOS Applications - Stormpath 101
Mobile Authentication for iOS Applications - Stormpath 101Stormpath
 
Gestión de identidad en Cloud
Gestión de identidad en CloudGestión de identidad en Cloud
Gestión de identidad en CloudIbon Landa
 
Web API 2 Token Based Authentication
Web API 2 Token Based AuthenticationWeb API 2 Token Based Authentication
Web API 2 Token Based Authenticationjeremysbrown
 
WSO2Con USA 2017: Introduction to Security: End-to-End Identity Management
WSO2Con USA 2017: Introduction to Security: End-to-End Identity ManagementWSO2Con USA 2017: Introduction to Security: End-to-End Identity Management
WSO2Con USA 2017: Introduction to Security: End-to-End Identity ManagementWSO2
 
Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot Stormpath
 
Real-time Communication using SignalR and cloud
Real-time Communication using SignalR and cloudReal-time Communication using SignalR and cloud
Real-time Communication using SignalR and cloudRadu Vunvulea
 
Secure API Services in Node with Basic Auth and OAuth2
Secure API Services in Node with Basic Auth and OAuth2Secure API Services in Node with Basic Auth and OAuth2
Secure API Services in Node with Basic Auth and OAuth2Stormpath
 
Ssl certificates
Ssl certificatesSsl certificates
Ssl certificatesCollege
 
Automate+ Final Presentation
Automate+ Final PresentationAutomate+ Final Presentation
Automate+ Final PresentationSanat Maharjan
 
Spring4 security oauth2
Spring4 security oauth2Spring4 security oauth2
Spring4 security oauth2Sang Shin
 
OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)Emad Alashi
 
WSO2Con USA 2017: Opening Keynote - Vision for Agile Digital Transformation
WSO2Con USA 2017: Opening Keynote - Vision for Agile Digital TransformationWSO2Con USA 2017: Opening Keynote - Vision for Agile Digital Transformation
WSO2Con USA 2017: Opening Keynote - Vision for Agile Digital TransformationWSO2
 
WSO2Con USA 2017: Enhancing Customer Experience with WSO2 Identity Server
WSO2Con USA 2017: Enhancing Customer Experience with WSO2 Identity ServerWSO2Con USA 2017: Enhancing Customer Experience with WSO2 Identity Server
WSO2Con USA 2017: Enhancing Customer Experience with WSO2 Identity ServerWSO2
 

Mais procurados (20)

RESTful API Authentication
RESTful API AuthenticationRESTful API Authentication
RESTful API Authentication
 
Rest API Authentication - Uttom Akash
Rest API Authentication - Uttom AkashRest API Authentication - Uttom Akash
Rest API Authentication - Uttom Akash
 
Identity Access and Management with Globus
Identity Access and Management with GlobusIdentity Access and Management with Globus
Identity Access and Management with Globus
 
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018Easy Auth Overview - Tokyo Azure Meetup - Feb 2018
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018
 
Zabil
ZabilZabil
Zabil
 
Grey tower technical capablities
Grey tower  technical capablitiesGrey tower  technical capablities
Grey tower technical capablities
 
Mobile Authentication for iOS Applications - Stormpath 101
Mobile Authentication for iOS Applications - Stormpath 101Mobile Authentication for iOS Applications - Stormpath 101
Mobile Authentication for iOS Applications - Stormpath 101
 
Gestión de identidad en Cloud
Gestión de identidad en CloudGestión de identidad en Cloud
Gestión de identidad en Cloud
 
Web API 2 Token Based Authentication
Web API 2 Token Based AuthenticationWeb API 2 Token Based Authentication
Web API 2 Token Based Authentication
 
WSO2Con USA 2017: Introduction to Security: End-to-End Identity Management
WSO2Con USA 2017: Introduction to Security: End-to-End Identity ManagementWSO2Con USA 2017: Introduction to Security: End-to-End Identity Management
WSO2Con USA 2017: Introduction to Security: End-to-End Identity Management
 
Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot
 
Real-time Communication using SignalR and cloud
Real-time Communication using SignalR and cloudReal-time Communication using SignalR and cloud
Real-time Communication using SignalR and cloud
 
The Power of Social Login
The Power of Social LoginThe Power of Social Login
The Power of Social Login
 
Secure API Services in Node with Basic Auth and OAuth2
Secure API Services in Node with Basic Auth and OAuth2Secure API Services in Node with Basic Auth and OAuth2
Secure API Services in Node with Basic Auth and OAuth2
 
Ssl certificates
Ssl certificatesSsl certificates
Ssl certificates
 
Automate+ Final Presentation
Automate+ Final PresentationAutomate+ Final Presentation
Automate+ Final Presentation
 
Spring4 security oauth2
Spring4 security oauth2Spring4 security oauth2
Spring4 security oauth2
 
OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)
 
WSO2Con USA 2017: Opening Keynote - Vision for Agile Digital Transformation
WSO2Con USA 2017: Opening Keynote - Vision for Agile Digital TransformationWSO2Con USA 2017: Opening Keynote - Vision for Agile Digital Transformation
WSO2Con USA 2017: Opening Keynote - Vision for Agile Digital Transformation
 
WSO2Con USA 2017: Enhancing Customer Experience with WSO2 Identity Server
WSO2Con USA 2017: Enhancing Customer Experience with WSO2 Identity ServerWSO2Con USA 2017: Enhancing Customer Experience with WSO2 Identity Server
WSO2Con USA 2017: Enhancing Customer Experience with WSO2 Identity Server
 

Semelhante a Introduction to Web Security

IoT mobile app device cloud identity and security architecture
IoT mobile app device cloud identity and security architectureIoT mobile app device cloud identity and security architecture
IoT mobile app device cloud identity and security architectureVinod Wilson
 
JDD2015: Security in the era of modern applications and services - Bolesław D...
JDD2015: Security in the era of modern applications and services - Bolesław D...JDD2015: Security in the era of modern applications and services - Bolesław D...
JDD2015: Security in the era of modern applications and services - Bolesław D...PROIDEA
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsCh 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsSam Bowne
 
CNIT 129S: Securing Web Applications Ch 1-2
CNIT 129S: Securing Web Applications Ch 1-2CNIT 129S: Securing Web Applications Ch 1-2
CNIT 129S: Securing Web Applications Ch 1-2Sam Bowne
 
Web authentication
Web authenticationWeb authentication
Web authenticationPradeep J V
 
Building open source identity infrastructures
Building open source identity infrastructuresBuilding open source identity infrastructures
Building open source identity infrastructuresFrancesco Chicchiriccò
 
Mr. desmond cloud security_format
Mr. desmond cloud security_formatMr. desmond cloud security_format
Mr. desmond cloud security_formatMULTIMATICS_ID
 
Complete Guide to Setup Secure Scheme for Restful APIs
Complete Guide to Setup Secure Scheme for Restful APIsComplete Guide to Setup Secure Scheme for Restful APIs
Complete Guide to Setup Secure Scheme for Restful APIsXing (Xingheng) Wang
 
TrialPay Security Tech Talk at Stanford ACM
TrialPay Security Tech Talk at Stanford ACMTrialPay Security Tech Talk at Stanford ACM
TrialPay Security Tech Talk at Stanford ACMhackingtrialpay
 
Securing SharePoint Apps with OAuth
Securing SharePoint Apps with OAuthSecuring SharePoint Apps with OAuth
Securing SharePoint Apps with OAuthKashif Imran
 
SPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideSPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideJ.D. Wade
 
Building a secure BFF at Postman
Building a secure BFF at PostmanBuilding a secure BFF at Postman
Building a secure BFF at PostmanAnkit Muchhala
 
Authenticationtechnologies 120711134100-phpapp01
Authenticationtechnologies 120711134100-phpapp01Authenticationtechnologies 120711134100-phpapp01
Authenticationtechnologies 120711134100-phpapp01Hai Nguyen
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2Rodrigo Cândido da Silva
 
Token Authentication for Java Applications
Token Authentication for Java ApplicationsToken Authentication for Java Applications
Token Authentication for Java ApplicationsStormpath
 
HTTP Services & REST API Security
HTTP Services & REST API SecurityHTTP Services & REST API Security
HTTP Services & REST API SecurityTaiseer Joudeh
 
Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetShivanand Arur
 
How Cloud-Based Service Providers Can Integrate Strong Identity and Security
How Cloud-Based Service Providers Can Integrate Strong Identity and SecurityHow Cloud-Based Service Providers Can Integrate Strong Identity and Security
How Cloud-Based Service Providers Can Integrate Strong Identity and SecurityGlobalSign
 
Fragments-Plug the vulnerabilities in your App
Fragments-Plug the vulnerabilities in your AppFragments-Plug the vulnerabilities in your App
Fragments-Plug the vulnerabilities in your AppAppsecco
 
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationCNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationSam Bowne
 

Semelhante a Introduction to Web Security (20)

IoT mobile app device cloud identity and security architecture
IoT mobile app device cloud identity and security architectureIoT mobile app device cloud identity and security architecture
IoT mobile app device cloud identity and security architecture
 
JDD2015: Security in the era of modern applications and services - Bolesław D...
JDD2015: Security in the era of modern applications and services - Bolesław D...JDD2015: Security in the era of modern applications and services - Bolesław D...
JDD2015: Security in the era of modern applications and services - Bolesław D...
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsCh 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
 
CNIT 129S: Securing Web Applications Ch 1-2
CNIT 129S: Securing Web Applications Ch 1-2CNIT 129S: Securing Web Applications Ch 1-2
CNIT 129S: Securing Web Applications Ch 1-2
 
Web authentication
Web authenticationWeb authentication
Web authentication
 
Building open source identity infrastructures
Building open source identity infrastructuresBuilding open source identity infrastructures
Building open source identity infrastructures
 
Mr. desmond cloud security_format
Mr. desmond cloud security_formatMr. desmond cloud security_format
Mr. desmond cloud security_format
 
Complete Guide to Setup Secure Scheme for Restful APIs
Complete Guide to Setup Secure Scheme for Restful APIsComplete Guide to Setup Secure Scheme for Restful APIs
Complete Guide to Setup Secure Scheme for Restful APIs
 
TrialPay Security Tech Talk at Stanford ACM
TrialPay Security Tech Talk at Stanford ACMTrialPay Security Tech Talk at Stanford ACM
TrialPay Security Tech Talk at Stanford ACM
 
Securing SharePoint Apps with OAuth
Securing SharePoint Apps with OAuthSecuring SharePoint Apps with OAuth
Securing SharePoint Apps with OAuth
 
SPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideSPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival Guide
 
Building a secure BFF at Postman
Building a secure BFF at PostmanBuilding a secure BFF at Postman
Building a secure BFF at Postman
 
Authenticationtechnologies 120711134100-phpapp01
Authenticationtechnologies 120711134100-phpapp01Authenticationtechnologies 120711134100-phpapp01
Authenticationtechnologies 120711134100-phpapp01
 
ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2ConFoo 2015 - Securing RESTful resources with OAuth2
ConFoo 2015 - Securing RESTful resources with OAuth2
 
Token Authentication for Java Applications
Token Authentication for Java ApplicationsToken Authentication for Java Applications
Token Authentication for Java Applications
 
HTTP Services & REST API Security
HTTP Services & REST API SecurityHTTP Services & REST API Security
HTTP Services & REST API Security
 
Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.Net
 
How Cloud-Based Service Providers Can Integrate Strong Identity and Security
How Cloud-Based Service Providers Can Integrate Strong Identity and SecurityHow Cloud-Based Service Providers Can Integrate Strong Identity and Security
How Cloud-Based Service Providers Can Integrate Strong Identity and Security
 
Fragments-Plug the vulnerabilities in your App
Fragments-Plug the vulnerabilities in your AppFragments-Plug the vulnerabilities in your App
Fragments-Plug the vulnerabilities in your App
 
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationCNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking Authentication
 

Mais de Kamil Lelonek

Mais de Kamil Lelonek (8)

Angular2 ecosystem
Angular2 ecosystemAngular2 ecosystem
Angular2 ecosystem
 
Elixir metaprogramming
Elixir metaprogrammingElixir metaprogramming
Elixir metaprogramming
 
Rails New Way
Rails New WayRails New Way
Rails New Way
 
Crystal
CrystalCrystal
Crystal
 
Ansible
AnsibleAnsible
Ansible
 
Scala vs ruby
Scala vs rubyScala vs ruby
Scala vs ruby
 
A brief intro to RubyMotion
A brief intro to RubyMotionA brief intro to RubyMotion
A brief intro to RubyMotion
 
oAuth wroclove
oAuth wrocloveoAuth wroclove
oAuth wroclove
 

Último

𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...SUHANI PANDEY
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...SUHANI PANDEY
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...nilamkumrai
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 

Último (20)

𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 

Introduction to Web Security

  • 1. Web Security • What is security in web app context? • Authentication vs Authorization • „Standard” way - Stateful • „Modern” way - Stateless • Cookies and Tokens • Double and 2-step verification • Useful libraries • Summary
  • 2. What is Security? • practice of defending information from unauthorized access • keeping away all valuable information from unprivileged users • protecting data from leaking outside the company • storing confidential informations only for provisioned roles
  • 4.
  • 5. Session • Storing data on server side • Client passes back only id • Server knows what user it is talking to • Lasts form first user's visit on the page and is kept some time after his last activity (request) • It almost impossible to know that user left the page • In most servers session express after particular period
  • 6. RESTful • The whole state need to be held by the client, not the server • State is being transfered in every request to release server from remembering it • An ideal RESTful service allows clients to perform any needed task in one request Stateless? Actually, there is a state! thentication, some information has to stay on the server side
  • 7. And what about cookies? • If cookies are used to maintain state at the client side, for the client, of the client and by the client then they are restful. • For clients besides browsers, managing cookies is a pretty big inconvenience compared to query params • However in browser, using cookies can make lots of things much simpler • API should first look in the Authorization header for the authentication data (the place for non-browser clients) and in case authentication data is missing then may also check for a session cookie • When we are the only developers who creating apps which can access to our web service, we can depend on cookies and implement cookie mechanisms in our applications
  • 8. Login Token Request Response Data DB Use the new TLS! • Asymmetric cryptography • Secure data between connection endpoints • Client encrypts data, Server decrypts it • Protects from MITM
  • 9. Multi-factor authentication Token + • IP • User Agent • SMS • Biometric • Face • Electronic signature • Codes from card
  • 10.
  • 13.
  • 14. Useful GEMs for Rails • the_role | https://github.com/the-teacher/the_role Which resources are available for what role (group of users) Roles and permissions are declared with JSON and stored in DB Access can be managed from administrative panel within our web app • declarative_authorization | https://github.com/stffn/declarative_authorization The developer needs to specify which roles are allowed to access a specific controller action or a part of a view Authorization at controller, model or view level DSL for specifying Authorization rules • devise | https://github.com/plataformatec/devise Complete MVC solution based on modularity concept Offers complete session model for authentication Provide generators for scaffolding authorization skeleton
  • 15. $ npm install jsonwebtoken $ bower install jsjws http://jwt.io/#

Notas do Editor

  1. W tej prezentacji chciałbym przedstawić podstawowe zagadnienia w temacie bezpieczeństwa w aplikacjach typu Single Page. Opowiem między innymi o: bezpieczeństwie samym w sobie jak możemy chronić nasze serwisy przedstawię różne podejścia do tematu bezpieczeństwa i sposoby weryfikacji użytkownika a na koniec wskażę pomocne narzędzia w temacie zabezpieczeń In this presentation I'd like to cover a brief introduction to security topics in Single Page Applications. I will say about: Security in web app How can we protect our services Different approach to web security Ways of users verification Helpful tools
  2. Żeby w ogóle zacząć mówić o szczegółach dotyczących bezpieczeństwa, na początek musimy sobie zdefiniować czym to bezpieczeństwo właściwie jest. Bo mówiąc ogólnie - bezpieczeństwem możemy nazwać zestaw akcji, które musimy podjąć by chronić nasze dane przed nieuprzywilejowanym dostępem przez niechciane osoby lub systemy. Czyli są to wymagane kroki, których wynikiem jest ochrona przed niepożądanym zachowaniem. > Chcemy tworzyć bezpieczne systemy w tym sensie, że nie tylko użytkownik będzie czuł, że jego dane są bezpiecznie, ale także, musimy rzeczywiście chronić je przed złośliwymi operacjami czy nawet atakami. To start talking about security details, firstly we need to define what actually the security is. Talking in general - security is a set of actions which taking protect our data and prevent them from access by unwanted users or systems. So it’s a bunch of steps required for defending us from unauthorized actions. We want to keep our systems secure to give users not only feeling that their data is safe but really prevent it from any malicious operations and attacks.
  3. Bardzo istotną kwestią jest rozróżnienie tych dwóch pojęć: Authentication i Authorization. Co ciekawe, w języku polskim, tylko jedno z nich jest tłumaczone prawie bezpośrednio. Authorization to oczywiście autoryzacja, natomiast Authenticiation to już uwierzytelnianie. Nie ma takiego słowa jak autentykacja, czy nawet autentyfikacja. Jeżeli popełnię taki błąd to krzyczcie od razu. Jedno z tych pojęć oznacza tyle co sprawdzenie tego, kto chciałby uzyskać dostęp do naszego serwisu, podczas gdy drugie to sprawdzenie czy znany nam użytkownik może poprosić o te, konkretne zasoby. At the beginning we need to distinguish between Authentication and Authorization which are often misunderstood. What is interesting, authentication is usually translated incorrectly in polish. It's "uwierzytelnianie", not "autentykacja". One of them is to define wether web service knows who the user is and the other one allows user to access some particular information.
  4. I teraz lekki mindfuck. Kod 401, używany przy uwierzytelnianiu, czyli jak pamiętacie Authentication, niesie za sobą wiadomość Unauthorized. W tym przypadku, powinniśmy zawsze dołączać nagłówek HTTTP WWW-Authenticate, który wskazuje możliwy sposób uwierzytelnienia. Jeżeli jednak zapytanie zawierało dane uwierzytelnienia takie jak login i hasło, ten kod oznacza podanie błędnego hasło dla danego użytkownika. Kod 403, używany przy autoryzacji, czyli jak pamiętacie Authorization, niesie za sobą wiadomość Forbidden. Serwer rozumie zapytanie i zna użytkownika, natomiast odmawia mu dostępu do zasobów. > Czyli podsumowując: 401 - brak lub złe dane użytkownika, 403 - brak wystarczających uprawnień. 401 Unauthorized (for authentication errors): It will always include a WWW-Authenticate header that describes how to authenticate. If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. 403 Forbidden (for authorization problems): The server understood the request, but is refusing to fulfill it. In summary, a 401 Unauthorized response should be used for missing or bad authentication, and a 403 Forbidden response should be used afterwards, when the user is authenticated but isn’t authorized to perform the requested operation on the given resource.
  5. HTTP jest protokołem bezstanowym, tzn. że nie możemy powiązać .ze sobą kolejnych zapytań. Musi więc istnieć sposób na przechowywanie stanu pomiędzy tymi zapytaniami. Klienci wysyłają dane do serwera takie jak metoda, atrybuty, ciasteczka, przeglądarka czy źródło pochodzenia. > HTTP is a stateless protocol. You can’t associate a one request to another. There need to be some way to keep state. Browser sends some data to server like method type, request attributes, cookies, user agent and refereer.
  6. REST jest skrótem od Representational State Transfer. > Jest ściśle powiązany z bezstanowością, jednak tylko na serwerze. > Istnieje potrzeba pamiętania klienta, który wykonuje dane zapytania. > REST is an abbreviation of Representational State Transfer. It strictly connected with the stateless but only on the server side. There is a need to remember what clients are authenticated
  7. Ciasteczka są niczym innym jak nagłówkami HTTP. Jaka jest więc różnica czy przekażemy dane w nagłówku Authorization lub Cookie? Ciasteczka mogą być ograniczone czasowo, tj. mieć datę ważności. Mogą też być zaszyfrowane, są wygodne w użyciu. Komunikacja pomiędzy klientem a serwerem RESTowym jest bezstanowa w tym sensie, że dane pomiędzy kolejnymi zapytaniami i w ramach różnych sesji nie zwiększają się. Cookies are simply HTTP header. What is the difference if we pass some data in Authorization or in Cookie header? Cookies can be time-limited. Cookies can be encrypted. Cookies are safe and convenient. The communication between the REST service and the REST client is stateless, when the data stored by the service does not grow with the count of the user sessions.
  8. TLS - Transport Layer Security (1.2) - by protocol > („handshake”) SSL - Secure Socet Layer (3.0) - by port :443 (secure by default) TLS is cryptographic protocol which is designed to provide communication security over the Internet Part of lower sublayer of application layer in OSI model > Work on behalf of the underlying transport layer, whose segments carry encrypted data
  9. - Binding token to IP my cause user of mobile internet (like LTE) need to reauthenticating all the time for example during train travel - User Agent is just specific string, very specific at the first sight but easy to forge - We need to provide something what potentially hacker cannot steal
  10. Method of attack that fakes websites which requires authentication. Cookies themselves are not the cause of CSRF vulnerabilities. It’s using the cookies on the server to validate a user that is the cause of CSRF. When a Single Page App loads it can read the cookies (via JavaScript), grab the authentication token, and then manually send that token on each request through a custom HTTP header.
  11. Embedding JS scripts on websites. Same origin policy allows to use objects that comes only from the same source as website URL (protocol, host, port). Javascript injection - sanitazing input
  12. Create separate app-specific password and then provision with an additional SMS code. Returns token which gain access to application. Twitter was hacked by fake email.
  13. oAuth - the way to provision users in third-party services to get access to your own service An open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications. A simple way to publish and interact with protected data. Have access to users data while prodecting their credentials.
  14. Role: Lightweight library for defining roles for users Roles are connected with controller actions Administrator role with full access Declarative: From the one side User is assigned to Role From the second side Developer specifies which permissions are required for user to perform activities (call controller, perform DB operation, display view fragments) Permissions have a bunch of Privileges and Context (perm - uprawnienie, privi - przywilej) In configuration Permissions are assigned to Roles Devise: The heaviest and the biggest authentication library for Rails Provide comprehensive security rules for web application Supports asynchronous requests, oAuth, multi-step verification, timeouts, validations, black lists and many well-known features