SlideShare ist ein Scribd-Unternehmen logo
1 von 61
Downloaden Sie, um offline zu lesen
Building a secure
Cocoa application
   Graham Lee (@iamleeg)
MOAB - Jan 2007
 OS                  Apple apps                      Other apps




          27%



                                              47%



                27%




      Source - http://projects.info-pull.com/moab/
Principles

            c2

 a2


      b 2
What is a threat?
What is a threat?
What is a threat?
What is a threat?
Who is the misuser?
Who is the misuser?
Who is the misuser?
           What’s my
           motivation??
Who is the misuser?
                What’s my
                motivation??
  How risk-
 averse am I?
Who is the misuser?
                What’s my
                motivation??
  How risk-
 averse am I?


                 What skills
                and resources
                  can I use?
Assets
Assets
Assets
Assets
Assets
Assets

   credit: freefoto.com
C
I
A
Confidentiality
I
A
Confidentiality
I ntegrity
A
Confidentiality
I ntegrity
A vailability
I’m sorry, Dave…
I’m sorry, Dave…


• We remember -rwxrwxrwx
I’m sorry, Dave…


• We remember -rwxrwxrwx
• What about “group:everyone   deny
  delete”?
Keychain
Keychain

•Secure storage…
Keychain

•Secure storage…
•…with access control!
Keychain

•Secure storage…
•…with access control!
•Really simple API (simpler on iPhone :P)
Keychain

•Secure storage…
•…with access control!
•Really simple API (simpler on iPhone :P)
•SecKeychainFindInternetPassword()
Keychain

              •Secure storage…
              •…with access control!
              •Really simple API (simpler on iPhone :P)
              •SecKeychainFindInternetPassword()
              •Even protects against “cold boot”*



*http://citp.princeton.edu/memory/
Keychain

              •Secure storage…
              •…with access control!
              •Really simple API (simpler on iPhone :P)
              •SecKeychainFindInternetPassword()
              •Even protects against “cold boot”*
              •…if used carefully


*http://citp.princeton.edu/memory/
my secret password




            my secret password




my secret password
Confidentiality
I ntegrity
A vailability
How to sign code
How to sign code




     Erm, that’s it.
Confidentiality
I ntegrity
A vailability
launchd
launchd

• pretty sweet (on 10.5)
launchd

• pretty sweet (on 10.5)
• somewhat sweet on 10.4
launchd

• pretty sweet (on 10.5)
• somewhat sweet on 10.4
• 10.3 still exists?!?
launchd

• pretty sweet (on 10.5)
• somewhat sweet on 10.4
• 10.3 still exists?!?
• check out <key>KeepAlive</key> for
  watchdog-related goodness, in
  launchd.plist(5)
Exercise 1 :-)
Exercise 1 :-)
S
T
R
I
D
E
Spoofing
T
R
I
D
E
Spoofing
Tampering
R
I
D
E
Spoofing
Tampering
Repudiation
I
D
E
Spoofing
Tampering
Repudiation
I nformation leak
D
E
Spoofing
Tampering
Repudiation
I nformation leak
Denial of Service
E
Spoofing
Tampering
Repudiation
I nformation leak
Denial of Service
E levation of Privilege
Authorisation Services
Authorisation Services
          SFAuthorizationView
Authorisation Services
          SFAuthorizationView
Authorisation Services
          SFAuthorizationView
Authorisation Services
                   SFAuthorizationView




                                    	
                                    	
                                    <key>system.preferences.accounts
                                    </key>
                               	   	    <dict>
    AuthorizationRights
                               	   	    	    <key>allow-root</key>
                               	   	    	    <true/>
                               	   	    	    <key>class</key>
                               	   	    	    <string>user</string>
                               	   	    	    <key>comment</key>
                               	   	    	    <string><!-- … -->
                                                </string>
                               	   	    	    <key>group</key>
                               	   	    	    <string>admin</string>
                               	   	    	    <key>shared</key>
                               	   	    	    <false/>
                               	   	    </dict>
Demo


           c
       a
?

Weitere ähnliche Inhalte

Ähnlich wie Designing a Secure Cocoa App

Security Research2.0 - FIT 2008
Security Research2.0 - FIT 2008Security Research2.0 - FIT 2008
Security Research2.0 - FIT 2008Raffael Marty
 
IT Data Visualization - Sumit 2008
IT Data Visualization - Sumit 2008IT Data Visualization - Sumit 2008
IT Data Visualization - Sumit 2008Raffael Marty
 
