SlideShare a Scribd company logo
1 of 82
Download to read offline
David Rook

Agnitio
Security code review swiss army knife

BruCON, Belgium




Wednesday, 21 September 2011
if (slide == introduction)
                 System.out.println("I’m David Rook");

 • Application Security Lead, Realex Payments, Ireland
     CISSP, CISA, GCIH and many other acronyms



 • Security Ninja (@securityninja)

 • Speaker at developer and security conferences

 • Microsoft Developer Security MVP

 • Developed and released Agnitio




Wednesday, 21 September 2011
Agenda


 • What is static analysis?

 • Agnitio: security code review Swiss army knife

 • Agnitio and mobile apps




Wednesday, 21 September 2011
Static analysis


 • What do I mean by static analysis?

       • A review of source code without executing the application
       • Can be either manual or automated through one or more tools
       • Human and/or tools analysing application source code




Wednesday, 21 September 2011
Static analysis


 • Wetware or software?

       • Humans are needed with or without static analysis tools
       • The best thing about humans is that they aren’t software




Wednesday, 21 September 2011
Static analysis


 • Wetware or software?

       • Humans are needed with or without static analysis tools
       • The best thing about humans is that they aren’t software
       • The worst thing about humans is that they are humans




Wednesday, 21 September 2011
Static analysis


 • Wetware or software?




 http://www.ibm.com/developerworks/rational/library/11-proven-practices-for-peer-review/index.html?sf1100063=1




Wednesday, 21 September 2011
Static analysis


 • Wetware or software?




 http://www.ibm.com/developerworks/rational/library/11-proven-practices-for-peer-review/index.html?sf1100063=1




Wednesday, 21 September 2011
Static analysis


 • Wetware or software?

       • Tools can cover more code in less time than a human
       • The best thing about software is that it isn’t human




Wednesday, 21 September 2011
Static analysis


 • Wetware or software?

       • Tools can cover more code in less time than a human
       • The best thing about software is that it isn’t human
       • The worst thing about software is that it’s software




Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Agnitio


 • What is Agnitio?

       • Tool to help with manual static analysis
       • Checklist based with reviewer & developer guidance
       • Produces audit trails & enforces integrity checks
       • Single tool for security code review reports & metrics




Wednesday, 21 September 2011
Agnitio


 • What is Agnitio?

       • C# open source application, GPLv3 license
       • Four different versions in 10 months
       • 10,000+ downloads from users in over 100 countries
       • Used by SMEs, consulting firms and companies of the NYSE




Wednesday, 21 September 2011
Agnitio


 • Checklists?

       • An application for doing checklist reviews? *yawn* how boring!
       • Checklists are for n00bs! I don't need a checklist to review code!
       • I beg to differ, would you say Doctors and Pilots are n00bs?




Wednesday, 21 September 2011
Wednesday, 21 September 2011
Wednesday, 21 September 2011
Agnitio




Wednesday, 21 September 2011
Agnitio




Wednesday, 21 September 2011
Agnitio


 • Checklists?

       • Do you use checklists for your source code reviews?
       • What's the worst that could happen if you don’t?




Wednesday, 21 September 2011
Ariane 5 flight 501




