SlideShare ist ein Scribd-Unternehmen logo
1 von 59
Join the conversation #DevSecCon
The Path of Secure Software
BY KATY ANTON CA / VERACODE
Katy Anton
• Software development background
• Certified Secure Software Lifecycle Professional (CSSLP)
• Application Security Consultant @Veracode (part of CA
Technologies)
• OWASP Bristol Chapter Leader
• Project Co-leader for OWASP Top 10 Proactive Controls
OWASP Top 10 Risks - 2013
A1 – Injection A2 - Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
Cyber attacks
Casinos
New Website
OWASP Application Security Verification Standard
(ASVS)
OWASP ASVS
C1. Consider OWASP ASVS
• Choose the level of security for your application
• Extract the requirements for that level
• Use requirements to generate test cases
• Integrate security testing in SDLC.
C1. Build Security Into Software Early and Verify It
Development
Code Commit
Deployment
Code
review
System
Tests
Pre-commit
hooks
Unit Tests
Unit Test
Regression
Tests
C1. Verify for Security Early and Often
C1. Vulnerabilities Addressed - All Top Ten!
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
SQL injection example
$email=‘;- - @owasp.org;
$sql = UPDATE user set email=‘$email’ WHERE id=‘1’;
$sql = UPDATE user SET email=‘'; -- @owasp.org' WHERE id=‘1’;
Becomes
C2. Query Parameterization Example
String cmd = String.Format(“SELECT * FROM users where userID = {}”,userID)
reader = cmd.ExecuteReader();
Example of Query ParameterisationHow not to do it ! .
C2. Query Parameterization - Correct Usage
string cmd= "SELECT * FROM users WHERE userId = @Id";
SqlCommand sql = new SqlCommand(cmd);
sql.SqlParameter("@Id", System.Data.SqlDbType.Int));
sql.Parameters["@Id"].Value = ID;
reader = sql.ExecuteReader();
Secure Database Access
Credentials:
• Store encrypted credentials out of the source code
Database user:
• Grant least privilege
• Remove unrequired users
Stored procedures:
• Grant EXECUTE permissions on the stored procedures
• Revoke or deny all permissions to the underlying tables for all roles
C2: Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
XSS Example
C3. Encode Your Output
C3. Contextual Encoding Libraries
Java OWASP Java Encoder Project
.Net AntiXSS
PHP Symfony 2+: Twig
Zend Framework: ZendEscaper
C3. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
C4. Validate All Input
C4. Example of Validations
• GET / POST data (including hidden fields )
• File uploads
• HTTP Headers
• Cookies
• Database
C4. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
C5. Implement Digital Identity Controls
C5. Best practices
• Secure Password Storage
• Multi-Factor Authentication
• Secure Password Recovery Mechanism
• Transmit sensitive data only over TLS (v1.2)
• Error Messages
C5. Strong cryptographic algorithms
• PBKDF2
• scrypt
• bcrypt
Source: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
NIST: 2017 Digital Identity Guidelines
• Allow all ASCII printable characters, including space
• Minimum 8 characters length
• Allow users to passwords lengthy as they want, within reason.
• Offer guidance, such as a password-strength meter
• Do not require password to be changed periodically
• Permit to use “paste” functionality
• Check against a list of bad password
Source: https://pages.nist.gov/800-63-3/sp800-63b.html
Hash Password with a modern Hash
Problem:
• Long passwords can cause DoS
• bcrypt truncates passwords to 72 bytes
Solution:
• SHA-512 - converts long passwords to 512 bits
C5. Secure Password Storage
protect(sha512(password), [salt], [workFactor])
+
2nd Factor Authentication
Don’t use SMS as multi-factor (use FIDO or dedicated app)
C5. Password Storage – How Not To Do It!
$password=bcrypt([salt] + [password], work_factor);
$loginkey =md5(lc([username]).”::”.lc([password]))
C5. Error Messages - How Not To Do It!
Error message for not-registered userError message for valid user
C5. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
C6. Implement Appropriate Access Controls
C6. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
C7. Protect Data
C7. Data in Transit
Data in transit: HTTPS
• Confidentiality: Spy cannot view your data
• Integrity: Spy cannot change your data
• Authenticity: Server you visit is the right one
MITM Protection - HSTS
• HTTPS + Strict Transport Security Header
C7. Data at Rest
1. Strong algorithm – AES
2. Secure key management
3. Adequate access controls and auditing
C7. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
C8. Implement Logging and Intrusion Detection
C8. Examples of Intrusion Detection Points
• Application receives GET when expecting POST
• Additional form or URL parameters submitted with request
• Input validation failure server side when client side validation exists
• Input validation failure server side on non-user editable parameters
such as hidden fields, checkboxes, radio buttons or select lists
• HTTP headers, Cookies received differ from the expected
Source: https://www.owasp.org/index.php/OWASP_AppSensor_Project
Logging Frameworks
• Use logging framework
• Encode untrusted data -> protection against Log injection attacks
• Validate untrusted data-> protection against Log forging attacks
C8. Vulnerabilities Addressed - All Top Ten!
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
C9. Leverage Security Frameworks
and Libraries
C9. Examples
• Access Controls
• CSRF protection
• XSS protection
• ORM - SQL injection prevention
Current state of software
Source: https://www.veracode.com/resources/state-of-software-security
Cyber breaches
Root cause of the top 50 breaches in 2016:
#1
A9-Using Components with Known Vulnerabilities
Source: snyk.io
Unmanaged 3rd Party Components
C9. API Integration Best Practices
“When you wrap a third-party API, you minimize
your dependencies upon it: You can choose to move
to a different library in the future without much
penalty. “
Robert C. Martin
Wrapper
Adapter
C9. Design Patterns for Integration
Façade
C9. Automate
OWASP Dependency Check - supported languages:
• Java
• .NET
JavaScript
• Retire.JS scanner
PHP
• PHP Security Checker
C9. Best Practices
• Use trusted sources
• Encapsulate 3rd party libraries
• Hide information
• Reduce attack surface
• Update regularly / replace
C9. Vulnerabilities Addressed - All Top Ten!
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
C10. Error and Exception Handling
C10: Best Practices
• Centralised error handling
• Verbose enough to explain the issue
• Don’t leak critical information
C10. Don’t leak information !
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
C10. Vulnerabilities Addressed - All Top Ten!
Developer Controls
C1
Build Security Early
C4
Validate Input
C6
Access Controls
C5
Digital Identity C7
Protect Data
C10
Error Handling
C8
Logging
C2
Secure Database Access
C9
Leverage security
C3
Encode Data
Project Page
Project page: https://www.owasp.org/index.php/OWASP_Proactive_Controls
Twitter: @OWASPControls
Join the conversation #DevSecCon
Thank you
Katy Anton
Application Security Consultant
Ca / Veracode

