SlideShare a Scribd company logo
SECURE CODE
TRAINING
DATA PROTECTION
DAVID CERVIGNI
IT SECURITY CONSULTANT AND
PCI CODE REVIEWER
What? Data Classification:
• Non sensitive/Public
• Personally identifiable information (PII), or
sensitive personal information (SPI)
• Secret: financial statements, CC, passwords…
• Technical: java stack-traces, source code, component
versions…
When? How?
Data at rest:
• Encryption (full device vs data encryption)
Data in transit:
• Encrypted protocols
• HTTP Headers configurations
What benefits do HTTPS provide?
• Confidentiality: Spy cannot view your data
• Integrity: Spy cannot change your data
• Authenticity: Server you are visiting is the right one
• High performance!
HTTPS configuration best practices
https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet
https://www.ssllabs.com/projects/best-practices/
Encrypting data in Transit
• HSTS (Strict Transport Security)
http://www.youtube.com/watch?v=zEV3HOuM_Vw
• Forward Secrecy
https://whispersystems.org/blog/asynchronous-security/
• Certificate Creation Transparency
http://certificate-transparency.org
• Certificate Pinning
https://www.owasp.org/index.php/Pinning_Cheat_Sheet
• Browser Certificate Pruning
Encrypting data in Transit
Encrypting data in Transit : HSTS (Strict Transport Security)
• Forces browser to only make HTTPS connection to server
• Must be initially delivered over a HTTPS connection
• Current HSTS Chrome preload list
http://src.chromium.org/viewvc/chrome/trunk/src/net/http/transport_security_state_static.json
• If you own a site that you would like to see included in the preloaded Chromium HSTS list,
start sending the HSTS header and then contact: https://hstspreload.appspot.com/
• A site is included in the Firefox preload list if the following hold:
 It is in the Chromium list (with force-https).
 It sends an HSTS header.
 The max-age sent is at least 10886400 (18 weeks).
http://dev.chromium.org/sts
• What is Pinning ?
 Pinning is a key continuity scheme
 Detect when an imposter with a fake but CA validated certificate attempts to act like
the real server
• 2 Types of pinning
 Carry around a copy of the server's public key;
 Great if you are distributing a dedicated client-server application since you know the
server's certificate or public key in advance
• Note of the server's public key on first use
 Trust-on-First-Use (TOFU) pinning
 Useful when no a priori knowledge exists, such as SSH or a Browser
