SlideShare uma empresa Scribd logo
1 de 68
Baixar para ler offline
David Rook

The Principles of Secure Development

OWASP Ireland Conference, Dublin




Friday, 18 September 2009
if (slide == introduction)
                  System.out.println("I’m David Rook");

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



 • Security Ninja (www.securityninja.co.uk)

 • Speaker at security events (national and international)

 • IIA Web Development Working Group

 • Facebook hacker and published security author (insecure
   magazine, bloginfosec etc)



Friday, 18 September 2009
Agenda

 • It is broken so lets fix it

 • The current approach

 • The Principles of Secure Development

 • An example of a real world implementation




Friday, 18 September 2009
It is broken so lets fix it


  • Cross Site Scripting, 10 years old?

  • SQL Injection, 11 years old?

  33% of all vulnerabilities in 2008 and 2009 (so far) are
  XSS or SQL Injection (Based on CVE numbers)




 CVE statistics: http://web.nvd.nist.gov/view/vuln/statistics
Friday, 18 September 2009
It is broken so lets fix it




                                                CVE's
                                                Total
                                                SQLi
                                                XSS




Friday, 18 September 2009
It is broken so lets fix it

7000


6000


5000                                                         CVE's
                                                             Total
                                                             SQLi
4000                                                         XSS

 3000


 2000


 1000


     0
         2009 2008 2007 2006 2005 2004 2003 2002 2001 2000
Friday, 18 September 2009
It is broken so lets fix it

                                                             SQLi & XSS = 32.24%
7000


6000


5000                                                                  CVE's
                                                                      Total
                                                                      SQLi
4000                                                                  XSS

 3000


 2000


 1000


     0
         2009 2008 2007 2006 2005 2004 2003 2002 2001 2000
Friday, 18 September 2009
Philosophical Application Security


 Give a man a fish and you feed him for a day, teach
 him to fish and you feed him for a lifetime.




Friday, 18 September 2009
Philosophical Application Security


 Give a man a fish and you feed him for a day, teach
 him to fish and you feed him for a lifetime.

  I want to apply this to secure application development:

 Teach a developer about a vulnerability and he will
 prevent it, teach him how to develop securely and
 he will prevent many vulnerabilities.




Friday, 18 September 2009
The current approach
                   (And why I think it fails to deliver secure applications)

  • The cart before the horse

        • Security guys tell developers about specific vulnerabilities
        • We hope they figure out how to prevent them
        • Inevitably security flaws end up in live code
        • Security guys complain when data gets stolen




Friday, 18 September 2009
The current approach
                   (And why I think it fails to deliver secure applications)

  • What if we taught drivers in the same way?

        • Instructor tells driver about the different ways to crash
        • We hope the driver figures out how not to crash
        • Inevitably the driver will crash
        • People complain when they get crashed into




Friday, 18 September 2009
The current approach
                   (And why I think it fails to deliver secure applications)

  • Many lists of vulnerabilities

        • OWASP Top 10
        • White Hat Sec Top 10
        • SANS Top 25
        • Others??


  • != Secure development guidance




Friday, 18 September 2009
The current approach
                   (And why I think it fails to deliver secure applications)

  • Many lists of vulnerabilities

        • OWASP Top 10
        • White Hat Sec Top 10
        • SANS Top 25
        • Others??


  • != Secure development guidance

  • 45 vulnerabilities, 42 unique names

  • 8 secure coding principles to prevent them
Friday, 18 September 2009
What we need to do


  • Put the application security horse before the cart

        • Security guys tell developers how to write secure code
        • Developer doesn’t need to guess anymore
        • Common vulnerabilities prevented in applications
        • Realistic or just a caffeine fueled dream?




Friday, 18 September 2009
Lets make secure development easier


  • Keep It Short and Simple (KISS)

        • The principles must be clearly defined
        • Language/Platform/Framework independent
        • Should cover more than just the common vulnerabilities
        • More secure software and greater ROI on security training?




Friday, 18 September 2009
The Principles of Secure Development


  Input Validation

  Output Validation

  Error Handling

  Authentication and Authorisation

  Session Management

  Secure Communications

  Secure Storage

  Secure Resource Access

Friday, 18 September 2009
The Principles of Secure Development


  • Input Validation

        • Identify and define the data your application must accept




Friday, 18 September 2009
The Principles of Secure Development


  • Input Validation

        • Identify and define the data your application must accept
        • Create regex’s to validate each data type (content and size)
        • For example, a credit card number data type: d{12,16}$




Friday, 18 September 2009
The Principles of Secure Development


  • Input Validation

        • Identify and define the data your application must accept
        • Create regex’s to validate each data type (content and size)
        • For example, a credit card number data type: d{12,16}$
        • Use whitelisting for validation where possible