Weitere ähnliche Inhalte

Was ist angesagt?

Elizabeth Lawler - Devops, security, and compliance working in unison
Elizabeth Lawler - Devops, security, and compliance working in unisonElizabeth Lawler - Devops, security, and compliance working in unison
Elizabeth Lawler - Devops, security, and compliance working in unison
DevSecCon
 
Application Security at DevOps Speed and Portfolio Scale
Application Security at DevOps Speed and Portfolio ScaleApplication Security at DevOps Speed and Portfolio Scale
Application Security at DevOps Speed and Portfolio Scale
Jeff Williams
 

Was ist angesagt? (20)

Introduction to DevSecOps
Introduction to DevSecOpsIntroduction to DevSecOps
Introduction to DevSecOps
 
AllDayDevOps 2019 AppSensor
AllDayDevOps 2019 AppSensorAllDayDevOps 2019 AppSensor
AllDayDevOps 2019 AppSensor
 
Elizabeth Lawler - Devops, security, and compliance working in unison
Elizabeth Lawler - Devops, security, and compliance working in unisonElizabeth Lawler - Devops, security, and compliance working in unison
Elizabeth Lawler - Devops, security, and compliance working in unison
 
Application Security at DevOps Speed and Portfolio Scale
Application Security at DevOps Speed and Portfolio ScaleApplication Security at DevOps Speed and Portfolio Scale
Application Security at DevOps Speed and Portfolio Scale
 