Encrypting data in Transit : Certificate Pinning
https://www.owasp.org/index.php/Pinning_Cheat_Sheet
Encrypting data in Transit : Browser-Based TOFU Pinning
https://www.owasp.org/index.php/Pinning_Cheat_Sheet
• Browser-Based TOFU Pinning : Trust on First Use
• HTTP Public Key Pinning IETF Draft
http://tools.ietf.org/html/draft-ietf-websec-key-pinning-11
• Freezes the certificate by pushing a fingerprint of (parts of) the certificate chain to the
browser
• Example:
Public-Key-Pins: pin-sha1="4n972HfV354KP560yw4uqe/baXc=";
pin-sha1="qvTGHdzF6KLavt4PO0gs2a6pQ00=";
pin-sha256="LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=";
max-age=10000; includeSubDomains
Encrypting data in Transit : Pinning in Play (Chrome)
https://www.owasp.org/index.php/Pinning_Cheat_Sheet
Encrypting data in Transit : Forward Secrecy
• If you use older SSL ciphers, every time anyone makes a SSL connection to your
server, that message is encrypted with (basically) the same private server key
• Perfect forward secrecy: Peers in a conversation instead negotiate secrets
through an ephemeral (temporary) key exchange
• With PFS, recording ciphertext traffic doesn't help an attacker even if the private
server key is stolen!
https://whispersystems.org/blog/asynchronous-security/
In information security, computer science, and other fields, the principle of
least privilege (also known as the principle of minimal privilege or the
principle of least authority) requires that in a particular abstraction layer of a
computing environment, every module (such as a process, a user, or a
program, depending on the subject) must be able to access only the
information and resources that are necessary for its legitimate purpose.
Principle: Least Privilege
For example:
• OS users (technical)
• Directory permissions
• restrict users to only the functionality, data and system
information that is required to perform their tasks
Encrypt highly sensitive stored information, like authentication verification
data, even on the server side. Always use well vetted algorithms, follow the
company approved "Cryptographic Practices”.
Do not store passwords, connection strings or other sensitive information in
clear text or in any non-cryptographically secure manner on the client side.
This includes embedding in insecure formats like: MS viewstate, Adobe flash,
serialized java classes or compiled code.
Encryption of data at rest
You do not store passwords 
Evolution of password “non-storage”:
I. Hashes password
II. Salted Hashed passwords
III. Adaptive one-way function (bcrypt, Argon2…)
…how to store passwords?
...and technical information.
• Protect server-side source-code from being downloaded by a user
• Remove comments in user accessible production code that may reveal
backend system or other sensitive information
• Remove unnecessary application and system documentation as this can
reveal useful information to attackers
NOTE: this is not security by obscurity antipattern
Protect source-code…
• Do not include sensitive information in HTTP GET request parameters.
This includes jsessoinId parameters and others:
In web.xml (Tomcat 7):
<session-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
Or programmatically, you can use:
servletContext.setSessionTrackingModes
(EnumSet.of(SessionTrackingMode.COOKIE));
Avoid data leakage - 1
• Disable auto complete features on forms expected to contain sensitive
information, including authentication.
<INPUT TYPE="password" AUTOCOMPLETE="off">
• Disable client side caching on pages containing sensitive information. Cache-
Control: no-store, may be used in conjunction with the HTTP header control
"Pragma: no-cache", which is less effective, but is HTTP/1.0 backward
compatible.
Cache-Control: no-cache, no-store and
Pragma: no-cache,
Expires: 0
• Disable unnecessary iframe support with header:
X-Frame-Options: SAMEORIGIN
Avoid data leakage - 2
• The application should support the removal of sensitive data when that
data is no longer required. (e.g. personal information or certain financial
data).
• Implement appropriate access controls for sensitive data stored on the
server. This includes cached data, temporary files and data that should be
accessible only by specific system users.
Avoid data leakage - 3
Enforcing (and avoiding) Same-Origin Policy
* More info: https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
How to manage cross-origin access?
1. To prevent cross-origin access, check for an unguessable token in the request, known as a Cross-
Site Request Forgery (CSRF) token. You must prevent cross-origin reads of pages that know this
token.
1. To prevent cross-origin reads of a resource, ensure that it is not embeddable (X-Frame-Options:
SAMEORIGIN). It is often necessary to prevent embedding, because embedding a resource always
leaks some information about it.
2. To prevent cross-origin embedding, ensure that your resource can not be interpreted as one of the
embeddable formats(<script src="..."></script>, CSS with <link rel="stylesheet”, <img Plug-ins with
<object>, <embed> and <applet>). BUT The browser does not respect the Content-Type in most
cases. For example if you point a <script> tag at an HTML document, the browser will try to parse
the HTML as JavaScript.
How to manage cross-origin access?
APACHE example:
Restrict access to certain URIs - Apache examples
RewriteRule ^/api(.*).json$ /api$1.json [CORS=True]
Header set Access-Control-Allow-Origin "*" env=CORS
Header set Access-Control-Allow-Methods "GET" env=CORS
PHP example:
<?php // We'll be granting access to only the arunranga.com domain
// which we think is safe to access this resource as application/xml
if($_SERVER['HTTP_ORIGIN'] == "http://arunranga.com")
{
header('Access-Control-Allow-Origin: http://arunranga.com');
header('Content-type: application/xml');
readfile('arunerDotNetResource.xml'); }
[…]
//ELSE ERROR
SECURE CODE
TRAINING
INTENSIVE COURSE
DAVID CERVIGNI
IT SECURITY CONSULTANT AND
PCI CODE REVIEWER

More Related Content

PDF
Truetesters presents OWASP Top 10 Web Vulnerability
PPT
Secure Web Applications Ver0.01
PDF
Web Development Security
PPTX
Owasp top10salesforce
PPTX
Website Hacking and Preventive Measures
PPTX
Application Security Tools
PPTX
The Notorious 9: Is Your Data Secure in the Cloud?
PDF
Introduction to Mod security session April 2016
Truetesters presents OWASP Top 10 Web Vulnerability
Secure Web Applications Ver0.01
Web Development Security
Owasp top10salesforce
Website Hacking and Preventive Measures
Application Security Tools
The Notorious 9: Is Your Data Secure in the Cloud?
Introduction to Mod security session April 2016

What's hot (20)

