SlideShare uma empresa Scribd logo
1 de 32
Reducing Application Risk:

Minimizing your Web
Application’s Attack Surface


           Jason Taylor
                CTO
         Security Innovation
About Security Innovation

• Software and Crypto Security Experts
   – 10+ years research on vulnerabilities and cryptography
   – Hundreds of assessments on world’s most dominant
     software applications

• Products, Services & Training
   – Software & SDLC Assessments
   – Industry’s largest eLearning library
   – High-performance encryption


• Helping organizations:
   – Build internal security awareness and expertise
   – Roll out secure software applications and products
   – Protect data in transit and while applications are accessing it
Agenda


Objectives of Attack Surface Analysis
 and Reduction
• Measuring and Reducing your Attack Surface
• Microsoft Case Study
• Conclusion
A Software Application’s Attack Surface

• Software exposes key business
 and customer assets via entry points:
   –   User interfaces
   –   Web services
   –   Direct database access
   –   Network channels, pipes, files, APIs …

• The entire collection of entry points in
 a product is called it’s Attack Surface
   – Set of ways in which adversaries can attack a software system
   – Not limited to local resources; channels used to communicate
     with remote resources are vectors for attack

• Big Attack Surface = Big Security Work= Big Security Problems
   – With big attack surface, you must spend more time making sure the code is
     excellent quality, conservative, and defensive
Understanding Attack Surface

• Attack Surface can Gauge Risk of Attack
   – Attack surface measures potential avenues of attack
   – Attack surface measures potential impact of an attack

• Useful as a Metric in Design through Deployment
   – Measurement is both point-in-time and relative

• Attacks over the years show that certain vectors are more
 likely to be opportunities of attack than others
   – Known (and un-patched) vulnerabilities
   – Services running with high privileges are more likely to cause damage when
     attacked
   – Files with full control (e.g., rwxrwxrwx) are more likely to be attacked than
     files with less generous permissions
   – Use of binary controls such as ActiveX or Flash increase the chance of a
     damaging attack
Main Goals of Attack Surface Reduction


• Every feature that is added to an application adds risk
• The aim for secure development is to reduce the overall risk by
 balancing functionality vs. risk
   – Reduce the amount of code executing by default
   – Reduce the volume of code that is accessible to untrusted users by
     default
   – Close doors (access points) that can be easily opened/exploited
   – Limit the damage if the access point is exploited




              Bottom Line: Fend off Future Attacks
Considerations for Attack Surface Reduction


Some Web applications inherently need more attention on
attack surface than others
 • Is it Internet or Intranet accessible? Internet implies more risk.
 • Does it transmit, store or manipulate sensitive data?
   – If so, there are potential threats to that data and depending on the data there
     may be regulatory compliance requirements.

 • Has the application had security problems in the past?
     – Past security problems increase the likelihood of future problems
Agenda


• Objectives of Attack Surface Analysis and
 Reduction
Measuring and Reducing your Attack Surface
• Microsoft Case Study
• Conclusion
Common Metrics for Application Risk/Security

• At CODE LEVEL
   – We count the number of bugs found
   – Not an ideal metric because:
       • It misses bugs that are not found (or fixed), perhaps
         the one that gets exploited
       • equal importance is given to all bugs, even though some bugs are easier to
         exploit than others
       • the exploit of one may result in more damage than the exploit of another


• At the PRODUCT/SYSTEM level
   – We count the number of times a system version is mentioned in CERT,
     Microsoft Security Bulletins, MITRE CVEs, etc.
   – Not an ideal metric because it ignores the specific system configuration that
     gave rise to the vulnerability
       • whether a security patch has been installed
       • whether defaults are turned off
       • whether it always runs in system administrator mode.
New Metric to Add: Attack Surface

• Rather than count bugs at code level or vulnerability reports at
  system level, you can measure the avenues of attack
    – The counts of these “more likely to be attacked” features determine a
      system’s attack surface

• Attack Surface attempts to measure security in relative terms
    – Useful as a delta measurement (i.e. v1.2 to v1.n of a product)
    – Not useful for comparing app to app or as stand-alone metric
Measuring attack surface

 • Start with baseline, then measure each week
       – Define your minimal attack surface early on during design

 • If the attack surface count goes up, determine why and see if you
    can drive it back down
       – When engineers know you are measuring the attack surface, they may
         improve efforts
       Baseline            Baseline + 1 month                              Comment

3 x TCP ports          2 x TCP ports               Good; one fewer port to worry about.
1 x UDP port           2 x UDP port                Which functionality opened the new UDP port? Why is
                                                   it open by default? Is it authenticated? Is it restricted
                                                   to a subnet?