Why should developers care about container security?
Why should developers care about container security?Why should developers care about container security?
Why should developers care about container security?
 
The Joy of Proactive Security
The Joy of Proactive SecurityThe Joy of Proactive Security
The Joy of Proactive Security
 
Agile Network India | DevSecOps - The What and the Why | Ritesh Shregill
Agile Network India | DevSecOps  - The What and the Why | Ritesh ShregillAgile Network India | DevSecOps  - The What and the Why | Ritesh Shregill
Agile Network India | DevSecOps - The What and the Why | Ritesh Shregill
 
2017-11 Three Ways of Security - OWASP London
2017-11 Three Ways of Security - OWASP London2017-11 Three Ways of Security - OWASP London
2017-11 Three Ways of Security - OWASP London
 
Devops security-An Insight into Secure-SDLC
Devops security-An Insight into Secure-SDLCDevops security-An Insight into Secure-SDLC
Devops security-An Insight into Secure-SDLC
 
Realities of Security in the Cloud - CSS ATX 2017
Realities of Security in the Cloud - CSS ATX 2017Realities of Security in the Cloud - CSS ATX 2017
Realities of Security in the Cloud - CSS ATX 2017
 
The New Security Practitioner
The New Security PractitionerThe New Security Practitioner
The New Security Practitioner
 
Realities of Security in the Cloud
Realities of Security in the CloudRealities of Security in the Cloud
Realities of Security in the Cloud
 
A Successful SAST Tool Implementation
A Successful SAST Tool ImplementationA Successful SAST Tool Implementation
A Successful SAST Tool Implementation
 
Making Security Agile
Making Security AgileMaking Security Agile
Making Security Agile
 
Dev seccon london 2016 intelliment security
Dev seccon london 2016   intelliment securityDev seccon london 2016   intelliment security
Dev seccon london 2016 intelliment security
 
Cloud Security vs Security in the Cloud
Cloud Security vs Security in the CloudCloud Security vs Security in the Cloud
Cloud Security vs Security in the Cloud
 
Practical Secure Coding Workshop - {DECIPHER} Hackathon
Practical Secure Coding Workshop - {DECIPHER} HackathonPractical Secure Coding Workshop - {DECIPHER} Hackathon
Practical Secure Coding Workshop - {DECIPHER} Hackathon
 
Integrate Security into DevOps - SecDevOps
Integrate Security into DevOps - SecDevOpsIntegrate Security into DevOps - SecDevOps
Integrate Security into DevOps - SecDevOps
 
IntroSec Con - Building Your Blue Team Arsenal - glitch
IntroSec Con - Building Your Blue Team Arsenal - glitchIntroSec Con - Building Your Blue Team Arsenal - glitch
IntroSec Con - Building Your Blue Team Arsenal - glitch
 
Proactive Security AppSec Case Study
Proactive Security AppSec Case StudyProactive Security AppSec Case Study
Proactive Security AppSec Case Study
 

Ähnlich wie The path of secure software by Katy Anton

owasp top 10 security risk categories and CWE
owasp top 10 security risk categories and CWEowasp top 10 security risk categories and CWE
owasp top 10 security risk categories and CWE
Arun Voleti
 
Owasp Indy Q2 2012 Cheat Sheet Overview
Owasp Indy Q2 2012 Cheat Sheet OverviewOwasp Indy Q2 2012 Cheat Sheet Overview
Owasp Indy Q2 2012 Cheat Sheet Overview
owaspindy
 

Ähnlich wie The path of secure software by Katy Anton (20)