PPT
Anypoint enterprise security
PPT
Mule anypoint enterprise security
PDF
Threat Modeling and OWASP Top 10 (2017 rc1)
PDF
Wakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
PPTX
Spa Secure Coding Guide
PDF
OWASP ASVS 3 - What's new for level 1?
PPTX
RubiX ID - SOA Security - Ingrid Cox
PPTX
PHP Security Tips
PPTX
Apache mod security 3.1
PPTX
Secure Code Warrior - Local storage
PDF
A security note for web developers
PDF
Advances inbrowsersecurity
PDF
Redteaming in Poland - test cases (Security)
PDF
Defense in Depth: Lessons Learned Securing 200,000 Sites
PPT
Simple Principles for Website Security
PPT
Security Vulnerabilities
PPTX
Slides for the #JavaOne Session ID: CON11881
PPTX
Secure Code Warrior - Cookies and sessions
PDF
Web Site vulnerability Sales and Consulting
Anypoint enterprise security
Mule anypoint enterprise security
Threat Modeling and OWASP Top 10 (2017 rc1)
Wakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
Spa Secure Coding Guide
OWASP ASVS 3 - What's new for level 1?
RubiX ID - SOA Security - Ingrid Cox
PHP Security Tips
Apache mod security 3.1
Secure Code Warrior - Local storage
A security note for web developers
Advances inbrowsersecurity
Redteaming in Poland - test cases (Security)
Defense in Depth: Lessons Learned Securing 200,000 Sites
Simple Principles for Website Security
Security Vulnerabilities
Slides for the #JavaOne Session ID: CON11881
Secure Code Warrior - Cookies and sessions
Web Site vulnerability Sales and Consulting
Ad

Similar to Cm2 secure code_training_1day_data_protection (20)

PDF
wapt lab 6 - converted (2).pdfwaptLab09 tis lab is used for college lab exam
PDF
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
PPTX
Bsidesnova- Pentesting Methodology - Making bits less complicated
PPTX
Web Exploitation Security
PDF
Owasp top 10 2013
PPTX
Password Management System: Enhancing Security and Efficiency
PDF
Essential Security Practices for Modern Web Developers.pdf
PPTX
Don’t Get Caught in a PCI Pickle: Meet Compliance and Protect Payment Card Da...
PPTX
Dmytro Kochergin - "The OWASP TOP 10 - Typical Attacks on Web Applications an...
PDF
Web application security (eng)
PDF
Owasp top 10_openwest_2019
PPTX
Owasp Indy Q2 2012 Cheat Sheet Overview
PPTX
Owasp first5 presentation
PPTX
Owasp first5 presentation
PDF
Layer one 2011-joe-mccray-you-spent-all-that-money-and-still-got-0wned
PDF
Web-of-Things and Services Security
PPTX
Scan Website Vulnerability - Project Presentation
PPTX
Understanding Network Security and Vulnerability Assessment
PDF
Soteria Cybersecurity Healthcheck-FB01
PDF
Security Ninjas: An Open Source Application Security Training Program
wapt lab 6 - converted (2).pdfwaptLab09 tis lab is used for college lab exam
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Bsidesnova- Pentesting Methodology - Making bits less complicated
Web Exploitation Security
Owasp top 10 2013
Password Management System: Enhancing Security and Efficiency
Essential Security Practices for Modern Web Developers.pdf
Don’t Get Caught in a PCI Pickle: Meet Compliance and Protect Payment Card Da...
Dmytro Kochergin - "The OWASP TOP 10 - Typical Attacks on Web Applications an...
Web application security (eng)
Owasp top 10_openwest_2019
Owasp Indy Q2 2012 Cheat Sheet Overview
Owasp first5 presentation
Owasp first5 presentation
Layer one 2011-joe-mccray-you-spent-all-that-money-and-still-got-0wned
Web-of-Things and Services Security
Scan Website Vulnerability - Project Presentation
Understanding Network Security and Vulnerability Assessment
Soteria Cybersecurity Healthcheck-FB01
Security Ninjas: An Open Source Application Security Training Program
Ad

More from dcervigni (9)

