SlideShare a Scribd company logo
Securing Angular and Node.js Apps in Azure
Brian Clark
_clarkio
Casterly Rock
Casterly Rock
Casterly Rock
Casterly Rock
“an impregnable
fortress”
Casterly Rock
?!
Casterly Rock
Deter your enemies
Defending against…
MortarsArrowsInfantry
Defending against…
O W A S P
pen
eb
pplication owasp.org
O
A
P
ecurity
roject
W
S
Access Control
Authenticatio
n
Authorization
You are who you
say you are
You have the required
permissions for the request
Browser
http://insecureheroes.com
Server
http://insecureheroes.com
Browser
http://insecureheroes.com
Server
http://insecureheroes.com
Browser
http://insecureheroes.com
Server
http://insecureheroes.com
Browser
http://insecureheroes.comCookies
Server
http://insecureheroes.com
Browser
http://insecureheroes.comCookies
Server
http://insecureheroes.com
Hero: Luke
Demo
Malicious Input
Insecure Heroes
http://insecureheroes.com
An attack that injects malicious code into a trusted web
site such that it may be executed unintendedly by other
users
Cross-site Scripting (XSS)
Prevention
Content Security PolicyInput Handling
Control what resources
the browser is allowed to
load
Ensure data is aligned
with the expectations for
its intended use
Input Handling
Input Handling
Input Handling
EscapingSanitizationValidation
Sanitization EscapingValidation
Ensure the data is legit
Invalid Email
Result
:
Validation EscapingSanitization
Clean the bad data
BC
Result
:
SanitizationValidation Escaping
Encode the bad data
B<script>alert(1);</script>C
Result
:
Do not trust user input
Where should we apply
input handlers?
Where should we apply
input handlers?
Client? Server?
Browser
http://insecureheroes.com
Server
http://insecureheroes.com
Browser
http://insecureheroes.com
Server
http://insecureheroes.com
Security
Boundary
Browser
http://insecureheroes.com
Server
http://insecureheroes.com
Security
Boundary
Untruste
d
Browser
http://insecureheroes.com
Server
http://insecureheroes.com
Security
Boundary
Truste
Both
Securing Angular and Node.js Apps in Azure
Securing Angular and Node.js Apps in Azure
https://angular.io/guide/security
https://angular.io/guide/security
?
https://www.npmjs.com/package/express-validator
https://www.npmjs.com/package/xss-filters
Demo
Content Security Policy
<script>var x = “yz”;</script>
Content Security Policy
Content-Security-Policy: default-src 'self '
Describes sources types in directives (css, image, etc.)
<div style=“{margin-top:10px;}”>
1
3
4
2
https://www.npmjs.com/package/helmet
https://www.npmjs.com/package/helmet
Faking Requests
Browser
http://insecureheroes.comCookies
Server
http://insecureheroes.com
Hero: Luke
Browser
http://insecurehe
roes.com
Cookies
Server
http://insecureheroes.com
http://clickbaity.co
Browser
http://insecurehe
roes.com
Cookies
Server
http://insecureheroes.com
http://attacker.com
Attack
insecureheroes.com
Hero: Darth
Demo
An attack that executes a request on behalf of another
authenticated user that was not intending to perform
that action being requested
Cross-site Request Forgery
Synchronizer
Token
Pattern
Random token
Unique to user and
session
Included as a header
Validated server-
side
https://www.npmjs.com/package/csu
rf
Securing Angular and Node.js Apps in Azure
https://angular.io/guide/http#security-xsrf-protection
Demo
Securing Angular and Node.js Apps in Azure
Stealing Clicks
Demo
An attack that tricks users into clicking on content that
they were not intending to click on
Clickjacking
Clickjacking
Mitigation
X-FRAME-OPTIONS
DENY
SAMEORIGIN
ALLOW-FROM: URL*
*Content-Security-Policy: frame-ancestors:
URL
https://helmetjs.github.io/
Securing Angular and Node.js Apps in Azure
Securing Angular and Node.js Apps in Azure
Securing Angular and Node.js Apps in Azure
Demo
Package
Management
Securing Angular and Node.js Apps in Azure
https://nodesecurity.io/opensource
https://snyk.io
Demo
Summary
Access Control
Faking Requests
Stealing Clicks
Package
Management
Malicious Input
© DEVintersection 2017. All rights reserved.
https://www.DEVintersection.com
References
 https://owasp.org
 https://github.com/Azure-Samples/angular-cosmosdb
 (branch: insecure-heroes)
 https://angular.io/guide/security
 https://www.npmjs.com/package/csurf
 https://angular.io/guide/http#security-xsrf-protection
 https://www.npmjs.com/package/helmet
 https://nodesecurity.io/opensource
 https://snyk.io
