79
An Approach to Application Security For beginners #vodqa

An approach to app security - For beginners

  • Upload
    vodqa

  • View
    51

  • Download
    2

Embed Size (px)

Citation preview

Page 1: An approach to app security - For beginners

An Approach to Application Security

For beginners

#vodqa

Page 2: An approach to app security - For beginners

Hi!

Page 3: An approach to app security - For beginners

Why are you here?

Page 4: An approach to app security - For beginners

Reference: https://www.owasp.org

Identify Security

Objectives

Application Overview

Decompose Application

Identify Threats

Identify Vulnerabilities

Page 5: An approach to app security - For beginners

AgendaIntroduction and case study

High-level threat modeling

Application threat modeling

Vulnerability Testing

References

Page 6: An approach to app security - For beginners

Case study

Page 7: An approach to app security - For beginners

BackgroundHave food industry background

Known network of food critics

Business and Investment numbers

Start-up

Venture capital investment: ~$10mn

Number of employees: 50

Hired contractors for development

Application strategyFood critics write and read reviews

In the future, plans to extend ads to hotels for revenue

Critical assetsCustomers (food critics)

Credibility

Page 8: An approach to app security - For beginners

Reference: https://www.owasp.org

Identify Security

Objectives

Application Overview

Decompose Application

Identify Threats

Identify Vulnerabilities

Page 9: An approach to app security - For beginners

Mockups

Page 10: An approach to app security - For beginners

Mockups

Page 11: An approach to app security - For beginners

Mockups

Page 12: An approach to app security - For beginners

Reference: https://www.owasp.org

Identify Security

Objectives

Application Overview

Decompose Application

Identify Threats

Identify Vulnerabilities

Page 13: An approach to app security - For beginners

Phases in our delivery lifecycleInception (Business Feasibility Study and Requirement Gathering)

Design thinking and tech analysis

Development

Testing

Release

Page 14: An approach to app security - For beginners

Inception

Page 15: An approach to app security - For beginners

ParticipantsBusiness stakeholders : CTO, CFO, Tech architect

Delivery team: BA, Tech lead, QA, Tech architect, developers (optional)

Page 16: An approach to app security - For beginners

High-level Threat modelingStructured, shared understanding of what could go wrong

Incorporate security thinking throughout our software delivery

Vocabulary to record and talk about possible threats

Understand the security threats that your client is facing

Understand the stakeholders’ concerns

Page 17: An approach to app security - For beginners

ASK!

Page 18: An approach to app security - For beginners

Split up in delivery teams

Page 19: An approach to app security - For beginners

What are the

services and people

that are a

part of YourFeedback’s ecosystem?

Page 20: An approach to app security - For beginners

Employees?

Hotels?

App users?

Government?

Cloud systems?

Page 21: An approach to app security - For beginners

ActorsPeople and services within a system

Page 22: An approach to app security - For beginners

But first, why protect anything?

What

does YourFeedback app want

to protect?

Page 23: An approach to app security - For beginners

CIA TriadConfidentiality

IntegrityAvailability

Page 24: An approach to app security - For beginners

What

does YourFeedback app want

to protect?

Page 25: An approach to app security - For beginners

Reviews?

Customer information?

Logs?

Server?

Page 26: An approach to app security - For beginners

AssetDevice, data or service that needs to be protected

Page 27: An approach to app security - For beginners

Who

might

attack

YourFeeback’s assets?

Page 28: An approach to app security - For beginners

Competitors?

Application users?

Firewall?

Hacktivists?

Government?

Other app in the same network?

Page 29: An approach to app security - For beginners

AttackerPeople/services that intentionally, or unintentionally, compromise an asset

Page 30: An approach to app security - For beginners

Reference: https://www.owasp.org

Identify Security

Objectives

Application Overview

Decompose Application

Identify Threats

Identify Vulnerabilities

Page 31: An approach to app security - For beginners

What are we protecting our assets against?

Page 32: An approach to app security - For beginners

ThreatA cause of a possible incident that could lead an attacker to attack an asset

Page 33: An approach to app security - For beginners

AttackerAsset Threat

Page 34: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 35: An approach to app security - For beginners

Identifying threats and risk

