37
Join the conversation #devseccon Using Adversarial Modelling In Driving Secure Application Development By Pishu Mahtani Application Security Consultant Trustwave SpiderLabs

DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Embed Size (px)

Citation preview

Page 1: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Join the conversation #devseccon

Using Adversarial Modelling In Driving Secure Application Development

By Pishu MahtaniApplication Security ConsultantTrustwave SpiderLabs

Page 2: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Agenda

• Introduction• Overview• Goal of Adversarial Modelling• How do you conduct it?• Case Study• Conclusion• Q & A

Page 3: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Introduction ($whoami)

• Singaporean. Over 12 years of progressive experience in Information Security in various capacities.

• Previous roles as a pentester, auditor, incident response/forensics.• Application Security Consultant @ SpiderLabs, the advanced security team in

Trustwave.• Currently focused on security & privacy of applications, mobile and Internet of

Things (IoT) devices.• Professionally, previously contributed to the development of Center for Internet

Security (CIS) benchmarks and currently contributing to OWASP Mobile Security Testing Guide.

Page 4: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Overview

• Adversarynoun, plural adversaries.

1. a person, group, or force that opposes or attacks; opponent; enemy; foe.2. a person, group, etc., that is an opponent in a contest; contestant.

• Adversarial Modeling• A practice in identifying, learning and emulating the tactics, techniques and procedures

that may be adopted by a malicious user to defeat a system or an organization so as to build defences dedicated to countering such a threat.

• Example: if you design a castle and moat to keep out enemies, but do not realize the enemy has catapults that can breach castle walls from afar, then your castle is wholly ineffective against the threat you face.

Page 5: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Goal Of Adversarial Modelling

• Start thinking like the REALLY bad guy (if you haven’t started doing so).• Learn why they ALWAYS get in.• Ask yourselves these key questions when developing an application.

• What are your ‘Crown Jewels’?• What’s the worst that can happen?• Am I prepared with the correct understanding in developing a defensive and resilient

application that can deter the most motivated adversaries?• Do I want to suffer first and develop a strong and robust application and sleep well later?

• Enable you to start developing applications with an adversarial mindset!

Page 6: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Enterprise Adversarial Modelling Strategies

• Lockheed Martin Cyber Kill Chain• Mandiant APT Attack Lifecycle• DoD Joint Publication 3-13, 2006• MITRE ATT&CK Matrix

Page 7: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Adversary Model

• Adversary Type (AT) • Campaign Objective (CO) • Campaign Vehicle (CV) • Campaign Weapon (CW) • Payload Delivery (PD) • Payload Capabilities (PC)

Page 8: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Adversary Type (AT)

• Script kiddy • Hacktivist• Insider threat • Commercial hacking (for theft of IP, customer data, etc.) • Nation-state cyber warfare

Page 9: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Campaign Objective (CO)

• Account take-over/Identify fraud• Botnet farming• DDOS• Data/Intellectual property theft• Intelligence collection• Data/System destruction• Corporate/political agenda

Page 10: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Campaign Vehicle (CV)

• Spear-phish with link/attachment • Compromised legitimate website • Malicious website • Social engineering • Insider threat • Remote login • Physical media (USB/DVD) • Supply chain

Page 11: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Campaign Weapon (CW)

• IE, Firefox, Chrome exploit • Adobe Flash exploit • Oracle Java exploit • Microsoft Silverlight exploit • Microsoft Office macro • Adobe Reader exploit • User-installed malware • Socially engineered remote access

Page 12: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Payload Delivery (PD)

• Executable file – pre-assembled • Executable file – just-in-time assembly on-host • Process hijacking/ROP • Scripting • DLL injection/side-loading

Page 13: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Payload Capabilities (PC)

• Command and control (Backdoor for remote access)• DDOS • Privilege escalation • Keystroke logging• Screen capture • Ransomware• Network mapping • Lateral movement • Data discovery/archiving/exfiltration/corruption/destruction• System wiping

Page 14: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Characteristics of Adversarial Modelling Strategies

• Heavyweight process with substantial documentation• All encompassing, used in an enterprise level • Includes a very in-depth view of various existing mechanisms that are in place• Time-consuming and lots of work needs to be done

Page 15: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Let’s think about this

• Developers they write code• Faced with time constrains, deadlines…• Code needs to be pushed out ASAP. Deadline in 2 weeks.• If something is very complex, there must be a faster way to do it. • Security comes later (that’s why we have pentesters!), focus on

user experience first.

Page 16: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Reality of Application Development

Pentesters,overtoyou!Findthosebugsforus!Thankyou!

Page 17: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Adversarial Modelling for Applications

Page 18: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

How do you conduct it?

• Create an overview of the application from a high level perspective• Define the all the actors that will use the system• Identify the primary components of the architecture of the system• Develop an transaction based application workflow (high-level) for the application from start to

finish incorporating the different elements of the application• Identify use cases for each individual function that is present in the application• Classify the different type of adversaries (misusers) that may compromise the system• Develop misuse cases for each valid use case in the application• Conduct an analysis at a high level view of the possible threats that can materialize in different

parts of the application. Focus on goal oriented threats.• Adopt a comprehensive application vulnerability classification list

Page 19: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Case Study

• Electronic Procurement Application• Used by the organization to create public tender opportunities for

the eventual procurement of goods and services to the organization• Users: Vendors (External) & Staff (Internal)• Connected to the Internet and thus accessible to everyone

Page 20: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Overview of the application

Page 21: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Actors (Users)

Page 22: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Transaction Based Application Workflow (1)

TenderingPhaseWorkflow

Page 23: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Transaction Based Application Workflow (2)

BidEvaluationWorkflow

Page 24: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Transaction Based Application Workflow (3)

AwardofContractWorkflow

Page 25: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Transaction Based Application Workflow (4)

PurchasingWorkflow

Page 26: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Use cases

• Use cases are a scenario-based technique for requirements elicitation.• Used as a modeling technique to analyze and specify functional requirements

in an early stage. • Provide scenarios about how the system works when the user is interacting,

and help to describe the requirements in a graphical way.• Put simply, a use case denotes as a function that a system should do.• In uses cases, an actor plays the role of the users that interact with the system

Page 27: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Use Cases (Sample)

Page 28: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Attacker Types (Misusers)

Page 29: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Threats (STRIDE)

Page 30: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Taxonomy of Software Vulnerabilities

• MITRE Common Weakness Enumeration (CWE)• Open Web Application Security Project (OWASP) – Top 10• Seven Pernicious Kingdoms (7PK)• Software Fault Pattern Clusters• CMU-SEI CERT Secure Coding Standards

Page 31: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Misuse Cases

• Introduced by Guttorm Sindre and Andreas Opdahl• Misuse cases are denoted as a function that a system should not

allow• In misuse cases, a malicious actor plays the function of the users

and spells out the situations that can break the system • Misuse cases analyze the interaction between applications and the

misusers• Tool for helping to think about your software the same way

attackers do

Page 32: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Misuse Cases (Sample)

Page 33: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Misuse Case Diagram

MisuseCaseDiagram(Victim:ProcurementOfficer)

Page 34: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Misuse Case Table

Page 35: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Conclusion

To Know Your Enemy, You Must Become Your Enemy.

Sun Tzu, The Art of War

Page 36: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Question? & Answer!

Page 37: DevSecCon Asia 2017 Pishu Mahtani: Adversarial Modelling

Join the conversation #devseccon

Thank you to everyone who contributed to the development of this presentation.

Twitter: @pishumahtani