SlideShare uma empresa Scribd logo
1 de 49
Baixar para ler offline
STOPEXPECTING
MAGIC
FAIRY DUSTMAKE APPS SECURE BY DESIGN
@zmre zmre
Patrick Walsh
15 Years of Security and Eng. Leadership
CEO IronCore Labs
Story is from the book: Secure by Design
Östgöta Bank Robbery of 1854
@zmre / #bsdc
ÖSTÖTA BANK
@zmre / #bsdc
PICK-PROOF LOCK == FEATURE != SECURE SYSTEM
@zmre / #bsdc
SECURE DESIGN SECURE APP
@zmre / #bsdc
PERFORMANCE
DEVELOPMENT CONCERNS
SCALABILITY
USABILITY
SECURITY
RELIABILITY
MAINTAINABILITY
@zmre / #bsdc
(CONFIDENTIALITY,
INTEGRITY,
AVAILABILITY)
SECURITY CONCERNS
==
@zmre / #bsdc
WHO IS RESPONSIBLE FOR YOUR
SECURITY BUDGET?
@zmre / #bsdc
I T
OWNS
SECURITY
BUDGET
IT’s toolkit: firewall,
anti-virus, intrusion
detection, VPN, etc.
(CISO or CIO)
@zmre / #bsdc
Bugs and security
flaws can’t be fixed
from outside.
A wall without a
gate is a prison. By
design, perimeters
have gates.
<
/>
App Code
@zmre / #bsdc
A perfectly secure
app doesn’t need
a perimeter.
<
/>
App Code
@zmre / #bsdc
But programmers
aren’t perfect.
And no code runs
in isolation. It’s
balanced atop a
fragile chain of
trust.
So we need both.
<
/>
App Code
@zmre / #bsdc
IT

ASSUME APP IS VULNERABLE
DEV

ASSUME NETWORK IS COMPROMISED
@zmre / #bsdc
/ˈprinsəpəl/
noun
1. a rule or belief governing one's
behavior
2. fundamental quality or attribute;
an essence
SECURE DESIGN PRINCIPLES
@zmre / #bsdc
Layers

Defense in Depth
Verify Everything

Complete Mediation
Play The What If Game

Weakest Link
Expect Transparency

Open Design
Distrust Users & Services

Least Privilege
Compartmentalize

Separation of Duties
KISS

Economy of Mechanism
Usability

Psychological Acceptability
Secure by Default

Fail Safe
Monitor

n/a
PATRICK’S SECURE DESIGN PRINCIPLES

OWASP EQUIVALENTS
@zmre / #bsdc
SYLVANIA LIGHTIFY BY OSRAM
@zmre / #bsdc
/smärt/
adjective
1. a quick-witted intelligence
2. clean, neat, and well-dressed
noun
1. intelligence; acumen
2. sharp stinging pain
DEFINITION OF SMART
@zmre / #bsdc
/smärt/
adjective
1. a quick-witted intelligence
2. clean, neat, and well-dressed
noun
1. intelligence; acumen
2. sharp stinging pain
DEFINITION OF SMART
@zmre / #bsdc
SYLVANIA LIGHTIFY BY OSRAM
XSS on username field.
No SSL cert verification.
Malicious wi-fi network name
hack.
Trivial bullshit pre-shared key:
0123456789abcdef.
6 other serious issues.
Research credit: Rapid7@zmre / #bsdc
VERIFY EVERYTHING

COMPLETE MEDIATION
Assume the worst. Check all
inputs. Verify all SSL connections.
Check permissions at each data
access.
Should have verified (or pinned)
SSL cert. Should have a RegEx
validation on username field.
More code.
OVERVIEW CASE STUDY HARD PART
NO EXCUSE
Not to use HTTPS in dev/staging/QA.
@zmre / #bsdc
EXPECT TRANSPARENCY

OPEN DESIGN
Never rely on obscurity to
keep something secure.
Assume all details are public.
Magic pre-shared keys
are bad. Especially weak
and unprotected ones.
Security is easy if obscurity
works. Have to think harder to
make it robust if transparent.
OVERVIEW HARD PARTCASE STUDY
AWS key stolen, server accessed, all customers’ data decrypted and stolen.
@zmre / #bsdc
“customer data was compromised, including
the ability to decrypt encrypted data.”
@zmre / #bsdc
Every user’s secret tokens, passwords, and notes are encrypted
with that user’s unique AES key.
Every user’s AES key is stored on the server and encrypted with
the server’s master AES key.
An attacker with access to the server can trivially decrypt all
secrets. And did.
OneLogin ARCHITECTURE
@zmre / #bsdc
LAYERS