2 x Services (both     3 x Services (2 x SYSTEM,   Why is another service running by default? Why are
SYSTEM)                1 x LocalService)           any running as SYSTEM?
3 x ActiveX controls   4 x ActiveX controls        Why is the new control installed? Is it safe for
                                                   scripting?
No additional user     1 x application account     Turns out this is a member of the administrators group
accounts                                           too! Why? What's the password?
Potential Uses for Attack Surface Measurement

• Developers and architects can better prioritize testing efforts
    – If a software’s attack surface measurement is high, they may want to invest
      more in testing

• Developers can use it as a guide while implementing patches of
  security vulnerabilities
    – A good patch should not only remove a vulnerability from a system, but
      also should not increase the system's attack surface.

• Consumers can use it to guide their choice of configuration
    – Since a system's attack surface measurement is dependent on the
      system's configuration, software consumers would choose a configuration
      that results in a smaller attack surface exposure.

• Risk Management/Corporate Security can understand their
  potential business exposure
Attack Surface & Entry Points


• To attack an application, attackers will
   – Identify entry points
   – Exploit the entry point or the backend exposed behind it
   – Try to deny legitimate users access to these entry points

• In our software, we have to:
   – Understand the attack surface
   – Reduce it as much as possible
   – Test against it for exposed vulnerabilities

• Mapping our Attack Surface
   – Architecture and design docs, code..
   – But how many entry points are undocumented
       • Temporary files? Pipes? Network communication? Registry keys?
         Embeddable code?
The Attack Surface Reduction Process


• Look at all of your entry points
   – User input (UI)
   – Programmatic input (Web Service APIs)
   – File reads
   – Database access

• Rank them
   – Authenticated versus anonymous
   – Administrator only versus user
   – Network versus local

              Attack Surface Reduction is as important as
                      trying to get the code right
It’s Not Just About Turning Stuff Off!


        Higher Attack Surface   Lower Attack Surface
         Executing by default      Off by default
             Open socket           Closed socket
          Anonymous access      Authenticated access
            Constantly on         Intermittently on
            Admin access            User access
           Internet access       Local subnet access
               SYSTEM               Not SYSTEM!
           Uniform defaults     User-chosen settings
             Large code              Small code
             Weak ACLs              Strong ACLs
Reducing your Attack Surface – Best Practices

• Reduce the amount of code running by default
• Reduce access to entry points by untrusted users
   – restrict access to network endpoints used by your
     application to the local subnet or IP range
   – limit access to network endpoints using authentication.

• Reduce privilege to limit damage potential
   – Sandbox running code
   – Give higher permissions for as short a period as possible
   – Pay attention to trust boundaries

• Integrate with your SDLC
ASR Best Practices
Reduce the Amount of Running Code

• Apply the 80/20 rule
   – Ask yourself, "Do 80 percent of users/customers use this feature?“
   – If the answer is no, then turn it off and make it easy to
     turn the feature back on

• Services can’t be attacked if they are not running
   – All forms of dynamic Web content should be opt-in
   – If there is security defect in a service, this ensures that the only affected
     users are those actively running the service (versus all software users)

• ASR is not just an "on or off" proposition
   – You can reduce attack surface by limiting who can access the code once it
     is running
   – This has an interesting side effect: many features are still usable, but are
     inaccessible by attackers (must have knowledge of access controls?)
ASR Best Practices
Reduce access to entry points by untrusted users

• Example:
    – By default, most Web sites are accessible to all users
    – If the Web server limited access only to trusted users, or users on a
      specific subnet, then fewer users could take advantage of the defect
    – This is good because the code works for those who require the
      functionality
    – Restrict access to network endpoints used by your application to the local
      subnet or IP range.

• To reduce the number of users who can communicate with
  potentially vulnerable code, authenticate before they can access
  the code
    – Limit access to network endpoints using authentication. Simply validating
      the user reduces your component's attack surface.
    – Most bad guys are unauthenticated. By raising the authentication bar a
      little you can eliminate a large population of potential attackers.
ASR Best Practices
Reduce access to entry points by untrusted users

• Pay attention to trust boundaries
   – Review the entire data flow from entry point to data store
   – Look for all the potential data flows, data stores, and processes that the
     code touches (code that an attacker can touch)
   – Determine what privilege is required to access that entry point
   – Can you raise the authorization bar?

• Example: Code with only two network-facing entry points
   – One is anonymous and the other can only be accessed by administrators
   – Hacker is going to attack the code along the anonymous data path simply
     because they can
       • Not going to exercise the administrative code path because, if they can, then
         they are already an administrator (and your problems are only just starting) 

    As you review dataflow, look for anonymous threat paths. It may
        be prudent to raise the authorization bar on these paths