Wednesday, 21 September 2011
Wednesday, 21 September 2011
Ariane 5 flight 501



  L_M_BV_32 := TBD.T_ENTIER_32S ((1.0/C_M_LSB_BV) * G_M_INFO_DERIVE(T_ALG.E_BV));

  if L_M_BV_32 > 32767 then
          P_M_DERIVE(T_ALG.E_BV) := 16#7FFF#;
  elsif L_M_BV_32 < -32768 then
          P_M_DERIVE(T_ALG.E_BV) := 16#8000#;
  else
          P_M_DERIVE(T_ALG.E_BV) := UC_16S_EN_16NS(TDB.T_ENTIER_16S(L_M_BV_32);
  end if;

  P_M_DERIVE(T_ALG.E_BH) := UC_16S_EN_16NS (TDB.T_ENTIER_16S ((1.0/C_M_LSB_BH) *
  G_M_INFO_DERIVE(T_ALG.E_BH)));




 http://moscova.inria.fr/~levy/talks/10enslongo/enslongo.pdf




Wednesday, 21 September 2011
Therac-25




Wednesday, 21 September 2011
Mars Climate Orbiter




Wednesday, 21 September 2011
Mars Climate Orbiter




Wednesday, 21 September 2011
Agnitio


 • Checklists?

       • Do you use checklist for your source code reviews?
       • What's the worst that could happen if you don’t?
       • Four people dead and over €700m of equipment destroyed
       • Checklists can be useful to pilots, doctors and code reviewers!




Wednesday, 21 September 2011
Agnitio


 • So, why did I develop Agnitio?

       • I love using checklists for security code reviews!




Wednesday, 21 September 2011
Agnitio


 • So, why did I develop Agnitio?

       • I love using checklists for security code reviews!
       • Even if your process is good it might not be smart




Wednesday, 21 September 2011
Agnitio


 • So, why did I develop Agnitio?

       • I love using checklists for security code reviews!
       • Even if your process is good it might not be smart
       • Is your review process really repeatable and easy to audit?




Wednesday, 21 September 2011
Agnitio


 • So, why did I develop Agnitio?

       • I love using checklists for security code reviews!
       • Even if your process is good it might not be smart
       • Is your review process really repeatable and easy to audit?
       • How about producing metrics, useful reports & integrity checks?




Wednesday, 21 September 2011
Agnitio


 • So, why did I develop Agnitio?

       • I love using checklists for security code reviews!
       • Even if your process is good it might not be smart
       • Is your review process really repeatable and easy to audit?
       • How about producing metrics, useful reports & integrity checks?
       • No? That’s why I developed Agnitio!




Wednesday, 21 September 2011
Why did I develop Agnitio?


 • Demonstration: application profiles




Wednesday, 21 September 2011
Why did I develop Agnitio?


 • Demonstration: security code reviews




Wednesday, 21 September 2011
Why did I develop Agnitio?


 • Demonstration: security code review reports




Wednesday, 21 September 2011
Why did I develop Agnitio?


 • Demonstration: application security metrics




Wednesday, 21 September 2011
Why did I develop Agnitio?


 • Demonstration: customise your Agnitio installation




Wednesday, 21 September 2011
Agnitio hands on


 • Create a PHP rule




Wednesday, 21 September 2011
Agnitio hands on


 • Analyse the PHP application




Wednesday, 21 September 2011
Mobile apps and Agnitio


 • Mobile apps can create value for a business

       • Businesses can benefit from having a mobile presence
       • Innovative apps for customers using mobile functionality




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio




Wednesday, 21 September 2011
Mobile apps and Agnitio


 • Mobile apps can create value for a business

       • Businesses can benefit from having a mobile presence
       • Innovative apps for customers using mobile functionality
       • Most developers have not been trained to write secure code




Wednesday, 21 September 2011
Mobile apps and Agnitio


 • Mobile apps can create value for a business

       • Businesses can benefit from having a mobile presence
       • Innovative apps for customers using mobile functionality
       • Most developers have not been trained to write secure code
       • Not trained to write secure code, new to mobile development......




Wednesday, 21 September 2011
Mobile apps and Agnitio


 • Mobile apps can create value for a business

       • Businesses can benefit from having a mobile presence
       • Innovative apps for customers using mobile functionality
       • Most developers have not been trained to write secure code
       • Not trained to write secure code, new to mobile development......
       • What could possibly go wrong?




Wednesday, 21 September 2011
There’s an app for that




Wednesday, 21 September 2011
There’s an app for that




Wednesday, 21 September 2011
There’s an app for that


 • Lets assume the predicted growth happens

       • 1,000,000+ apps by the end of 2011
       • How many have been developed with security in mind?
       • The answer isn’t “none” but it won’t be many, ≤1%?




Wednesday, 21 September 2011
There’s an app for that


 • Lets assume the predicted growth happens

       • 1,000,000+ apps by the end of 2011
       • How many have been developed with security in mind?
       • The answer isn’t “none” but it won’t be many, ≤1%?
       • But none of us are surprised by this are we?




Wednesday, 21 September 2011
There’s an app for that


 • Lets assume the predicted growth happens

       • 1,000,000+ apps by the end of 2011
       • How many have been developed with security in mind?
       • The answer isn’t “none” but it won’t be many, ≤1%?
       • But none of us are surprised by this are we?
       • I want us to try and find the insecure apps with Agnitio




Wednesday, 21 September 2011
Mobile app security issues


 • Data in transit and at rest
 • Dangerous inputs




Wednesday, 21 September 2011
There’s an app for that




Wednesday, 21 September 2011
Android Source Code


 package com.denimgroup.android.training.pandemobium.stocktrader;

 import   android.app.Activity;
 import   android.os.Bundle;
 import   android.util.Log;
 import   android.webkit.WebView;

 public class TipsActivity extends Activity {

      private WebView wvTips;

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
     
    Log.i("TipsActivity", " Loading up browser page to display stock tips");
     
         super.onCreate(savedInstanceState);
         setContentView(R.layout.tips);
         
         wvTips = (WebView)findViewById(R.id.wv_tips);
         wvTips.loadUrl(getString(R.string.tip_list));
     }
 }



