SlideShare a Scribd company logo
Drew DiPalma – Sr. Product Manager, Cloud
Application Security from Day 1
How often do you put the security of your application first?
Traditional Application Structure
Presentation
UI Components
UI Process Components
Business
Business
Workflow
Business
Components
Business
Entities
Application Facade
Data
Data Access
Components
Data Helper
Utilities
Server Agents
Data Sources
Users
External
Systems
Service
Interface
Let’s break down the pieces –
Data
Users Systems
API
Hosting
Data Access
Business Logic / Integrations
What do we trust?
Data
Users Systems
API
Hosting
Data Access
Data
Users Systems
API
Hosting
Data Access
Business Logic / Integrations
Requests from
the browser?
Users? Integrity/Security
Of upstream services
Connection between
the browser and app?
Endpoints between
Services?
Presentation
UI Components
UI Process Components
Business
Business
Workflow
Business
Components
Business
Entities
Application Facade
Data
Data Access
Components
Data Helper
Utilities
Server Agents
Data Sources
Users
External
Systems
Benefits of a platform
Automatic initial
configuration of security
Regular penetration testing
and security audits
Streamlined assessment,
updates, and patches
Strict access and storage
policies
Data
Users Systems
API
Hosting
Data Access
Business Logic / Integrations
QueryAnywhere
Simple, streamlined syntax
for data access, robust
access rules, hosting
included
Build full apps for iOS,
Android, Web, and IoT
Functions
Integrate server-side logic +
microservices + cloud
services
Power apps with Server-side
logic, or enable Data as a
Service with custom APIs.
Triggers
Real-time notifications let your
application functions react in
response to database changes
App responds immediately to
change
Mobile Sync
Automatically synchronizes
data between documents
held locally in MongoDB
Mobile and your backend
database
(Beta)
Stitch provides services to build applications –
• Write generic requests from applications
• Rule-based Access set by Asset/Document
SDKs:
• JavaScript, Android, and iOS SDKs
• Integrated Authentication, Database, and Service
requests
Stitch Rules:
• Fine-grained access rules relating to all aspects of
Stitch
• Access to context from users, request, external
services, functions, etc.
Stitch
(Authentication & Access rules)
Application
(Stitch SDK)
MongoDB
Stitch QueryAnywhere
Stitch Functions
• Stitch is a set of servers that process requests
Requests:
• Single actions for Database or Services
• Or executing a Stitch Function
• Integrated with Stitch’s Rules
Functions:
• Scalable, hosted JavaScript (ES6) Functions
• Integrated with application context
• User, Request, Services, Values, etc.
Stitch Functions
addtoCart calcStats
… sendMail
Application
(Stitch SDK)
MongoDB
Identity & Authenication
Authentication Overview
Stitch provides built-in
Authentication:
§ Anonymous
§ Email/Password
§ API Key
§ Facebook/Google
§ Custom Authentication
Alternatively, use an auth library like
Passport.js, Auth0, or Cognito
§ Authenication links request to identity
§ Users want options for authentication
§ Credential storage introduces risk
§ Auth frameworks provide choice, stability
and scalability
Authentication with Stitch
StitchClientExternal Auth Provider
1 1-2. If using Facebook, Google, or
Custom Auth user completes a
separate auth flow.
3
2
3. Stitch receives the token/
credential and validates it.
4. Stitch returns an access/ refresh
token to the client.
Any Auth triggers associated with the
provider run. On initial log-in a user
may be created.
4
Data Access
Authorization Overview
Stitch provides Rule-based
access for:
§ Read
§ Write
§ Authentication
§ Function/Service calle
Alternatively, use info about the user and
authentication context to assign a role for
server-side access
Alternatives:
§ RBAC – Create roles that users inherit
permissions from
§ ABAC – Center rules around assets within
your application
§ Rules-based – Create a rules that evaluate
It can be easy to start by access choices on a per-call basis, but…
ELB
Stitch Request
Processing
Atlas
Stitch
Metadata
1 Services
The user requests to run a function
and Stitch SDKs check authentication,
refreshing if necessary.
1 Authentication Check
User
Stitch Function Access
ELB
Stitch Request
Processing
Atlas
Stitch
Metadata
2
Services
Stitch requests hit a load balancer
which distributes them across available
capacity within a region.
2 Load Balancer
User
Stitch Function Access
ELB
Stitch Request
Processing
Atlas
Stitch
Metadata
3
Services
Stitch requests are processed by a set
of multi-tenant Go servers. Each
request is run within a goroutine. All
JavaScript is run by Otto.
3 Request Processor
User
Stitch Function Access
ELB
Stitch Request
Processing
Atlas
Stitch
Metadata
4
Services
Stitch coordinates with a metadata
instance used for: application
definition, authentication, end-user
information, and logs. For functions,
Stitch will check if the user has the
permissions to run it.
3 Stitch Metadata
User
Stitch Function Access
ELB
Stitch Core
Request Processing
Atlas
Stitch
Metadata
4
Services
When Stitch works with Atlas it keeps
connections alive and pools whenever
possible. Service interactions are
done over standard HTTPS. All
requests are subject to rules and Atlas
requests have Read, Write, and
Validation rules
4 Service Coordination
User
Stitch Function Access
Data Access in Practice
{
"userid":"101",
"name": "Bernice Herrera",
"employeeId": 53164957,
"zip": 2082,
"position": "IT Manager",
"manager": "Ralph McBride",
"hiringDate": ISODate("2017-05-02"),
"employeeSource": "website ads",
"salary": 205000,
"gender": "female",
"dob": ISODate("1972-10-02"),
"citizenship": "Australia",
"email": "bernice.herrera@example.com",
"empStatus": "active"
}
Sensitive
Information
Rules for Data Access
{
"filters": [{
"name": "ActiveOnly",
"apply_when": {"%%true" : true},
"query": {"empStatus":"active"}
}, … ],
"roles": [{
name: "OwnData"
apply_when: {"userid":"%%user.id"}
"fields": {
"name": {"read": true},
"salary": {"read": true}}
},
"additional fields": {
"read": false,
"write": false
}}, … ],
"schema": {…}
}
Filters
Roles
Rules
Schema
Finding Data
User
db.collection.find()
(plus user info)
db.collection.find({"empStatus": "active"})
[{
userid: "101"
name: …,
salary: …,
empStatus:"active"
},{
userid: "404"
name: …,
salary: …,
empStatus: "terminated",
}]
Results
{
"name": "ActiveOnly",
"apply_when": {"%%true" : true},
"query": {"empStatus":"active"}
}
Filters contain an apply_when and a
Query which is appended to a request
[{
userid: "101"
name: …,
salary: …,
empStatus:"active"
}]
Finding Data
[{ userid: "101"
name: …
salary: …
empStatus: "active"}]
Roles are defined by Match statements,
evaluated per document, and assign a set of
Rules per document
User
{name: "OwnData",
apply_when: {"userid":"%%user.id"},
fields: {…}
}
[{ userid: "101"
name: …
salary: …
empStatus: "active"}]
userid: "101"
Finding Data
User
Each Role has a set of matching Rules that define
read and write access at the field-level
[{ userid: "101"
name: …
salary: …
empStatus: "active"}]
"fields": {
"name" :{ "read": true},
"salary":{"read": true}
},
"additional_fields": {
"read": false,
"write": false
}
userid: "101"
[{ userid: "101"
name: …
salary: …}]
Updating Data
JSON Schema
schema: {
bsonType: "object",
required: ["userid", "email", "name"],
properties: {
userid: {
bsonType: "objectid",
description: "The ID of the Stitch user"
},
email: {
bsonType: "string",
description: "must be a string and is required"
},
name: {
bsonType: "string",
description: "must be a string and is required"
}
}
Schema Validation
schema: {
bsonType: "object",
required: ["userid", "email", "name"],
properties: {
userid: {
bsonType: "objectid",
description: "The ID of the Stitch user"
},
email: {
bsonType: "string",
validate: {"%%true": {
"%function": {
"name": "isValid",
"arguments": ["%%user", "%%this"]}
}},
description: "must be a string and is not required"
},
name: {
bsonType: "bool",
description: "True if the data is a secret"
}
[...]
Streamlining Performance
Performance hinges on assets evaluated in a request.
§ Use Filters to limit the data sent to the server and checked
§ Project out unnecessary fields to skip their evaluation
§ Use Functions run as System to avoid rules when appropriate
Demo
Stitch Roadmap
Rules
• Additional Rules Context
• Function-enhanced Rules
• Caching for Rules evaluation
• Alerts on permissive Rules
Authentication
• UI Elements for Auth
• Function-based Authentication
• Configurable email/password
confirmation flows
• Apple Sign-in support
Development
• Automatic Github Deployment
• Draft deploys for Stitch UI
• Better API Creation Support
• Static Hosting GA
• Additional Watch() support
Stitch has recently announced HIPAA and ISO compliance
What’s Next?
Get started at stitch.mongodb.com
Stitch
§ Tutorial: Modern Web Dev with MongoDB Stitch – 12:45pm Tuesday – Naussau
§ Check out the Stitch POD on Wednesday!
Realm
§ REST-less Mobile Apps – 9:00am Tuesday – Rhinelander South
§ Realm: The Secret Sauce for Better Mobile Apps – 3:00pm Tuesday – Murray Hill
§ Check out the Realm Mobile POD on Wednesday
MongoDB World 2019: Securing Application Data from Day One
Titles on one line looks so much better
First line of copy is not bulleted. Use bold or green font treatment to
place emphasize on content.
§ Bullet one - use Paragraph > Increase List Level to add bullet
§ Bullet two – click Increase List Level again for next level bullet
§ Bullet three – click Increase List Level again for next level bullet

More Related Content

What's hot (20)

PDF
.NET Fest 2017. Anton Moldovan. How do we cook highload microservices at SBTech?
NETFest
 
PPTX
Continuous Integration (& Mr Jenkins)
Ciro Donato Caiazzo
 
PPTX
.NET Fest 2017. Андрей Антиликаторов. Проектирование и разработка приложений ...
NETFest
 
PPTX
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Binary Studio
 
PPTX
Building a document e-signing workflow with Azure Durable Functions
Joonas Westlin
 
PPTX
Azure AD B2C An Introduction - DogFoodCon 2018
Jeremy Gray
 
PPTX
Code Generation for Azure with .net
Marco Parenzan
 
PPTX
Microservice.net by sergey seletsky
Sergey Seletsky
 
PPTX
Running Regulated Workloads on Azure PaaS services (DogFoodCon 2018)
Jeremy Gray
 
PPTX
"Project Tye to Tie .NET Microservices", Oleg Karasik
Fwdays
 
PDF
Programming with Azure Active Directory
Joonas Westlin
 
PDF
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
DotNetCampus
 
PPTX
2 Speed IT powered by Microsoft Azure and Minecraft
Sriram Hariharan
 
PPTX
Azure Functions - Introduction
Venkatesh Narayanan
 
PPTX
Azure Key Vault - Getting Started
Taswar Bhatti
 
PPTX
The bits and pieces of Azure AD B2C
Anton Staykov
 
PDF
Building Scalable Web Applications Using Microservices Architecture and NodeJ...
NodejsFoundation
 
PPTX
.NET Fest 2017. Денис Резник. Исполнение Запроса в SQL Server. Ожидание - Реа...
NETFest
 
ODP
micro services architecture (FrosCon2014)
smancke
 
PPTX
The Rise of Microservices - Containers and Orchestration
MongoDB
 
.NET Fest 2017. Anton Moldovan. How do we cook highload microservices at SBTech?
NETFest
 
Continuous Integration (& Mr Jenkins)
Ciro Donato Caiazzo
 
.NET Fest 2017. Андрей Антиликаторов. Проектирование и разработка приложений ...
NETFest
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Binary Studio
 
Building a document e-signing workflow with Azure Durable Functions
Joonas Westlin
 
Azure AD B2C An Introduction - DogFoodCon 2018
Jeremy Gray
 
Code Generation for Azure with .net
Marco Parenzan
 
Microservice.net by sergey seletsky
Sergey Seletsky
 
Running Regulated Workloads on Azure PaaS services (DogFoodCon 2018)
Jeremy Gray
 
"Project Tye to Tie .NET Microservices", Oleg Karasik
Fwdays
 
Programming with Azure Active Directory
Joonas Westlin
 
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
DotNetCampus
 
2 Speed IT powered by Microsoft Azure and Minecraft
Sriram Hariharan
 
Azure Functions - Introduction
Venkatesh Narayanan
 
Azure Key Vault - Getting Started
Taswar Bhatti
 
The bits and pieces of Azure AD B2C
Anton Staykov
 
Building Scalable Web Applications Using Microservices Architecture and NodeJ...
NodejsFoundation
 
.NET Fest 2017. Денис Резник. Исполнение Запроса в SQL Server. Ожидание - Реа...
NETFest
 
micro services architecture (FrosCon2014)
smancke
 
The Rise of Microservices - Containers and Orchestration
MongoDB
 

Similar to MongoDB World 2019: Securing Application Data from Day One (20)

PPTX
MongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB
 
PPTX
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB
 
PPTX
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
MongoDB
 
PDF
Evolving your Data Access with MongoDB Stitch
MongoDB
 
PPTX
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB
 
PPTX
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
PPTX
Building Your First App with MongoDB Stitch
MongoDB
 
PPTX
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
MongoDB
 
PPTX
MongoDB Stitch Introduction
MongoDB
 
PDF
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
MongoDB
 
PPTX
Serverless Application Development with MongoDB Stitch
Michael Lynn
 
PPTX
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB
 
PPTX
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB
 
PDF
MongoDB.local Berlin: App development in a Serverless World
MongoDB
 
PPTX
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
MongoDB
 
PPTX
MongoDB Stich Overview
MongoDB
 
PPTX
Building Your First App with MongoDB Stitch
MongoDB
 
PDF
MongoDB Mobile
MongoDB
 
PPTX
SH 2 - SES 1 - Stitch_Workshop_TLV.pptx
MongoDB
 
PPTX
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
MongoDB
 
MongoDB World 2018: Evolving your Data Access with MongoDB Stitch
MongoDB
 
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB
 
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
MongoDB
 
Evolving your Data Access with MongoDB Stitch
MongoDB
 
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB
 
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
Building Your First App with MongoDB Stitch
MongoDB
 
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
MongoDB
 
MongoDB Stitch Introduction
MongoDB
 
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
MongoDB
 
Serverless Application Development with MongoDB Stitch
Michael Lynn
 
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB
 
MongoDB.local Berlin: App development in a Serverless World
MongoDB
 
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
MongoDB
 
MongoDB Stich Overview
MongoDB
 
Building Your First App with MongoDB Stitch
MongoDB
 
MongoDB Mobile
MongoDB
 
SH 2 - SES 1 - Stitch_Workshop_TLV.pptx
MongoDB
 
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
MongoDB
 
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 
Ad

Recently uploaded (20)

PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 

MongoDB World 2019: Securing Application Data from Day One

  • 1. Drew DiPalma – Sr. Product Manager, Cloud Application Security from Day 1
  • 2. How often do you put the security of your application first?
  • 3. Traditional Application Structure Presentation UI Components UI Process Components Business Business Workflow Business Components Business Entities Application Facade Data Data Access Components Data Helper Utilities Server Agents Data Sources Users External Systems Service Interface
  • 4. Let’s break down the pieces – Data Users Systems API Hosting Data Access Business Logic / Integrations
  • 5. What do we trust? Data Users Systems API Hosting Data Access Data Users Systems API Hosting Data Access Business Logic / Integrations Requests from the browser? Users? Integrity/Security Of upstream services Connection between the browser and app? Endpoints between Services?
  • 6. Presentation UI Components UI Process Components Business Business Workflow Business Components Business Entities Application Facade Data Data Access Components Data Helper Utilities Server Agents Data Sources Users External Systems Benefits of a platform Automatic initial configuration of security Regular penetration testing and security audits Streamlined assessment, updates, and patches Strict access and storage policies Data Users Systems API Hosting Data Access Business Logic / Integrations
  • 7. QueryAnywhere Simple, streamlined syntax for data access, robust access rules, hosting included Build full apps for iOS, Android, Web, and IoT Functions Integrate server-side logic + microservices + cloud services Power apps with Server-side logic, or enable Data as a Service with custom APIs. Triggers Real-time notifications let your application functions react in response to database changes App responds immediately to change Mobile Sync Automatically synchronizes data between documents held locally in MongoDB Mobile and your backend database (Beta) Stitch provides services to build applications –
  • 8. • Write generic requests from applications • Rule-based Access set by Asset/Document SDKs: • JavaScript, Android, and iOS SDKs • Integrated Authentication, Database, and Service requests Stitch Rules: • Fine-grained access rules relating to all aspects of Stitch • Access to context from users, request, external services, functions, etc. Stitch (Authentication & Access rules) Application (Stitch SDK) MongoDB Stitch QueryAnywhere
  • 9. Stitch Functions • Stitch is a set of servers that process requests Requests: • Single actions for Database or Services • Or executing a Stitch Function • Integrated with Stitch’s Rules Functions: • Scalable, hosted JavaScript (ES6) Functions • Integrated with application context • User, Request, Services, Values, etc. Stitch Functions addtoCart calcStats … sendMail Application (Stitch SDK) MongoDB
  • 11. Authentication Overview Stitch provides built-in Authentication: § Anonymous § Email/Password § API Key § Facebook/Google § Custom Authentication Alternatively, use an auth library like Passport.js, Auth0, or Cognito § Authenication links request to identity § Users want options for authentication § Credential storage introduces risk § Auth frameworks provide choice, stability and scalability
  • 12. Authentication with Stitch StitchClientExternal Auth Provider 1 1-2. If using Facebook, Google, or Custom Auth user completes a separate auth flow. 3 2 3. Stitch receives the token/ credential and validates it. 4. Stitch returns an access/ refresh token to the client. Any Auth triggers associated with the provider run. On initial log-in a user may be created. 4
  • 14. Authorization Overview Stitch provides Rule-based access for: § Read § Write § Authentication § Function/Service calle Alternatively, use info about the user and authentication context to assign a role for server-side access Alternatives: § RBAC – Create roles that users inherit permissions from § ABAC – Center rules around assets within your application § Rules-based – Create a rules that evaluate It can be easy to start by access choices on a per-call basis, but…
  • 15. ELB Stitch Request Processing Atlas Stitch Metadata 1 Services The user requests to run a function and Stitch SDKs check authentication, refreshing if necessary. 1 Authentication Check User Stitch Function Access
  • 16. ELB Stitch Request Processing Atlas Stitch Metadata 2 Services Stitch requests hit a load balancer which distributes them across available capacity within a region. 2 Load Balancer User Stitch Function Access
  • 17. ELB Stitch Request Processing Atlas Stitch Metadata 3 Services Stitch requests are processed by a set of multi-tenant Go servers. Each request is run within a goroutine. All JavaScript is run by Otto. 3 Request Processor User Stitch Function Access
  • 18. ELB Stitch Request Processing Atlas Stitch Metadata 4 Services Stitch coordinates with a metadata instance used for: application definition, authentication, end-user information, and logs. For functions, Stitch will check if the user has the permissions to run it. 3 Stitch Metadata User Stitch Function Access
  • 19. ELB Stitch Core Request Processing Atlas Stitch Metadata 4 Services When Stitch works with Atlas it keeps connections alive and pools whenever possible. Service interactions are done over standard HTTPS. All requests are subject to rules and Atlas requests have Read, Write, and Validation rules 4 Service Coordination User Stitch Function Access
  • 20. Data Access in Practice { "userid":"101", "name": "Bernice Herrera", "employeeId": 53164957, "zip": 2082, "position": "IT Manager", "manager": "Ralph McBride", "hiringDate": ISODate("2017-05-02"), "employeeSource": "website ads", "salary": 205000, "gender": "female", "dob": ISODate("1972-10-02"), "citizenship": "Australia", "email": "[email protected]", "empStatus": "active" } Sensitive Information
  • 21. Rules for Data Access { "filters": [{ "name": "ActiveOnly", "apply_when": {"%%true" : true}, "query": {"empStatus":"active"} }, … ], "roles": [{ name: "OwnData" apply_when: {"userid":"%%user.id"} "fields": { "name": {"read": true}, "salary": {"read": true}} }, "additional fields": { "read": false, "write": false }}, … ], "schema": {…} } Filters Roles Rules Schema
  • 22. Finding Data User db.collection.find() (plus user info) db.collection.find({"empStatus": "active"}) [{ userid: "101" name: …, salary: …, empStatus:"active" },{ userid: "404" name: …, salary: …, empStatus: "terminated", }] Results { "name": "ActiveOnly", "apply_when": {"%%true" : true}, "query": {"empStatus":"active"} } Filters contain an apply_when and a Query which is appended to a request [{ userid: "101" name: …, salary: …, empStatus:"active" }]
  • 23. Finding Data [{ userid: "101" name: … salary: … empStatus: "active"}] Roles are defined by Match statements, evaluated per document, and assign a set of Rules per document User {name: "OwnData", apply_when: {"userid":"%%user.id"}, fields: {…} } [{ userid: "101" name: … salary: … empStatus: "active"}] userid: "101"
  • 24. Finding Data User Each Role has a set of matching Rules that define read and write access at the field-level [{ userid: "101" name: … salary: … empStatus: "active"}] "fields": { "name" :{ "read": true}, "salary":{"read": true} }, "additional_fields": { "read": false, "write": false } userid: "101" [{ userid: "101" name: … salary: …}]
  • 26. JSON Schema schema: { bsonType: "object", required: ["userid", "email", "name"], properties: { userid: { bsonType: "objectid", description: "The ID of the Stitch user" }, email: { bsonType: "string", description: "must be a string and is required" }, name: { bsonType: "string", description: "must be a string and is required" } }
  • 27. Schema Validation schema: { bsonType: "object", required: ["userid", "email", "name"], properties: { userid: { bsonType: "objectid", description: "The ID of the Stitch user" }, email: { bsonType: "string", validate: {"%%true": { "%function": { "name": "isValid", "arguments": ["%%user", "%%this"]} }}, description: "must be a string and is not required" }, name: { bsonType: "bool", description: "True if the data is a secret" } [...]
  • 28. Streamlining Performance Performance hinges on assets evaluated in a request. § Use Filters to limit the data sent to the server and checked § Project out unnecessary fields to skip their evaluation § Use Functions run as System to avoid rules when appropriate
  • 29. Demo
  • 30. Stitch Roadmap Rules • Additional Rules Context • Function-enhanced Rules • Caching for Rules evaluation • Alerts on permissive Rules Authentication • UI Elements for Auth • Function-based Authentication • Configurable email/password confirmation flows • Apple Sign-in support Development • Automatic Github Deployment • Draft deploys for Stitch UI • Better API Creation Support • Static Hosting GA • Additional Watch() support Stitch has recently announced HIPAA and ISO compliance
  • 31. What’s Next? Get started at stitch.mongodb.com Stitch § Tutorial: Modern Web Dev with MongoDB Stitch – 12:45pm Tuesday – Naussau § Check out the Stitch POD on Wednesday! Realm § REST-less Mobile Apps – 9:00am Tuesday – Rhinelander South § Realm: The Secret Sauce for Better Mobile Apps – 3:00pm Tuesday – Murray Hill § Check out the Realm Mobile POD on Wednesday
  • 33. Titles on one line looks so much better First line of copy is not bulleted. Use bold or green font treatment to place emphasize on content. § Bullet one - use Paragraph > Increase List Level to add bullet § Bullet two – click Increase List Level again for next level bullet § Bullet three – click Increase List Level again for next level bullet