DEFENSE IN DEPTH
Use multiple access
methods, protections
and technologies.
Access to their server (via
AWS keys or otherwise)
gave access to all data.
Can reduce usability,
reusability, and increase
complexity.
OVERVIEW HARD PARTCASE STUDY
PLAY THE WHAT IF GAME

WEAKEST LINK
When designing systems,
always seek the weakest
link and ask, “what if…”
What if a hacker gets
onto a server?
Can be hard to identify
and fix the weakest link.
OVERVIEW HARD PARTCASE STUDY
Who has their router at home?
@zmre / #bsdc
http://a.b.c.d/cgi-bin/;COMMAND
@zmre / #bsdc
http://a.b.c.d/cgi-bin/;killall$IFS'httpd'
“Users who have the option of doing so should strongly
consider discontinuing use of affected devices.”
@zmre / #bsdc
NO AUTOMATIC UPDATES
@zmre / #bsdc
DISTRUST USERS & SERVICES

LEAST PRIVILEGE
Limit permissions and keep
things “need-to-know.” Define
the minimum required
permissions and use those.
Services (especially httpd)
should never run as root.
Giving all services and users
admin privileges makes life
easy, but is a terrible mistake.
OVERVIEW HARD PARTCASE STUDY
MIRAI BOTNET

THE “FUTURE”
@zmre / #bsdc
60 factory default usernames and passwords
Weaponized IoT: IP cameras, home routers, universal
remotes, DVRs, and more.
Used for DDoS attacks.
Took down DynDNS and Brian Krebs.
MIRAI BOTNET
@zmre / #bsdc
SECURE BY DEFAULT

FAIL SAFE
Even fresh out of the box, software
should be secure. That goes
double for failure states. “Fail open”
only when no security implications.
Should have forced a setup
step to set a password before
product would work.
Hard to make secure defaults a
good user experience.
OVERVIEW HARD PARTCASE STUDY
MongoDB
@zmre / #bsdc
Default config: listens on public port
Default config: no access control or authentication
Expectation: users RTFM and set up security.
MongoDB
@zmre / #bsdc
680
MongoDB CONSEQUENCES
TERABYTES
of data
UNSECURED
@zmre / #bsdc
30,000
MongoDB CONSEQUENCES
DATABASES
COMPROMISED & RANSOMED
@zmre / #bsdc
USABILITY

PSYCHOLOGICAL ACCEPTABILITY
Users find ways around
security if it gets in their way.
Like propping open doors.
Mongo used insecure defaults
to make it easy to get started,
but they made it hard to secure
and ultimately failed at usability.
Highly secure systems often
come at the expense of
usability so striking this balance
is difficult.
OVERVIEW HARD PARTCASE STUDY
JEEP
@zmre / #bsdc
COMPARTMENTALIZE

SEPARATION OF DUTIES
Isolate access to data and gate it.
Different systems have their own
gates. Modular and no trust or master
auth. One system, one purpose.
Extreme example where
networked A/V system should
be completely isolated from
driving controls.
More complexity, harder
troubleshooting, dev, QA.
OVERVIEW HARD PARTCASE STUDY
Many crypto algorithms: going back to the nineties.
Support about a dozen different versions
Across architectures and operating systems
Combinatorics of code paths is insanely high
OpenSSL
@zmre / #bsdc
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
0 10 20 30 40
Low
Moderate
High
FREAK, Logjam
HeartBleed, Poodle, Goto Fail
DROWN
OCSP Stapling
ASN1 Bio
Plaintext Recovery
OpenSSL CONSEQUENCES
@zmre / #bsdc
KISS

ECONOMY OF MECHANISM
You must be able to reason about
and understand a system or it can’t
be secure. Legacy is the enemy
when no one understands it and is
afraid to remove it.
OpenSSL is the living example
of this and it’s just getting
worse.
Removing old functionality is
hard to do to customers and
systems. But better for security
and maintainability.
OVERVIEW HARD PARTCASE STUDY
MONITOR
Audit and log everything, and
monitor those logs. Use off-
prem or tamper resistant
mechanisms.
Be ready to detect if your app
is hacked and to have data to
tell you how.
Acting on info and getting to
people who understand it.
OVERVIEW HARD PARTCASE STUDY
Layers