© DEVintersection 2017. All rights reserved.
https://www.DEVintersection.com
Please use EventsXD to fill out a session evaluation.
Thank you!
Brian Clark _clarkio

More Related Content

PDF
H4x0rs gonna hack
PPTX
Forgotten Security
PPTX
Web Security Jumpstart
PPTX
Web Security Workshop : A Jumpstart
PDF
RoadSec 2017 - Trilha AppSec - APIs Authorization
PDF
Ajax Security
PPTX
OWASP Khartoum - Top 10 A5 - 7th meeting - Cross Site Request Forgery
PPTX
Daniel Crowley - Speaking with Cryptographic Oracles
H4x0rs gonna hack
Forgotten Security
Web Security Jumpstart
Web Security Workshop : A Jumpstart
RoadSec 2017 - Trilha AppSec - APIs Authorization
Ajax Security
OWASP Khartoum - Top 10 A5 - 7th meeting - Cross Site Request Forgery
Daniel Crowley - Speaking with Cryptographic Oracles

Similar to Securing Angular and Node.js Apps in Azure (8)

PDF
Web Application Security: Winning When The Odds Are Against You
PPTX
Security Protection for WordPress
PDF
Beyond The Padlock: New Ideas in Browser Security UI
PPTX
Malicious Input: Angular Has Our Back
PDF
Securing Your BBC Identity
PDF
Os Nightingale
PDF
Let's get evil - threat modelling at scale - Jakub Kałużny
PPTX
Believe It Or Not SSL Attacks
Web Application Security: Winning When The Odds Are Against You
Security Protection for WordPress
Beyond The Padlock: New Ideas in Browser Security UI
Malicious Input: Angular Has Our Back
Securing Your BBC Identity
Os Nightingale
Let's get evil - threat modelling at scale - Jakub Kałużny
Believe It Or Not SSL Attacks
Ad

Recently uploaded (20)

PPTX
Artificial Intelligence
PDF
737-MAX_SRG.pdf student reference guides
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
introduction to high performance computing
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
Design Guidelines and solutions for Plastics parts
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Management Information system : MIS-e-Business Systems.pptx
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Artificial Intelligence
737-MAX_SRG.pdf student reference guides
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Information Storage and Retrieval Techniques Unit III
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
III.4.1.2_The_Space_Environment.p pdffdf
introduction to high performance computing
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
Nature of X-rays, X- Ray Equipment, Fluoroscopy
Categorization of Factors Affecting Classification Algorithms Selection
Fundamentals of Mechanical Engineering.pptx
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
distributed database system" (DDBS) is often used to refer to both the distri...
Design Guidelines and solutions for Plastics parts
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
R24 SURVEYING LAB MANUAL for civil enggi
Management Information system : MIS-e-Business Systems.pptx
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Ad

Securing Angular and Node.js Apps in Azure

Editor's Notes

  • #5: Mountain Icon credit: http://kreavi.com/royyanwijaya Mountain Icon Source: https://www.iconfinder.com/icons/1664206/climb_climbing_mountain_nature_rock_stone_icon#size=128
  • #6: Mountain Icon credit: http://kreavi.com/royyanwijaya Mountain Icon Source: https://www.iconfinder.com/icons/1664206/climb_climbing_mountain_nature_rock_stone_icon#size=128 Boat Icon credit: https://chihabjraoui.com/ Boat Icon Source: https://www.iconfinder.com/icons/1308361/boat_solid_tourism_travel_icon#size=128
  • #7: Mountain Icon credit: http://kreavi.com/royyanwijaya Mountain Icon Source: https://www.iconfinder.com/icons/1664206/climb_climbing_mountain_nature_rock_stone_icon#size=128 Boat Icon credit: https://chihabjraoui.com/ Boat Icon Source: https://www.iconfinder.com/icons/1308361/boat_solid_tourism_travel_icon#size=128
  • #8: Mountain Icon credit: http://kreavi.com/royyanwijaya Mountain Icon Source: https://www.iconfinder.com/icons/1664206/climb_climbing_mountain_nature_rock_stone_icon#size=128 Boat Icon credit: https://chihabjraoui.com/ Boat Icon Source: https://www.iconfinder.com/icons/1308361/boat_solid_tourism_travel_icon#size=128
  • #68: Instruct the browser to turn on security measures Helmet.js (available for Node.js and simple set up) Example headers: XSS-Protection, Frame-Options, HSTS https://helmetjs.github.io/ Mention nsp how it alerts of packages with vulns https://nodesecurity.io/opensource