exam Flashcards

1
Q

What is the definition of computer security and what does it involve?

A

The protection of a computer system against theft and damage. Involves controlling physical access to hardware, malpractice by users and network access, bad data or code injection.

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

What is confidentiality?

A

Data is kept private or restricted by ensuring only authorised users can access it. More important when value of data depends on limiting access to it e.g. personal/financial info

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

What is integrity?

A

Data is kept accurate, authentic and reliable by ensuring only authorised users may modify it. More important when data must be accurate and consistent e.g. financial records

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

What is availability?

A

Data is available to authorised users when it is needed. More important when data must be seen or sent e.g. medical records

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

What is authentication?

A

Determining whether someone/something is what it declares itself to be.

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

What is non-repudiation?

A

Ensuring someone/something cannot deny or contest something (inability to refuse responsibility).

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

What is a: threat, vulnerability, risk?

A

Threat -> a potential negative action or event that could harm a computer system.
Vulnerability -> a weakness in a computer system that can be exploited by a threat to deliver a successful attack.
Risk -> potential for loss/damage when a threat exploits a vulnerability.
risk = threat x vulnerability

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

Why does computer security matter?

A

Computer systems are valuable targets.
Computer systems have many security threats.
Cyber crime is growing.
Cyber crime comes with a cost (economic, reputational and regulatory).

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

What are the two key programming paradigms?

A

Imperative -> describes how. Explicitly specifying step-by-step instructions which change the program’s state. Usually has more lines of code. Provides flexibility but brings in complexity. Structural, procedural, object-oriented.
Declarative -> describes what. Overall control flow; doesn’t specify. Allows more readable code to be written that reflects exactly what we want to see. Less lines, hides complexity and provides simplicity. Functional and logic.
Other paradigms include scripting, event-driven and DB querying.

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

What is an injection (input validation) attack?

A

An attacker submits malicious input which then gets injected into a genuine query or command that is subsequently processed. Can cause data loss, alterations, denial of service or even full system compromise.

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

What is an SQL injection attack?

A

Consists of inputting malicious SQL code which is inserted into genuine SQL commands to: read sensitive data from DB, modify DB data, execute admin operations (e.g. shut down DBMS), access sensitive file or issue commands to OS.

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

What is a Cross-Site Scripting (XSS) attack?

A

Involves injecting malicious scripts into vulnerable web applications which are delivered to user’s systems. Included with dynamic content delivered as markup text to a victim’s browser, taking advantage that browsers can’t distinguish and will execute whatever markup they receive. Can spread malware, deface websites, disrupt social networks, phish for credentials and cause more damaging attacks with the addition of social engineering techniques.

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

What is bounds checking?

A

a method of detecting whether a variable is within some bounds before it is used. Used for index checks. A failed check usually produces some kind of exception signal.

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

What is a buffer overflow attack?

A

forces a program to put more data in an array/buffer than it can hold, putting extra data in a memory area past a buffer. This can corrupt/overwrite existing data, crash program or cause execution of malicious code (forcing an out of bounds write can force an out of bounds read).

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

What is a format string attack?

A

a submitted input string is evaluated as a command by the application to cause some malicious action. Takes advantage of format specifiers referring to the stack and reading the next variable. Variable values, return addresses, parameters user input data or pointer memory addresses can be revealed.

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

What is an integer overflow attack?

A

integer value forcibly incremented to a value to large to store in the associated representation. Wraps to a very small or negative number. Security critical when result is used to control looping, make a security decision or determine the offset size in behaviours such as memory allocation, copying, concatenation etc.

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

What is input validation?

A

proper checking or testing of any input supplied by the user or application to ensure it meets permitted input criteria (validation characteristics). Should occur when data is received from an external party, especially if untrusted.

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

What are the two types of input validation?

A

Whitelisting -> defines allowed input data while any other input data is denied by default.
Blacklisting -> defines unallowed input data while any other input data is allowed by default.

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

What are data fields used for?

A