ASR Best Practices
Reduce privilege to limit damage potential

• Even if your code has vulnerabilities, and you don’t limit access to
  the code, you can still reduce the damage potential by operating
  the code with reduced privileges
    – remove any privileges not explicitly required by the application

• Example: Dangerous Backup Privilege
    –    Any process running under an account with this privilege can read any file
        in the file system, regardless of the access control list (ACL) on the file
    – Wrong way
      run as SYSTEM, which has backup privilege, but also has restore, debug,
      and "act as part of operating system" privilege; and is an admin account too
    – Right Way:
      run service under a specific authenticated account that has this privilege

   Never run services as SYSTEM, or daemons as root, or user accounts
  with administrative rights unless you have exhausted all other possibilities
ASR Best Practices
Integrate with your SDLC

• When designing your application, outline what the attack
 surface will look like and identify the following:
   – The networking protocols you enabled by default
   – The endpoints that should support authentication and authorization. Focus on
     other anonymous endpoints
   – The off-by-default features
       • Look for code that auto-starts or will execute when accessed, such as services,
         daemons, ISAPI filters and applications, SOAP services, and Web roots
   – Reusable components (ActiveX® controls, COM objects, and .NET
     Framework assemblies, etc)
   – Process identities for all the code you run
   – User accounts installed

     When developers know early what the attack surface looks like,
         they can design and code defensively from the start
ASR Best Practices
Integrate into your SDLC

• Implementation
   – Increase awareness of secure coding principles
   – Discover dangerous code changes that can add vulnerabilities or impact
     attack surface

• Testing
   – Detailed measurement of attack surface
   – Test against attack surface specified during design

• Deployment
   – Configuration changes can make a big impact on attack surface
   – Turn off features you’re not using, reduce privileges of running processes, etc
Agenda


• Objectives of Attack Surface Analysis and
 Reduction
• Measuring and Reducing your Attack Surface
Microsoft Case Study
• Conclusion
Microsoft Attack Surface Reduction Case Study


• In 2002, Michael Howard was asked to measure
 security progress in Windows Server 2003

• He developed a set of metrics that became known as
 the Relative Attack Surface Quotient or “RASQ”
     • Open ports            • Services running default
     • Named pipes           • Services running as SYSTEM
     • RPC endpoints         • IIS web directories (including sample apps)
     • Null Sessions         • Users
     • Installed Services

• Enumerating all these elements took about a dozen tools
Microsoft Attack Surface Reduction Case Study

• RASQ for each version of Windows: NT4 through Windows XP
Microsoft Attack Surface Reduction Case Study
Key Deltas




• NT4 SP6a + Option Pack to NT4 SP6a + Option Pack + IISChk
   – IISChk is a checklist which reduces attack surface

• Windows 2000 + IISChk to Windows Server 2003
   – Default install of Windows Server 2003 has smaller attack surface than
     Windows 2000 even after the checklist is applied
Microsoft Attack Surface Reduction Case Study
Key Takeaways

• Windows Server 2003
   – Watershed moment for Microsoft Windows
   – IIS no longer installed by default


• As the SDL evolved, slogan emerged: Secure by Design,
 Secure by Default
   – First clause means “get the design and code secure”
   – Last clause means “product will never be 100% secure, so reduce its
     attack surface”

• Microsoft teams saw the value of a reduced attack surface
   – Fewer security bulletins and lower severity bulletins
   – Attack surface analysis tool was born
Agenda


• Objectives of Attack Surface Analysis
 and Reduction
• Measuring and Reducing your Attack Surface
• Microsoft Case Study
Conclusion
Conclusion


• Use Attack Surface Reduction to reduce your overall security
 profile
   – Protect against the threats and vulnerabilities you don’t know about

• Match attack surface risk to the level of effort devoted to
 secure design, development and testing
   – Include Attack Surface analysis as part of your overall strategy
   – Include design, development and test best practices as effective ways
     to minimize your attack surface and overall risk

• Get the Microsoft Attack Surface Analyzer Beta
 http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e068c224-
 9d6d-4bf4-aab8-f7352a5e7d45&displaylang=en
How Security Innovation can Help


• Services
   – SDLC Process review
   – Code Review
   – Pen Test

• eLearning Products
   – Computer based training
   – Secure Development Knowledgebase

• Data Encryption
   – Fastest, most secure cryptography available on the market
eLearning Solutions for Secure Development

                          Secure Development Knowledgebase
                            – Out of the box secure development standards for:
                                  • Secure Design
                                  • Secure Coding
                                  • Security Testing
                            – How-to’s, code snippets, attacks, checklists