Owasp top-ten-mapping-2015-05-lwc
Owasp top-ten-mapping-2015-05-lwcOwasp top-ten-mapping-2015-05-lwc
Owasp top-ten-mapping-2015-05-lwc
 
Spa Secure Coding Guide
Spa Secure Coding GuideSpa Secure Coding Guide
Spa Secure Coding Guide
 
How to Harden the Security of Your .NET Website
How to Harden the Security of Your .NET WebsiteHow to Harden the Security of Your .NET Website
How to Harden the Security of Your .NET Website
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Web hackingtools cf-summit2014
Web hackingtools cf-summit2014Web hackingtools cf-summit2014
Web hackingtools cf-summit2014
 
How to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid themHow to avoid top 10 security risks in Java EE applications and how to avoid them
How to avoid top 10 security risks in Java EE applications and how to avoid them
 
Managed Threat Detection and Response
Managed Threat Detection and ResponseManaged Threat Detection and Response
Managed Threat Detection and Response
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
 
Managed Threat Detection & Response for AWS Applications
Managed Threat Detection & Response for AWS ApplicationsManaged Threat Detection & Response for AWS Applications
Managed Threat Detection & Response for AWS Applications
 
Web hackingtools 2015
Web hackingtools 2015Web hackingtools 2015
Web hackingtools 2015
 
Web hackingtools 2015
Web hackingtools 2015Web hackingtools 2015
Web hackingtools 2015
 
AWS Security Architecture - Overview
AWS Security Architecture - OverviewAWS Security Architecture - Overview
AWS Security Architecture - Overview
 
owasp top 10 security risk categories and CWE
owasp top 10 security risk categories and CWEowasp top 10 security risk categories and CWE
owasp top 10 security risk categories and CWE
 
Owasp Indy Q2 2012 Cheat Sheet Overview
Owasp Indy Q2 2012 Cheat Sheet OverviewOwasp Indy Q2 2012 Cheat Sheet Overview
Owasp Indy Q2 2012 Cheat Sheet Overview
 
How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?
 
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
 
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017 OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
 
The Path of Secure Software
The Path of Secure SoftwareThe Path of Secure Software
The Path of Secure Software
 
Securing Applications in the Cloud
Securing Applications in the CloudSecuring Applications in the Cloud
Securing Applications in the Cloud
 
CS166 Final project
CS166 Final projectCS166 Final project
CS166 Final project
 

Mehr von DevSecCon

DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon
 
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon
 
DevSecCon Seattle 2019: Containerizing IT Security Knowledge
DevSecCon Seattle 2019: Containerizing IT Security KnowledgeDevSecCon Seattle 2019: Containerizing IT Security Knowledge
DevSecCon Seattle 2019: Containerizing IT Security Knowledge
DevSecCon
 
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon
 
DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...
DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...
DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...
DevSecCon
 
DevSecCon Singapore 2019: Embracing Security - A changing DevOps landscape
DevSecCon Singapore 2019: Embracing Security - A changing DevOps landscapeDevSecCon Singapore 2019: Embracing Security - A changing DevOps landscape
DevSecCon Singapore 2019: Embracing Security - A changing DevOps landscape
DevSecCon
 
DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...
DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...
DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...
DevSecCon
 
DevSecCon London 2018: Is your supply chain your achille's heel
DevSecCon London 2018: Is your supply chain your achille's heelDevSecCon London 2018: Is your supply chain your achille's heel
DevSecCon London 2018: Is your supply chain your achille's heel
DevSecCon
 

Mehr von DevSecCon (20)

DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
 
DevSecCon London 2019: Are Open Source Developers Security’s New Front Line?
DevSecCon London 2019: Are Open Source Developers Security’s New Front Line?DevSecCon London 2019: Are Open Source Developers Security’s New Front Line?
DevSecCon London 2019: Are Open Source Developers Security’s New Front Line?
 