Page 36: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 37: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 38: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 39: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 40: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 41: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 42: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 43: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 44: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 45: An approach to app security - For beginners

Assets● Reputation, credibility

● Investors Info

● Application

● Servers

● Code

● Reviews

● Customer data

● Audit/financial data

● Investment

● Application / Server Logs

Attackers● Business competitors

● Application user

● Hotel owners

● Investor’s competitors

● Hotel’s competitors

● Hackers

● Firewall

● Delivery team

● Employees

● Hacktivists

(Sample List)

Page 46: An approach to app security - For beginners

More terminologiesMitigation : Ways to counterbalance a threat

Vulnerability : An un-mitigated or insufficiently mitigated threat

Risk : An onset of a threat on a vulnerability

Threat Vulnerability

Mitigation

Page 47: An approach to app security - For beginners

Risk Magic QuadrantImpact

Probability

Page 48: An approach to app security - For beginners

Our Risk Magic Quadrant (examples)

Application User giving unfair reviews

Application user misusing customer data

Hotel Owner changing reviews in favor of themselves

Business competitors bringing down Reputation and Credibility

Hackers bring down reputation and credibility

Probability

Impact

Firewall brings down the server

Business competitor’s catching hold of investment detailsEmployees disclosing

customer data

Page 49: An approach to app security - For beginners

Design thinkingTech analysis

Page 50: An approach to app security - For beginners

ParticipantsBusiness stakeholders : Tech team (if distributed team)

Delivery team: BA, Tech lead, QA, Tech architect, developers

Page 51: An approach to app security - For beginners

Application Threat ModelingStructured, shared understanding of what could go wrong in identified threats

Incorporate security thinking into user stories and designThreat awareness for the delivery teamUnderstand protection mechanisms

But first, what ways can attackers attack in?

Page 52: An approach to app security - For beginners

Example - STRIDESpoofing

Tampering

Repudiation

Information Disclosure

Denial of Service

Elevation of privileges

Page 53: An approach to app security - For beginners

Application Threat Modeling : Attack TreesOpen safe

Break openLearn combinationPick lock

Find written combination

Get combination from someone

Look into emails/chatsLook into personal diary/notebooks Social engg PhishingCheck notes in laptop

Goal

Ways

Page 54: An approach to app security - For beginners

What will bring Our business down?

Lose Customers

Lose Credibility

Targeted Marketing - By CompetitorsUnrelated/Unfair reviews

Competitors release attractive features before YourFeedback.comApplication is not usable.

Application is not performing as expected.

Illegitimate/Offensive content posted on the site.

Business owners have lost personal credibility.

Has been proved to be hacked at least once.

Page 55: An approach to app security - For beginners

Lets see how one of those goals can be achieved by Attacker

Page 56: An approach to app security - For beginners

Attack threats for you to pick upDisplay unreliable reviews

Make application unusable for users

Offensive/illegitimate content posted on the sites

Targeted marketing (by competitors/hotel owners)

Competitors release attractive features before us

Application is not performing as expected for business

Page 57: An approach to app security - For beginners

Make the App not usable by user

Make the App not usable

Existing users are not able to Login

Redirect to another website

Bring the server down

Change Password

Delete User

Creating too much load

Sending too many asynchronous calls

Hide content on page load

Stop users from viewing/reading content

of website

Show popup on page load

Getting access to DB server

Show pop up on any click

Make website/browser too slow

Access the DB through application

Creating load on Database

Show irrelevant content on top of

actual page content

Running too many scripts on page

load

Page 58: An approach to app security - For beginners

Display unreliable reviews

Display unreliable reviews

Login as existing member

Phishing

Change directly in database

Bypass login

Social engineering

Find password

Add new member

Bug in login

Get Password

Post wrong reviews

Page 59: An approach to app security - For beginners

Offensive/illegitimate content posted on the sites

Offensive/illegitimate content posted on the sites

Offensive content in the review section

Run a script with offensive images

Login as existing user and post review

Add a new user and post review

Add offensive content and image in the information PDF

Load illegitimate image on page load

Get password

Bug in login

Get access to DB server

Page 60: An approach to app security - For beginners

Targeted marketing (by competitors/hotel owners)

Targeted marketing