Making Joomla Insecure - Explaining security by breaking it
Making Joomla Insecure - Explaining security by breaking itMaking Joomla Insecure - Explaining security by breaking it
Making Joomla Insecure - Explaining security by breaking itTim Plummer
 
Php Code Audits (PHP UK 2010)
Php Code Audits (PHP UK 2010)Php Code Audits (PHP UK 2010)
Php Code Audits (PHP UK 2010)Damien Seguy
 
What Going All-Remote Taught Us About Appsec and Testing Shortfalls
What Going All-Remote Taught Us About Appsec and Testing ShortfallsWhat Going All-Remote Taught Us About Appsec and Testing Shortfalls
What Going All-Remote Taught Us About Appsec and Testing ShortfallsDevOps.com
 
Security in Android Applications / Александр Смирнов (RedMadRobot)
Security in Android Applications / Александр Смирнов (RedMadRobot)Security in Android Applications / Александр Смирнов (RedMadRobot)
Security in Android Applications / Александр Смирнов (RedMadRobot)Ontico
 
Essential security measures in ASP.NET MVC
Essential security measures in ASP.NET MVC Essential security measures in ASP.NET MVC
Essential security measures in ASP.NET MVC Rafał Hryniewski
 
Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Barry Dorrans
 
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...Rudy Jahchan
 
Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Masoud Kalali
 
Java EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishJava EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishMarkus Eisele
 
Hacking identity: A Pen Tester's Guide to IAM
Hacking identity: A Pen Tester's Guide to IAMHacking identity: A Pen Tester's Guide to IAM
Hacking identity: A Pen Tester's Guide to IAMJerod Brennen
 
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
Reliable and fast security audits - The modern and offensive way-Mohan GandhiReliable and fast security audits - The modern and offensive way-Mohan Gandhi
Reliable and fast security audits - The modern and offensive way-Mohan Gandhibhumika2108
 
Dip Your Toes in the Sea of Security (PHP Cambridge)
Dip Your Toes in the Sea of Security (PHP Cambridge)Dip Your Toes in the Sea of Security (PHP Cambridge)
Dip Your Toes in the Sea of Security (PHP Cambridge)James Titcumb
 
JavaScript and Accessibility: Creating Interface Magic for Everyone
JavaScript and Accessibility: Creating Interface Magic for EveryoneJavaScript and Accessibility: Creating Interface Magic for Everyone
JavaScript and Accessibility: Creating Interface Magic for EveryoneDerek Featherstone
 
2015 09-18-jug summer camp
2015 09-18-jug summer camp2015 09-18-jug summer camp
2015 09-18-jug summer campSebastien Gioria
 
42 minutes to secure your code....
42 minutes to secure your code....42 minutes to secure your code....
42 minutes to secure your code....Sebastien Gioria
 
Liferay hardening principles
Liferay hardening principlesLiferay hardening principles
Liferay hardening principlesAmbientia
 

Ähnlich wie Designing a Secure Cocoa App (20)

Security Research2.0 - FIT 2008
Security Research2.0 - FIT 2008Security Research2.0 - FIT 2008
Security Research2.0 - FIT 2008
 
IT Data Visualization - Sumit 2008
IT Data Visualization - Sumit 2008IT Data Visualization - Sumit 2008
IT Data Visualization - Sumit 2008
 
Making Joomla Insecure - Explaining security by breaking it
Making Joomla Insecure - Explaining security by breaking itMaking Joomla Insecure - Explaining security by breaking it
Making Joomla Insecure - Explaining security by breaking it
 
Rails Security
Rails SecurityRails Security
Rails Security
 
Php Code Audits (PHP UK 2010)
Php Code Audits (PHP UK 2010)Php Code Audits (PHP UK 2010)
Php Code Audits (PHP UK 2010)
 
Truth and Consequences
Truth and ConsequencesTruth and Consequences
Truth and Consequences
 
What Going All-Remote Taught Us About Appsec and Testing Shortfalls
What Going All-Remote Taught Us About Appsec and Testing ShortfallsWhat Going All-Remote Taught Us About Appsec and Testing Shortfalls
What Going All-Remote Taught Us About Appsec and Testing Shortfalls
 
Security in Android Applications / Александр Смирнов (RedMadRobot)
Security in Android Applications / Александр Смирнов (RedMadRobot)Security in Android Applications / Александр Смирнов (RedMadRobot)
Security in Android Applications / Александр Смирнов (RedMadRobot)
 
