Is Your App Secure
Chathur anga Bandar a
Who TF is this?
• Engineer by profession, Husband and a Father by decision
• Love Python
• Love and hate JavaScript
• Have 8 odd years of experience doing some coding and shit
• Like CnH2n+1OH, Gin to be specific
What Does
Securing
your app
means?
Best Practices
-
Security Implementations
Use Latest Angular Possible
XSS | XSRF
XSS?
“enables an attacker toinject
client-side script into web pages
viewed by other users”
How toPrevent?
Angular is a Good Guy..
Rather Like an overprotective Girl/Boy Friend
“Angular treats all values as
untrusted bydefault. When a
value is insertedinto the DOM
froma template, via property,
attribute, style and class binding,
orinterpolation,
Angular sanitizes and escapes
untrusted values.”
unsafe value usedin a resource URL context.
Bypassing?
Makesure you sanitize after!
Avoid direct DOMmanipulations
Ahead-of-Time Compilation
“You can compilethe app
in the browser, at runtime,
as the application loads,
usingthe just-in-time (JIT) compiler.
This is the standard development approach
shownthroughout the documentation.
It's great but it has shortcomings.”
“With AOT, the compiler
runs onceat build time
using oneset of libraries;
with JIT it runs every time
forevery user at runtime
using a different set of libraries.”
Faster Rendering
FewerAsync Requests
Smaller Angular frameworkdownload
Detect Template Errors earlier
Better Security
Never use Angular Templating fromServer side
XSRF??
“Cross-Site Request Forgery(CSRF) is an attack
that forcesan end user to executeunwanted
actions ona web application in whichthey're
currentlyauthenticated.”
To prevent this, the application
must ensure that a user
request originates fromthe
real application
Angular's HttpClient has built-in support
for theclient-side half ofthis technique.
CookieXSRFStrategy
Macaroons
Decentralized Authorization
js-macaroon
Python, C, C++,C#,Java
http://macaroons.io/
Thank you

Is your app secure

Editor's Notes

  • #2 Good evening everyone. In this session I’m going to talk about Angular-CLI. Which is the Command Line Interface for Angular 2 development
  • #18 Angular throwing this error because the <iframe src> attribute is a resource URL security context, because an untrusted source can, for example, smuggle in file downloads that unsuspecting users could execute.
  • #29  Faster rendering With AOT, the browser downloads a pre-compiled version of the application. The browser loads executable code so it can render the application immediately, without waiting to compile the app first. Fewer asynchronous requests The compiler inlines external HTML templates and CSS style sheets within the application JavaScript, eliminating separate ajax requests for those source files. Smaller Angular framework download size There's no need to download the Angular compiler if the app is already compiled. The compiler is roughly half of Angular itself, so omitting it dramatically reduces the application payload. Detect template errors earlier The AOT compiler detects and reports template binding errors during the build step before users can see them. Better security AOT compiles HTML templates and components into JavaScript files long before they are served to the client. With no templates to read and no risky client-side HTML or JavaScript evaluation, there are fewer opportunities for injection attacks.
  • #32  CSRF attacks specifically target state-changing requests, not theft of data, since the attacker has no way to see the response to the forged request