Wednesday, 21 September 2011
AndroidManifest.xml


 • A good place to start your security code reviews!

       • Applications and System code have an AndroidManifest file
       • Declares the package name, a unique identifier for the app
       • Defines the permissions needed by the application
       • Defines app activities and intents
       • Compressed XML file in the .apk




Wednesday, 21 September 2011
Agnitio hands on


 • AndroidManifest.xml - before and after




Wednesday, 21 September 2011
Android Static Analysis


 •    Context.openFileOutput()
 •    Context.openOrCreateDatabase()
 •    rawQuery()
 •    URLConnection()
 •    HttpResponse()
 •    MODE_PRIVATE
 •    MODE_WORLD_READABLE
 •    MODE_WORLD_WRITABLE



Wednesday, 21 September 2011
Agnitio hands on


 • Analyse the Android Pandemobium app




Wednesday, 21 September 2011
iOS Source Code


 #import   "TipViewController.h"
 #import   "StockDatabase.h"
 #import   "/usr/include/sqlite3.h"
 #import   "ASIHTTPRequest.h"
 #import   "ASIFormDataRequest.h"

 @implementation TipViewController

 @synthesize keyboardToolbar;

 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
 {
     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
     if (self) {
         // Custom initialization
         stockDB = [[StockDatabase alloc] init];
     }
     return self;
 }




Wednesday, 21 September 2011
iOS Static Analysis


 •    writeToFile()
 •    openURL()
 •    sqlite3_prepare()
 •    NSFILE




Wednesday, 21 September 2011
Agnitio hands on


 • Automated analysis of Android .apk files




Wednesday, 21 September 2011
Using Agnitio


 • How you can use Agnitio in your reviews

       • Download Agnitio from Source Forge
       • Focus security code reviews on root causes not vulnerabilities
       • Use your language/s in all code examples and checklist items
       • Use Agnitio to conduct principles based security code reviews




Wednesday, 21 September 2011
My USB key........


 • I have some things on my USB key you might want

       • .apk files of popular and “suspicious” Android apps
       • System.img file for v2.2 emulator to enable the marketplace
       • My slides from this workshop
       • You have to trust my USB key is safe to use ;-)




Wednesday, 21 September 2011
Do you want to work with me?


 • I’m expanding our application security team

       • 1x Application Security Analyst
       • 2x Junior Application Security Analyst
       • Speak to me today or tomorrow!
       • jobs@realexpayments.com




Wednesday, 21 September 2011
www.securityninja.co.uk
   http://sourceforge.net/projects/agnitiotool/

                   @securityninja

                   /realexninja

                   /securityninja

                   /realexninja



Wednesday, 21 September 2011
QUESTIONS?
            www.securityninja.co.uk
   http://sourceforge.net/projects/agnitiotool/

                   @securityninja

                   /realexninja

                   /securityninja

                   /realexninja



Wednesday, 21 September 2011

More Related Content

Viewers also liked (8)

OWASP Birmingham - Mobile Application Security
OWASP Birmingham - Mobile Application SecurityOWASP Birmingham - Mobile Application Security
OWASP Birmingham - Mobile Application Security
 