Essential security measures in ASP.NET MVC
Essential security measures in ASP.NET MVC Essential security measures in ASP.NET MVC
Essential security measures in ASP.NET MVC
 
Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10
 
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
 
Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881
 
Java EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishJava EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFish
 
Hacking identity: A Pen Tester's Guide to IAM
Hacking identity: A Pen Tester's Guide to IAMHacking identity: A Pen Tester's Guide to IAM
Hacking identity: A Pen Tester's Guide to IAM
 
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
Reliable and fast security audits - The modern and offensive way-Mohan GandhiReliable and fast security audits - The modern and offensive way-Mohan Gandhi
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
 
Dip Your Toes in the Sea of Security (PHP Cambridge)
Dip Your Toes in the Sea of Security (PHP Cambridge)Dip Your Toes in the Sea of Security (PHP Cambridge)
Dip Your Toes in the Sea of Security (PHP Cambridge)
 
JavaScript and Accessibility: Creating Interface Magic for Everyone
JavaScript and Accessibility: Creating Interface Magic for EveryoneJavaScript and Accessibility: Creating Interface Magic for Everyone
JavaScript and Accessibility: Creating Interface Magic for Everyone
 
2015 09-18-jug summer camp
2015 09-18-jug summer camp2015 09-18-jug summer camp
2015 09-18-jug summer camp
 
42 minutes to secure your code....
42 minutes to secure your code....42 minutes to secure your code....
42 minutes to secure your code....
 
Liferay hardening principles
Liferay hardening principlesLiferay hardening principles
Liferay hardening principles
 

Mehr von Graham Lee

Object-Oriented Programming in Functional Programming in Swift
Object-Oriented Programming in Functional Programming in SwiftObject-Oriented Programming in Functional Programming in Swift
Object-Oriented Programming in Functional Programming in SwiftGraham Lee
 
Taking a Test Drive
Taking a Test DriveTaking a Test Drive
Taking a Test DriveGraham Lee
 
Smartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrongSmartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrongGraham Lee
 
Unit testing for Cocoa developers
Unit testing for Cocoa developersUnit testing for Cocoa developers
Unit testing for Cocoa developersGraham Lee
 
Security and Encryption on iOS
Security and Encryption on iOSSecurity and Encryption on iOS
Security and Encryption on iOSGraham Lee
 
Intel Briefing Notes
Intel Briefing NotesIntel Briefing Notes
Intel Briefing NotesGraham Lee
 

Mehr von Graham Lee (6)

Object-Oriented Programming in Functional Programming in Swift
Object-Oriented Programming in Functional Programming in SwiftObject-Oriented Programming in Functional Programming in Swift
Object-Oriented Programming in Functional Programming in Swift
 
Taking a Test Drive
Taking a Test DriveTaking a Test Drive
Taking a Test Drive
 
Smartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrongSmartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrong
 
Unit testing for Cocoa developers
Unit testing for Cocoa developersUnit testing for Cocoa developers
Unit testing for Cocoa developers
 
Security and Encryption on iOS
Security and Encryption on iOSSecurity and Encryption on iOS
Security and Encryption on iOS
 
Intel Briefing Notes
Intel Briefing NotesIntel Briefing Notes
Intel Briefing Notes
 

Kürzlich hochgeladen

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 

