Unit 2.3 Robust Programs Lesson 1 - Defensive Design Consideration

Slides:



Advertisements
Similar presentations
Validation and Verification
Advertisements

 By the end of this, you should be able to state the difference between DATE and INFORMAITON.
A Level Physics A Delivery Guide Modelling decay of charge Key Concepts.
What is Validation Understanding Validation (Different from Verification)
Data and information. Information and data By the end of this, you should be able to state the difference between DATE and INFORMAITON.
Verification & Validation. Batch processing In a batch processing system, documents such as sales orders are collected into batches of typically 50 documents.
1 AQA ICT AS Level © Nelson Thornes 2008 Good quality data and information Data terms.
© OCR 2016 Motion graphs. © OCR 2016 MOTION GRAPHS LESSON ELEMENT.
Data Capture Forms What are they?. Example 1 Example 2.
© OCR 2016 H070 Topic Title H470 Topic Title Urban Futures Learner Resource 4 – Push and Pull Factors.
© OCR 2016 H070 Topic Title H470 Topic Title Rotations.
N5 Databases Notes Information Systems Design & Development: Structures and links.
The purpose of one Christian Aid Agency
Marriage and the wedding ceremony
Learner Activity 2: Boltzmann Distribution Curves Part of the ‘Rates of reaction and the Arrhenius equation’ Topic Exploration Pack.
The Boltzmann Distribution
Validation and verification 1.2
A Level Business Investment Appraisal Lesson Elements.
Vectors H070 Topic Title H470 Topic Title.
Burglary picture game.
China and its rulers activities
H070 Topic Title H470 Topic Title Delivery Guide (Learner Resource)
Balancing Equations Lesson Element.
Unit 2.5 Translators and Facilities of Languages – Lesson 1
Delivery Guide Distinctive Landscapes © OCR 2017
Unit 2.5 Translators and Facilities of Languages – Lesson 2
H070 Topic Title H470 Topic Title Urban Futures
A Level Physics Delivery Guide.
The Maxwell–Boltzmann Distribution
Watch this video clip taken from Futurama
Unit 2.3 Robust Programs Lesson 2 - Testing Programs
H070 Topic Title H470 Topic Title Urban Futures
Validation Bury College.
Unit 1.4 Wired and Wireless Networks Lesson 2
Unit Network Topologies, protocols and layers Lesson 3
Landscapes of the UK Learner Resource 3 Comparing characteristics.
Unit 1.4 Wired and Wireless Networks Lesson 1
Little work is accurate
Unit 1.6 Systems security Lesson 3
Unit Network Topologies, protocols and layers Lesson 2
Unit Network Topologies, protocols and layers Lesson 1
Fun gym Cambridge Nationals R001.
Theft picture game.
Electromagnetic spectrum
Combination of Transformations
Fun gym Cambridge Nationals R001.
Electromagnetic spectrum
Unit 1.6 Systems security Lesson 4
Unit 1.6 Systems security Lesson 2
Roots and Shoots Lesson Element.
Unit 1.4 Wired and Wireless Networks Lesson 3
Unit 1.3 Storage Lesson 2: Storing Data
What makes these UK landscapes distinctive?
Unit 1.1 Systems Architecture Lesson 1
Learner Activity 2: Boltzmann Distribution Curves Part of the ‘Rates of reaction and the Arrhenius equation’ Topic Exploration Pack.
TCP/IP routing simulation
H070 Topic Title H470 Topic Title Urban Futures
Unit 1.3 Storage Lesson 1: Storage Devices
Unit 1.1 System Architecture Lesson 2
Unit 1.3 Storage Lesson 1: Storage Devices
Introduction to Databases
A Level Business Investment Appraisal Lesson Elements.
Who… What… Why… When… Where… How… Could… Should….
Who… What… Why… When… Where… How… Could… Should….
What evidence is there to suggest climate change is a natural process?
Describing Graphs Describe the overall trend shown on the graph
Unit 1.6 Systems security Lesson 1
Presentation transcript:

Unit 2.3 Robust Programs Lesson 1 - Defensive Design Consideration

Big Picture How can ROBUST programs be created that are defensive against hacks and attacks. How can this be implemented in the design stage of the program development?

Learning Objectives To understand the elements of defensive program design Know how comments and indentation can support maintainability Describe the role of testing, including how to identify errors and select appropriate test data.

Engagement Activity https://www.youtube.com/watch?feature=player_embedded&v=rGllClLzYts

Engagement Activity What caused the SONY hack? What are the outcomes of this hack? How could SONY have prevented the attack? How might SONY alter their programs to prevent this kind of attack in the future?

Key Words Data Validation Data Sanitisation Authentication Maintainability Comments Indentation

Defensive Design Considerations Make a list of where you commonly enter data. How much of this is personal data? When data is entered into a program it is important that it is valid in order for the program to operate correctly. Sometimes users will deliberately enter incorrect or ‘spam’ data in an attempt to access a program or the program code.

