Top Banner
SECURE CODING PRACTICES BY – MOHAMMED DANISH AMBER
12
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Secure coding practices

SECURE CODING PRACTICES

BY – MOHAMMED DANISH AMBER

Page 2: Secure coding practices

ABOUT ME

• Mohammed Danish Amber

• Web Application & Database Security Administrator

• CEH & CHFI Certified

• N|u Hyderabad Chapter Core Member

Page 3: Secure coding practices

GUIDE OVERVIEW

• Technology agnostic coding practices

• What to do, not how to do it

• Compact, but comprehensive checklist format

• Focuses on secure coding requirements, rather then on vulnerabilities and exploits

• Includes a cross referenced glossary to get developers and security folks talking the same language

Page 4: Secure coding practices

CHECKLIST

• Data Validation

• Authentication and Password Management

• Authorization and Access Management

• Session Management

• Sensitive Information Storage or Transmission

• System Configuration Management

• General Coding Practices

• Database Security

• File Management

• Memory Management

Page 5: Secure coding practices

CHECKLIST PRACTICES

• Short and to the point.

• Straight forward "do this" or "don't do that"

• Does not attempt to rank the practices

• Some practices are conditional recommendations that depend on the criticality of the system or information

• The security implications of not following any of the practices that apply to the application, should be clearly understood

Page 6: Secure coding practices

EXTRACT - DATABASE SECURITY• Use strongly typed parameterized queries. Parameterized queries keep the query and data separate through the use of placeholders. The

query structure is defined with place holders and then the application specifies the contents of each placeholder.

• Utilize input validation and if validation fails, do not run the database command.

• Ensure that variables are strongly typed.

• Escape meta characters in SQL statements.

• The application should use the lowest possible level of privilege when accessing the database.

• Use secure credentials for database access.

• Do not provide connection strings or credentials directly to the client. If this is unavoidable, encrypted them.

• Use stored procedures to abstract data access.

• Turn off any database functionality (e.g., unnecessary stored procedures or services).

• Eliminate default content.

• Disable any default accounts that are not required to support business requirements.

• Close the connection as soon as possible.

• The application should connect to the database with different credentials for every trust distinction (e.g., user, read-only user, guest, administrators).

Page 7: Secure coding practices

DEVELOPING GUIDANCE DOCUMENTS

Security Policy

GUIDING PRINCIPLES

Application Security

ProceduresWhat to Do

Application Security Coding

Standards

How to do it

Page 8: Secure coding practices

SUPPORT SECURE DEVELOPMENT LIFECYCLE

•Review Solutions•Test Solution Implementation

•Application Development Practices

•Standardized Libraries

•Standard Guidance for non-Library Solutions

•Application Security Requirements

What to do

How you

should do it

What you did

Did it work

Page 9: Secure coding practices

CONTRACTED DEVELOPMENT

• Identify security requirements to be added to outsourced software development projects.

• Include them in the RFP and Contract

I NEED COOL

SOFTWARECUSTOMER

We can build

anythingSALESMAN

How do I make it

workPROGRAMMER

Page 10: Secure coding practices

SUMMARY

• Makes it easier for development teams to quickly understand secure coding practices

• Assists with defining requirements and adding them to policies and contracts

• Provides a context and vocabulary for interactions with security staff

• Serves as an easy desk reference

Page 11: Secure coding practices

A SECURE DEVELOPMENT FRAMEWORK

• Implement a secure software development lifecycle

• OWASP CLASP Project

• Establish secure coding standards

• OWASP Development Guide Project

• Build a re-usable object library

• OWASP Enterprise Security API (ESAPI) Project

• Verify the effectiveness of security controls

• OWASP Application Security Verification Standard (ASVS) Project)

• Establish secure outsourced development practices including defining security requirements and verification methodologies in both the RFP and contract

• OWASP Legal Project

Page 12: Secure coding practices

QUESTIONS

HACK

LEARN

SHARE