SECURITY FOR DEVELOPERS
@shawkyz1
@shawkyz
• Secure Software Development Life Cycle
• Design Issues.
• Threat Modeling.
• Static Code Analysis.
• Fuzzing.
• Resources.
AGENDA
SDLC (SOFTWARE DEVELOPMENT LIFECYCLE)
• A Software Development Life Cycle (SDLC) is a framework that defines the process
used by organizations to build an application from its inception to its
decommission. Over the years, multiple standard SDLC models have been proposed
(Waterfall, Iterative, Agile, etc.) and used in various ways to fit individual
circumstances.
• Planning and requirements.
• Architecture and design.
• Test planning.
• Coding.
• Testing and results.
• Release and maintenance.
SDLC PHASES
SECURE YOUR SDLC ACCORDING TO
MICROSOFT
• Provide Training.
• Define Security Requirements.
• Perform Threat Modeling.
• Define and Use Cryptography Standards.
• Follow Best Practices.
• Perform Static Analysis.
• Perform Dynamic Analysis.
• Regularly Pentest.
• Establish Incident Response Mechanism.
Source: https://www.microsoft.com/en-us/securityengineering/sdl/practices
EX: LOGIN PROCESS
EX: LOGIN PROCESS
EX: LOGIN PROCESS FLOW SSO
THREAT MODELING
THREAT MODELING
THREAT MODELING
EXAMPLE OF UNSAFE MANAGED
CODE
• unsafe static void Main()
• {
• fixed (char* value = "safe")
• {
• char* ptr = value;
• while (*ptr != '0')
• {
• Console.WriteLine(*ptr);
• ++ptr;
• }
• }
• }
ATTACK SURFACE REDUCTION
• Part of the process of reducing the attack surface is taking down APIs or functionalities that are no longer neeeded by
following the LEAN engineering principle.
• Threat modelling can also help with scaling-down the attack surface.
• Unnecessary logic complexity can lead to security problems in the future.
• Automated Tests (Static and/or dynamic analysis).
• Pentesting your application.
STATIC ANALYSIS TOOLS
• https://owasp.org/www-community/Source_Code_Analysis_Tools
BROWSER SECURITY FEATURES
• HTTP Strict Transport Security (HSTS)
• Public Key Pinning Extension for HTTP (HPKP)
• X-Frame-Options
• X-XSS-Protection
• X-Content-Type-Options
• Content-Security-Policy
• X-Permitted-Cross-Domain-Policies
• Referrer-Policy
• Expect-CT
• Feature-Policy
• Cookies attributes (Secure, Samesite).
OWASP TOP 10
RESOURCES?
• Troy Hunt‘s OWASP Top 10 for .NET developers
• https://files.troyhunt.com/OWASP%20Top%2010%20for%20.NET%20developers.pdf
• OWASP TOP 10 2017
• https://www.owasp.org/images/7/72/OWASP_Top_10-2017_%28en%29.pdf.pdf
• Security Engineering Practices
• https://www.microsoft.com/en-us/securityengineering/sdl/practices
HOW TO APPLY BEST PRACTICES
• Always check OWASP‘s Best practices for a certain vulnerability.
• Look for OWASP‘s Library/Framework Recommendations.
• Don‘t trust any default configs. Always double check it.
• Never trust user‘s input.
• Apply ACLs.
HOW DO I KNOW ABOUT NEW 0DAYS?
• Check if your local CERT if they offer a newsletter.
• Subscribe to MITRE newsletter https://cve.mitre.org/news/newsletter.html
• Regrularly Update Libraries/Frameworks you‘re using.
FOLLOW ME?
@shawkyz1
@shawkyz
@shawkyz1
https://shawkyz.info abdelrhmanshawky4@gmail.com

Security for developers

  • 1.
  • 2.
    • Secure SoftwareDevelopment Life Cycle • Design Issues. • Threat Modeling. • Static Code Analysis. • Fuzzing. • Resources. AGENDA
  • 3.
    SDLC (SOFTWARE DEVELOPMENTLIFECYCLE) • A Software Development Life Cycle (SDLC) is a framework that defines the process used by organizations to build an application from its inception to its decommission. Over the years, multiple standard SDLC models have been proposed (Waterfall, Iterative, Agile, etc.) and used in various ways to fit individual circumstances.
  • 4.
    • Planning andrequirements. • Architecture and design. • Test planning. • Coding. • Testing and results. • Release and maintenance. SDLC PHASES
  • 5.
    SECURE YOUR SDLCACCORDING TO MICROSOFT • Provide Training. • Define Security Requirements. • Perform Threat Modeling. • Define and Use Cryptography Standards. • Follow Best Practices. • Perform Static Analysis. • Perform Dynamic Analysis. • Regularly Pentest. • Establish Incident Response Mechanism. Source: https://www.microsoft.com/en-us/securityengineering/sdl/practices
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
    EXAMPLE OF UNSAFEMANAGED CODE • unsafe static void Main() • { • fixed (char* value = "safe") • { • char* ptr = value; • while (*ptr != '0') • { • Console.WriteLine(*ptr); • ++ptr; • } • } • }
  • 13.
    ATTACK SURFACE REDUCTION •Part of the process of reducing the attack surface is taking down APIs or functionalities that are no longer neeeded by following the LEAN engineering principle. • Threat modelling can also help with scaling-down the attack surface. • Unnecessary logic complexity can lead to security problems in the future. • Automated Tests (Static and/or dynamic analysis). • Pentesting your application.
  • 14.
    STATIC ANALYSIS TOOLS •https://owasp.org/www-community/Source_Code_Analysis_Tools
  • 15.
    BROWSER SECURITY FEATURES •HTTP Strict Transport Security (HSTS) • Public Key Pinning Extension for HTTP (HPKP) • X-Frame-Options • X-XSS-Protection • X-Content-Type-Options • Content-Security-Policy • X-Permitted-Cross-Domain-Policies • Referrer-Policy • Expect-CT • Feature-Policy • Cookies attributes (Secure, Samesite).
  • 16.
  • 17.
    RESOURCES? • Troy Hunt‘sOWASP Top 10 for .NET developers • https://files.troyhunt.com/OWASP%20Top%2010%20for%20.NET%20developers.pdf • OWASP TOP 10 2017 • https://www.owasp.org/images/7/72/OWASP_Top_10-2017_%28en%29.pdf.pdf • Security Engineering Practices • https://www.microsoft.com/en-us/securityengineering/sdl/practices
  • 18.
    HOW TO APPLYBEST PRACTICES • Always check OWASP‘s Best practices for a certain vulnerability. • Look for OWASP‘s Library/Framework Recommendations. • Don‘t trust any default configs. Always double check it. • Never trust user‘s input. • Apply ACLs.
  • 19.
    HOW DO IKNOW ABOUT NEW 0DAYS? • Check if your local CERT if they offer a newsletter. • Subscribe to MITRE newsletter https://cve.mitre.org/news/newsletter.html • Regrularly Update Libraries/Frameworks you‘re using.
  • 20.

Editor's Notes