Flevum, 14 maart 2013. Zou dat cloud nu ook wat voor mij zijn
Flevum, 14 maart 2013. Zou dat cloud nu ook wat voor mij zijn Flevum, 14 maart 2013. Zou dat cloud nu ook wat voor mij zijn
Flevum, 14 maart 2013. Zou dat cloud nu ook wat voor mij zijn
 
Slimmer werken dames opbezoek 20 jan 2011
Slimmer werken dames opbezoek 20 jan 2011Slimmer werken dames opbezoek 20 jan 2011
Slimmer werken dames opbezoek 20 jan 2011
 
Hoe kom ik van e-mail af? 16 april 2010
Hoe kom ik van e-mail af? 16 april 2010Hoe kom ik van e-mail af? 16 april 2010
Hoe kom ik van e-mail af? 16 april 2010
 
Marketing high-tech products in emerging markets : the differential impacts ...
Marketing high-tech products in emerging markets :  the differential impacts ...Marketing high-tech products in emerging markets :  the differential impacts ...
Marketing high-tech products in emerging markets : the differential impacts ...
 
Using dematel to analyze the quality characteristics of mobile
Using dematel to analyze the quality characteristics of mobileUsing dematel to analyze the quality characteristics of mobile
Using dematel to analyze the quality characteristics of mobile
 
Strategisch gebruik van Linkedin
Strategisch gebruik van LinkedinStrategisch gebruik van Linkedin
Strategisch gebruik van Linkedin
 
Customizing iso 9126 quality model for evaluation of b2 b applications
Customizing iso 9126 quality model for evaluation of b2 b applicationsCustomizing iso 9126 quality model for evaluation of b2 b applications
Customizing iso 9126 quality model for evaluation of b2 b applications
 

Similar to BruCON Agnitio Workshop

SecurityBSides las vegas - Agnitio
SecurityBSides las vegas - AgnitioSecurityBSides las vegas - Agnitio
SecurityBSides las vegas - Agnitio
Security Ninja
 

Similar to BruCON Agnitio Workshop (20)

SecurityBSides las vegas - Agnitio
SecurityBSides las vegas - AgnitioSecurityBSides las vegas - Agnitio
SecurityBSides las vegas - Agnitio
 
Agile Mëtteg - June 2011
Agile Mëtteg - June 2011Agile Mëtteg - June 2011
Agile Mëtteg - June 2011
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Single pane of glass monitoring tool myth or reality
Single pane of glass monitoring tool   myth or realitySingle pane of glass monitoring tool   myth or reality
Single pane of glass monitoring tool myth or reality
 
Agile Mobile Testing Workshop
Agile Mobile Testing WorkshopAgile Mobile Testing Workshop
Agile Mobile Testing Workshop
 
Enhancing Developer Productivity with Code Forensics
Enhancing Developer Productivity with Code ForensicsEnhancing Developer Productivity with Code Forensics
Enhancing Developer Productivity with Code Forensics
 
A year of SonarQube and TFS/VSTS
A year of SonarQube and TFS/VSTSA year of SonarQube and TFS/VSTS
A year of SonarQube and TFS/VSTS
 
Benefits of using native automation tooling for mobile application testing.pptx
Benefits of using native automation tooling for mobile application testing.pptxBenefits of using native automation tooling for mobile application testing.pptx
Benefits of using native automation tooling for mobile application testing.pptx
 
Single Pane of Glass Monitoring Tool - Is it a Myth or a Reality
Single Pane of Glass Monitoring Tool - Is it a Myth or a RealitySingle Pane of Glass Monitoring Tool - Is it a Myth or a Reality
Single Pane of Glass Monitoring Tool - Is it a Myth or a Reality
 
Developing for Windows 8 based devices
Developing for Windows 8 based devicesDeveloping for Windows 8 based devices
Developing for Windows 8 based devices
 
Lean Startup: Insider's Story
Lean Startup: Insider's StoryLean Startup: Insider's Story
Lean Startup: Insider's Story
 