validating input data is of the type wanted when implementing web forms. They help prevent users from submitting the wrong type of data in particular input fields.

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

What is a Cross-Site Request Forgery (CSRF) attack? What is a CSRF token?

A

tricking an authenticated user into sending a malicious request not generated via the user interface. A CSRF token is a random, unguessable string used to validate the origin of the request.

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

What is a session?

A

a group of user interactions with a web application within a given time frame. Session data is stored as a session cookie in the user’s browser.

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

What is a secret key used for?

A

used for encryption tasks such as cryptographically signing session cookies and generating a CSRF token.

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

What are validator class instances used for?

A

checking or validating input data values in a Form class. Can be in-built or custom. Must all return True for form’s input data to be submitted to the web application.

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

What is pattern matching?

A

a technique to check a requirement of characters in an inputted string needing to follow some specific pattern or sequence.

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

What is a regular expression?

A

a string of text defining a pattern or sequence ( a search pattern). Regex is used for pattern matching. May include metacharacters, sets or special sequences. When matching, the regex engine pointer steps along a given string and checks each character (order is important).

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

Why might a lookahead be used?

A

to check for the existence of characters within an inputted string. Can be chained to look for multiple somethings.

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

What is error handling used for?

A

gracefully handling software errors and helping execution to resume when interrupted.

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

Why is it better to have self-generated error messages than externally-generated (automatic) ones?

A

Automatically generated error messages can contain sensitive info: private/personal info; system status and environment; network status and configuration; app’s own code or internal state. Having the source code explicitly construct messages prevents information leakage.

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

What are the disadvantages of hardcoding data?

A

Considered anti-pattern - requires source code to be changed.
Hard to adapt - hardcoding file paths makes adapting to another location difficult.
Hard to internationalise - harcoding of messages make it difficult.
Raises security vulnerabilities.

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

What security concern does source code disclosure raise?

A

attackers can check for logical flaws or harcoded data to better understand how the application behaves.

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

What are hidden form fields for?

A

used in web pages to pass information to be sent to the server, along with form data, without the user having to be involved in the process. Can also pass info to scripts e.g. security tokens. Being able to view a hidden field when inspecting source can reveal sensitive values.

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

What is reverse engineering and why is it usually used?

A

reversal of a program’s machine code back into source code it was written in. Used:
because source code was lost
to study how program performs certain operations
to improve performance of a program
to fix a bug
to identify malicious content
to adapt program for a different microprocessor

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

Why is a .env file used?

A

used to remove and store sensitive environmental variables separately from the source code e.g. secret keys

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

What are best practices to secure DBs?

A

have separate web and DB servers
use firewalls
secure DB user access
regularly update OS and patches
audit and continuously monitor DB activity
test DB security
avoid using default network ports
encrypt data and backups

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

What is authentication and an authentication factor?

A

the process of validating the identity of a registered user before allowing authorised access to protected resources. An authentication factor is a category of evidence that a person has to present to prove their identity: knowledge, possession or inherence. Always comes before authorisation.

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

What is authorisation?

A

the process of validating the authenticated user has been granted permission to access the requested resources.

37
Q

What is access control?

A

the general term for restricting access to resources to a certain number of authenticated and authorised users.

38
Q

What is a user not yet logged in referred to as?

A

An anonymous user. Has no identity.

39
Q

What does logging a user in involve?

A

turning an anonymous user into an authenticated one. Creates a uniquely identifiable web session so requests can be distinguished from other users. Any requests made will also pass this session ID.

40
Q

What is FlaskLogin for?

A

a package that handles the common tasks involved with logging in/out and remembering user sessions over extended periods of time. It will:
store identities in respective web sessions
restrict operation users are authorised to do
handle ‘remember me’ functionality
help protect web session data from being stolen

41
Q

What is a LoginManager and its functions?

A

a program element needed to login and manage authenticated users. Lets application and FlaskLogin package work together. functions:
storing user’s ID in a new web session
getting user instance from DB using their ID
managing multiple web sessions
logging users out - anonymous again
redirecting anon. users to login page