DevSecCon London 2019: How to Secure OpenShift Environments and What Happens ...
DevSecCon London 2019: How to Secure OpenShift Environments and What Happens ...DevSecCon London 2019: How to Secure OpenShift Environments and What Happens ...
DevSecCon London 2019: How to Secure OpenShift Environments and What Happens ...
 
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
 
DevSecCon Seattle 2019: Containerizing IT Security Knowledge
DevSecCon Seattle 2019: Containerizing IT Security KnowledgeDevSecCon Seattle 2019: Containerizing IT Security Knowledge
DevSecCon Seattle 2019: Containerizing IT Security Knowledge
 
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
 
DevSecCon Seattle 2019: Liquid Software as the real solution for the Sec in D...
DevSecCon Seattle 2019: Liquid Software as the real solution for the Sec in D...DevSecCon Seattle 2019: Liquid Software as the real solution for the Sec in D...
DevSecCon Seattle 2019: Liquid Software as the real solution for the Sec in D...
 
DevSecCon Seattle 2019: Fully Automated production deployments with HIPAA/HIT...
DevSecCon Seattle 2019: Fully Automated production deployments with HIPAA/HIT...DevSecCon Seattle 2019: Fully Automated production deployments with HIPAA/HIT...
DevSecCon Seattle 2019: Fully Automated production deployments with HIPAA/HIT...
 
DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...
DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...
DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...
 
DevSecCon Singapore 2019: crypto jacking: An evolving threat for cloud contai...
DevSecCon Singapore 2019: crypto jacking: An evolving threat for cloud contai...DevSecCon Singapore 2019: crypto jacking: An evolving threat for cloud contai...
DevSecCon Singapore 2019: crypto jacking: An evolving threat for cloud contai...
 
DevSecCon Singapore 2019: Can "dev", "sec" and "ops" really coexist in the wi...
DevSecCon Singapore 2019: Can "dev", "sec" and "ops" really coexist in the wi...DevSecCon Singapore 2019: Can "dev", "sec" and "ops" really coexist in the wi...
DevSecCon Singapore 2019: Can "dev", "sec" and "ops" really coexist in the wi...
 
DevSecCon Singapore 2019: Workshop - Burp extension writing workshop
DevSecCon Singapore 2019: Workshop - Burp extension writing workshopDevSecCon Singapore 2019: Workshop - Burp extension writing workshop
DevSecCon Singapore 2019: Workshop - Burp extension writing workshop
 
DevSecCon Singapore 2019: Embracing Security - A changing DevOps landscape
DevSecCon Singapore 2019: Embracing Security - A changing DevOps landscapeDevSecCon Singapore 2019: Embracing Security - A changing DevOps landscape
DevSecCon Singapore 2019: Embracing Security - A changing DevOps landscape
 
DevSecCon Singapore 2019: Web Services aren’t as secure as we think
DevSecCon Singapore 2019: Web Services aren’t as secure as we thinkDevSecCon Singapore 2019: Web Services aren’t as secure as we think
DevSecCon Singapore 2019: Web Services aren’t as secure as we think
 
DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...
DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...
DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...
 
DevSecCon Singapore 2019: The journey of digital transformation through DevSe...
DevSecCon Singapore 2019: The journey of digital transformation through DevSe...DevSecCon Singapore 2019: The journey of digital transformation through DevSe...
DevSecCon Singapore 2019: The journey of digital transformation through DevSe...
 
DevSecCon Singapore 2019: Preventative Security for Kubernetes
DevSecCon Singapore 2019: Preventative Security for KubernetesDevSecCon Singapore 2019: Preventative Security for Kubernetes
DevSecCon Singapore 2019: Preventative Security for Kubernetes
 
DevSecCon London 2018: Is your supply chain your achille's heel
DevSecCon London 2018: Is your supply chain your achille's heelDevSecCon London 2018: Is your supply chain your achille's heel
DevSecCon London 2018: Is your supply chain your achille's heel
 
