3.1 Defensive Desgin Flashcards

1
Q

What are the things you must consider when creating a program that is secure and robust

A

. Anticipating Misuse
. Input Sanitization
. Validation
. Verification
. Authentication
. Maintainable Code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Anticipating Misuse

A

Planning ahead to take steps against potential misuse (e.g Twitter preventing the same tweet sent twice in a row).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Input Sanitisation

A

Cleaning up data that has been input, (e.g. removing special characters to prevent a SQL injection).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Validation

A

Checking whether input data follows criteria and should be accepted. (e.g. length check on a password).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Verification

A

Checking whether data has been entered correctly (e.g. double entry).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Authentication

A

Ensuring only authorised users can gain access to a system (e.g. passwords)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Maintainable Code

A

Allowing other programmers to understand the code (e.g. comments, indentation, meaningful variable names).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is validation

A

Validation is a process to check that data is reasonable or sensible before it is accepted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a Range Check

A

Checks data is within a certain range.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Type Check

A

Checks data is a certain data type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a Format Check

A

Checks data is entered in a certain way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a Presence Check

A

Checks that data has actually been entered and not left blank.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a Lookup Table

A

A table of acceptable entries, also known as a list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a Length Check

A

Checks the length of the input is within a certain amount.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How should Programs be written

A

Programs should be written in a way that makes maintaining and understanding them as straightforward as possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are examples of making a program maintainable:

A

.Using subprograms to reuse code and make them easier to test. This is called modularization

.Appropriate variable names, using a naming convention, ensure the purpose of a variable is immediately understood

.Using indentation to improve readability and clearly show each ‘block’ of code.

.Comments enable a programmer to understand the purpose of each line of code. Crucial when working in a team.

Using constants is another method of improving maintainability. This keeps the program code consistent, which makes it easier to read and debug a program.