Defense in Depth
Verify Everything

Complete Mediation
Play The What If Game

Weakest Link
Expect Transparency

Open Design
Distrust Users & Services

Least Privilege
Compartmentalize

Separation of Duties
KISS

Economy of Mechanism
Usability

Psychological Acceptability
Secure by Default

Fail Safe
Monitor

n/a
PATRICK’S SECURE DESIGN PRINCIPLES

OWASP EQUIVALENTS
@zmre / #bsdc
Thank You
@zmre
zmre
@ironcorelabs
ironcorelabs.com
Patrick Walsh

Mais conteúdo relacionado

Semelhante a Stop expecting magic fairy dust: Make apps secure by design

How we found a firewall vendor bug using Teleport as a bastion jump host
How we found a firewall vendor bug using Teleport as a bastion jump hostHow we found a firewall vendor bug using Teleport as a bastion jump host
How we found a firewall vendor bug using Teleport as a bastion jump host
Faelix Ltd
 

Semelhante a Stop expecting magic fairy dust: Make apps secure by design (20)

A Stuxnet for Mainframes
A Stuxnet for MainframesA Stuxnet for Mainframes
A Stuxnet for Mainframes
 
The Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDThe Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CD
 
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...
 
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devne...
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devne...Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devne...
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devne...
 
MQTT - IoT - explore & exploit - BSidesTLV 2017 (June 2017)
MQTT - IoT - explore & exploit - BSidesTLV 2017 (June 2017)MQTT - IoT - explore & exploit - BSidesTLV 2017 (June 2017)
MQTT - IoT - explore & exploit - BSidesTLV 2017 (June 2017)
 
Hardening cassandra q2_2016
Hardening cassandra q2_2016Hardening cassandra q2_2016
Hardening cassandra q2_2016
 
Securing Cassandra for Compliance
Securing Cassandra for ComplianceSecuring Cassandra for Compliance
Securing Cassandra for Compliance
 
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and InfraLock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra
 
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
 
MongoDB World 2019: New Encryption Capabilities in MongoDB 4.2: A Deep Dive i...
MongoDB World 2019: New Encryption Capabilities in MongoDB 4.2: A Deep Dive i...MongoDB World 2019: New Encryption Capabilities in MongoDB 4.2: A Deep Dive i...
MongoDB World 2019: New Encryption Capabilities in MongoDB 4.2: A Deep Dive i...
 
TrustLeap Multipass - Unbreakable Passwords For Cloud Services
TrustLeap Multipass - Unbreakable Passwords For Cloud ServicesTrustLeap Multipass - Unbreakable Passwords For Cloud Services
TrustLeap Multipass - Unbreakable Passwords For Cloud Services
 
WebApps vs Blockchain dApps (SmartContracts): tools, vulns and standards
WebApps vs Blockchain dApps (SmartContracts): tools, vulns and standardsWebApps vs Blockchain dApps (SmartContracts): tools, vulns and standards
WebApps vs Blockchain dApps (SmartContracts): tools, vulns and standards
 
Drupal Camp Atlanta 2011 - Drupal Security
Drupal Camp Atlanta 2011 - Drupal SecurityDrupal Camp Atlanta 2011 - Drupal Security
Drupal Camp Atlanta 2011 - Drupal Security
 
Attacking SCADA systems: Story Of SCADASTRANGELOVE
Attacking SCADA systems: Story Of SCADASTRANGELOVEAttacking SCADA systems: Story Of SCADASTRANGELOVE
Attacking SCADA systems: Story Of SCADASTRANGELOVE
 
So you want to be a security expert
So you want to be a security expertSo you want to be a security expert
So you want to be a security expert
 
Q Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - ConjurQ Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - Conjur
 
How we found a firewall vendor bug using Teleport as a bastion jump host
How we found a firewall vendor bug using Teleport as a bastion jump hostHow we found a firewall vendor bug using Teleport as a bastion jump host
How we found a firewall vendor bug using Teleport as a bastion jump host
 
PLMCE - Security and why you need to review yours
PLMCE - Security and why you need to review yoursPLMCE - Security and why you need to review yours
PLMCE - Security and why you need to review yours
 
Droidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensicsDroidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensics
 
SCADA deep inside:protocols and software architecture
SCADA deep inside:protocols and software architectureSCADA deep inside:protocols and software architecture
SCADA deep inside:protocols and software architecture
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Stop expecting magic fairy dust: Make apps secure by design