42
Q

What is the name of the function that loads a user instance from a DB?

A

user_loader
Used by the current_user function.

43
Q

What is UserMixin and the properties it provides?

A

a class providing the implementation of functions used to give the User model class the properties:
is_authenticated
is_active
is_anonymous
get_id

44
Q

What web application features can support and strengthen use authentication?

A

Automatically generate secure passwords
Secure password recovery
Change password
Password expiration
Re-authenticate in sensitive areas

45
Q

What is a brute force attack?

A

an attacker configures predetermined values (username/password combinations), making requests to a server and analysing the response for success or failure.
Dictionary attack - having a subset of all login credentials.

46
Q

What are security mechanisms to prevent against a brute force attack?

A

Strong password policy
Biometrics
Notification of unrecognised login
Comprehensive login process - CAPTCHA or 2FA
Limiting login attempts

47
Q

What are some secondary authentication factors?

A

One Time Password (OTP)
Time-based pin
Digital (PKI) certificate

48
Q

What does CAPTCHA stand for and why is image-based more difficult for bots to interpret?

A

Completely Automated Public Turing test to tell Computers and Humans Apart. Image-base requires image recognition and semantic classification.

49
Q

What is a drawback of locking out accounts after numerous incorrect authentication attempts?

A

Can be exploited to lock users out of their accounts.

50
Q

What phases are in the authorisation process?

A

Policy definition -> where accesses are authorised.
Policy enforcement -> where access requests are permitted/denied depending on policy.

51
Q

What is a reference monitor?

A

takes access requests and current security policy as input. Should be NEAT:
Non-bypassable
Evaluable
Always-invoked
Tamperproof

52
Q

What is the directory user access is restricted to called and what does it contain?

A

Web document root (or CGI root) directory. Contains files intended for user access and executables necessary to drive functionality.

53
Q

What is a path traversal attack?

A

changing URL in a HTTP -based interface to allow unauthorised access to files, directories and commands that potentially reside outside the web document root directory. Utilise the abilities of special character sequence.

54
Q

What can be added to a view function to prevent it being accessed by actions of anonymous user?

A

@login_required decorator

55
Q

What is role-based access control?Advantages/disadvantages?

A

assigns authorisations to roles given to groups of users. Advantages: improved operational efficiency, enhanced compliance, gives administrators enhanced visibility, reduces costs in terms of resources used, decreased risk of breaches and data leakage.
Disadvantages: role explosion, somewhat rigid, scalability and dynamism, expensive and difficult implementation.

56
Q

What principle does RBAC follow?

A

Principle of least privilege

57
Q

What is an ACL?

A

Access Control List. A table listing permissions attached to computing resources. tells OS which users can access an object and which actions they can carry out.

58
Q

What is ABAC?

A

Attribute Based Access Control. Evaluates a set of rules and policies to manage access rights according to specific attributes such as environmental, system, object or user info. Applies Boolean logic to grant/deny access to users.

59
Q

What is event logging?

A

every activity is considered a security event and logged to monitor behaviour. data can be moved to central DB fo additional investigations and necessary action.

59
Q

What are the benefits of event logging?

A

detection of security breaches
event reconstruction to understand how event happened
faster recovery

60
Q

What events might be stored in DB storage?

A

Date/ time of new user registration/ current login/ previous login.

61
Q

What events might be stored in a log file?

A

User registrations, successful user logins, invalid user login attempts, user logouts, unauthorised access attempts.

62
Q

What is cryptography?

A

an essential security technique that scrambles/encodes data. Provides confidentiality, integrity, authentication and non-repudiation.

63
Q

What is an encryption key?

A

A random string of bits created specifically for encrypting/decrypting data. usually generated with RNGs.

64
Q

Which key(s) should be kept secret in symmetric and asymmetric encryption?

A

Symmetric key and the asymmetric decryption key should be kept secret.

65
Q

How can you view and decrypt data from a DB without changes being reflected?

A