Kürzlich hochgeladen (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 

Designing a Secure Cocoa App

Hinweis der Redaktion

  1. The goal of this presentation is to give you an idea of how security experts think about designing security into applications. A few examples of Mac OS X technologies will be used to indicate how these principles can be applied in real applications. Finally, we&amp;#x2019;ll look at an example of a vulnerability in an app, so that we can apply the ideas we&amp;#x2019;ve learned.
  2. Why should I want to talk about security, and why should you want to listen? The press and security researchers like talking about insecure Macs. They don&amp;#x2019;t care whether the holes are in our apps or in Apple&amp;#x2019;s; come to that, neither do our customers. If my app is less secure than the competitor&amp;#x2019;s then that&amp;#x2019;s a reason to choose the competition; just like UI fit and finish, usability or performance.
  3. First, remember that security is not a one-size-fits-all operation. Something which works in one context may not be appropriate elsewhere. Questions to ask are of risk: what could go wrong, how likely is it and what would the impact be? Can I live with that? How much am I (or my customers) willing to pay to reduce that risk? My &amp;#x201C;Pythagoras theorem&amp;#x201D;, i.e. my fundamental rule of software security is to think of it like real-world security. Securing an office building by locking _everyone_ out would stop burglars getting in, but it would stop the workers getting in too. Ultimately the user has to be confident that they can get their work done without untoward problems, just as good real-world security provides assurance that law-abiders can go about their business.
  4. So if we want to identify and mitigate threats which pose a risk to our app, we need to know what a threat is. We want to know _who_ is doing something which compromises our app, _what_ they get by doing it (or, conversely, what we lose), and _how_ they get in and acquire that asset.
  5. So if we want to identify and mitigate threats which pose a risk to our app, we need to know what a threat is. We want to know _who_ is doing something which compromises our app, _what_ they get by doing it (or, conversely, what we lose), and _how_ they get in and acquire that asset.
  6. So if we want to identify and mitigate threats which pose a risk to our app, we need to know what a threat is. We want to know _who_ is doing something which compromises our app, _what_ they get by doing it (or, conversely, what we lose), and _how_ they get in and acquire that asset.
  7. So if we want to identify and mitigate threats which pose a risk to our app, we need to know what a threat is. We want to know _who_ is doing something which compromises our app, _what_ they get by doing it (or, conversely, what we lose), and _how_ they get in and acquire that asset.
  8. So if we want to identify and mitigate threats which pose a risk to our app, we need to know what a threat is. We want to know _who_ is doing something which compromises our app, _what_ they get by doing it (or, conversely, what we lose), and _how_ they get in and acquire that asset.
  9. Could be a malicious person, could be someone accidentally exploiting a problem, such as misconfiguring their own application. That&amp;#x2019;s why I used the term &amp;#x201C;misuser&amp;#x201D; instead of &amp;#x201C;abuser&amp;#x201D;. They could be known to the customer/user or you or not. Each attacker will have different characteristics. Example: CanSecWest held the pwn2own competition, where competitors were encouraged to compromise various computers in order to win that computer as a prize. In that arena, the attacker is motivated by personal gain, there is little to no chance of recrimination so they&amp;#x2019;re likely to take huge risks and it&amp;#x2019;s also probable that they&amp;#x2019;d be security experts. That&amp;#x2019;s quite an edge case though.
  10. Could be a malicious person, could be someone accidentally exploiting a problem, such as misconfiguring their own application. That&amp;#x2019;s why I used the term &amp;#x201C;misuser&amp;#x201D; instead of &amp;#x201C;abuser&amp;#x201D;. They could be known to the customer/user or you or not. Each attacker will have different characteristics. Example: CanSecWest held the pwn2own competition, where competitors were encouraged to compromise various computers in order to win that computer as a prize. In that arena, the attacker is motivated by personal gain, there is little to no chance of recrimination so they&amp;#x2019;re likely to take huge risks and it&amp;#x2019;s also probable that they&amp;#x2019;d be security experts. That&amp;#x2019;s quite an edge case though.
  11. Could be a malicious person, could be someone accidentally exploiting a problem, such as misconfiguring their own application. That&amp;#x2019;s why I used the term &amp;#x201C;misuser&amp;#x201D; instead of &amp;#x201C;abuser&amp;#x201D;. They could be known to the customer/user or you or not. Each attacker will have different characteristics. Example: CanSecWest held the pwn2own competition, where competitors were encouraged to compromise various computers in order to win that computer as a prize. In that arena, the attacker is motivated by personal gain, there is little to no chance of recrimination so they&amp;#x2019;re likely to take huge risks and it&amp;#x2019;s also probable that they&amp;#x2019;d be security experts. That&amp;#x2019;s quite an edge case though.
  12. Could be a malicious person, could be someone accidentally exploiting a problem, such as misconfiguring their own application. That&amp;#x2019;s why I used the term &amp;#x201C;misuser&amp;#x201D; instead of &amp;#x201C;abuser&amp;#x201D;. They could be known to the customer/user or you or not. Each attacker will have different characteristics. Example: CanSecWest held the pwn2own competition, where competitors were encouraged to compromise various computers in order to win that computer as a prize. In that arena, the attacker is motivated by personal gain, there is little to no chance of recrimination so they&amp;#x2019;re likely to take huge risks and it&amp;#x2019;s also probable that they&amp;#x2019;d be security experts. That&amp;#x2019;s quite an edge case though.
  13. Could be a malicious person, could be someone accidentally exploiting a problem, such as misconfiguring their own application. That&amp;#x2019;s why I used the term &amp;#x201C;misuser&amp;#x201D; instead of &amp;#x201C;abuser&amp;#x201D;. They could be known to the customer/user or you or not. Each attacker will have different characteristics. Example: CanSecWest held the pwn2own competition, where competitors were encouraged to compromise various computers in order to win that computer as a prize. In that arena, the attacker is motivated by personal gain, there is little to no chance of recrimination so they&amp;#x2019;re likely to take huge risks and it&amp;#x2019;s also probable that they&amp;#x2019;d be security experts. That&amp;#x2019;s quite an edge case though.
  14. Could be a malicious person, could be someone accidentally exploiting a problem, such as misconfiguring their own application. That&amp;#x2019;s why I used the term &amp;#x201C;misuser&amp;#x201D; instead of &amp;#x201C;abuser&amp;#x201D;. They could be known to the customer/user or you or not. Each attacker will have different characteristics. Example: CanSecWest held the pwn2own competition, where competitors were encouraged to compromise various computers in order to win that computer as a prize. In that arena, the attacker is motivated by personal gain, there is little to no chance of recrimination so they&amp;#x2019;re likely to take huge risks and it&amp;#x2019;s also probable that they&amp;#x2019;d be security experts. That&amp;#x2019;s quite an edge case though.
  15. The assets in an application can be tangible data held by the app, such as a password, a user&amp;#x2019;s identity or some information of financial value. Alternatively they can be intangible; there&amp;#x2019;s no file on the Sophos webserver which actually contains the company&amp;#x2019;s reputation, but the reputation could still be damaged by a successful attack on the webserver content. The asset at risk could also be something which the app has access to but doesn&amp;#x2019;t actually &amp;#x201C;own&amp;#x201D;, such as the network connectivity or CPU time which are often the targets of zombie networks.
  16. The assets in an application can be tangible data held by the app, such as a password, a user&amp;#x2019;s identity or some information of financial value. Alternatively they can be intangible; there&amp;#x2019;s no file on the Sophos webserver which actually contains the company&amp;#x2019;s reputation, but the reputation could still be damaged by a successful attack on the webserver content. The asset at risk could also be something which the app has access to but doesn&amp;#x2019;t actually &amp;#x201C;own&amp;#x201D;, such as the network connectivity or CPU time which are often the targets of zombie networks.
  17. The assets in an application can be tangible data held by the app, such as a password, a user&amp;#x2019;s identity or some information of financial value. Alternatively they can be intangible; there&amp;#x2019;s no file on the Sophos webserver which actually contains the company&amp;#x2019;s reputation, but the reputation could still be damaged by a successful attack on the webserver content. The asset at risk could also be something which the app has access to but doesn&amp;#x2019;t actually &amp;#x201C;own&amp;#x201D;, such as the network connectivity or CPU time which are often the targets of zombie networks.
  18. The assets in an application can be tangible data held by the app, such as a password, a user&amp;#x2019;s identity or some information of financial value. Alternatively they can be intangible; there&amp;#x2019;s no file on the Sophos webserver which actually contains the company&amp;#x2019;s reputation, but the reputation could still be damaged by a successful attack on the webserver content. The asset at risk could also be something which the app has access to but doesn&amp;#x2019;t actually &amp;#x201C;own&amp;#x201D;, such as the network connectivity or CPU time which are often the targets of zombie networks.
  19. The assets in an application can be tangible data held by the app, such as a password, a user&amp;#x2019;s identity or some information of financial value. Alternatively they can be intangible; there&amp;#x2019;s no file on the Sophos webserver which actually contains the company&amp;#x2019;s reputation, but the reputation could still be damaged by a successful attack on the webserver content. The asset at risk could also be something which the app has access to but doesn&amp;#x2019;t actually &amp;#x201C;own&amp;#x201D;, such as the network connectivity or CPU time which are often the targets of zombie networks.
  20. The assets in an application can be tangible data held by the app, such as a password, a user&amp;#x2019;s identity or some information of financial value. Alternatively they can be intangible; there&amp;#x2019;s no file on the Sophos webserver which actually contains the company&amp;#x2019;s reputation, but the reputation could still be damaged by a successful attack on the webserver content. The asset at risk could also be something which the app has access to but doesn&amp;#x2019;t actually &amp;#x201C;own&amp;#x201D;, such as the network connectivity or CPU time which are often the targets of zombie networks.
  21. So we can classify the importance of assets - and thus the value in protecting them - along at least three axes: * how much damage would be done (put another way: how much would it cost) if this asset were to be read by someone who shouldn&amp;#x2019;t be able to? * how much damage would be done if the asset were modified in an unexpected fashion? * how much damage would be done if the asset disappeared, or could not be used for the legitimate use cases?
  22. So we can classify the importance of assets - and thus the value in protecting them - along at least three axes: * how much damage would be done (put another way: how much would it cost) if this asset were to be read by someone who shouldn&amp;#x2019;t be able to? * how much damage would be done if the asset were modified in an unexpected fashion? * how much damage would be done if the asset disappeared, or could not be used for the legitimate use cases?
  23. So we can classify the importance of assets - and thus the value in protecting them - along at least three axes: * how much damage would be done (put another way: how much would it cost) if this asset were to be read by someone who shouldn&amp;#x2019;t be able to? * how much damage would be done if the asset were modified in an unexpected fashion? * how much damage would be done if the asset disappeared, or could not be used for the legitimate use cases?
  24. So we can classify the importance of assets - and thus the value in protecting them - along at least three axes: * how much damage would be done (put another way: how much would it cost) if this asset were to be read by someone who shouldn&amp;#x2019;t be able to? * how much damage would be done if the asset were modified in an unexpected fashion? * how much damage would be done if the asset disappeared, or could not be used for the legitimate use cases?
  25. Filesystem permissions can protect the confidentiality and integrity of persistent assets - up to a point. The super-user gets to trump the permissions model. Of course, it&amp;#x2019;s easier to change the permissions or ACLs on a file than it is to protect it against misuse - think carefully about what classes of user will be interacting with your app, and what they should be able to change or read.
  26. Filesystem permissions can protect the confidentiality and integrity of persistent assets - up to a point. The super-user gets to trump the permissions model. Of course, it&amp;#x2019;s easier to change the permissions or ACLs on a file than it is to protect it against misuse - think carefully about what classes of user will be interacting with your app, and what they should be able to change or read.
  27. Of course the filesystem permissions can be trumped by the super-user, but it&amp;#x2019;s not always the case that their superior status should mean they can read a regular user&amp;#x2019;s data. That&amp;#x2019;s where encryption comes in. Keychain is actually very easy to use for the usual case of keeping one password for an app to access a single service such as a web application or e-mail account.
  28. Of course the filesystem permissions can be trumped by the super-user, but it&amp;#x2019;s not always the case that their superior status should mean they can read a regular user&amp;#x2019;s data. That&amp;#x2019;s where encryption comes in. Keychain is actually very easy to use for the usual case of keeping one password for an app to access a single service such as a web application or e-mail account.
  29. Of course the filesystem permissions can be trumped by the super-user, but it&amp;#x2019;s not always the case that their superior status should mean they can read a regular user&amp;#x2019;s data. That&amp;#x2019;s where encryption comes in. Keychain is actually very easy to use for the usual case of keeping one password for an app to access a single service such as a web application or e-mail account.
  30. Of course the filesystem permissions can be trumped by the super-user, but it&amp;#x2019;s not always the case that their superior status should mean they can read a regular user&amp;#x2019;s data. That&amp;#x2019;s where encryption comes in. Keychain is actually very easy to use for the usual case of keeping one password for an app to access a single service such as a web application or e-mail account.
  31. Of course the filesystem permissions can be trumped by the super-user, but it&amp;#x2019;s not always the case that their superior status should mean they can read a regular user&amp;#x2019;s data. That&amp;#x2019;s where encryption comes in. Keychain is actually very easy to use for the usual case of keeping one password for an app to access a single service such as a web application or e-mail account.
  32. Of course the filesystem permissions can be trumped by the super-user, but it&amp;#x2019;s not always the case that their superior status should mean they can read a regular user&amp;#x2019;s data. That&amp;#x2019;s where encryption comes in. Keychain is actually very easy to use for the usual case of keeping one password for an app to access a single service such as a web application or e-mail account.
  33. Of course the filesystem permissions can be trumped by the super-user, but it&amp;#x2019;s not always the case that their superior status should mean they can read a regular user&amp;#x2019;s data. That&amp;#x2019;s where encryption comes in. Keychain is actually very easy to use for the usual case of keeping one password for an app to access a single service such as a web application or e-mail account.
  34. The longer a secret is kept in memory, the easier it is for a debugging tool such as gdb or F-Script Anywhere to retrieve it. Keychain allows us to pass around references to the encrypted secret, only retrieving the plain-text at the point where it&amp;#x2019;s really needed.
  35. The longer a secret is kept in memory, the easier it is for a debugging tool such as gdb or F-Script Anywhere to retrieve it. Keychain allows us to pass around references to the encrypted secret, only retrieving the plain-text at the point where it&amp;#x2019;s really needed.
  36. The longer a secret is kept in memory, the easier it is for a debugging tool such as gdb or F-Script Anywhere to retrieve it. Keychain allows us to pass around references to the encrypted secret, only retrieving the plain-text at the point where it&amp;#x2019;s really needed.
  37. So that was how we can protect the confidentiality and integrity (and to some extent, the availability) of filesystem assets. But what about the integrity of our app itself?
  38. So it&amp;#x2019;s incredibly easy to sign apps with Xcode, but for some reason few apps actually ship signed. Why is that? I think it&amp;#x2019;s because there&amp;#x2019;s very minimal UI related to the feature in Leopard, so it&amp;#x2019;s hard to see that there&amp;#x2019;s any benefit for the Mac user on the Clapham omnibus. However, look at the iPhone where the code signature is used everywhere, and the administration features on OS X (and Server) which rely on code signatures such as the application controls and the firewall.
  39. So it&amp;#x2019;s incredibly easy to sign apps with Xcode, but for some reason few apps actually ship signed. Why is that? I think it&amp;#x2019;s because there&amp;#x2019;s very minimal UI related to the feature in Leopard, so it&amp;#x2019;s hard to see that there&amp;#x2019;s any benefit for the Mac user on the Clapham omnibus. However, look at the iPhone where the code signature is used everywhere, and the administration features on OS X (and Server) which rely on code signatures such as the application controls and the firewall.
  40. So it&amp;#x2019;s incredibly easy to sign apps with Xcode, but for some reason few apps actually ship signed. Why is that? I think it&amp;#x2019;s because there&amp;#x2019;s very minimal UI related to the feature in Leopard, so it&amp;#x2019;s hard to see that there&amp;#x2019;s any benefit for the Mac user on the Clapham omnibus. However, look at the iPhone where the code signature is used everywhere, and the administration features on OS X (and Server) which rely on code signatures such as the application controls and the firewall.
  41. So, presumably, I&amp;#x2019;m going to address availability next.
  42. Launchd offers some very cool and flexible configuration as a service watchdog, so if there&amp;#x2019;s some service used by your app for which availability is important this should be your first port of call. Note that there were a few bugs on 10.4 and the whole thing was less flexible. 10.3 and before never existed - we have always been at war with Eurasia.
  43. Launchd offers some very cool and flexible configuration as a service watchdog, so if there&amp;#x2019;s some service used by your app for which availability is important this should be your first port of call. Note that there were a few bugs on 10.4 and the whole thing was less flexible. 10.3 and before never existed - we have always been at war with Eurasia.
  44. Launchd offers some very cool and flexible configuration as a service watchdog, so if there&amp;#x2019;s some service used by your app for which availability is important this should be your first port of call. Note that there were a few bugs on 10.4 and the whole thing was less flexible. 10.3 and before never existed - we have always been at war with Eurasia.
  45. Launchd offers some very cool and flexible configuration as a service watchdog, so if there&amp;#x2019;s some service used by your app for which availability is important this should be your first port of call. Note that there were a few bugs on 10.4 and the whole thing was less flexible. 10.3 and before never existed - we have always been at war with Eurasia.
  46. Look at this screenshot of iTunes, and rather than complaining about my taste in music try and think of what the various assets are. Which of the CIA attributes are important in each case? Who might have a stake in protecting them? Who might compromise them?
  47. So once we&amp;#x2019;ve identified a threat (I didn&amp;#x2019;t explicitly discuss entry points and routes around the app - those are highly app-specific), we can see what type of damage is done should the threat succeed.
  48. So once we&amp;#x2019;ve identified a threat (I didn&amp;#x2019;t explicitly discuss entry points and routes around the app - those are highly app-specific), we can see what type of damage is done should the threat succeed.
  49. So once we&amp;#x2019;ve identified a threat (I didn&amp;#x2019;t explicitly discuss entry points and routes around the app - those are highly app-specific), we can see what type of damage is done should the threat succeed.
  50. So once we&amp;#x2019;ve identified a threat (I didn&amp;#x2019;t explicitly discuss entry points and routes around the app - those are highly app-specific), we can see what type of damage is done should the threat succeed.
  51. So once we&amp;#x2019;ve identified a threat (I didn&amp;#x2019;t explicitly discuss entry points and routes around the app - those are highly app-specific), we can see what type of damage is done should the threat succeed.
  52. So once we&amp;#x2019;ve identified a threat (I didn&amp;#x2019;t explicitly discuss entry points and routes around the app - those are highly app-specific), we can see what type of damage is done should the threat succeed.
  53. So once we&amp;#x2019;ve identified a threat (I didn&amp;#x2019;t explicitly discuss entry points and routes around the app - those are highly app-specific), we can see what type of damage is done should the threat succeed.
  54. Does authorisation services protect us against elevation of privilege attacks? Not directly - note that the rights obtained are passed back to the calling application, which is running as the user who made the request - if the user can make the request they can do whatever was &amp;#x201C;behind&amp;#x201D; the right without bothering your app to acquire the right. This is why we must consider &amp;#x201C;factored&amp;#x201D; apps - where the auth right is used to invoke a privileged helper, which then retrieves the right from the calling app to verify that it really should perform the privileged task. In this way, the user cannot circumvent the requirement to obtain the right in order to perform the gated task.
  55. Does authorisation services protect us against elevation of privilege attacks? Not directly - note that the rights obtained are passed back to the calling application, which is running as the user who made the request - if the user can make the request they can do whatever was &amp;#x201C;behind&amp;#x201D; the right without bothering your app to acquire the right. This is why we must consider &amp;#x201C;factored&amp;#x201D; apps - where the auth right is used to invoke a privileged helper, which then retrieves the right from the calling app to verify that it really should perform the privileged task. In this way, the user cannot circumvent the requirement to obtain the right in order to perform the gated task.
  56. Does authorisation services protect us against elevation of privilege attacks? Not directly - note that the rights obtained are passed back to the calling application, which is running as the user who made the request - if the user can make the request they can do whatever was &amp;#x201C;behind&amp;#x201D; the right without bothering your app to acquire the right. This is why we must consider &amp;#x201C;factored&amp;#x201D; apps - where the auth right is used to invoke a privileged helper, which then retrieves the right from the calling app to verify that it really should perform the privileged task. In this way, the user cannot circumvent the requirement to obtain the right in order to perform the gated task.
  57. Does authorisation services protect us against elevation of privilege attacks? Not directly - note that the rights obtained are passed back to the calling application, which is running as the user who made the request - if the user can make the request they can do whatever was &amp;#x201C;behind&amp;#x201D; the right without bothering your app to acquire the right. This is why we must consider &amp;#x201C;factored&amp;#x201D; apps - where the auth right is used to invoke a privileged helper, which then retrieves the right from the calling app to verify that it really should perform the privileged task. In this way, the user cannot circumvent the requirement to obtain the right in order to perform the gated task.
  58. Does authorisation services protect us against elevation of privilege attacks? Not directly - note that the rights obtained are passed back to the calling application, which is running as the user who made the request - if the user can make the request they can do whatever was &amp;#x201C;behind&amp;#x201D; the right without bothering your app to acquire the right. This is why we must consider &amp;#x201C;factored&amp;#x201D; apps - where the auth right is used to invoke a privileged helper, which then retrieves the right from the calling app to verify that it really should perform the privileged task. In this way, the user cannot circumvent the requirement to obtain the right in order to perform the gated task.
  59. Does authorisation services protect us against elevation of privilege attacks? Not directly - note that the rights obtained are passed back to the calling application, which is running as the user who made the request - if the user can make the request they can do whatever was &amp;#x201C;behind&amp;#x201D; the right without bothering your app to acquire the right. This is why we must consider &amp;#x201C;factored&amp;#x201D; apps - where the auth right is used to invoke a privileged helper, which then retrieves the right from the calling app to verify that it really should perform the privileged task. In this way, the user cannot circumvent the requirement to obtain the right in order to perform the gated task.
  60. Does authorisation services protect us against elevation of privilege attacks? Not directly - note that the rights obtained are passed back to the calling application, which is running as the user who made the request - if the user can make the request they can do whatever was &amp;#x201C;behind&amp;#x201D; the right without bothering your app to acquire the right. This is why we must consider &amp;#x201C;factored&amp;#x201D; apps - where the auth right is used to invoke a privileged helper, which then retrieves the right from the calling app to verify that it really should perform the privileged task. In this way, the user cannot circumvent the requirement to obtain the right in order to perform the gated task.
  61. Does authorisation services protect us against elevation of privilege attacks? Not directly - note that the rights obtained are passed back to the calling application, which is running as the user who made the request - if the user can make the request they can do whatever was &amp;#x201C;behind&amp;#x201D; the right without bothering your app to acquire the right. This is why we must consider &amp;#x201C;factored&amp;#x201D; apps - where the auth right is used to invoke a privileged helper, which then retrieves the right from the calling app to verify that it really should perform the privileged task. In this way, the user cannot circumvent the requirement to obtain the right in order to perform the gated task.