Computer Based Training
 –   Intro to Threat Modeling
 –   OWASP Top Ten: Threats & Mitigations
 –   Creating Secure ASP.Net & J2EE Code
 –   Architecture Risk Analysis
 –   Intro to Cryptography
 –   35 more
Free eLearning Course for Attending
   Introduction to Threat Modeling
        Creating Secure Code
 Fundamentals of Application Security

  http://elearning.securityinnovation.com

         Monthly Webcasts

http://www.securityinnovation.com/security-
        lab/upcomingwebcasts.shtml

                 Contact
   getsecure@securityinnovation.com
     jtaylor@securityinnovation.com

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

API Training 10 Nov 2014
API Training 10 Nov 2014API Training 10 Nov 2014
API Training 10 Nov 2014
 
Symantec Endpoint Suite
Symantec Endpoint SuiteSymantec Endpoint Suite
Symantec Endpoint Suite
 
Slide Deck – Session 9 – FRSecure CISSP
Slide Deck – Session 9 – FRSecure CISSP Slide Deck – Session 9 – FRSecure CISSP
Slide Deck – Session 9 – FRSecure CISSP
 
501 ch 8 risk management tools
501 ch 8 risk management tools501 ch 8 risk management tools
501 ch 8 risk management tools
 
Assessing network security
Assessing network securityAssessing network security
Assessing network security
 
Slide Deck – Session 5 – FRSecure CISSP Mentor Program 2017
Slide Deck – Session 5 – FRSecure CISSP Mentor Program 2017Slide Deck – Session 5 – FRSecure CISSP Mentor Program 2017
Slide Deck – Session 5 – FRSecure CISSP Mentor Program 2017
 
Radware DefensePipe: Cloud-Based Attack Mitigation Solution
Radware DefensePipe:  Cloud-Based Attack Mitigation SolutionRadware DefensePipe:  Cloud-Based Attack Mitigation Solution
Radware DefensePipe: Cloud-Based Attack Mitigation Solution
 
Affordable app sec for startups by - Sandeep Singh, Vaibhav Gupta and Vishal ...
Affordable app sec for startups by - Sandeep Singh, Vaibhav Gupta and Vishal ...Affordable app sec for startups by - Sandeep Singh, Vaibhav Gupta and Vishal ...
Affordable app sec for startups by - Sandeep Singh, Vaibhav Gupta and Vishal ...
 
Security Culture from Concept to Maintenance: Secure Software Development Lif...
Security Culture from Concept to Maintenance: Secure Software Development Lif...Security Culture from Concept to Maintenance: Secure Software Development Lif...
Security Culture from Concept to Maintenance: Secure Software Development Lif...
 
2018 FRecure CISSP Mentor Program- Session 4
2018 FRecure CISSP Mentor Program- Session 42018 FRecure CISSP Mentor Program- Session 4
2018 FRecure CISSP Mentor Program- Session 4
 
4 florin coada - dast automation, more value for less work
4   florin coada - dast automation, more value for less work4   florin coada - dast automation, more value for less work
4 florin coada - dast automation, more value for less work
 
Detección y mitigación de amenazas con Check Point
Detección y mitigación de amenazas con Check PointDetección y mitigación de amenazas con Check Point
Detección y mitigación de amenazas con Check Point
 
Secure design best practices and design patterns
Secure design best practices and design patternsSecure design best practices and design patterns
Secure design best practices and design patterns
 
501 ch 6 threats vulnerabilities attacks
501 ch 6 threats vulnerabilities attacks501 ch 6 threats vulnerabilities attacks
501 ch 6 threats vulnerabilities attacks
 
2018 FRSecure CISSP Mentor Program- Session 5
2018 FRSecure CISSP Mentor Program-  Session 52018 FRSecure CISSP Mentor Program-  Session 5
2018 FRSecure CISSP Mentor Program- Session 5
 
Technical Writing for Consultants
Technical Writing for ConsultantsTechnical Writing for Consultants
Technical Writing for Consultants
 
Social Distance Your IBM i from Cybersecurity Risk
Social Distance Your IBM i from Cybersecurity RiskSocial Distance Your IBM i from Cybersecurity Risk
Social Distance Your IBM i from Cybersecurity Risk
 
Slide Deck – Session 11 – FRSecure CISSP Mentor Program 2017
Slide Deck – Session 11 – FRSecure CISSP Mentor Program 2017Slide Deck – Session 11 – FRSecure CISSP Mentor Program 2017
Slide Deck – Session 11 – FRSecure CISSP Mentor Program 2017
 