DevSecCon London 2018: Get rid of these TLS certificates
DevSecCon London 2018: Get rid of these TLS certificatesDevSecCon London 2018: Get rid of these TLS certificates
DevSecCon London 2018: Get rid of these TLS certificates
 
DevSecCon London 2018: Open DevSecOps
DevSecCon London 2018: Open DevSecOpsDevSecCon London 2018: Open DevSecOps
DevSecCon London 2018: Open DevSecOps
 

Kürzlich hochgeladen

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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
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...
 
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...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
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...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 

The path of secure software by Katy Anton

  • 1. Join the conversation #DevSecCon The Path of Secure Software BY KATY ANTON CA / VERACODE
  • 2. Katy Anton • Software development background • Certified Secure Software Lifecycle Professional (CSSLP) • Application Security Consultant @Veracode (part of CA Technologies) • OWASP Bristol Chapter Leader • Project Co-leader for OWASP Top 10 Proactive Controls
  • 3. OWASP Top 10 Risks - 2013 A1 – Injection A2 - Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 6. OWASP Application Security Verification Standard (ASVS)
  • 8. C1. Consider OWASP ASVS • Choose the level of security for your application • Extract the requirements for that level • Use requirements to generate test cases • Integrate security testing in SDLC.
  • 9. C1. Build Security Into Software Early and Verify It
  • 10. Development Code Commit Deployment Code review System Tests Pre-commit hooks Unit Tests Unit Test Regression Tests C1. Verify for Security Early and Often
  • 11. C1. Vulnerabilities Addressed - All Top Ten! A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards
  • 12. SQL injection example $email=‘;- - @owasp.org; $sql = UPDATE user set email=‘$email’ WHERE id=‘1’; $sql = UPDATE user SET email=‘'; -- @owasp.org' WHERE id=‘1’; Becomes
  • 13. C2. Query Parameterization Example String cmd = String.Format(“SELECT * FROM users where userID = {}”,userID) reader = cmd.ExecuteReader(); Example of Query ParameterisationHow not to do it ! .
  • 14. C2. Query Parameterization - Correct Usage string cmd= "SELECT * FROM users WHERE userId = @Id"; SqlCommand sql = new SqlCommand(cmd); sql.SqlParameter("@Id", System.Data.SqlDbType.Int)); sql.Parameters["@Id"].Value = ID; reader = sql.ExecuteReader();
  • 15. Secure Database Access Credentials: • Store encrypted credentials out of the source code Database user: • Grant least privilege • Remove unrequired users Stored procedures: • Grant EXECUTE permissions on the stored procedures • Revoke or deny all permissions to the underlying tables for all roles
  • 16. C2: Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 18. C3. Encode Your Output
  • 19. C3. Contextual Encoding Libraries Java OWASP Java Encoder Project .Net AntiXSS PHP Symfony 2+: Twig Zend Framework: ZendEscaper
  • 20. C3. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 22. C4. Example of Validations • GET / POST data (including hidden fields ) • File uploads • HTTP Headers • Cookies • Database
  • 23. C4. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards
  • 24. C5. Implement Digital Identity Controls
  • 25. C5. Best practices • Secure Password Storage • Multi-Factor Authentication • Secure Password Recovery Mechanism • Transmit sensitive data only over TLS (v1.2) • Error Messages
  • 26. C5. Strong cryptographic algorithms • PBKDF2 • scrypt • bcrypt Source: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
  • 27. NIST: 2017 Digital Identity Guidelines • Allow all ASCII printable characters, including space • Minimum 8 characters length • Allow users to passwords lengthy as they want, within reason. • Offer guidance, such as a password-strength meter • Do not require password to be changed periodically • Permit to use “paste” functionality • Check against a list of bad password Source: https://pages.nist.gov/800-63-3/sp800-63b.html
  • 28. Hash Password with a modern Hash Problem: • Long passwords can cause DoS • bcrypt truncates passwords to 72 bytes Solution: • SHA-512 - converts long passwords to 512 bits
  • 29. C5. Secure Password Storage protect(sha512(password), [salt], [workFactor]) + 2nd Factor Authentication Don’t use SMS as multi-factor (use FIDO or dedicated app)
  • 30. C5. Password Storage – How Not To Do It! $password=bcrypt([salt] + [password], work_factor); $loginkey =md5(lc([username]).”::”.lc([password]))
  • 31. C5. Error Messages - How Not To Do It! Error message for not-registered userError message for valid user
  • 32. C5. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 33. C6. Implement Appropriate Access Controls
  • 34. C6. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 36. C7. Data in Transit Data in transit: HTTPS • Confidentiality: Spy cannot view your data • Integrity: Spy cannot change your data • Authenticity: Server you visit is the right one MITM Protection - HSTS • HTTPS + Strict Transport Security Header
  • 37. C7. Data at Rest 1. Strong algorithm – AES 2. Secure key management 3. Adequate access controls and auditing
  • 38. C7. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 39. C8. Implement Logging and Intrusion Detection
  • 40. C8. Examples of Intrusion Detection Points • Application receives GET when expecting POST • Additional form or URL parameters submitted with request • Input validation failure server side when client side validation exists • Input validation failure server side on non-user editable parameters such as hidden fields, checkboxes, radio buttons or select lists • HTTP headers, Cookies received differ from the expected Source: https://www.owasp.org/index.php/OWASP_AppSensor_Project
  • 41. Logging Frameworks • Use logging framework • Encode untrusted data -> protection against Log injection attacks • Validate untrusted data-> protection against Log forging attacks
  • 42. C8. Vulnerabilities Addressed - All Top Ten! A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards
  • 43. C9. Leverage Security Frameworks and Libraries
  • 44. C9. Examples • Access Controls • CSRF protection • XSS protection • ORM - SQL injection prevention
  • 45. Current state of software Source: https://www.veracode.com/resources/state-of-software-security
  • 46. Cyber breaches Root cause of the top 50 breaches in 2016: #1 A9-Using Components with Known Vulnerabilities Source: snyk.io
  • 47. Unmanaged 3rd Party Components
  • 48. C9. API Integration Best Practices “When you wrap a third-party API, you minimize your dependencies upon it: You can choose to move to a different library in the future without much penalty. “ Robert C. Martin
  • 49. Wrapper Adapter C9. Design Patterns for Integration Façade
  • 50. C9. Automate OWASP Dependency Check - supported languages: • Java • .NET JavaScript • Retire.JS scanner PHP • PHP Security Checker
  • 51. C9. Best Practices • Use trusted sources • Encapsulate 3rd party libraries • Hide information • Reduce attack surface • Update regularly / replace
  • 52. C9. Vulnerabilities Addressed - All Top Ten! A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards
  • 53. C10. Error and Exception Handling
  • 54. C10: Best Practices • Centralised error handling • Verbose enough to explain the issue • Don’t leak critical information
  • 55. C10. Don’t leak information !
  • 56. A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards C10. Vulnerabilities Addressed - All Top Ten!
  • 57. Developer Controls C1 Build Security Early C4 Validate Input C6 Access Controls C5 Digital Identity C7 Protect Data C10 Error Handling C8 Logging C2 Secure Database Access C9 Leverage security C3 Encode Data
  • 58. Project Page Project page: https://www.owasp.org/index.php/OWASP_Proactive_Controls Twitter: @OWASPControls
  • 59. Join the conversation #DevSecCon Thank you Katy Anton Application Security Consultant Ca / Veracode

Hinweis der Redaktion

  1. Think for example of coordinates: latitude and longitude have no value by themselves, but put them together, and they can pin-point the exact location on earth! The same thing can happened with error messages when attackers will aggregate /^ them from different parts /^ of the application. One way to deal with this, is to present the end user an error code, and store the details of the error in the database. ——> American English uses the Z, and British uses the S.