software security - the road less traveled...cissp, ecsa/lpt, mcsd, mcad, comptia network+...

44
SELECT name, certifications SELECT name, certifications FROM tblSPEAKER FROM tblSPEAKER WHERE topic = ‘ WHERE topic = ‘Software Security Software Security – The Road Less Traveled The Road Less TraveledAND date = ‘ AND date = ‘04/29/2008 04/29/2008AND event = ‘ AND event = ‘OWASP OWASP - Austin AustinManoranjan (Mano) Paul CISSP, ECSA,LPT, MCSD, MCAD, CompTIA Network+

Upload: others

Post on 13-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

SELECT name, certifications SELECT name, certifications FROM tblSPEAKERFROM tblSPEAKERWHERE topic = ‘WHERE topic = ‘Software Security Software Security ––

The Road Less TraveledThe Road Less Traveled’ ’ The Road Less TraveledThe Road Less Traveled’ ’ AND date = ‘AND date = ‘04/29/200804/29/2008’ ’ AND event = ‘AND event = ‘OWASP OWASP -- AustinAustin’’

Manoranjan (Mano) PaulCISSP, ECSA,LPT, MCSD, MCAD, CompTIA Network+

Page 2: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</UNO me Name, but Who am I?></UNO me Name, but Who am I?>

� Shark Biologist – Bimini Biological Field Station, Bahamas

� Information Security Engineer/Pgm. Manager – Dell Inc.

� Contributing Author

◦ Security PnP for MSDN

◦ Information Security Management Handbook◦ Information Security Management Handbook

◦ Information Security Management Top 10

� ISSA – Industry Representative

� Speaker @ CSI, OWASP, Burton Group Catalyst, TRISC

� Founded SecuRisk Solutions and Express Certifications

Page 3: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</What do I do?></What do I do?>

� SecuRisk Solutions

◦ Mission: Securing YOUR Risk is OUR Solution

◦ Information Security Consulting – A to Z

◦ Product Development

◦ Awareness, Training and Education (A,T&E) Services

� Express Certifications

◦ Mission: Your Key to Professional Certifications

◦ (ISC)2 Official readiness self-assessment for CISSP® and SSCP®

◦ Skills Measuring Assessment Reinforced Training (SMART) Learning Management Solutions

GET AWARE, GET SKILLED, GET CERTIFIED, GET SECURE

Page 4: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</The Road Less Traveled></The Road Less Traveled>Two roads diverged in a yellow wood,And sorry I could not travel bothAnd be one traveler, long I stoodAnd looked down one as far as I couldTo where it bent in the undergrowth;

Then took the other, as just as fair,And having perhaps the better claim,Because it was grassy and wanted wear;Though as for that the passing thereHad worn them really about the same,

� Are the Two Roads Same?◦ equally

� Are the Two Roads Different?◦ one worn (familiar), the And both that morning equally lay

In leaves no step had trodden black.Oh, I kept the first for another day!Yet knowing how way leads on to way,I doubted if I should ever come back.

I shall be telling this with a sighSomewhere ages and ages hence: Two roads diverged in a wood, and I -I took the one less traveled by, And that has made all the difference.

Robert Frost, 1920

◦ one worn (familiar), the other (less traveled)

◦ first for another day

◦ Made ALL the difference

Page 5: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Familiar Roads in Security></Familiar Roads in Security>

� Network Security� Platform (Host) Security� Viruses, Worms and Malware� Identity Access Management� Mobile Security� Mobile Security� Governance, Regulations and Compliance� Risk Management � Web 1.0wn3d/2.0wn3d Security� Generation H - Hackers � Products, Services and More …

Page 6: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Stops on the Road Less Traveled></Stops on the Road Less Traveled>

� Wonders of the World

� Literature

� Art / Film

� Science� Science

� Nature

Page 7: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</8</8thth Wonder of the World?>Wonder of the World?>

Page 8: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Shakespearean Security></Shakespearean Security>

� All the World’s a Stage (As you like It)

� The ides of … (Julius Caesar)

◦ Digital Pearl Harbor

� Method in the Madness (Hamlet)� Method in the Madness (Hamlet)

� 2B || !2B (Hamlet) Secure – That is the Question

Page 9: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</The </The BearBear Bare Necessities>Bare Necessities>

Down Across

1. Synonym: Sensitivity; Antonym: Disclosure 5. Who is making the request?

2. Rights and Privileges of the Requestor 6. Historical Evidence

3. Synonym: Criticality;Antonym: Destruction

4. Synonym: Accuracy; Antonym: Alteration

Page 10: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</The </The BearBear Bare Necessities>Bare Necessities>Down

1. Synonym: Sensitivity; Antonym: Disclosure

2. Rights and Privileges of the Requestor

3. Synonym: Criticality;Antonym: Destruction

4. Synonym: Accuracy; Antonym: Alteration

Across

5. Who is making the request?

6. Historical Evidence

Page 11: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

CoNFiDeNTiaLTYCoNFiDeNTiaLTYSynonym: Sensitivity

Antonym: Disclosure

Page 12: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Loose Lips Sink Ships></Loose Lips Sink Ships>

� a.k.a. To blab = to help the enemy

Page 13: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Encryption Racer></Encryption Racer>

Source: http://blogs.msdn.com/vbertocci/archive/2005/04/25/411913.aspx

Page 14: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Confidentiality Controls></Confidentiality Controls>

� Non-Verbose Instrumentation of Code

� Generic Error Handling

� Masking Data

� Encryption of Data� Encryption of Data

Page 15: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Non</Non--Verbose Instrumentation>Verbose Instrumentation>

� Instrumentation: is writing code documentation/comments inline

� Verbose Instrumentation◦ Good practice for Maintainability, Support and Handover

◦ Bad from a security standpoint, if comments reveal sensitive information � E.g., Connection Strings; Valid data for Testing� E.g., Connection Strings; Valid data for Testing<!--Authenticate Method Takes 2 parameters – username and passwordE.g., bool _bAuthenticateStatus = Authenticate(“admin”,”pwd”);-->

� Use Instrumentation selectively and intelligently; keep it non-verbose

<!--Authenticate Method Takes 2 parameters to determine access to system-->

Page 16: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Generic Error Handling></Generic Error Handling>

� Don’t give our verbose error messages◦ “The username does not exist” – Bad

◦ “Login Invalid” – Good

� Handle Errors – Don’t display system generated errors as isgenerated errors as is◦ YSOD – Default .Net Error Handling

� Redirect Remote Errors to a custom and generic error location

� <customErrors mode="RemoteOnly" defaultRedirect="~/errorPage.aspx">

</customErrors>

Page 17: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Masking Data></Masking Data>

� Passwords Fields◦ <asp:TextBox id=“txtPassword”

mode=“Password” runat=“server”>

� Financial Data e.g., Credit Card Numbers� Financial Data e.g., Credit Card Numbers

◦ Visa – XXXX-XXXX-XXXX-1234

◦ American Express - XXXX-XXXXXX-X1234

� Personally Identification Information (PII)

Page 18: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Encryption of Data></Encryption of Data>

� Encryption

◦ is the process of transforming data in humanly readable form (plaintext) using an algorithm (cipher) to make it unreadable (ciphertext) to anyone except those possessing special knowledge (key). those possessing special knowledge (key).

� Encryption

◦ Plaintext � Ciphertext

� Decryption

◦ Ciphertext � Plaintext

Page 19: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Web.Config Connection Strings </Web.Config Connection Strings En(De)cryption Example>En(De)cryption Example>

<connectionStrings>

<add name="ContractFinConn”

connectionString=“Server=(local);uid=ContractFinUse r;

pwd=ContractFinPwd; Database=ContractFinance” providerName="System.Data.SqlClient" />

</connectionStrings>

Encryptionaspnet_regiis -pdf "connectionStrings" vDir

<connectionStrings configProtectionProvider=“ConFinRSAProvider"><EncryptedData …>

<CipherData> <CipherValue>Z1uePkgBjr8GR4DH0f9bsW7YeegeCe9MpFlpgCwHrtJukUre6sKmC6a89efv00MWx0iKGhYd+/jQpvSMphy12+zvszEnBMmsR+6WNyb7xG/d6guF84VL+DKb+Z2jq5yFKqHpoLqjFAhAeLtv4JcOEiwFVjtkMh9Klk5GFEzGzuA=</CipherValue>

</CipherData>…

</EncryptedData></connectionStrings>

EncryptionDecryption

aspnet_regiis -pef "connectionStrings" vDir -prov "ConFinRSAProvider"

Page 20: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

iNTeGRiTYiNTeGRiTYSynonym: Accuracy

Antonym: Alteration

Page 21: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Integrity </Integrity –– Security Controls>Security Controls>

� Input Validation

� Fail Securely

� Hashing

Page 22: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Input Validation></Input Validation>

� Input, the r00t of all Evil; Trust, but verify� Validation Approaches◦ Black-list – list of “bad” input blocked; all else allowed◦ White-list – list of “good” input allowed; all else

blocked

� Validate What?� Validate What?◦ Length, Range, Format, Data Type

� Validate Using◦ Maxlength restrictions & str ‘n’ functions◦ Regular Expression (RegEx) & XSD Schemas◦ Safe libraries ◦ Type Casting

OWASP Testing Guide

Page 23: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Fail Securely></Fail Securely>

� Design in secure defaults and baseline configuration

� Do not allow automatic re-authentication after failed attempt

� Do not cache credentials and Abandon Session

� Do not cache credentials and Abandon Session◦ <%@ OutputCache CacheProfile="NoCacheProfile"

VaryByParam="none" %>◦ FormsAuthentication.SignOut();

Session.Abandon();

� Alert on application failure if possible or else audit log it

Page 24: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Hashing></Hashing>

� Hashing - a reproducible method of turning data into a (relatively) small number that may serve as a digital "fingerprint" as a digital "fingerprint" of the data.

� Is One-Way

� Common Hash Functions◦ MD5

◦ SHA-1

Page 25: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

aVaiLaBiLiTYaVaiLaBiLiTYSynonym: Criticality

Antonym: Destruction

Page 26: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Availability </Availability -- Security Controls>Security Controls>

� Classify First : Low, Moderate, Significant, Critical or Your Own

� Source Control & Configuration ManagementManagement

� Contingency and Disaster Recovery

� Load Balancing

� Threshold monitoring service/process monitors

Page 27: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

auTHeNTiCaTioNauTHeNTiCaTioNWho is making the Request?

Page 28: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Authentication </Authentication –– Security Controls>Security Controls>

� Deny Anonymous Access

� Use Complex Authn. Mechanisms◦ Two-Factor or Multi-Factor

◦ Biometrics

� When using “Password” authentication, use complex passwordspasswords◦ > 15 characters; mixed case; alpha-numeric

� Randomize Session IDs

� Timeout Sessions

� Store no authentication information on client

� Clipping levels for incorrect attempts

� Record Valid/Invalid Login Attempts

Page 29: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

auTHoRiZaTioNauTHoRiZaTioNRights and Privileges of the Requestor

Page 30: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Authorization </Authorization –– Security Controls>Security Controls>

� Role Based or Resource Based

� Deny Permissions/Rights by Default◦ Give your Users PITA; Better 2B $afe than $$$orry

� Do not use built-in administrative accounts (system admin, dbo)(system admin, dbo)

� Use accounts with Least Privilege / Need to know rights / no elevated privileges (reader/writer)

� Restrict and Record Impersonation and Backdoor functionality

� Restrict Application Configuration Information

Page 31: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

auDiTiNGauDiTiNGHistorical Evidence

Page 32: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Auditing </Auditing –– Security Controls>Security Controls>

� Record Activity AND Errors

� Record all administrative activities

◦ E.g., Login, Logoff, Password change

� Record critical business functions

◦ E.g., Price change; Order cancellation

� Turn on system/database logging by default

� Record changes for building a historical evidence trail

� Always Append, Never Overwrite

� Treat Audit Logs as Highly Restricted Sensitive information

Page 33: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Liar, Liar, …></Liar, Liar, …>

� Social Engineering -Art of Deception

� Targets Human Trust

� var stealPwd = prompt(‘Please enter your password’);

� Really no technical control – security awareness, a chance Photo Credit: IsStockphoto

Page 34: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

Natural SecurityNatural Security

“ … organisms keep themselves safe in a world that's every bit as unpredictable as our world”

- Raphael Sagarin

- Author of Natural Security

Page 35: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Security Management></Security Management>

From monolithic applications to smaller disconnected and modular services/apis/apps.

Page 36: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Bee</Bee--Hiving Software>Hiving Software>

Quality (Secure) software should be

a. Modular (Unit)

b. Highly CohesiveHighly Cohesive

(discreet functions)

c. Loosely Coupled

(no dependencies)

Page 37: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Regenerative Bugs></Regenerative Bugs>

� The stick insect can regrow an amputated appendage

� (Im)proper/effective config. mgt. controls config. mgt. controls such as versioning can lead to re-generation of fixed production bugs without and updates to dev/test environments.

Page 38: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Defensive Dams></Defensive Dams>

� Necessary protections should be built in the software layered with defense in depth, starting with the perimeter.

Page 39: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Head in the Sand></Head in the Sand>

� Ignoring or Not Mitigating known Vulnerabilities in your software is akin to sticking your head to sticking your head in the sand …

� Accept, Transfer or Mitigate Ri$k.

Page 40: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</The Third Eye></The Third Eye>

� The Horse Shoe Crab (Limulus) is said to have a third eye.

� Secure Software should allow for Extra Vigilance !

Page 41: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Sleep</Sleep--Swimming>Swimming>

� Some aquatic mammals sleep by shutting ONLY one side of their brain at a time.

� Security should always be vigilant (conscious).

Page 42: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</pH </pH –– potentially Hackable>potentially Hackable>

� pH is ◦ the measure of

acidity/alkalinity

� Security pH-ilosophy should be to should be to NEUTRALIZE

a. threats with countermeasures

� Any Imbalance will lead to potentially Hackable software

Page 43: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</To sum of …/></To sum of …/>

2B || !2B Secure Naturally

Incorporating the Bare Necessitiesso that your software is NOT

potentially Hackablepotentially HackableThat is the Question

- Software Security -The Road Less Travelled

Makes ALL the difference

Page 44: Software Security - The Road Less Traveled...CISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+ mano(dot)paul(at)securisksolutions(dot)com mano(dot)paul(at)expresscertifications(dot)com

</Cont@ct!/></Cont@ct!/>If You (Liked the presentation ||

Did not like the presentation ||

Need Encore(other) presentation for your company ||

Have Security Program Development Needs ||

Have Security Product Development/Evaluations Needs ||

Have Awareness, Training & Education Needs ||

Have Certification (CISSP ®/SCCP®) Needs)

{

Manoranjan (Mano) PaulCISSP, ECSA/LPT, MCSD, MCAD, CompTIA Network+

mano(dot)paul(at)securisksolutions(dot)commano(dot)paul(at)expresscertifications(dot)com

1-866-369-CERT (2378)

SecuRiskSolutions

Contact me;

}

else

{

Have a great day;

}

finally

{

Thank you;

}