Using Assessment Tools on ICS (English)
Using Assessment Tools on ICS (English)Using Assessment Tools on ICS (English)
Using Assessment Tools on ICS (English)
 
PLNOG15 :DDOS Attacks & Collateral Damage. Can we avoid it? Asraf Ali
PLNOG15 :DDOS Attacks & Collateral Damage. Can we avoid it? Asraf AliPLNOG15 :DDOS Attacks & Collateral Damage. Can we avoid it? Asraf Ali
PLNOG15 :DDOS Attacks & Collateral Damage. Can we avoid it? Asraf Ali
 

Semelhante a Reducing Application Risk: minimizing your web application's attack surface

Semelhante a Reducing Application Risk: minimizing your web application's attack surface (20)

Threat_Modelling.pdf
Threat_Modelling.pdfThreat_Modelling.pdf
Threat_Modelling.pdf
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSec
 
chap-1 : Vulnerabilities in Information Systems
chap-1 : Vulnerabilities in Information Systemschap-1 : Vulnerabilities in Information Systems
chap-1 : Vulnerabilities in Information Systems
 
Cyber security - It starts with the embedded system
Cyber security - It starts with the embedded systemCyber security - It starts with the embedded system
Cyber security - It starts with the embedded system
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017
 
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...Bringing Security Testing to Development: How to Enable Developers to Act as ...
Bringing Security Testing to Development: How to Enable Developers to Act as ...
 
The Top 10 Most Common Weaknesses in Serverless Applications 2018
The Top 10 Most Common Weaknesses in Serverless Applications 2018The Top 10 Most Common Weaknesses in Serverless Applications 2018
The Top 10 Most Common Weaknesses in Serverless Applications 2018
 
L08 architecture considerations
L08 architecture considerationsL08 architecture considerations
L08 architecture considerations
 
Cyber-Security-Unit-4.pptx
Cyber-Security-Unit-4.pptxCyber-Security-Unit-4.pptx
Cyber-Security-Unit-4.pptx
 
Chapter 9 system penetration [compatibility mode]
Chapter 9 system penetration [compatibility mode]Chapter 9 system penetration [compatibility mode]
Chapter 9 system penetration [compatibility mode]
 
Software Security
Software SecuritySoftware Security
Software Security
 
Defcon 22-tim-mcguffin-one-man-shop
Defcon 22-tim-mcguffin-one-man-shopDefcon 22-tim-mcguffin-one-man-shop
Defcon 22-tim-mcguffin-one-man-shop
 
Vapt life cycle
Vapt life cycleVapt life cycle
Vapt life cycle
 
Vulnerability assessment and penetration testing
Vulnerability assessment and penetration testingVulnerability assessment and penetration testing
Vulnerability assessment and penetration testing
 
Application Explosion How to Manage Productivity vs Security
Application Explosion How to Manage Productivity vs SecurityApplication Explosion How to Manage Productivity vs Security
Application Explosion How to Manage Productivity vs Security
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptx
 
Building an application security program
Building an application security programBuilding an application security program
Building an application security program
 
AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile World
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Reducing Application Risk: minimizing your web application's attack surface

  • 1. Reducing Application Risk: Minimizing your Web Application’s Attack Surface Jason Taylor CTO Security Innovation
  • 2. About Security Innovation • Software and Crypto Security Experts – 10+ years research on vulnerabilities and cryptography – Hundreds of assessments on world’s most dominant software applications • Products, Services & Training – Software & SDLC Assessments – Industry’s largest eLearning library – High-performance encryption • Helping organizations: – Build internal security awareness and expertise – Roll out secure software applications and products – Protect data in transit and while applications are accessing it
  • 3. Agenda Objectives of Attack Surface Analysis and Reduction • Measuring and Reducing your Attack Surface • Microsoft Case Study • Conclusion
  • 4. A Software Application’s Attack Surface • Software exposes key business and customer assets via entry points: – User interfaces – Web services – Direct database access – Network channels, pipes, files, APIs … • The entire collection of entry points in a product is called it’s Attack Surface – Set of ways in which adversaries can attack a software system – Not limited to local resources; channels used to communicate with remote resources are vectors for attack • Big Attack Surface = Big Security Work= Big Security Problems – With big attack surface, you must spend more time making sure the code is excellent quality, conservative, and defensive
  • 5. Understanding Attack Surface • Attack Surface can Gauge Risk of Attack – Attack surface measures potential avenues of attack – Attack surface measures potential impact of an attack • Useful as a Metric in Design through Deployment – Measurement is both point-in-time and relative • Attacks over the years show that certain vectors are more likely to be opportunities of attack than others – Known (and un-patched) vulnerabilities – Services running with high privileges are more likely to cause damage when attacked – Files with full control (e.g., rwxrwxrwx) are more likely to be attacked than files with less generous permissions – Use of binary controls such as ActiveX or Flash increase the chance of a damaging attack
  • 6. Main Goals of Attack Surface Reduction • Every feature that is added to an application adds risk • The aim for secure development is to reduce the overall risk by balancing functionality vs. risk – Reduce the amount of code executing by default – Reduce the volume of code that is accessible to untrusted users by default – Close doors (access points) that can be easily opened/exploited – Limit the damage if the access point is exploited Bottom Line: Fend off Future Attacks
  • 7. Considerations for Attack Surface Reduction Some Web applications inherently need more attention on attack surface than others • Is it Internet or Intranet accessible? Internet implies more risk. • Does it transmit, store or manipulate sensitive data? – If so, there are potential threats to that data and depending on the data there may be regulatory compliance requirements. • Has the application had security problems in the past? – Past security problems increase the likelihood of future problems
  • 8. Agenda • Objectives of Attack Surface Analysis and Reduction Measuring and Reducing your Attack Surface • Microsoft Case Study • Conclusion
  • 9. Common Metrics for Application Risk/Security • At CODE LEVEL – We count the number of bugs found – Not an ideal metric because: • It misses bugs that are not found (or fixed), perhaps the one that gets exploited • equal importance is given to all bugs, even though some bugs are easier to exploit than others • the exploit of one may result in more damage than the exploit of another • At the PRODUCT/SYSTEM level – We count the number of times a system version is mentioned in CERT, Microsoft Security Bulletins, MITRE CVEs, etc. – Not an ideal metric because it ignores the specific system configuration that gave rise to the vulnerability • whether a security patch has been installed • whether defaults are turned off • whether it always runs in system administrator mode.
  • 10. New Metric to Add: Attack Surface • Rather than count bugs at code level or vulnerability reports at system level, you can measure the avenues of attack – The counts of these “more likely to be attacked” features determine a system’s attack surface • Attack Surface attempts to measure security in relative terms – Useful as a delta measurement (i.e. v1.2 to v1.n of a product) – Not useful for comparing app to app or as stand-alone metric
  • 11. Measuring attack surface • Start with baseline, then measure each week – Define your minimal attack surface early on during design • If the attack surface count goes up, determine why and see if you can drive it back down – When engineers know you are measuring the attack surface, they may improve efforts Baseline Baseline + 1 month Comment 3 x TCP ports 2 x TCP ports Good; one fewer port to worry about. 1 x UDP port 2 x UDP port Which functionality opened the new UDP port? Why is it open by default? Is it authenticated? Is it restricted to a subnet? 2 x Services (both 3 x Services (2 x SYSTEM, Why is another service running by default? Why are SYSTEM) 1 x LocalService) any running as SYSTEM? 3 x ActiveX controls 4 x ActiveX controls Why is the new control installed? Is it safe for scripting? No additional user 1 x application account Turns out this is a member of the administrators group accounts too! Why? What's the password?
  • 12. Potential Uses for Attack Surface Measurement • Developers and architects can better prioritize testing efforts – If a software’s attack surface measurement is high, they may want to invest more in testing • Developers can use it as a guide while implementing patches of security vulnerabilities – A good patch should not only remove a vulnerability from a system, but also should not increase the system's attack surface. • Consumers can use it to guide their choice of configuration – Since a system's attack surface measurement is dependent on the system's configuration, software consumers would choose a configuration that results in a smaller attack surface exposure. • Risk Management/Corporate Security can understand their potential business exposure
  • 13. Attack Surface & Entry Points • To attack an application, attackers will – Identify entry points – Exploit the entry point or the backend exposed behind it – Try to deny legitimate users access to these entry points • In our software, we have to: – Understand the attack surface – Reduce it as much as possible – Test against it for exposed vulnerabilities • Mapping our Attack Surface – Architecture and design docs, code.. – But how many entry points are undocumented • Temporary files? Pipes? Network communication? Registry keys? Embeddable code?
  • 14. The Attack Surface Reduction Process • Look at all of your entry points – User input (UI) – Programmatic input (Web Service APIs) – File reads – Database access • Rank them – Authenticated versus anonymous – Administrator only versus user – Network versus local Attack Surface Reduction is as important as trying to get the code right
  • 15. It’s Not Just About Turning Stuff Off! Higher Attack Surface Lower Attack Surface Executing by default Off by default Open socket Closed socket Anonymous access Authenticated access Constantly on Intermittently on Admin access User access Internet access Local subnet access SYSTEM Not SYSTEM! Uniform defaults User-chosen settings Large code Small code Weak ACLs Strong ACLs
  • 16. Reducing your Attack Surface – Best Practices • Reduce the amount of code running by default • Reduce access to entry points by untrusted users – restrict access to network endpoints used by your application to the local subnet or IP range – limit access to network endpoints using authentication. • Reduce privilege to limit damage potential – Sandbox running code – Give higher permissions for as short a period as possible – Pay attention to trust boundaries • Integrate with your SDLC
  • 17. ASR Best Practices Reduce the Amount of Running Code • Apply the 80/20 rule – Ask yourself, "Do 80 percent of users/customers use this feature?“ – If the answer is no, then turn it off and make it easy to turn the feature back on • Services can’t be attacked if they are not running – All forms of dynamic Web content should be opt-in – If there is security defect in a service, this ensures that the only affected users are those actively running the service (versus all software users) • ASR is not just an "on or off" proposition – You can reduce attack surface by limiting who can access the code once it is running – This has an interesting side effect: many features are still usable, but are inaccessible by attackers (must have knowledge of access controls?)
  • 18. ASR Best Practices Reduce access to entry points by untrusted users • Example: – By default, most Web sites are accessible to all users – If the Web server limited access only to trusted users, or users on a specific subnet, then fewer users could take advantage of the defect – This is good because the code works for those who require the functionality – Restrict access to network endpoints used by your application to the local subnet or IP range. • To reduce the number of users who can communicate with potentially vulnerable code, authenticate before they can access the code – Limit access to network endpoints using authentication. Simply validating the user reduces your component's attack surface. – Most bad guys are unauthenticated. By raising the authentication bar a little you can eliminate a large population of potential attackers.
  • 19. ASR Best Practices Reduce access to entry points by untrusted users • Pay attention to trust boundaries – Review the entire data flow from entry point to data store – Look for all the potential data flows, data stores, and processes that the code touches (code that an attacker can touch) – Determine what privilege is required to access that entry point – Can you raise the authorization bar? • Example: Code with only two network-facing entry points – One is anonymous and the other can only be accessed by administrators – Hacker is going to attack the code along the anonymous data path simply because they can • Not going to exercise the administrative code path because, if they can, then they are already an administrator (and your problems are only just starting)  As you review dataflow, look for anonymous threat paths. It may be prudent to raise the authorization bar on these paths
  • 20. ASR Best Practices Reduce privilege to limit damage potential • Even if your code has vulnerabilities, and you don’t limit access to the code, you can still reduce the damage potential by operating the code with reduced privileges – remove any privileges not explicitly required by the application • Example: Dangerous Backup Privilege – Any process running under an account with this privilege can read any file in the file system, regardless of the access control list (ACL) on the file – Wrong way run as SYSTEM, which has backup privilege, but also has restore, debug, and "act as part of operating system" privilege; and is an admin account too – Right Way: run service under a specific authenticated account that has this privilege Never run services as SYSTEM, or daemons as root, or user accounts with administrative rights unless you have exhausted all other possibilities
  • 21. ASR Best Practices Integrate with your SDLC • When designing your application, outline what the attack surface will look like and identify the following: – The networking protocols you enabled by default – The endpoints that should support authentication and authorization. Focus on other anonymous endpoints – The off-by-default features • Look for code that auto-starts or will execute when accessed, such as services, daemons, ISAPI filters and applications, SOAP services, and Web roots – Reusable components (ActiveX® controls, COM objects, and .NET Framework assemblies, etc) – Process identities for all the code you run – User accounts installed When developers know early what the attack surface looks like, they can design and code defensively from the start
  • 22. ASR Best Practices Integrate into your SDLC • Implementation – Increase awareness of secure coding principles – Discover dangerous code changes that can add vulnerabilities or impact attack surface • Testing – Detailed measurement of attack surface – Test against attack surface specified during design • Deployment – Configuration changes can make a big impact on attack surface – Turn off features you’re not using, reduce privileges of running processes, etc
  • 23. Agenda • Objectives of Attack Surface Analysis and Reduction • Measuring and Reducing your Attack Surface Microsoft Case Study • Conclusion
  • 24. Microsoft Attack Surface Reduction Case Study • In 2002, Michael Howard was asked to measure security progress in Windows Server 2003 • He developed a set of metrics that became known as the Relative Attack Surface Quotient or “RASQ” • Open ports • Services running default • Named pipes • Services running as SYSTEM • RPC endpoints • IIS web directories (including sample apps) • Null Sessions • Users • Installed Services • Enumerating all these elements took about a dozen tools
  • 25. Microsoft Attack Surface Reduction Case Study • RASQ for each version of Windows: NT4 through Windows XP
  • 26. Microsoft Attack Surface Reduction Case Study Key Deltas • NT4 SP6a + Option Pack to NT4 SP6a + Option Pack + IISChk – IISChk is a checklist which reduces attack surface • Windows 2000 + IISChk to Windows Server 2003 – Default install of Windows Server 2003 has smaller attack surface than Windows 2000 even after the checklist is applied
  • 27. Microsoft Attack Surface Reduction Case Study Key Takeaways • Windows Server 2003 – Watershed moment for Microsoft Windows – IIS no longer installed by default • As the SDL evolved, slogan emerged: Secure by Design, Secure by Default – First clause means “get the design and code secure” – Last clause means “product will never be 100% secure, so reduce its attack surface” • Microsoft teams saw the value of a reduced attack surface – Fewer security bulletins and lower severity bulletins – Attack surface analysis tool was born
  • 28. Agenda • Objectives of Attack Surface Analysis and Reduction • Measuring and Reducing your Attack Surface • Microsoft Case Study Conclusion
  • 29. Conclusion • Use Attack Surface Reduction to reduce your overall security profile – Protect against the threats and vulnerabilities you don’t know about • Match attack surface risk to the level of effort devoted to secure design, development and testing – Include Attack Surface analysis as part of your overall strategy – Include design, development and test best practices as effective ways to minimize your attack surface and overall risk • Get the Microsoft Attack Surface Analyzer Beta http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e068c224- 9d6d-4bf4-aab8-f7352a5e7d45&displaylang=en
  • 30. How Security Innovation can Help • Services – SDLC Process review – Code Review – Pen Test • eLearning Products – Computer based training – Secure Development Knowledgebase • Data Encryption – Fastest, most secure cryptography available on the market
  • 31. eLearning Solutions for Secure Development Secure Development Knowledgebase – Out of the box secure development standards for: • Secure Design • Secure Coding • Security Testing – How-to’s, code snippets, attacks, checklists Computer Based Training – Intro to Threat Modeling – OWASP Top Ten: Threats & Mitigations – Creating Secure ASP.Net & J2EE Code – Architecture Risk Analysis – Intro to Cryptography – 35 more
  • 32. Free eLearning Course for Attending Introduction to Threat Modeling Creating Secure Code Fundamentals of Application Security http://elearning.securityinnovation.com Monthly Webcasts http://www.securityinnovation.com/security- lab/upcomingwebcasts.shtml Contact getsecure@securityinnovation.com jtaylor@securityinnovation.com