Use a transient state instead of persistent state.

66
Q

What is a cryptographic one-way function?

A

hashing. Same string outputs same hash.

67
Q

How can you protect against a hash being cracked?

A

use a salt - hashing function will extract salt from stored password hash and use it to hash the submitted plaintext password for comparisons.

68
Q

What is a pseudorandom number?

A

A number produced using the arithmetic properties of a computer. Not truly random as generation is dependent on its predecessors.

69
Q

Computers are deterministic - what does this mean and why is it prohibitive in security?

A

given the same input, there is always the same output, making it difficult to get a computer to do something by chance. can predetermine exact behaviour.

70
Q

What is a PRNG?

A

PseudoRandom Number Generators use mathematical formulae or precalculated tables to produce sequences. Must be given a seed (base value). Efficient but deterministic and periodic.
Used for repeated testing and simulations.

71
Q

What is a TRNG?

A

True Random Number Generator. extract randomness from physical phenomena and introduce it into the computing platform. Process involves identifying little, unpredictable changes in data. inefficient but non-deterministic and aperiodic. Used for data encryption key generation.

72
Q

What is a CSPRNG and its properties?

A

Cryptographically Secure PRNG. introduces randomness from high quality sources. Used to generate keys. properties:
Generated number appear random, are unpredictable in advance and cannot be reliably reproduced after generation.

73
Q

What tasks is sniffing usually used for?

A

Analyse network usage
trouble-shooting network issues
monitoring web session for development and testing purposes.

74
Q

What is a sniffing attack?

A

tapping into network traffic or routing traffic to a target where it can be captured, analysed and monitored.

75
Q

What are defences against a sniffing attack?

A

Connect to trusted networks
encrypt data being sent
network scanning and monitoring

76
Q

What is a MITM attack?

A

Man In The Middle attacks involve an attacker getting in the middle of data transmission in order to eavesdrop or impersonate. Has an interception phase and a decryption phase.

77
Q

What are defences against a MITM attack?

A

Ensure HTTPS in URL bar
Beware of potential phishing emails
Avoid direct connections to public routers
Install comprehensive internet security solutions
Be sure home WiFi network is secure

78
Q

What is a spoofing attack?

A

an attacker impersonates another device or user on a network in order to launch an attack against network hosts, steal data, spread malware or bypass access controls.

79
Q

What are defences against a spoofing attack?

A

packet filtering
Avoid Trust relationships which give users in one domain access to resources in another
use spoofing detection software
use cryptographic network protocols

80
Q

What is a replay attack?

A

an attacker intercepts and then delays or resends a secure data transmissionto misdirect the receiver into doing what the attacker wants.

81
Q

What are the defences against a replay attack?

A

random session keys - valid for one transaction only
timestamps - reduces window of opportunity by preventing resending
One Time Password (OTP) - used once and discarded, for each transaction. Ensures even if message is duplicated and resent, encryption key has expired.

82
Q

What is HTTPS for?

A

Encrypts requests and responses before sending and decrypts them once arrived. Protects against sniffing and MITM attacks. Uses TLS on top of HTTP, providing confidentiality, integrity and authentication.

83
Q

What does a TLS cetificate contain?

A

Owner of web application’s domain name and the server’s public encryption key.

84
Q

What is a HTTP security header for?

A

subset of HTTP headers that restrict behaviours permitted by browsers and servers once a web application is running. Can improve resilience against common attacks e.g. XSS

85
Q

What is a CSP security header?

A

Content Security Policy headers must be defined to allow web applications to embed content from external sources such as:
CSS styling libraries
JavaScript functions
CAPTCHA

86
Q

What are digital signatures for?

A

guarantee contents of a message haven’t been changed in transit (provides integrity). A hash of the message content is calculated and encrypted using the sender’s private (signing) key before being added to the message. Only the sender’s public key can decrypt it. Digitally signing a document requires a Digital Certificate.

87
Q

What are the different types of digital signatures?

A

Adobe: certified and approval
Word: visible and invisible