PNSQC 2021 January 28 Culture Jam
PNSQC 2021 January 28 Culture JamPNSQC 2021 January 28 Culture Jam
PNSQC 2021 January 28 Culture Jam
 
How to Embed Codeless Test Automation Into DevOps
How to Embed Codeless Test Automation Into DevOpsHow to Embed Codeless Test Automation Into DevOps
How to Embed Codeless Test Automation Into DevOps
 
Building a design system with (p)react
Building a design system with (p)reactBuilding a design system with (p)react
Building a design system with (p)react
 
Building High Quality Android Applications
Building High Quality Android ApplicationsBuilding High Quality Android Applications
Building High Quality Android Applications
 
AppSec Pipelines and Event based Security
AppSec Pipelines and Event based SecurityAppSec Pipelines and Event based Security
AppSec Pipelines and Event based Security
 
Scale14x Patterns and Practices for Open Source Project Success
Scale14x Patterns and Practices for Open Source Project SuccessScale14x Patterns and Practices for Open Source Project Success
Scale14x Patterns and Practices for Open Source Project Success
 
My Application is Slow | Best Practices for Troubleshooting and Prevention
My Application is Slow | Best Practices for Troubleshooting and PreventionMy Application is Slow | Best Practices for Troubleshooting and Prevention
My Application is Slow | Best Practices for Troubleshooting and Prevention
 
Sugsa mobile ux_april 2013
Sugsa mobile ux_april 2013Sugsa mobile ux_april 2013
Sugsa mobile ux_april 2013
 
Evolving Operational Maturity in a Startup Environment
Evolving Operational Maturity in a Startup EnvironmentEvolving Operational Maturity in a Startup Environment
Evolving Operational Maturity in a Startup Environment
 

More from Security Ninja

Owasp App Sec Ireland Windows Phone 7 Security
Owasp App Sec Ireland Windows Phone 7 SecurityOwasp App Sec Ireland Windows Phone 7 Security
Owasp App Sec Ireland Windows Phone 7 Security
Security Ninja
 

More from Security Ninja (16)

Hack in Paris 2013
Hack in Paris 2013Hack in Paris 2013
Hack in Paris 2013
 
The Realex Payments Application Story
The Realex Payments Application StoryThe Realex Payments Application Story
The Realex Payments Application Story
 
Owasp App Sec Ireland Windows Phone 7 Security
Owasp App Sec Ireland Windows Phone 7 SecurityOwasp App Sec Ireland Windows Phone 7 Security
Owasp App Sec Ireland Windows Phone 7 Security
 
SecurityBSides London - windows phone 7
SecurityBSides London - windows phone 7SecurityBSides London - windows phone 7
SecurityBSides London - windows phone 7
 
Hack in Paris - Agnitio
Hack in Paris - AgnitioHack in Paris - Agnitio
Hack in Paris - Agnitio
 
SecurityBSides London - Jedi mind tricks for building application security pr...
SecurityBSides London - Jedi mind tricks for building application security pr...SecurityBSides London - Jedi mind tricks for building application security pr...
SecurityBSides London - Jedi mind tricks for building application security pr...
 
SecurityBSides London - Agnitio: it's static analysis but not as we know it
SecurityBSides London - Agnitio: it's static analysis but not as we know itSecurityBSides London - Agnitio: it's static analysis but not as we know it
SecurityBSides London - Agnitio: it's static analysis but not as we know it
 
The Principles of Secure Development - Epicenter Dublin
The Principles of Secure Development - Epicenter DublinThe Principles of Secure Development - Epicenter Dublin
The Principles of Secure Development - Epicenter Dublin
 
Application security and PCI DSS
Application security and PCI DSSApplication security and PCI DSS
Application security and PCI DSS
 
The Security Risks of Web 2.0 - DEF CON 17
The Security Risks of Web 2.0 - DEF CON 17The Security Risks of Web 2.0 - DEF CON 17
The Security Risks of Web 2.0 - DEF CON 17
 
Developing secure web applications
Developing secure web applicationsDeveloping secure web applications
Developing secure web applications
 
Injecting simplicity not SQL RSA Europe 2010
Injecting simplicity not SQL RSA Europe 2010Injecting simplicity not SQL RSA Europe 2010
Injecting simplicity not SQL RSA Europe 2010
 