Capture attention by Ads

Call /email customers directly Get Customer Info

Posts Add in our feedback App

Get customers to visit competitor’s sites

Social Engineering Get Customer Info

Page 61: An approach to app security - For beginners

Competitors market new attractive features before Yourfeedback.com

Competitors market new features before Yourfeedback.com

Get access to staging or pre prod environment

Get access to project management system

Accessing development branch to get active code

Page 62: An approach to app security - For beginners

Reference: https://www.owasp.org

Identify Security

Objectives

Application Overview

Decompose Application

Identify Threats

Identify Vulnerabilities

Page 63: An approach to app security - For beginners

DevelopmentTesting

Page 64: An approach to app security - For beginners

Vulnerability IdentificationVulnerability is an unmitigated or insufficiently mitigated threat

Page 65: An approach to app security - For beginners

OWASP Top 10 Vulnerabilities : A Start

Page 66: An approach to app security - For beginners

SQL InjectionServer-side attack

Misuses interpreter to attack database

Different types of SQL injections: Error-based, Blind etc.

Page 67: An approach to app security - For beginners

Cross-Site Scripting (XSS)A type of injection

Client-side attack

Misusing powers of HTML, Javascript, CSS etc.

Types:

Reflective

Persistent

Page 68: An approach to app security - For beginners

Reflective XSS

Reflective XSS

Page 69: An approach to app security - For beginners

Persistent XSS

Persistent XSS

Page 70: An approach to app security - For beginners

Path TraversalAccess or execute command on restricted directories or files

Outside the web root folder

a.k.a. ‘dot-dot-slash’, ‘directory traversal’, ‘directory climbing’ or ‘backtracking’

Page 71: An approach to app security - For beginners

Demo

Page 72: An approach to app security - For beginners

Let’s test

Make the App not usable

Existing users are not able to Login

Redirect to another website

Bring the server down

Change Password

Delete User

Creating too much load

Sending too many Asynchronous Calls

Hide actual page content on Page

load

Stop users from viewing/reading content

of website

Show popup on Page load

Getting access to DB server

Show pop up on any click

Make website/browser too slow

Access the DB from the application

Creating load on Database

Show irrelevant content on top of

actual page content

Running too many scripts on page load

Access the DB from the applicationChange Password

Delete User

Hide actual page content on Page

load

Show popup on Page load

Redirect to another website

Page 73: An approach to app security - For beginners

Display unreliable reviews

Display unreliable reviews

Login as existing member

Phishing

Change directly in database

Bypass login

Social engineering

Find password

Add new member

Bug in login

Get Password

Post wrong reviews

Page 74: An approach to app security - For beginners

Competitors market new attractive features before Yourfeedback.com

Competitors market new features before Yourfeedback.com

Get access to staging or pre prod environment

Get access to project management system

Accessing development branch to get active

code

Page 75: An approach to app security - For beginners

Reference: https://www.owasp.org

Identify Security

Objectives

Application Overview

Decompose Application

Identify Threats

Identify Vulnerabilities

Page 76: An approach to app security - For beginners

Mitigations/SuggestionsSQL Injections :

Input Validation, like use of ORM.

Limit Database Permission

Configure Error Reporting

Path Traversal :

Use of search function instead of appending from URL.

XSS

CSP - Content Security Policy

Use AutoEscape

Input validation

Page 77: An approach to app security - For beginners

Tool ExamplesZed Attack Proxy

BurpSuite

IronWASP

Fiddler

TamperData

Websecurify

XSS Me, SQL Inject Me etc.

Page 78: An approach to app security - For beginners

ReferencesVulnerable application: https://github.com/jaydeepc/vul_feedback_app

Fixed application: https://github.com/jaydeepc/non_vul_python_app

https://www.thoughtworks.com/insights/blog/appsec101-welcoming-all-roles-world-security

https://www.owasp.org

Page 79: An approach to app security - For beginners

Thank you!Harinee Muralinath ([email protected]) , Jaydeep Chakraborty ([email protected])

Nagesh Kumar, Shraddha Suman, Navya Bailkeri, Fathima Harris, Pallipuspa Samal, Astha Jaiswal, Hitesh Sharma

Presenters:

Volunteers: