Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS...

33
Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Transcript of Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS...

Page 1: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Topic: Web Design, Development and Security

Purushottam PantaPartial fulfillment of MS (Mathematics,

Computer Science Concentration)

Page 2: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Overview

• The thesis on "Web Design, Development and Security" is a complete analysis of website design and development. Web sites should be able to present abundant information to a visitor in well organized manner. In addition, there must be a reliable transfer of secure information between server and client. I have covered a lot of issues on a complete website design.

Page 3: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Covered topic

• Overview on web design and development:(Client-server-database model)

• The design and development of website as a process.

• Design issues on Web service components:We describe a number of issues that directly related with the quality of the web service in terms of user (customer) satisfaction.

Page 4: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Covered topic Contd.

• Web Server security challenges and defense- Client-server-database validation.- Overlapping types of risks.- SQL Injection and defense.- Bruit force solution by Human / Program request recognition (CAPTCHA)

• Disaster Recovery

Page 5: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Overview of web design and development

Page 6: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

The design and development of website as a process:

Step 1: Determine the objective and the structure of the organization

Step 2: Feedback from the possible users (For example the employee of the organization):

Step 3: Project PlanningStep 4: Component wise website analysis and

design:– Client side design

Page 7: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Process Contd..

– Server Side Design– Database Design

• Step 5: Implement the complete system and testing:• Step 6: Get the feedback from users:• Step 7: Make any necessary change, modification

according as the user feedback:

Page 8: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Design issues on Web service components:

• Error free: (Syntax and Logical Error)Script (JavaScript / VBScript) errorServer program errorDatabase design error

• Browser compatible markup.• Simplicity.• Uniform view.• Less use of Multimedia data and plug-ins.

Page 9: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Design Issue Contd.

• User Control.• Intelligent User Interaction.• Printer friendly version, sitemap and site search

capability.• Accessible design for the peoples with various

disabilities: (ALT, Tabindex, screen fed up texts, proper color combination for color blind proples)

• Globalization.

Page 10: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Design Issue Contd.

• Request handling.• Solve atomicity.• Followed some sort of Object Oriented

Concept:Encausulation, Modularity, Hirarchy

Page 11: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Web server security challenges and defense

Web server security is a major issue in the current internet world. There is much exchange of confidential information between hosts, so we can’t avoid the security issue in web service.

Page 12: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Web server security challenges and defense Contd.

Various type of people may create the security problem in web service. Let’s See who may cause the security problem and why:

Page 13: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Adversary Goal

Student To have fun snooping on people’s email, make a prank on friend’s email.

Hacker To test someone’s security, experiment with extreme programming, steal information for different purposes.

Sales Representative To claim to represent all the territories, not just to force users view their products, advertisements.

Businessman To discover a competitor’s strategic, marketing and product plan.

Ex-employee To get revenge of being fired. To reveal the secrets of the company to the competitor.

Accountant To embezzle money from company

Stockbroker To deny a promise made to a customer by email.

Con Man To steal credit card information for sale

Spy To learn an enemy’s secret plan, military, political strength and strategies.

Page 14: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Security Requirements• Secrecy:

This can be defined as keeping information out of the hands of unauthorized users

• Authentication:authentication basically deals for determining whom you are talking to before revealing sensitive information

• Non-repudiation:Deals with the signatures of the message (Unique identification of the person.

• Integrity Control:How can you be sure that a message you received was really the one sent and not something that a malicious adversary modified in transit or concocted?

Page 15: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Catagories of server attack

• Interruption.• Interception.• Modification.• Fabrication.

Page 16: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Client side validation

• Done in client side program.<input type="text" name="email" size="30" maxlength=10>

Page 17: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Validation function structure, example

function validate_myform(myForm){

var Err_reason = "";Err_reason += validate_name(myForm.lastname);Err_reason += validate_name(myForm.firstname);

Err_reason += validate_name(myForm.middlename);if (Err_reason != ""){ window.alert("Following fields need correction:\n\n" + Err_reason); return false;} return true;

}

Page 18: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

function validate_name(fld){ var error=""; var ill_char = /\W/; // Allow letters, numbers, and underscores only.

if(fld.name == "lastname" || fld.name == "firstname" || fld.name == "username"){

if (fld.value.length == 0 || fld.value == null || fld.value == ""){

fld.style.background = 'Yellow'; error = "You didn't enter a "+fld.name+"\n";

}else if ((fld.value.length < 3) || (fld.value.length > 15)){

fld.style.background = 'Yellow'; error = "The "+fld.name+" is of the wrong length.\n";

}else if (ill_char.test(fld.value)){

fld.style.background = 'Yellow'; error = "The "+fld.name+" contains illegal characters.\n";

}else{

fld.style.background = 'White';}

}

Page 19: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

else if(fld.name == "middlename"){

var ill_char1 = /\W/; // allow letters, numbers, and underscoresif (fld.value.length == 0 || fld.value == null || fld.value.length == 0){fld.style.background = 'Yellow'; error = "You didn't enter a "+fld.name+"\n";}else if(fld.value == "Last_Name"||fld.value == "First_Name"){error = "Invalid "+fld.name+"\n";fld.style.background = 'Yellow';}

else if(fld.value == "Middle_Name"){error = "Invalid "+fld.name+"\n";fld.style.background = 'Yellow';}else{fld.style.background = 'White';}

}return error;

}

Page 20: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Overlapping types of risk:

• Bugs or mis-configuration problems in the Web server that allow unauthorized remote users to

Page 21: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

A common threat: SQL Injection

• SQL injection refers to the act of inserting a SQL statement in such a way that would run on the database without server side program’s permission. Injection usually occurs when you ask a user for input, such as their name, and instead of a name they give inject such a logical MySQL statement that will directly run to the database, gain access, retrieve information.

Page 22: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

SQL Injection Contd.Example:My SQL & PHP Code:------------------------------------------------------------------------------------// A good user's name$name_good = "puru"; $query_good = "SELECT * FROM customers WHERE username = '$name_good'";echo "Normal: " . $query . "<br />"; // user input that uses SQL Injection$name_bad = "' OR 1'"; // A bad user name Input$query_bad = "SELECT * FROM customers WHERE username = '$name_bad'"; // display what the new query will look like, with injectionecho "Injection: " . $query_bad;------------------------------------------------------------------------------------Display:Normal: SELECT * FROM customers WHERE username=’puru’Injection: SELECT * FROM customers WHERE username= “OR 1”

Page 23: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

SQL Injection Contd.• MYSQL & PHP Code:• -----------------------------------------------------------------------------------• • $name_evil = "';• DELETE FROM customers WHERE 1=1 or username = '"; • • // our MySQL query builder really should check for injection• $query_evil = "SELECT * FROM customers WHERE username = '$name_evil'";• • // the new evil injection query would include a DELETE statement• echo "Injection: " . $query_evil;• --------------------------------------------------------------------------------• Display:• SELECT * FROM customers WHERE username= ‘ ’; DELETE FROM customers WHERE 1

OR username=’ ‘;• ----------------------------------------------------------------------------------• It results to completely empty the “customers” table in the database.

Page 24: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Defeating the SQL injection:

• Write a function in server side (make Servlet or DLL) to filter the bad string.

• With MYSQL_REAL_EXCAPE_STRING():

Page 25: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Defense bruit-force with Human / Program Recognition (Such as CAPTCHA)

How bruitforce works??

Page 26: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Disaster Recovery Plan

“Dollars spent in prevention are worth more than dollars spent in recovery”The key to survive in such types of IT-Disabling disaster for the continuity of the business is a set of policies and procedures called Disaster Recovery Plan (DRP). So, Disaster Recovery Plan is one of the crucial core components in smoothly running the web services and the business.

Page 27: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Disaster Recovery Process

• Risk Analysis:Find out all the possible risks by brainstorming:

- within IT department to find out every possible risk, chance of occurrence and its

importance (impact on the service).- Rate all the possible risks on the basis of:

Probability of occurrence and Its impact.

Page 28: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Disaster Recovery Process Contd.

• Feasibility Study and Budgeting:Generating all possible solution and determine which solution is feasible in term of available budget .

• Develop and implement the plan:The recovery procedure script should be written in detail by IT department. The IT department will get suggestion and feedback from all other units in the organization to implement.

Page 29: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Disaster Recovery Process Contd.

• Testing.After setting the DRP in the company, the final stage is to test and test for all the possible consequences and disasters. Observe how our recovery plan gives the solution; make any change if necessary for the best result.

Page 30: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Conclusion

• The better plan and a careful design of the web service will have a number of flexibilities in modification, a robustness security and user favourable.

• So the issues we have describe will contribute to our goal of ideal web site and service.

Page 31: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

References• Book: Web 101 Making the Network for you (By Wendy Lehnert ISBN:

0201704749).• http://www.w3.org/Security/Faq/• http://www.unixwiz.net/techtips/sql-injection.html• http://www.w3.org/DesignIssues/Principles.html• http://en.wikipedia.org/wiki/Website_design• http://www.tizag.com/mysqlTutorial/mysql-php-sql-injection.php• Murach’s Java Servlets and JSP, Second Edition, Andrea Steelman and Joel

Murach, Murach Books, ISBN 978-1-890774-44-8.• http://websitetips.com/planmanage/• http://www.ibm.com/developerworks/xml/library/x-wxxm2/index.html• http://www.w3.org/TR/REC-xml/• Cryptography and Network Security, Behrooz Forouzan, McGraw-Hill, ISBN: 978-

0-07-287022-0.• Lateral SQL Injection: A new Class of Vulnerability in Oracle ( David Litchfield

[[email protected]] 27th February 2008)• http://www.databasesecurity.com/dbsec/lateral-sql-injection.pdf

Page 32: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Special thanks to

• Dr John Sullins.• Dr Graciela Perera.• Dr. Jamal Tartir.• My Brother Nagendra and • My Friends.For encouragement and precious suggestions

Page 33: Topic: Web Design, Development and Security Purushottam Panta Partial fulfillment of MS (Mathematics, Computer Science Concentration)

Question - Answer Session