Injecting simplicity not SQL BSides Las Vegas 2010
Injecting simplicity not SQL BSides Las Vegas 2010Injecting simplicity not SQL BSides Las Vegas 2010
Injecting simplicity not SQL BSides Las Vegas 2010
 
The Principles of Secure Development - BSides Las Vegas 2009
The Principles of Secure Development - BSides Las Vegas 2009The Principles of Secure Development - BSides Las Vegas 2009
The Principles of Secure Development - BSides Las Vegas 2009
 
The Principles of Secure Development
The Principles of Secure DevelopmentThe Principles of Secure Development
The Principles of Secure Development
 
Owasp talk-november-08
Owasp talk-november-08Owasp talk-november-08
Owasp talk-november-08
 

Recently uploaded

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

BruCON Agnitio Workshop

  • 1. David Rook Agnitio Security code review swiss army knife BruCON, Belgium Wednesday, 21 September 2011
  • 2. if (slide == introduction) System.out.println("I’m David Rook"); • Application Security Lead, Realex Payments, Ireland CISSP, CISA, GCIH and many other acronyms • Security Ninja (@securityninja) • Speaker at developer and security conferences • Microsoft Developer Security MVP • Developed and released Agnitio Wednesday, 21 September 2011
  • 3. Agenda • What is static analysis? • Agnitio: security code review Swiss army knife • Agnitio and mobile apps Wednesday, 21 September 2011
  • 4. Static analysis • What do I mean by static analysis? • A review of source code without executing the application • Can be either manual or automated through one or more tools • Human and/or tools analysing application source code Wednesday, 21 September 2011
  • 5. Static analysis • Wetware or software? • Humans are needed with or without static analysis tools • The best thing about humans is that they aren’t software Wednesday, 21 September 2011
  • 6. Static analysis • Wetware or software? • Humans are needed with or without static analysis tools • The best thing about humans is that they aren’t software • The worst thing about humans is that they are humans Wednesday, 21 September 2011
  • 7. Static analysis • Wetware or software? http://www.ibm.com/developerworks/rational/library/11-proven-practices-for-peer-review/index.html?sf1100063=1 Wednesday, 21 September 2011
  • 8. Static analysis • Wetware or software? http://www.ibm.com/developerworks/rational/library/11-proven-practices-for-peer-review/index.html?sf1100063=1 Wednesday, 21 September 2011
  • 9. Static analysis • Wetware or software? • Tools can cover more code in less time than a human • The best thing about software is that it isn’t human Wednesday, 21 September 2011
  • 10. Static analysis • Wetware or software? • Tools can cover more code in less time than a human • The best thing about software is that it isn’t human • The worst thing about software is that it’s software Wednesday, 21 September 2011
  • 21. Agnitio • What is Agnitio? • Tool to help with manual static analysis • Checklist based with reviewer & developer guidance • Produces audit trails & enforces integrity checks • Single tool for security code review reports & metrics Wednesday, 21 September 2011
  • 22. Agnitio • What is Agnitio? • C# open source application, GPLv3 license • Four different versions in 10 months • 10,000+ downloads from users in over 100 countries • Used by SMEs, consulting firms and companies of the NYSE Wednesday, 21 September 2011
  • 23. Agnitio • Checklists? • An application for doing checklist reviews? *yawn* how boring! • Checklists are for n00bs! I don't need a checklist to review code! • I beg to differ, would you say Doctors and Pilots are n00bs? Wednesday, 21 September 2011
  • 28. Agnitio • Checklists? • Do you use checklists for your source code reviews? • What's the worst that could happen if you don’t? Wednesday, 21 September 2011
  • 29. Ariane 5 flight 501 Wednesday, 21 September 2011
  • 31. Ariane 5 flight 501 L_M_BV_32 := TBD.T_ENTIER_32S ((1.0/C_M_LSB_BV) * G_M_INFO_DERIVE(T_ALG.E_BV)); if L_M_BV_32 > 32767 then P_M_DERIVE(T_ALG.E_BV) := 16#7FFF#; elsif L_M_BV_32 < -32768 then P_M_DERIVE(T_ALG.E_BV) := 16#8000#; else P_M_DERIVE(T_ALG.E_BV) := UC_16S_EN_16NS(TDB.T_ENTIER_16S(L_M_BV_32); end if; P_M_DERIVE(T_ALG.E_BH) := UC_16S_EN_16NS (TDB.T_ENTIER_16S ((1.0/C_M_LSB_BH) * G_M_INFO_DERIVE(T_ALG.E_BH))); http://moscova.inria.fr/~levy/talks/10enslongo/enslongo.pdf Wednesday, 21 September 2011
  • 33. Mars Climate Orbiter Wednesday, 21 September 2011
  • 34. Mars Climate Orbiter Wednesday, 21 September 2011
  • 35. Agnitio • Checklists? • Do you use checklist for your source code reviews? • What's the worst that could happen if you don’t? • Four people dead and over €700m of equipment destroyed • Checklists can be useful to pilots, doctors and code reviewers! Wednesday, 21 September 2011
  • 36. Agnitio • So, why did I develop Agnitio? • I love using checklists for security code reviews! Wednesday, 21 September 2011
  • 37. Agnitio • So, why did I develop Agnitio? • I love using checklists for security code reviews! • Even if your process is good it might not be smart Wednesday, 21 September 2011
  • 38. Agnitio • So, why did I develop Agnitio? • I love using checklists for security code reviews! • Even if your process is good it might not be smart • Is your review process really repeatable and easy to audit? Wednesday, 21 September 2011
  • 39. Agnitio • So, why did I develop Agnitio? • I love using checklists for security code reviews! • Even if your process is good it might not be smart • Is your review process really repeatable and easy to audit? • How about producing metrics, useful reports & integrity checks? Wednesday, 21 September 2011
  • 40. Agnitio • So, why did I develop Agnitio? • I love using checklists for security code reviews! • Even if your process is good it might not be smart • Is your review process really repeatable and easy to audit? • How about producing metrics, useful reports & integrity checks? • No? That’s why I developed Agnitio! Wednesday, 21 September 2011
  • 41. Why did I develop Agnitio? • Demonstration: application profiles Wednesday, 21 September 2011
  • 42. Why did I develop Agnitio? • Demonstration: security code reviews Wednesday, 21 September 2011
  • 43. Why did I develop Agnitio? • Demonstration: security code review reports Wednesday, 21 September 2011
  • 44. Why did I develop Agnitio? • Demonstration: application security metrics Wednesday, 21 September 2011
  • 45. Why did I develop Agnitio? • Demonstration: customise your Agnitio installation Wednesday, 21 September 2011
  • 46. Agnitio hands on • Create a PHP rule Wednesday, 21 September 2011
  • 47. Agnitio hands on • Analyse the PHP application Wednesday, 21 September 2011
  • 48. Mobile apps and Agnitio • Mobile apps can create value for a business • Businesses can benefit from having a mobile presence • Innovative apps for customers using mobile functionality Wednesday, 21 September 2011
  • 49. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 50. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 51. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 52. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 53. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 54. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 55. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 56. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 57. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 58. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 59. Mobile apps and Agnitio Wednesday, 21 September 2011
  • 60. Mobile apps and Agnitio • Mobile apps can create value for a business • Businesses can benefit from having a mobile presence • Innovative apps for customers using mobile functionality • Most developers have not been trained to write secure code Wednesday, 21 September 2011
  • 61. Mobile apps and Agnitio • Mobile apps can create value for a business • Businesses can benefit from having a mobile presence • Innovative apps for customers using mobile functionality • Most developers have not been trained to write secure code • Not trained to write secure code, new to mobile development...... Wednesday, 21 September 2011
  • 62. Mobile apps and Agnitio • Mobile apps can create value for a business • Businesses can benefit from having a mobile presence • Innovative apps for customers using mobile functionality • Most developers have not been trained to write secure code • Not trained to write secure code, new to mobile development...... • What could possibly go wrong? Wednesday, 21 September 2011
  • 63. There’s an app for that Wednesday, 21 September 2011
  • 64. There’s an app for that Wednesday, 21 September 2011
  • 65. There’s an app for that • Lets assume the predicted growth happens • 1,000,000+ apps by the end of 2011 • How many have been developed with security in mind? • The answer isn’t “none” but it won’t be many, ≤1%? Wednesday, 21 September 2011
  • 66. There’s an app for that • Lets assume the predicted growth happens • 1,000,000+ apps by the end of 2011 • How many have been developed with security in mind? • The answer isn’t “none” but it won’t be many, ≤1%? • But none of us are surprised by this are we? Wednesday, 21 September 2011
  • 67. There’s an app for that • Lets assume the predicted growth happens • 1,000,000+ apps by the end of 2011 • How many have been developed with security in mind? • The answer isn’t “none” but it won’t be many, ≤1%? • But none of us are surprised by this are we? • I want us to try and find the insecure apps with Agnitio Wednesday, 21 September 2011
  • 68. Mobile app security issues • Data in transit and at rest • Dangerous inputs Wednesday, 21 September 2011
  • 69. There’s an app for that Wednesday, 21 September 2011
  • 70. Android Source Code package com.denimgroup.android.training.pandemobium.stocktrader; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.webkit.WebView; public class TipsActivity extends Activity { private WebView wvTips;     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {      Log.i("TipsActivity", " Loading up browser page to display stock tips");              super.onCreate(savedInstanceState);         setContentView(R.layout.tips);                  wvTips = (WebView)findViewById(R.id.wv_tips);         wvTips.loadUrl(getString(R.string.tip_list));     } } Wednesday, 21 September 2011
  • 71. AndroidManifest.xml • A good place to start your security code reviews! • Applications and System code have an AndroidManifest file • Declares the package name, a unique identifier for the app • Defines the permissions needed by the application • Defines app activities and intents • Compressed XML file in the .apk Wednesday, 21 September 2011
  • 72. Agnitio hands on • AndroidManifest.xml - before and after Wednesday, 21 September 2011
  • 73. Android Static Analysis • Context.openFileOutput() • Context.openOrCreateDatabase() • rawQuery() • URLConnection() • HttpResponse() • MODE_PRIVATE • MODE_WORLD_READABLE • MODE_WORLD_WRITABLE Wednesday, 21 September 2011
  • 74. Agnitio hands on • Analyse the Android Pandemobium app Wednesday, 21 September 2011
  • 75. iOS Source Code #import "TipViewController.h" #import "StockDatabase.h" #import "/usr/include/sqlite3.h" #import "ASIHTTPRequest.h" #import "ASIFormDataRequest.h" @implementation TipViewController @synthesize keyboardToolbar; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];     if (self) {         // Custom initialization         stockDB = [[StockDatabase alloc] init];     }     return self; } Wednesday, 21 September 2011
  • 76. iOS Static Analysis • writeToFile() • openURL() • sqlite3_prepare() • NSFILE Wednesday, 21 September 2011
  • 77. Agnitio hands on • Automated analysis of Android .apk files Wednesday, 21 September 2011
  • 78. Using Agnitio • How you can use Agnitio in your reviews • Download Agnitio from Source Forge • Focus security code reviews on root causes not vulnerabilities • Use your language/s in all code examples and checklist items • Use Agnitio to conduct principles based security code reviews Wednesday, 21 September 2011
  • 79. My USB key........ • I have some things on my USB key you might want • .apk files of popular and “suspicious” Android apps • System.img file for v2.2 emulator to enable the marketplace • My slides from this workshop • You have to trust my USB key is safe to use ;-) Wednesday, 21 September 2011
  • 80. Do you want to work with me? • I’m expanding our application security team • 1x Application Security Analyst • 2x Junior Application Security Analyst • Speak to me today or tomorrow! • jobs@realexpayments.com Wednesday, 21 September 2011
  • 81. www.securityninja.co.uk http://sourceforge.net/projects/agnitiotool/ @securityninja /realexninja /securityninja /realexninja Wednesday, 21 September 2011
  • 82. QUESTIONS? www.securityninja.co.uk http://sourceforge.net/projects/agnitiotool/ @securityninja /realexninja /securityninja /realexninja Wednesday, 21 September 2011