PPTX
Cm9 secure code_training_1day_input sanitization
PPTX
Cm1 secure code_training_1day_intro
PPTX
Cm8 secure code_training_1day_security libraries
PPTX
Cm3 secure code_training_1day_access_control
PPTX
Cm4 secure code_training_1day_error handling and logging
PPTX
Cm5 secure code_training_1day_system configuration
PPTX
Cm6 secure code_training_1day_file management
PPTX
Cm7 secure code_training_1day_xss
PPTX
JavaScript security and tools evolution at 2017 OWASP Taiwan Week
Cm9 secure code_training_1day_input sanitization
Cm1 secure code_training_1day_intro
Cm8 secure code_training_1day_security libraries
Cm3 secure code_training_1day_access_control
Cm4 secure code_training_1day_error handling and logging
Cm5 secure code_training_1day_system configuration
Cm6 secure code_training_1day_file management
Cm7 secure code_training_1day_xss
JavaScript security and tools evolution at 2017 OWASP Taiwan Week

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Electronic commerce courselecture one. Pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
Empathic Computing: Creating Shared Understanding
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Review of recent advances in non-invasive hemoglobin estimation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Electronic commerce courselecture one. Pdf
Understanding_Digital_Forensics_Presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Advanced methodologies resolving dimensionality complications for autism neur...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectroscopy.pptx food analysis technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Programs and apps: productivity, graphics, security and other tools
Diabetes mellitus diagnosis method based random forest with bat algorithm
Network Security Unit 5.pdf for BCA BBA.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
Empathic Computing: Creating Shared Understanding
The AUB Centre for AI in Media Proposal.docx
Review of recent advances in non-invasive hemoglobin estimation