Notas do Editor

  1. Security innovation is a company dedicated to helping our customers with hard application and data security problems. We’ve spent years researching security vulnerabilities, why they occur, what they look like in production code and how to find and fix them. We have experience working with some of the largest companies in a variety of industries - from software companies such as Microsoft to e-commerce companies such as amazon, financial companies and many more. We offer solutions for all phases of the SDLC including instructor led training, computer based eLearning courses, on-site consulting and security assessments as well as technology to help secure sensitive data over the network or at rest.
  2. First let’s look at some common ways of measuring application security…
  3. The attack surface is defined by the set of interfaces, or entry points, to the program. Attack surface reduction is the process of identifying and understanding all of the entry points that make up the attack surface and then reducing these to a minimum level. This is done by enumerating all of the interfaces, protocols, and code execution paths as well as understanding the trust levels required to access each entry point.For each entry point, you must consider the importance of the feature that it enables. For features that are not important to a vast majority of the users, turn the feature off, disable it by default, or don’t even install it by default; force your users to take explicit action to obtain that feature. As a result, any vulnerabilities related to that feature will affect a smaller percentage of your user base.Next, consider which types of users need that access to each feature, and then restrict its use to those classes. For example, don’t default to making the feature remotely accessible, allowing anonymous access, running with more privilege than is needed, etcA significant aspect of attack surface reduction is restricting who has access to a product feature and how they can obtain and use that access.
  4. Keep in mind that attack surface reductionis not as simple as a binary switch – on or off. It’s the active management of how your software exposes its features and reducing that access to the minimum required to meet your specifications and usage scenarios. Without a conscious focus on this aspect of your software design and implementation you are guaranteed to have a larger attack surface than necessary and you are guaranteed to have a higher risk of an attacker exploiting your system.
  5. Security Innovation can help you in your efforts to adopt a more secure development process or to otherwise improve the security of your applications. We offer a wide range of information and software security eLearning titles that cover topics such as how to adopt secure development processes, how to perform a penetration test, how to create more secure asp.net or java code and more. You can use these to help yourself, and your team, gain the skills to develop more secure applications.