Friday, 18 September 2009
The Principles of Secure Development


  • Input Validation

        • Identify and define the data your application must accept
        • Create regex’s to validate each data type (content and size)
        • For example, a credit card number data type: d{12,16}$
        • Use whitelisting for validation where possible
        • Blacklisting approach harder and potentially less secure
        • Blacklist example, replacing single quotes:
            s.replaceAll(Pattern.quote(" ' "),
            Matcher.quoteReplacement(" " "))


Friday, 18 September 2009
The Principles of Secure Development


  • Output Validation

        • Identify and define the data your application must output




Friday, 18 September 2009
The Principles of Secure Development


  • Output Validation

        • Identify and define the data your application must output
        • Understand where (i.e. in a URL) your data should end up
        • Choose the correct output encoding for the data's destination




Friday, 18 September 2009
The Principles of Secure Development


  • Output Validation

        • Identify and define the data your application must output
        • Understand where (i.e. in a URL) your data should end up
        • Choose the correct output encoding for the data's destination
        • Proper encoding means this attack:
 www.examplesite.com/home.html?day=<script>alert(document.cookie)</script>

            Becomes:
         day=%3Cscript%3Ealert%28document.cookie%29%3C/script%3E




Friday, 18 September 2009
The Principles of Secure Development


  • Error Handling

        • Even the best apps will crash at some point, be prepared!




Friday, 18 September 2009
The Principles of Secure Development


  • Error Handling

        • Even the best apps will crash at some point, be prepared!
        • Crashes/errors can help an attacker if you don’t handle them




Friday, 18 September 2009
The Principles of Secure Development


  • Error Handling

        • Even the best apps will crash at some point, be prepared!
        • Crashes/errors can help an attacker if you don’t handle them
        • Handle error conditions securely, sanitise the message sent




Friday, 18 September 2009
The Principles of Secure Development


  • Error Handling

        • Even the best apps will crash at some point, be prepared!
        • Crashes/errors can help an attacker if you don’t handle them
        • Handle error conditions securely, sanitise the message sent
        • No error handling = information leakage
        Microsoft OLE DB Provider for ODBC
        Drivers(0x80040E14)
        [Microsoft][ODBC SQL Server Driver]
        [SQL Server]Invalid column name

        /examplesite/login.asp, line 10
Friday, 18 September 2009
The Principles of Secure Development


  • Authentication and Authorisation

        • Even simple apps often have a need to authenticate users




Friday, 18 September 2009
The Principles of Secure Development


  • Authentication and Authorisation

        • Even simple apps often have a need to authenticate users
        • Often at least two levels of authorisation




Friday, 18 September 2009
The Principles of Secure Development


  • Authentication and Authorisation

        • Even simple apps often have a need to authenticate users
        • Often at least two levels of authorisation
        • Need to prevent horizontal and vertical privilege escalation




Friday, 18 September 2009
The Principles of Secure Development


  • Authentication and Authorisation

        • Even simple apps often have a need to authenticate users
        • Often at least two levels of authorisation
        • Need to prevent horizontal and vertical privilege escalation
        • Implement strong passwords and management systems




Friday, 18 September 2009
The Principles of Secure Development


  • Authentication and Authorisation

        • Even simple apps often have a need to authenticate users
        • Often at least two levels of authorisation
        • Need to prevent horizontal and vertical privilege escalation
        • Implement strong passwords and management systems
        • Ensure A+A is secure, not a false sense of security (CAPTCHA?)




Friday, 18 September 2009
The Principles of Secure Development


  • Authentication and Authorisation

        • Even simple apps often have a need to authenticate users
        • Often at least two levels of authorisation
        • Need to prevent horizontal and vertical privilege escalation
        • Implement strong passwords and management systems
        • Ensure A+A is secure, not a false sense of security (CAPTCHA?)
        • Don’t rely on fields that are easily spoofed (referrer field)




Friday, 18 September 2009
The Principles of Secure Development


  • Session Management

        • Used to manage authenticated users, no need to re-auth




Friday, 18 September 2009
The Principles of Secure Development


  • Session Management

        • Used to manage authenticated users, no need to re-auth
        • You need to ensure that your sessionID’s have sufficient entropy




Friday, 18 September 2009
The Principles of Secure Development


  • Session Management

        • Used to manage authenticated users, no need to re-auth
        • You need to ensure that your sessionID’s have sufficient entropy
        • SessionID’s must not be predictable or reusable




Friday, 18 September 2009
The Principles of Secure Development


  • Session Management

        • Used to manage authenticated users, no need to re-auth
        • You need to ensure that your sessionID’s have sufficient entropy
        • SessionID’s must not be predictable or reusable
        • Never build your own session management, it will fail




Friday, 18 September 2009
The Principles of Secure Development


  • Session Management

        • Used to manage authenticated users, no need to re-auth
        • You need to ensure that your sessionID’s have sufficient entropy
        • SessionID’s must not be predictable or reusable
        • Never build your own session management, it will fail
        • Protect sessionID’s when in transit (i.e. SSL!)




Friday, 18 September 2009
The Principles of Secure Development


  • Session Management

        • Used to manage authenticated users, no need to re-auth
        • You need to ensure that your sessionID’s have sufficient entropy
        • SessionID’s must not be predictable or reusable
        • Never build your own session management, it will fail
        • Protect sessionID’s when in transit (i.e. SSL!)
        • Issue a new value for sensitive actions (i.e. funds transfer)




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Communications

        • Protect data (i.e. CC no, passwords, sessionID’s) in transit




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Communications

        • Protect data (i.e. CC no, passwords, sessionID’s) in transit
        • As with all crypto, don’t create your own




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Communications

        • Protect data (i.e. CC no, passwords, sessionID’s) in transit
        • As with all crypto, don’t create your own
        • Don’t use broken protection mechanisms (i.e. SSLv2)




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Communications

        • Protect data (i.e. CC no, passwords, sessionID’s) in transit
        • As with all crypto, don’t create your own
        • Don’t use broken protection mechanisms (i.e. SSLv2)
        • Don’t just use SSL/TLS for logon pages, protect the session!




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Communications

        • Protect data (i.e. CC no, passwords, sessionID’s) in transit
        • As with all crypto, don’t create your own
        • Don’t use broken protection mechanisms (i.e. SSLv2)
        • Don’t just use SSL/TLS for logon pages, protect the session!
        • Try to avoid mixing secure and insecure traffic on a page




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Storage

        • Protect data (i.e. CC no, passwords, sessionID’s) when stored




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Storage

        • Protect data (i.e. CC no, passwords, sessionID’s) when stored
        • As with all crypto, don’t create your own




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Storage

        • Protect data (i.e. CC no, passwords, sessionID’s) when stored
        • As with all crypto, don’t create your own
        • Don’t use broken protection mechanisms (i.e. DES)




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Storage

        • Protect data (i.e. CC no, passwords, sessionID’s) when stored
        • As with all crypto, don’t create your own
        • Don’t use broken protection mechanisms (i.e. DES)
        • Don’t store data in places where you can’t confidently secure it




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Storage

        • Protect data (i.e. CC no, passwords, sessionID’s) when stored
        • As with all crypto, don’t create your own
        • Don’t use broken protection mechanisms (i.e. DES)
        • Don’t store data in places where you can’t confidently secure it
        • Strong protection mechanisms, how strong should it be?




Friday, 18 September 2009
The Principles of Secure Development




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Resource Access

        • Obscurity != security, don’t try to hide sensitive resources




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Resource Access

        • Obscurity != security, don’t try to hide sensitive resources
        • Understand the users flow through an app, cover weak spots




Friday, 18 September 2009
The Principles of Secure Development


  • Secure Resource Access

        • Obscurity != security, don’t try to hide sensitive resources
        • Understand the users flow through an app, cover weak spots
        • T-Mobile didn’t do the above, Paris Hiltons account hacked




Friday, 18 September 2009
Lets redefine what secure development means


  • Follow a small, repeatable set of principles

  • Try not to focus on specific vulnerabilities

  • Develop securely, not to prevent "hot vuln of the day"

  • Build security into the code, don’t try to bolt it on at
    the end




Friday, 18 September 2009
Evolution, not revolution


  • Don’t make things more difficult than they need to be

        • This isn’t a new wheel, its just a smoother, easier to use wheel
        • Don’t treat security as something separate, integrate it
        • By integrating security fully a security bug is just another bug
        • Secure development doesn’t have to be hard, KISS it!




Friday, 18 September 2009
The new approach is working


  • Private banking development company, Switzerland
        • Application Security lead saw the secure development principles




Friday, 18 September 2009
The new approach is working


  • Private banking development company, Switzerland
        • Application Security lead saw the secure development principles
        • Re-designed secure development training for his company




Friday, 18 September 2009
The new approach is working


  • Private banking development company, Switzerland
        • Application Security lead saw the secure development principles
        • Re-designed secure development training for his company
        • Security training costs down, quicker "spin up" of developers




Friday, 18 September 2009
The new approach is working


  • Private banking development company, Switzerland
        • Application Security lead saw the secure development principles
        • Re-designed secure development training for his company
        • Security training costs down, quicker "spin up" of developers
        • Security within their SDLC now based on the principles




Friday, 18 September 2009
The new approach is working


  • Private banking development company, Switzerland
        • Application Security lead saw the secure development principles
        • Re-designed secure development training for his company
        • Security training costs down, quicker "spin up" of developers
        • Security within their SDLC now based on the principles
        • In his own words:

       You released the "secure development principles" at a time I had issues with
       my dev teams in how to teach them secure development. Your approach
       convinced me to look in another direction, not trying to teach every
       vulnerability but finding the basic principles that help prevent their
       existence. At that time, this was genius for me: most of my training since
       has been inspired by your secure development principles.


Friday, 18 September 2009
The new approach is working


They modified the principles matrix to match their own terminology




Friday, 18 September 2009
The new approach is working


They modified the principles matrix to match their own terminology




Friday, 18 September 2009
Security Ninja new site launch!


  • Security Ninja, brought you by Realex Payments

        • Free application security and compliance resource site




Friday, 18 September 2009
Security Ninja new site launch!


  • Security Ninja, brought you by Realex Payments

        • Free application security and compliance resource site
        • Blog and site managed and updated by myself




Friday, 18 September 2009
Security Ninja new site launch!


  • Security Ninja, brought you by Realex Payments

        • Free application security and compliance resource site
        • Blog and site managed and updated by myself
        • Security presentations, whitepapers, videos and audio online




Friday, 18 September 2009
Security Ninja new site launch!


  • Security Ninja, brought you by Realex Payments

        • Free application security and compliance resource site
        • Blog and site managed and updated by myself
        • Security presentations, whitepapers, videos and audio online
        • Secure Development Principles whitepaper available here today




Friday, 18 September 2009
www.securityninja.co.uk
              Twitter: @securityninja




Friday, 18 September 2009
QUESTIONS?
             www.securityninja.co.uk
              Twitter: @securityninja




Friday, 18 September 2009

Mais conteúdo relacionado

Semelhante a The Principles of Secure Development

Banfootguns devseccon 2019
Banfootguns devseccon 2019Banfootguns devseccon 2019
Banfootguns devseccon 2019Morgan Roman
 
Devouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site ScriptingDevouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site Scriptinggmaran23
 
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...CODE BLUE
 
(SEC202) Best Practices for Securely Leveraging the Cloud
(SEC202) Best Practices for Securely Leveraging the Cloud(SEC202) Best Practices for Securely Leveraging the Cloud
(SEC202) Best Practices for Securely Leveraging the CloudAmazon Web Services
 
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...Amazon Web Services
 
Design reliability 2.0: Safety is Everything
Design reliability 2.0: Safety is Everything Design reliability 2.0: Safety is Everything
Design reliability 2.0: Safety is Everything Amir Rahat
 
HMM-Web: a framework for the detection of attacks against Web applications
HMM-Web: a framework for the detection of  attacks against Web applicationsHMM-Web: a framework for the detection of  attacks against Web applications
HMM-Web: a framework for the detection of attacks against Web applicationsPluribus One
 
Content Management Selection and Strategy
Content Management Selection and StrategyContent Management Selection and Strategy
Content Management Selection and StrategyIvo Jansch
 
Ibuildings Cms Talk
Ibuildings Cms TalkIbuildings Cms Talk
Ibuildings Cms Talkdean1985
 
The Coming Tsunami in Microservices: Operating Microservices at Scale
The Coming Tsunami in Microservices: Operating Microservices at ScaleThe Coming Tsunami in Microservices: Operating Microservices at Scale
The Coming Tsunami in Microservices: Operating Microservices at ScaleCprime
 
Java application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developerJava application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developerSteve Poole
 
Creating resiliency through destruction
Creating resiliency through destructionCreating resiliency through destruction
Creating resiliency through destructionAmazon Web Services
 
Securing your Amazon SageMaker model development in a highly regulated enviro...
Securing your Amazon SageMaker model development in a highly regulated enviro...Securing your Amazon SageMaker model development in a highly regulated enviro...
Securing your Amazon SageMaker model development in a highly regulated enviro...Amazon Web Services
 
Get Ready for Web Application Security Testing
Get Ready for Web Application Security TestingGet Ready for Web Application Security Testing
Get Ready for Web Application Security TestingAlan Kan
 
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threatBasic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threatVladyslav Radetsky
 
ENT305 Compliance and Cloud Security for Regulated Industries
ENT305 Compliance and Cloud Security for Regulated IndustriesENT305 Compliance and Cloud Security for Regulated Industries
ENT305 Compliance and Cloud Security for Regulated IndustriesAmazon Web Services
 
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...Amazon Web Services
 

Semelhante a The Principles of Secure Development (20)

Banfootguns devseccon 2019
Banfootguns devseccon 2019Banfootguns devseccon 2019
Banfootguns devseccon 2019
 
Devouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site ScriptingDevouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site Scripting
 
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
 
(SEC202) Best Practices for Securely Leveraging the Cloud
(SEC202) Best Practices for Securely Leveraging the Cloud(SEC202) Best Practices for Securely Leveraging the Cloud
(SEC202) Best Practices for Securely Leveraging the Cloud
 
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
CI/CD best practices for building modern applications - MAD301 - Santa Clara ...
 
Design reliability 2.0: Safety is Everything
Design reliability 2.0: Safety is Everything Design reliability 2.0: Safety is Everything
Design reliability 2.0: Safety is Everything
 
HMM-Web: a framework for the detection of attacks against Web applications
HMM-Web: a framework for the detection of  attacks against Web applicationsHMM-Web: a framework for the detection of  attacks against Web applications
HMM-Web: a framework for the detection of attacks against Web applications
 
Content Management Selection and Strategy
Content Management Selection and StrategyContent Management Selection and Strategy
Content Management Selection and Strategy
 
Ibuildings Cms Talk
Ibuildings Cms TalkIbuildings Cms Talk
Ibuildings Cms Talk
 
The Coming Tsunami in Microservices: Operating Microservices at Scale
The Coming Tsunami in Microservices: Operating Microservices at ScaleThe Coming Tsunami in Microservices: Operating Microservices at Scale
The Coming Tsunami in Microservices: Operating Microservices at Scale
 
How to write maintainable software
How to write maintainable softwareHow to write maintainable software
How to write maintainable software
 
Java application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developerJava application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developer
 
Creating resiliency through destruction
Creating resiliency through destructionCreating resiliency through destruction
Creating resiliency through destruction
 
Securing your Amazon SageMaker model development in a highly regulated enviro...
Securing your Amazon SageMaker model development in a highly regulated enviro...Securing your Amazon SageMaker model development in a highly regulated enviro...
Securing your Amazon SageMaker model development in a highly regulated enviro...
 
Get Ready for Web Application Security Testing
Get Ready for Web Application Security TestingGet Ready for Web Application Security Testing
Get Ready for Web Application Security Testing
 
The Akamai Security Portfolio
The Akamai Security PortfolioThe Akamai Security Portfolio
The Akamai Security Portfolio
 
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threatBasic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
 
ENT305 Compliance and Cloud Security for Regulated Industries
ENT305 Compliance and Cloud Security for Regulated IndustriesENT305 Compliance and Cloud Security for Regulated Industries
ENT305 Compliance and Cloud Security for Regulated Industries
 
Webinar–Reviewing Modern JavaScript Applications
Webinar–Reviewing Modern JavaScript ApplicationsWebinar–Reviewing Modern JavaScript Applications
Webinar–Reviewing Modern JavaScript Applications
 
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
CI/CD best practices for building modern applications - MAD302 - Atlanta AWS ...
 

Mais de Security Ninja

The Realex Payments Application Story
The Realex Payments Application StoryThe Realex Payments Application Story
The Realex Payments Application StorySecurity 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 SecuritySecurity Ninja
 
SecurityBSides London - windows phone 7
SecurityBSides London - windows phone 7SecurityBSides London - windows phone 7
SecurityBSides London - windows phone 7Security Ninja
 
OWASP Birmingham - Mobile Application Security
OWASP Birmingham - Mobile Application SecurityOWASP Birmingham - Mobile Application Security
OWASP Birmingham - Mobile Application SecuritySecurity Ninja
 
BruCON Agnitio Workshop
BruCON Agnitio WorkshopBruCON Agnitio Workshop
BruCON Agnitio WorkshopSecurity Ninja
 
SecurityBSides las vegas - Agnitio
SecurityBSides las vegas - AgnitioSecurityBSides las vegas - Agnitio
SecurityBSides las vegas - AgnitioSecurity Ninja
 
Hack in Paris - Agnitio
Hack in Paris - AgnitioHack in Paris - Agnitio
Hack in Paris - AgnitioSecurity Ninja
 
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...Security Ninja
 
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 itSecurity Ninja
 
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 DublinSecurity Ninja
 
Application security and PCI DSS
Application security and PCI DSSApplication security and PCI DSS
Application security and PCI DSSSecurity Ninja
 
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 17Security Ninja
 
Developing secure web applications
Developing secure web applicationsDeveloping secure web applications
Developing secure web applicationsSecurity Ninja
 
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 2010Security Ninja
 
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 2010Security Ninja
 
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 2009Security Ninja
 
Owasp talk-november-08
Owasp talk-november-08Owasp talk-november-08
Owasp talk-november-08Security Ninja
 

Mais de Security Ninja (18)

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
 
OWASP Birmingham - Mobile Application Security
OWASP Birmingham - Mobile Application SecurityOWASP Birmingham - Mobile Application Security
OWASP Birmingham - Mobile Application Security
 
BruCON Agnitio Workshop
BruCON Agnitio WorkshopBruCON Agnitio Workshop
BruCON Agnitio Workshop
 
SecurityBSides las vegas - Agnitio
SecurityBSides las vegas - AgnitioSecurityBSides las vegas - Agnitio
SecurityBSides las vegas - Agnitio
 
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
 
Owasp talk-november-08
Owasp talk-november-08Owasp talk-november-08
Owasp talk-november-08
 

Último

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

The Principles of Secure Development

  • 1. David Rook The Principles of Secure Development OWASP Ireland Conference, Dublin Friday, 18 September 2009
  • 2. if (slide == introduction) System.out.println("I’m David Rook"); • Security Analyst, Realex Payments, Ireland CISSP, CISA, GCIH and many other acronyms • Security Ninja (www.securityninja.co.uk) • Speaker at security events (national and international) • IIA Web Development Working Group • Facebook hacker and published security author (insecure magazine, bloginfosec etc) Friday, 18 September 2009
  • 3. Agenda • It is broken so lets fix it • The current approach • The Principles of Secure Development • An example of a real world implementation Friday, 18 September 2009
  • 4. It is broken so lets fix it • Cross Site Scripting, 10 years old? • SQL Injection, 11 years old? 33% of all vulnerabilities in 2008 and 2009 (so far) are XSS or SQL Injection (Based on CVE numbers) CVE statistics: http://web.nvd.nist.gov/view/vuln/statistics Friday, 18 September 2009
  • 5. It is broken so lets fix it CVE's Total SQLi XSS Friday, 18 September 2009
  • 6. It is broken so lets fix it 7000 6000 5000 CVE's Total SQLi 4000 XSS 3000 2000 1000 0 2009 2008 2007 2006 2005 2004 2003 2002 2001 2000 Friday, 18 September 2009
  • 7. It is broken so lets fix it SQLi & XSS = 32.24% 7000 6000 5000 CVE's Total SQLi 4000 XSS 3000 2000 1000 0 2009 2008 2007 2006 2005 2004 2003 2002 2001 2000 Friday, 18 September 2009
  • 8. Philosophical Application Security Give a man a fish and you feed him for a day, teach him to fish and you feed him for a lifetime. Friday, 18 September 2009
  • 9. Philosophical Application Security Give a man a fish and you feed him for a day, teach him to fish and you feed him for a lifetime. I want to apply this to secure application development: Teach a developer about a vulnerability and he will prevent it, teach him how to develop securely and he will prevent many vulnerabilities. Friday, 18 September 2009
  • 10. The current approach (And why I think it fails to deliver secure applications) • The cart before the horse • Security guys tell developers about specific vulnerabilities • We hope they figure out how to prevent them • Inevitably security flaws end up in live code • Security guys complain when data gets stolen Friday, 18 September 2009
  • 11. The current approach (And why I think it fails to deliver secure applications) • What if we taught drivers in the same way? • Instructor tells driver about the different ways to crash • We hope the driver figures out how not to crash • Inevitably the driver will crash • People complain when they get crashed into Friday, 18 September 2009
  • 12. The current approach (And why I think it fails to deliver secure applications) • Many lists of vulnerabilities • OWASP Top 10 • White Hat Sec Top 10 • SANS Top 25 • Others?? • != Secure development guidance Friday, 18 September 2009
  • 13. The current approach (And why I think it fails to deliver secure applications) • Many lists of vulnerabilities • OWASP Top 10 • White Hat Sec Top 10 • SANS Top 25 • Others?? • != Secure development guidance • 45 vulnerabilities, 42 unique names • 8 secure coding principles to prevent them Friday, 18 September 2009
  • 14. What we need to do • Put the application security horse before the cart • Security guys tell developers how to write secure code • Developer doesn’t need to guess anymore • Common vulnerabilities prevented in applications • Realistic or just a caffeine fueled dream? Friday, 18 September 2009
  • 15. Lets make secure development easier • Keep It Short and Simple (KISS) • The principles must be clearly defined • Language/Platform/Framework independent • Should cover more than just the common vulnerabilities • More secure software and greater ROI on security training? Friday, 18 September 2009
  • 16. The Principles of Secure Development Input Validation Output Validation Error Handling Authentication and Authorisation Session Management Secure Communications Secure Storage Secure Resource Access Friday, 18 September 2009
  • 17. The Principles of Secure Development • Input Validation • Identify and define the data your application must accept Friday, 18 September 2009
  • 18. The Principles of Secure Development • Input Validation • Identify and define the data your application must accept • Create regex’s to validate each data type (content and size) • For example, a credit card number data type: d{12,16}$ Friday, 18 September 2009
  • 19. The Principles of Secure Development • Input Validation • Identify and define the data your application must accept • Create regex’s to validate each data type (content and size) • For example, a credit card number data type: d{12,16}$ • Use whitelisting for validation where possible Friday, 18 September 2009
  • 20. The Principles of Secure Development • Input Validation • Identify and define the data your application must accept • Create regex’s to validate each data type (content and size) • For example, a credit card number data type: d{12,16}$ • Use whitelisting for validation where possible • Blacklisting approach harder and potentially less secure • Blacklist example, replacing single quotes: s.replaceAll(Pattern.quote(" ' "), Matcher.quoteReplacement(" " ")) Friday, 18 September 2009
  • 21. The Principles of Secure Development • Output Validation • Identify and define the data your application must output Friday, 18 September 2009
  • 22. The Principles of Secure Development • Output Validation • Identify and define the data your application must output • Understand where (i.e. in a URL) your data should end up • Choose the correct output encoding for the data's destination Friday, 18 September 2009
  • 23. The Principles of Secure Development • Output Validation • Identify and define the data your application must output • Understand where (i.e. in a URL) your data should end up • Choose the correct output encoding for the data's destination • Proper encoding means this attack: www.examplesite.com/home.html?day=<script>alert(document.cookie)</script> Becomes: day=%3Cscript%3Ealert%28document.cookie%29%3C/script%3E Friday, 18 September 2009
  • 24. The Principles of Secure Development • Error Handling • Even the best apps will crash at some point, be prepared! Friday, 18 September 2009
  • 25. The Principles of Secure Development • Error Handling • Even the best apps will crash at some point, be prepared! • Crashes/errors can help an attacker if you don’t handle them Friday, 18 September 2009
  • 26. The Principles of Secure Development • Error Handling • Even the best apps will crash at some point, be prepared! • Crashes/errors can help an attacker if you don’t handle them • Handle error conditions securely, sanitise the message sent Friday, 18 September 2009
  • 27. The Principles of Secure Development • Error Handling • Even the best apps will crash at some point, be prepared! • Crashes/errors can help an attacker if you don’t handle them • Handle error conditions securely, sanitise the message sent • No error handling = information leakage Microsoft OLE DB Provider for ODBC Drivers(0x80040E14) [Microsoft][ODBC SQL Server Driver] [SQL Server]Invalid column name /examplesite/login.asp, line 10 Friday, 18 September 2009
  • 28. The Principles of Secure Development • Authentication and Authorisation • Even simple apps often have a need to authenticate users Friday, 18 September 2009
  • 29. The Principles of Secure Development • Authentication and Authorisation • Even simple apps often have a need to authenticate users • Often at least two levels of authorisation Friday, 18 September 2009
  • 30. The Principles of Secure Development • Authentication and Authorisation • Even simple apps often have a need to authenticate users • Often at least two levels of authorisation • Need to prevent horizontal and vertical privilege escalation Friday, 18 September 2009
  • 31. The Principles of Secure Development • Authentication and Authorisation • Even simple apps often have a need to authenticate users • Often at least two levels of authorisation • Need to prevent horizontal and vertical privilege escalation • Implement strong passwords and management systems Friday, 18 September 2009
  • 32. The Principles of Secure Development • Authentication and Authorisation • Even simple apps often have a need to authenticate users • Often at least two levels of authorisation • Need to prevent horizontal and vertical privilege escalation • Implement strong passwords and management systems • Ensure A+A is secure, not a false sense of security (CAPTCHA?) Friday, 18 September 2009
  • 33. The Principles of Secure Development • Authentication and Authorisation • Even simple apps often have a need to authenticate users • Often at least two levels of authorisation • Need to prevent horizontal and vertical privilege escalation • Implement strong passwords and management systems • Ensure A+A is secure, not a false sense of security (CAPTCHA?) • Don’t rely on fields that are easily spoofed (referrer field) Friday, 18 September 2009
  • 34. The Principles of Secure Development • Session Management • Used to manage authenticated users, no need to re-auth Friday, 18 September 2009
  • 35. The Principles of Secure Development • Session Management • Used to manage authenticated users, no need to re-auth • You need to ensure that your sessionID’s have sufficient entropy Friday, 18 September 2009
  • 36. The Principles of Secure Development • Session Management • Used to manage authenticated users, no need to re-auth • You need to ensure that your sessionID’s have sufficient entropy • SessionID’s must not be predictable or reusable Friday, 18 September 2009
  • 37. The Principles of Secure Development • Session Management • Used to manage authenticated users, no need to re-auth • You need to ensure that your sessionID’s have sufficient entropy • SessionID’s must not be predictable or reusable • Never build your own session management, it will fail Friday, 18 September 2009
  • 38. The Principles of Secure Development • Session Management • Used to manage authenticated users, no need to re-auth • You need to ensure that your sessionID’s have sufficient entropy • SessionID’s must not be predictable or reusable • Never build your own session management, it will fail • Protect sessionID’s when in transit (i.e. SSL!) Friday, 18 September 2009
  • 39. The Principles of Secure Development • Session Management • Used to manage authenticated users, no need to re-auth • You need to ensure that your sessionID’s have sufficient entropy • SessionID’s must not be predictable or reusable • Never build your own session management, it will fail • Protect sessionID’s when in transit (i.e. SSL!) • Issue a new value for sensitive actions (i.e. funds transfer) Friday, 18 September 2009
  • 40. The Principles of Secure Development • Secure Communications • Protect data (i.e. CC no, passwords, sessionID’s) in transit Friday, 18 September 2009
  • 41. The Principles of Secure Development • Secure Communications • Protect data (i.e. CC no, passwords, sessionID’s) in transit • As with all crypto, don’t create your own Friday, 18 September 2009
  • 42. The Principles of Secure Development • Secure Communications • Protect data (i.e. CC no, passwords, sessionID’s) in transit • As with all crypto, don’t create your own • Don’t use broken protection mechanisms (i.e. SSLv2) Friday, 18 September 2009
  • 43. The Principles of Secure Development • Secure Communications • Protect data (i.e. CC no, passwords, sessionID’s) in transit • As with all crypto, don’t create your own • Don’t use broken protection mechanisms (i.e. SSLv2) • Don’t just use SSL/TLS for logon pages, protect the session! Friday, 18 September 2009
  • 44. The Principles of Secure Development • Secure Communications • Protect data (i.e. CC no, passwords, sessionID’s) in transit • As with all crypto, don’t create your own • Don’t use broken protection mechanisms (i.e. SSLv2) • Don’t just use SSL/TLS for logon pages, protect the session! • Try to avoid mixing secure and insecure traffic on a page Friday, 18 September 2009
  • 45. The Principles of Secure Development • Secure Storage • Protect data (i.e. CC no, passwords, sessionID’s) when stored Friday, 18 September 2009
  • 46. The Principles of Secure Development • Secure Storage • Protect data (i.e. CC no, passwords, sessionID’s) when stored • As with all crypto, don’t create your own Friday, 18 September 2009
  • 47. The Principles of Secure Development • Secure Storage • Protect data (i.e. CC no, passwords, sessionID’s) when stored • As with all crypto, don’t create your own • Don’t use broken protection mechanisms (i.e. DES) Friday, 18 September 2009
  • 48. The Principles of Secure Development • Secure Storage • Protect data (i.e. CC no, passwords, sessionID’s) when stored • As with all crypto, don’t create your own • Don’t use broken protection mechanisms (i.e. DES) • Don’t store data in places where you can’t confidently secure it Friday, 18 September 2009
  • 49. The Principles of Secure Development • Secure Storage • Protect data (i.e. CC no, passwords, sessionID’s) when stored • As with all crypto, don’t create your own • Don’t use broken protection mechanisms (i.e. DES) • Don’t store data in places where you can’t confidently secure it • Strong protection mechanisms, how strong should it be? Friday, 18 September 2009
  • 50. The Principles of Secure Development Friday, 18 September 2009
  • 51. The Principles of Secure Development • Secure Resource Access • Obscurity != security, don’t try to hide sensitive resources Friday, 18 September 2009
  • 52. The Principles of Secure Development • Secure Resource Access • Obscurity != security, don’t try to hide sensitive resources • Understand the users flow through an app, cover weak spots Friday, 18 September 2009
  • 53. The Principles of Secure Development • Secure Resource Access • Obscurity != security, don’t try to hide sensitive resources • Understand the users flow through an app, cover weak spots • T-Mobile didn’t do the above, Paris Hiltons account hacked Friday, 18 September 2009
  • 54. Lets redefine what secure development means • Follow a small, repeatable set of principles • Try not to focus on specific vulnerabilities • Develop securely, not to prevent "hot vuln of the day" • Build security into the code, don’t try to bolt it on at the end Friday, 18 September 2009
  • 55. Evolution, not revolution • Don’t make things more difficult than they need to be • This isn’t a new wheel, its just a smoother, easier to use wheel • Don’t treat security as something separate, integrate it • By integrating security fully a security bug is just another bug • Secure development doesn’t have to be hard, KISS it! Friday, 18 September 2009
  • 56. The new approach is working • Private banking development company, Switzerland • Application Security lead saw the secure development principles Friday, 18 September 2009
  • 57. The new approach is working • Private banking development company, Switzerland • Application Security lead saw the secure development principles • Re-designed secure development training for his company Friday, 18 September 2009
  • 58. The new approach is working • Private banking development company, Switzerland • Application Security lead saw the secure development principles • Re-designed secure development training for his company • Security training costs down, quicker "spin up" of developers Friday, 18 September 2009
  • 59. The new approach is working • Private banking development company, Switzerland • Application Security lead saw the secure development principles • Re-designed secure development training for his company • Security training costs down, quicker "spin up" of developers • Security within their SDLC now based on the principles Friday, 18 September 2009
  • 60. The new approach is working • Private banking development company, Switzerland • Application Security lead saw the secure development principles • Re-designed secure development training for his company • Security training costs down, quicker "spin up" of developers • Security within their SDLC now based on the principles • In his own words: You released the "secure development principles" at a time I had issues with my dev teams in how to teach them secure development. Your approach convinced me to look in another direction, not trying to teach every vulnerability but finding the basic principles that help prevent their existence. At that time, this was genius for me: most of my training since has been inspired by your secure development principles. Friday, 18 September 2009
  • 61. The new approach is working They modified the principles matrix to match their own terminology Friday, 18 September 2009
  • 62. The new approach is working They modified the principles matrix to match their own terminology Friday, 18 September 2009
  • 63. Security Ninja new site launch! • Security Ninja, brought you by Realex Payments • Free application security and compliance resource site Friday, 18 September 2009
  • 64. Security Ninja new site launch! • Security Ninja, brought you by Realex Payments • Free application security and compliance resource site • Blog and site managed and updated by myself Friday, 18 September 2009
  • 65. Security Ninja new site launch! • Security Ninja, brought you by Realex Payments • Free application security and compliance resource site • Blog and site managed and updated by myself • Security presentations, whitepapers, videos and audio online Friday, 18 September 2009
  • 66. Security Ninja new site launch! • Security Ninja, brought you by Realex Payments • Free application security and compliance resource site • Blog and site managed and updated by myself • Security presentations, whitepapers, videos and audio online • Secure Development Principles whitepaper available here today Friday, 18 September 2009
  • 67. www.securityninja.co.uk Twitter: @securityninja Friday, 18 September 2009
  • 68. QUESTIONS? www.securityninja.co.uk Twitter: @securityninja Friday, 18 September 2009