Cm2 secure code_training_1day_data_protection

  • 1. SECURE CODE TRAINING DATA PROTECTION DAVID CERVIGNI IT SECURITY CONSULTANT AND PCI CODE REVIEWER
  • 2. What? Data Classification: • Non sensitive/Public • Personally identifiable information (PII), or sensitive personal information (SPI) • Secret: financial statements, CC, passwords… • Technical: java stack-traces, source code, component versions… When? How? Data at rest: • Encryption (full device vs data encryption) Data in transit: • Encrypted protocols • HTTP Headers configurations
  • 3. What benefits do HTTPS provide? • Confidentiality: Spy cannot view your data • Integrity: Spy cannot change your data • Authenticity: Server you are visiting is the right one • High performance! HTTPS configuration best practices https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet https://www.ssllabs.com/projects/best-practices/ Encrypting data in Transit
  • 4. • HSTS (Strict Transport Security) http://www.youtube.com/watch?v=zEV3HOuM_Vw • Forward Secrecy https://whispersystems.org/blog/asynchronous-security/ • Certificate Creation Transparency http://certificate-transparency.org • Certificate Pinning https://www.owasp.org/index.php/Pinning_Cheat_Sheet • Browser Certificate Pruning Encrypting data in Transit
  • 5. Encrypting data in Transit : HSTS (Strict Transport Security) • Forces browser to only make HTTPS connection to server • Must be initially delivered over a HTTPS connection • Current HSTS Chrome preload list http://src.chromium.org/viewvc/chrome/trunk/src/net/http/transport_security_state_static.json • If you own a site that you would like to see included in the preloaded Chromium HSTS list, start sending the HSTS header and then contact: https://hstspreload.appspot.com/ • A site is included in the Firefox preload list if the following hold:  It is in the Chromium list (with force-https).  It sends an HSTS header.  The max-age sent is at least 10886400 (18 weeks). http://dev.chromium.org/sts
  • 6. • What is Pinning ?  Pinning is a key continuity scheme  Detect when an imposter with a fake but CA validated certificate attempts to act like the real server • 2 Types of pinning  Carry around a copy of the server's public key;  Great if you are distributing a dedicated client-server application since you know the server's certificate or public key in advance • Note of the server's public key on first use  Trust-on-First-Use (TOFU) pinning  Useful when no a priori knowledge exists, such as SSH or a Browser Encrypting data in Transit : Certificate Pinning https://www.owasp.org/index.php/Pinning_Cheat_Sheet
  • 7. Encrypting data in Transit : Browser-Based TOFU Pinning https://www.owasp.org/index.php/Pinning_Cheat_Sheet • Browser-Based TOFU Pinning : Trust on First Use • HTTP Public Key Pinning IETF Draft http://tools.ietf.org/html/draft-ietf-websec-key-pinning-11 • Freezes the certificate by pushing a fingerprint of (parts of) the certificate chain to the browser • Example: Public-Key-Pins: pin-sha1="4n972HfV354KP560yw4uqe/baXc="; pin-sha1="qvTGHdzF6KLavt4PO0gs2a6pQ00="; pin-sha256="LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ="; max-age=10000; includeSubDomains
  • 8. Encrypting data in Transit : Pinning in Play (Chrome) https://www.owasp.org/index.php/Pinning_Cheat_Sheet
  • 9. Encrypting data in Transit : Forward Secrecy • If you use older SSL ciphers, every time anyone makes a SSL connection to your server, that message is encrypted with (basically) the same private server key • Perfect forward secrecy: Peers in a conversation instead negotiate secrets through an ephemeral (temporary) key exchange • With PFS, recording ciphertext traffic doesn't help an attacker even if the private server key is stolen! https://whispersystems.org/blog/asynchronous-security/
  • 10. In information security, computer science, and other fields, the principle of least privilege (also known as the principle of minimal privilege or the principle of least authority) requires that in a particular abstraction layer of a computing environment, every module (such as a process, a user, or a program, depending on the subject) must be able to access only the information and resources that are necessary for its legitimate purpose. Principle: Least Privilege For example: • OS users (technical) • Directory permissions • restrict users to only the functionality, data and system information that is required to perform their tasks
  • 11. Encrypt highly sensitive stored information, like authentication verification data, even on the server side. Always use well vetted algorithms, follow the company approved "Cryptographic Practices”. Do not store passwords, connection strings or other sensitive information in clear text or in any non-cryptographically secure manner on the client side. This includes embedding in insecure formats like: MS viewstate, Adobe flash, serialized java classes or compiled code. Encryption of data at rest
  • 12. You do not store passwords  Evolution of password “non-storage”: I. Hashes password II. Salted Hashed passwords III. Adaptive one-way function (bcrypt, Argon2…) …how to store passwords?
  • 13. ...and technical information. • Protect server-side source-code from being downloaded by a user • Remove comments in user accessible production code that may reveal backend system or other sensitive information • Remove unnecessary application and system documentation as this can reveal useful information to attackers NOTE: this is not security by obscurity antipattern Protect source-code…
  • 14. • Do not include sensitive information in HTTP GET request parameters. This includes jsessoinId parameters and others: In web.xml (Tomcat 7): <session-config> <tracking-mode>COOKIE</tracking-mode> </session-config> Or programmatically, you can use: servletContext.setSessionTrackingModes (EnumSet.of(SessionTrackingMode.COOKIE)); Avoid data leakage - 1
  • 15. • Disable auto complete features on forms expected to contain sensitive information, including authentication. <INPUT TYPE="password" AUTOCOMPLETE="off"> • Disable client side caching on pages containing sensitive information. Cache- Control: no-store, may be used in conjunction with the HTTP header control "Pragma: no-cache", which is less effective, but is HTTP/1.0 backward compatible. Cache-Control: no-cache, no-store and Pragma: no-cache, Expires: 0 • Disable unnecessary iframe support with header: X-Frame-Options: SAMEORIGIN Avoid data leakage - 2
  • 16. • The application should support the removal of sensitive data when that data is no longer required. (e.g. personal information or certain financial data). • Implement appropriate access controls for sensitive data stored on the server. This includes cached data, temporary files and data that should be accessible only by specific system users. Avoid data leakage - 3
  • 17. Enforcing (and avoiding) Same-Origin Policy * More info: https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
  • 18. How to manage cross-origin access? 1. To prevent cross-origin access, check for an unguessable token in the request, known as a Cross- Site Request Forgery (CSRF) token. You must prevent cross-origin reads of pages that know this token. 1. To prevent cross-origin reads of a resource, ensure that it is not embeddable (X-Frame-Options: SAMEORIGIN). It is often necessary to prevent embedding, because embedding a resource always leaks some information about it. 2. To prevent cross-origin embedding, ensure that your resource can not be interpreted as one of the embeddable formats(<script src="..."></script>, CSS with <link rel="stylesheet”, <img Plug-ins with <object>, <embed> and <applet>). BUT The browser does not respect the Content-Type in most cases. For example if you point a <script> tag at an HTML document, the browser will try to parse the HTML as JavaScript.
  • 19. How to manage cross-origin access? APACHE example: Restrict access to certain URIs - Apache examples RewriteRule ^/api(.*).json$ /api$1.json [CORS=True] Header set Access-Control-Allow-Origin "*" env=CORS Header set Access-Control-Allow-Methods "GET" env=CORS PHP example: <?php // We'll be granting access to only the arunranga.com domain // which we think is safe to access this resource as application/xml if($_SERVER['HTTP_ORIGIN'] == "http://arunranga.com") { header('Access-Control-Allow-Origin: http://arunranga.com'); header('Content-type: application/xml'); readfile('arunerDotNetResource.xml'); } […] //ELSE ERROR
  • 20. SECURE CODE TRAINING INTENSIVE COURSE DAVID CERVIGNI IT SECURITY CONSULTANT AND PCI CODE REVIEWER