SlideShare a Scribd company logo
BOSTON 10-11 SEPT 2018
ADVANCED MOBILE SECURITY AUTOMATION IN
YOUR SDLC WITH BDD TESTS
DAVIDE CIOCCIA
BOSTON 10-11 SEPT 2018
#whoami
• Davide Cioccia
Security Engineer @ ING
Co-Founder @ IoTsec.eu
• Mobile Security Lead
• OWASP MSTG contributor
• IoT, IIoT breaker
• @davide107
• davidecioccia.com
BOSTON 10-11 SEPT 2018
Agenda
• Background
• BDD introduction
• Mobile BDD security tests
• Workshop
BOSTON 10-11 SEPT 2018
Background
BOSTON 10-11 SEPT 2018
Why mobile security matters?
BOSTON 10-11 SEPT 2018
The mistake
WRITE_EXTERNAL_STORAGE
BOSTON 10-11 SEPT 2018
Why do developers make mistakes?
• We need it ASAP
• Agile environment requires multiple release per day/week
• Security requirements are not followed
• Threat model not in place
• Rely on SAST tools for vulnerability detection
• Security testing is not embedded in the CI/CD
• Security is too late in the SDLC
BOSTON 10-11 SEPT 2018
Security teams challenges
• Provide security at the DevOps speed
• Have developers understand security
• Detect vulnerabilities in early stage
• Have Pentesters focus on “serious” stuff
BOSTON 10-11 SEPT 2018
Mobile security challenges
• Different Operating Systems
• Client side testing
• Different apps (native, hybrid, web)
• Different languages (poor SAST tool support)
• Different security controls
BOSTON 10-11 SEPT 2018
Improve the testing
• Security must be an accelerator and not a step back
• Extend the SDLC with security integration tests
BOSTON 10-11 SEPT 2018
BDD Security Tests
BOSTON 10-11 SEPT 2018
Testing in Agile
BDD
ATDD
TDD
BOSTON 10-11 SEPT 2018
What do we solve with BDD
BOSTON 10-11 SEPT 2018
Why BDD in security
• BDD offers more precise guidance on organizing the conversation between developers,
testers and security experts
• Notations originating in the BDD approach, in particular the given-when-then canvas,
are closer to everyday language and have a shallower learning curve
• Tools targeting a BDD approach generally afford the automatic generation of technical
and end user documentation from BDD “specifications"
BOSTON 10-11 SEPT 2018
BDD steps
BOSTON 10-11 SEPT 2018
Cucumber as engine for BDD
Features + Step definitions
Java
C#
Python
Ruby
JavaScript
…more
Gherkin
BOSTON 10-11 SEPT 2018
BDD test example
Business facing
Technology facing
BOSTON 10-11 SEPT 2018
Mobile BDD security
BOSTON 10-11 SEPT 2018
OWASP MSTG to BDD
Test scripts
.features
steps
BOSTON 10-11 SEPT 2018
Process
Test scripts APK
.features
steps.rb
Emulator / Device
BOSTON 10-11 SEPT 2018
Full process in CI/CD
Security Requirements
Threat modelling
(abuse case generation)
Implement BDD standard
security tests
Implement BDD application
specific security tests
Test against acceptance
environment
MSTG Test casesMASVS Checklist
Manual PT
Identify what can be
automated
Requirements Design Code Build Test Release Deploy Operate
BOSTON 10-11 SEPT 2018
Attack surface
22
Application layer OS and architecture layer Network layer
AUTHENTICATION
ACCESS CONTROLS
SESSION MANAGEMENT
ENCRYPTION
OBFUSCATION
INPUT & ERROR VALIDATION
DATA PROTECTION
MORE
PERMISSION MODEL
SERVICES
LIBRARIES
RESIDUAL DATA
MORE
CERTIFICATE PINNING
ENCRYPTION
MITM
URL WHITELISTING
WEB SERVER ASSESSMENT
NETWORK SCAN
MORE
INTERACTION WITH OS
BOSTON 10-11 SEPT 2018
What are we going to do
• Automate MASVS using Calabash, Gherkin and Ruby
• Identify what we can automate from the MSTG
• Extend UI/UX testing framework to create security integration tests
• Write BDD tests
BOSTON 10-11 SEPT 2018
Why
• MASVS is becoming the standard de facto for security testing
• MSTG is the technical sister (thanks Sven Sneiler and Bernard Muller)
• All the checks are currently performed manually from pentesters, security
engineers, developers,
• ..or integrating SAST tools in the pipeline. But SAST is not too smart!
• With BDD security is pushed left in the SDLC
BOSTON 10-11 SEPT 2018
Benefits
• Increase security maturity of the teams
• Perform security integration tests on every build improves the code
• Simplify pentesterts life
• Decrease TTR (Time To Release) and enhance security
• Translate threats in tests
• Have a ready-to-use documentation
BOSTON 10-11 SEPT 2018
WORKSHOP
BOSTON 10-11 SEPT 2018
Setup
• Dockerfile
• Calabash
• Android SDK
• Android tools
• JDK
• Genymotion for Personal use (FREE)
• Emulate any Android device
• IDE / Text Editor of your choice
• Recommended: Sublime with Gherkin syntax plugin
BOSTON 10-11 SEPT 2018
Outcome
• .features
• A Feature File is an entry point to the Cucumber tests. This is a file
where you will describe your tests in Descriptive language (Like
English).
BOSTON 10-11 SEPT 2018
Steps
• security_steps.rb
• Implementation of the Gherkin syntax
• Ruby function with parameters in input
• We are going to use the android tools and to perform analysis on the
device
BOSTON 10-11 SEPT 2018
.features
Feature: Logs must not contain sensitive information
@first_scenario
Scenario: As a user I insert my sensitive information and I
check that they are not reflected in the logfiles
Given I clean "all" the application log
BOSTON 10-11 SEPT 2018
security_steps.rb
Given /^I clean "(.*)" the application log$/ do |log|
%x(adb logcat -b #{log} -c)
end
BOSTON 10-11 SEPT 2018
Clone the GitHub repository
https://github.com/ing-bank/bdd-mobile-security-automation-framework
BOSTON 10-11 SEPT 2018
Let’s do some work
BOSTON 10-11 SEPT 2018
Thank you

More Related Content

PDF
Attacking and defending GraphQL applications: a hands-on approach
PDF
Avoiding GraphQL insecurities with OWASP SKF - OWASP HU meetup
PDF
Improving Automated Tests with Fluent Assertions
PPTX
Aleksei Dremin - Application Security Pipeline - phdays9
PDF
Building Observable Infrastructure and Code
PDF
stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...
PPTX
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
PDF
Containers and Kubernetes without limits
Attacking and defending GraphQL applications: a hands-on approach
Avoiding GraphQL insecurities with OWASP SKF - OWASP HU meetup
Improving Automated Tests with Fluent Assertions
Aleksei Dremin - Application Security Pipeline - phdays9
Building Observable Infrastructure and Code
stackconf 2021 | Embracing change: Policy-as-code for Kubernetes with OPA and...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Containers and Kubernetes without limits

What's hot (20)

PDF
From Developer to Data Scientist - Gaines Kergosien
PPTX
Protecting Applications with Lambda@Edge and OAuth
PDF
Building advanced Chats Bots and Voice Interactive Assistants - Stève Sfartz ...
PPTX
Best practice recommendations for utilizing open source software (from a lega...
PPTX
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
PPTX
SPOTLIGHT IGNITE (10 MINUTES): THE FUTURE OF DEVELOPER TOOLS: FROM STACKOVERF...
PDF
E bpf and profilers
PDF
Can i service this from my raspberry pi
PPTX
Design and Evolution of APIs in Microservice Architecture
PDF
Gitlab for JS developers (BrisJs meetup, 2019-Apr-01)
PDF
Europace's journey to InnerSource
PPTX
Generic Test Automation Architecture
PDF
Reactive Microservices with Quarkus
PDF
OWASP Workshop: Docker Image Security Best Practices by Liran Tal - January 2020
PPTX
.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali...
PDF
Continuous Security for GitOps
PPTX
C++ Webinar "Why Should You Learn C++ in 2021-22?"
PPT
Distributed Tracing Velocity2016
PDF
Your Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
PDF
Kubernetes für Workstations Edge und IoT Devices
From Developer to Data Scientist - Gaines Kergosien
Protecting Applications with Lambda@Edge and OAuth
Building advanced Chats Bots and Voice Interactive Assistants - Stève Sfartz ...
Best practice recommendations for utilizing open source software (from a lega...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
SPOTLIGHT IGNITE (10 MINUTES): THE FUTURE OF DEVELOPER TOOLS: FROM STACKOVERF...
E bpf and profilers
Can i service this from my raspberry pi
Design and Evolution of APIs in Microservice Architecture
Gitlab for JS developers (BrisJs meetup, 2019-Apr-01)
Europace's journey to InnerSource
Generic Test Automation Architecture
Reactive Microservices with Quarkus
OWASP Workshop: Docker Image Security Best Practices by Liran Tal - January 2020
.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali...
Continuous Security for GitOps
C++ Webinar "Why Should You Learn C++ in 2021-22?"
Distributed Tracing Velocity2016
Your Application Deserves Better than Kubernetes Ingress: Istio vs. Kubernetes
Kubernetes für Workstations Edge und IoT Devices
Ad

Similar to DevSecCon Boston2018 - advanced mobile security automation with bdd (20)

PPTX
DevSecCon Boston 2018: Securing the Automated Pipeline: A Tale of Navigating ...
PPTX
Maintainability Sogeti Qx Day 2020
PDF
Embed Spark calling SDK in Your App - Olivier PROFFIT - Cisco Live Berlin 2017
PDF
Software Bill of Materials - Accelerating Your Secure Embedded Development.pdf
 
PPTX
Sogeti Java Meetup - How to ensure your code is maintainable
PDF
Zephyr-Overview-20230124.pdf
PPTX
DevSecCon Boston 2018: Automated DevSecOps infrastructure deployment: recipes...
PDF
SACON - Automating SecOps (Murray Goldschmidt)
PDF
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 1
PPTX
devops ppt for hjs jsdjhjd hsdbusinees.pptx
PPTX
ABN AMRO DevSecOps Journey
PDF
Container security within Cisco Container Platform
PDF
Codecoon - A technical Case Study
PDF
Philipe Riand - Building Social Applications using the Social Business Toolki...
DOC
Srikanth_PILLI_CV_latest
PPTX
Studio 5000® Application Code Manager: Introduction and Demonstration
PDF
Mobile SDK: Considerations & Best Practices
PPTX
CDK - The next big thing - Quang Phuong
PPTX
Luca, Marius Alexandru „BitDefender apsaugos sprendimai organizacijoms“ (Rumu...
PDF
HITCON Defense Summit 2019 - 從 SAST 談持續式資安測試
DevSecCon Boston 2018: Securing the Automated Pipeline: A Tale of Navigating ...
Maintainability Sogeti Qx Day 2020
Embed Spark calling SDK in Your App - Olivier PROFFIT - Cisco Live Berlin 2017
Software Bill of Materials - Accelerating Your Secure Embedded Development.pdf
 
Sogeti Java Meetup - How to ensure your code is maintainable
Zephyr-Overview-20230124.pdf
DevSecCon Boston 2018: Automated DevSecOps infrastructure deployment: recipes...
SACON - Automating SecOps (Murray Goldschmidt)
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 1
devops ppt for hjs jsdjhjd hsdbusinees.pptx
ABN AMRO DevSecOps Journey
Container security within Cisco Container Platform
Codecoon - A technical Case Study
Philipe Riand - Building Social Applications using the Social Business Toolki...
Srikanth_PILLI_CV_latest
Studio 5000® Application Code Manager: Introduction and Demonstration
Mobile SDK: Considerations & Best Practices
CDK - The next big thing - Quang Phuong
Luca, Marius Alexandru „BitDefender apsaugos sprendimai organizacijoms“ (Rumu...
HITCON Defense Summit 2019 - 從 SAST 談持續式資安測試
Ad

More from Davide Cioccia (8)

PPTX
Black Hat Europe 2018 Arsenal Tools - Squatm3
PPTX
BH ASIA 2019 Arsenal Tools - Squatm3 and Squatm3gator
PPTX
BDD Mobile Security Testing (OWASP AppSec Bucharest 2017)
DOCX
NAS Botnet Revealed - Mining Bitcoin
PDF
Inside TorrentLocker (Cryptolocker) Malware C&C Server
PDF
One shot eight banks
PDF
Windows Mobile 6.5: Client for a multimedia conferencing platform
PDF
A statistical framework to evaluate the "diversity" impact against Advanced P...
Black Hat Europe 2018 Arsenal Tools - Squatm3
BH ASIA 2019 Arsenal Tools - Squatm3 and Squatm3gator
BDD Mobile Security Testing (OWASP AppSec Bucharest 2017)
NAS Botnet Revealed - Mining Bitcoin
Inside TorrentLocker (Cryptolocker) Malware C&C Server
One shot eight banks
Windows Mobile 6.5: Client for a multimedia conferencing platform
A statistical framework to evaluate the "diversity" impact against Advanced P...

Recently uploaded (20)

PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPT
tcp ip networks nd ip layering assotred slides
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
artificial intelligence overview of it and more
PDF
The Internet -By the Numbers, Sri Lanka Edition
DOCX
Unit-3 cyber security network security of internet system
PPTX
Introduction to Information and Communication Technology
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
522797556-Unit-2-Temperature-measurement-1-1.pptx
tcp ip networks nd ip layering assotred slides
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
introduction about ICD -10 & ICD-11 ppt.pptx
Design_with_Watersergyerge45hrbgre4top (1).ppt
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Paper PDF World Game (s) Great Redesign.pdf
SAP Ariba Sourcing PPT for learning material
artificial intelligence overview of it and more
The Internet -By the Numbers, Sri Lanka Edition
Unit-3 cyber security network security of internet system
Introduction to Information and Communication Technology
WebRTC in SignalWire - troubleshooting media negotiation
Job_Card_System_Styled_lorem_ipsum_.pptx
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
Decoding a Decade: 10 Years of Applied CTI Discipline
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...

DevSecCon Boston2018 - advanced mobile security automation with bdd

  • 1. BOSTON 10-11 SEPT 2018 ADVANCED MOBILE SECURITY AUTOMATION IN YOUR SDLC WITH BDD TESTS DAVIDE CIOCCIA
  • 2. BOSTON 10-11 SEPT 2018 #whoami • Davide Cioccia Security Engineer @ ING Co-Founder @ IoTsec.eu • Mobile Security Lead • OWASP MSTG contributor • IoT, IIoT breaker • @davide107 • davidecioccia.com
  • 3. BOSTON 10-11 SEPT 2018 Agenda • Background • BDD introduction • Mobile BDD security tests • Workshop
  • 4. BOSTON 10-11 SEPT 2018 Background
  • 5. BOSTON 10-11 SEPT 2018 Why mobile security matters?
  • 6. BOSTON 10-11 SEPT 2018 The mistake WRITE_EXTERNAL_STORAGE
  • 7. BOSTON 10-11 SEPT 2018 Why do developers make mistakes? • We need it ASAP • Agile environment requires multiple release per day/week • Security requirements are not followed • Threat model not in place • Rely on SAST tools for vulnerability detection • Security testing is not embedded in the CI/CD • Security is too late in the SDLC
  • 8. BOSTON 10-11 SEPT 2018 Security teams challenges • Provide security at the DevOps speed • Have developers understand security • Detect vulnerabilities in early stage • Have Pentesters focus on “serious” stuff
  • 9. BOSTON 10-11 SEPT 2018 Mobile security challenges • Different Operating Systems • Client side testing • Different apps (native, hybrid, web) • Different languages (poor SAST tool support) • Different security controls
  • 10. BOSTON 10-11 SEPT 2018 Improve the testing • Security must be an accelerator and not a step back • Extend the SDLC with security integration tests
  • 11. BOSTON 10-11 SEPT 2018 BDD Security Tests
  • 12. BOSTON 10-11 SEPT 2018 Testing in Agile BDD ATDD TDD
  • 13. BOSTON 10-11 SEPT 2018 What do we solve with BDD
  • 14. BOSTON 10-11 SEPT 2018 Why BDD in security • BDD offers more precise guidance on organizing the conversation between developers, testers and security experts • Notations originating in the BDD approach, in particular the given-when-then canvas, are closer to everyday language and have a shallower learning curve • Tools targeting a BDD approach generally afford the automatic generation of technical and end user documentation from BDD “specifications"
  • 15. BOSTON 10-11 SEPT 2018 BDD steps
  • 16. BOSTON 10-11 SEPT 2018 Cucumber as engine for BDD Features + Step definitions Java C# Python Ruby JavaScript …more Gherkin
  • 17. BOSTON 10-11 SEPT 2018 BDD test example Business facing Technology facing
  • 18. BOSTON 10-11 SEPT 2018 Mobile BDD security
  • 19. BOSTON 10-11 SEPT 2018 OWASP MSTG to BDD Test scripts .features steps
  • 20. BOSTON 10-11 SEPT 2018 Process Test scripts APK .features steps.rb Emulator / Device
  • 21. BOSTON 10-11 SEPT 2018 Full process in CI/CD Security Requirements Threat modelling (abuse case generation) Implement BDD standard security tests Implement BDD application specific security tests Test against acceptance environment MSTG Test casesMASVS Checklist Manual PT Identify what can be automated Requirements Design Code Build Test Release Deploy Operate
  • 22. BOSTON 10-11 SEPT 2018 Attack surface 22 Application layer OS and architecture layer Network layer AUTHENTICATION ACCESS CONTROLS SESSION MANAGEMENT ENCRYPTION OBFUSCATION INPUT & ERROR VALIDATION DATA PROTECTION MORE PERMISSION MODEL SERVICES LIBRARIES RESIDUAL DATA MORE CERTIFICATE PINNING ENCRYPTION MITM URL WHITELISTING WEB SERVER ASSESSMENT NETWORK SCAN MORE INTERACTION WITH OS
  • 23. BOSTON 10-11 SEPT 2018 What are we going to do • Automate MASVS using Calabash, Gherkin and Ruby • Identify what we can automate from the MSTG • Extend UI/UX testing framework to create security integration tests • Write BDD tests
  • 24. BOSTON 10-11 SEPT 2018 Why • MASVS is becoming the standard de facto for security testing • MSTG is the technical sister (thanks Sven Sneiler and Bernard Muller) • All the checks are currently performed manually from pentesters, security engineers, developers, • ..or integrating SAST tools in the pipeline. But SAST is not too smart! • With BDD security is pushed left in the SDLC
  • 25. BOSTON 10-11 SEPT 2018 Benefits • Increase security maturity of the teams • Perform security integration tests on every build improves the code • Simplify pentesterts life • Decrease TTR (Time To Release) and enhance security • Translate threats in tests • Have a ready-to-use documentation
  • 26. BOSTON 10-11 SEPT 2018 WORKSHOP
  • 27. BOSTON 10-11 SEPT 2018 Setup • Dockerfile • Calabash • Android SDK • Android tools • JDK • Genymotion for Personal use (FREE) • Emulate any Android device • IDE / Text Editor of your choice • Recommended: Sublime with Gherkin syntax plugin
  • 28. BOSTON 10-11 SEPT 2018 Outcome • .features • A Feature File is an entry point to the Cucumber tests. This is a file where you will describe your tests in Descriptive language (Like English).
  • 29. BOSTON 10-11 SEPT 2018 Steps • security_steps.rb • Implementation of the Gherkin syntax • Ruby function with parameters in input • We are going to use the android tools and to perform analysis on the device
  • 30. BOSTON 10-11 SEPT 2018 .features Feature: Logs must not contain sensitive information @first_scenario Scenario: As a user I insert my sensitive information and I check that they are not reflected in the logfiles Given I clean "all" the application log
  • 31. BOSTON 10-11 SEPT 2018 security_steps.rb Given /^I clean "(.*)" the application log$/ do |log| %x(adb logcat -b #{log} -c) end
  • 32. BOSTON 10-11 SEPT 2018 Clone the GitHub repository https://github.com/ing-bank/bdd-mobile-security-automation-framework
  • 33. BOSTON 10-11 SEPT 2018 Let’s do some work
  • 34. BOSTON 10-11 SEPT 2018 Thank you

Editor's Notes

  • #3: Today we are going to touch three topics: Security, Mobile and Automation
  • #12: Because this workshop is heavily focus on how to implement BDD test, the questions come along: how many of you use BDD tests in their company? How many of you have used BDD at least once? how many of you know what BDD is? Great so let’s introduce BDD
  • #13: We are in the era of Agile right, this is the time where teams release once ,twice, three , four five six times per second right? But they also need to test at least once twice three times etc. How do DevOps test? As you know we have 3 main different type of testing
  • #15: Avoid or limits the gap between development and security