Input Validation Validation is a check made by a computer to ensure that the data entered is sensible or reasonable. It cannot check that it is correct because a user may lie or make a mistake. It attempts to ensure that it is within certain limits or rules.

Input Validation For example, a user is asked to enter a mobile phone number but only enters 9 digits. A standard UK mobile number is 11 digits. A length check validation can be used to ensure that 11 digits are entered

Activity One Sort the cards into the correct order create a table of the: Name of the validation technique A definition An example

Activity 1 Answers Check digit the last one or two digits in a code are used to check the other digits are correct bar code readers in supermarkets use check digits Format check checks the data is in the right format a National Insurance number is in the form LL 99 99 99 L where L is any letter and 9 is any number Length check checks the data isn't too short or too long a password which needs to be six letters long Lookup table looks up acceptable values in a table there are only seven possible days of the week Presence check checks that data has been entered into a field in most databases a key field cannot be left blank Range check checks that a value falls within the specified range number of hours worked must be less than 50 and more than 0 Spell check looks up words in a dictionary MS Word uses red lines to underline misspelt words

Input Sanitisation Another method for validating data and stopping attacks is to clean up the data that is inputted so that it is ready for the application to use. Some users may add additional data to try and access the program or provide clues on how to access the program. Data sanitisation trims or strips strings, removing unwanted characters from strings For example, Dave not dav%e, the % would be removed This ensures that the input is correct and contains only the permitted characters, letters and symbols.

Input Sanitisation Activity 2 Look at the data below and identify the issues Dav3 Sarah@#gmail.com Name: claire swainsworth £546.56.67 O1982 56O635

Input Sanitisation Answers Look at the data below and identify the issues Dav3 Sarah@#gmail.com Name: claire swainsworth £546.56.67 (two options here) O1982 56O635

Anticipating Misuse Defensive program design will consider and anticipate misuse. Misuse may be in the form of a brute force attack on the program. Many programs and systems only allow a user to enter a password three or four times before it locks out the system.

Anticipating Misuse The program should be able to identify when a user keeps inputting the same data. Consider Twitter which allows you to send the same tweet only once. If you send the same Tweet twice the program identifies this and removes the tweet, sending you an error message.

Planning for contingencies Once a programmer has anticipated the misuse they can then plan for the these issues. For example: Limiting the number of logon attempts Ensuring the code is robust in validating the data entered. Another method used is authentication

Authentication Authentication is a coding method to check that a user is who they say they are and allowed to accesses the program. This can be as simple as the user entering a user name and password which is compared against a stored user name and password. If they match then the user is authenticated.

Authentication Authentication can also be physical. New software often requires a key code which is generated by an app on the users phone and then entered. Online banking requires a user to enter credentials into a webpage and then a number is generated which is entered into a key device. This returns a number code which is entered into the webpage as well. Without the second part of the code the user is not authenticated.

Authentication Authentication methods vary from passwords to patterns and even image scanners. Authentication also occurs when you access a website, you request access to the server which hosts the page.

Authentication A summary of basic web authentication goes like this: You make for a request for a webpage by typing in the URL The server responds with an error, requesting authentication Your device retries request - with authentication details encoded in request Again the server checks the details and sends the page requested, or another error

Make a list of programs where authentication is required and what type of authentication happens Facebook Login

Maintainability If a program is to be defensive against attacks then it has to be maintained and up to date. API and code changes, which means that programs will need to adapt to complement new requirements. Comments and indentation are two methods to provide information for future users or programmers that may be required to maintain the code.

Indentation Code is indented for a number of reasons. To group together a function The code does not use a { syntax and indentation is used instead If altering a function in the future it can be easily found.

Comments Comments in programs serve a number of purposes To inform them reader of a bug or issues To explain the code and its function in more detail To stop a line of section of code from executing

Where are the comments?

Activity 3/Homework Create a simple ‘Top 10 tips for effective coding’ poster For example: add comments as you write the program and be polite Include examples and best practice You could include screen shots and images

Plenary Play Pictionary: draw words / terms related to the lesson content. Evaluate a program(s) that you have written: Are they robust? Make a list of features that are and that are not Apply defensive design to your own programs.

OCR Resources: the small print OCR’s resources are provided to support the teaching of OCR specifications, but in no way constitute an endorsed teaching method that is required by the Board, and the decision to use them lies with the individual teacher. Whilst every effort is made to ensure the accuracy of the content, OCR cannot be held responsible for any errors or omissions within these resources. © OCR 2016 - This resource may be freely copied and distributed, as long as the OCR logo and this message remain intact and OCR is acknowledged as the originator of this work. OCR acknowledges the use of the following content: youtube.com/ADN Media/bbc Please get in touch if you want to discuss the accessibility of resources we offer to support delivery of our qualifications: resources.feedback@ocr.org.uk