7 - 1

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Security and Privacy

Chapter 7

Engineering Software Products, First Edition by Ian Sommerville.

First Edition

Engineering Software Products

7 - 2

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Software security

7 - 3

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Types of security threat

A diagrams represents the different types of security threat.

Figure 7.1

7 - 4

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

System infrastructure stack

From the top to the bottom, the stack is as follows.
• Operational environment.
• Application.
• Frameworks and application libraries.
• Software infrastructure. Browsers and messaging, system libraries, database, and operating system.
• Network.

Figure 7.2

7 - 5

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Procedure

Explanation

Authentication and authorization

You should have authentication and authorization standards and procedures that ensure that all users have strong authentication and that they have properly set up access

permissions. This minimizes the risk of unauthorized users accessing system resources.

System infrastructure management

Infrastructure software should be properly configured, and security updates that patch vulnerabilities should be applied as soon as they become available.

Attack monitoring

The system should be regularly checked for possible unauthorized access. If attacks are detected, it may be possible to put resistance strategies in place that minimize the effects of the attack.

Backup

Backup policies should be implemented to ensure that you keep undamaged copies of program and data files. These can then be restored after an attack.

Table 7.1 Security management

7 - 6

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Operational security (1 of 2)

7 - 7

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Operational security (2 of 2)

7 - 8

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Injection attacks

7 - 9

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

SQL poisoning attacks

7 - 10

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Cross-site scripting attacks (1 of 2)

7 - 11

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Cross-site scripting attacks (2 of 2)

7 - 12

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Cross-site scripting attack

The attack is staged in three parts.
1. Introduce malicious code. Attacker uses a browser to add malicious code to valid data on a product website.
2. Victim sends a valid request for data from website. Data delivered and malware script installed in victim’s browser.
3. Malware script sends session cookie to attacker.

Figure 7.3

7 - 13

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Session hijacking attacks (1 of 2)

7 - 14

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Session hijacking attacks (2 of 2)

7 - 15

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Action

Explanation

Traffic encryption

Always encrypt the network traffic between clients and your server. This means setting up sessions using https rather than http. If traffic is encrypted, it is harder to monitor to find session cookies.

Multifactor authentication

Always use multifactor authentication and require confirmation of new actions that may be damaging. For example, before a new payee request is accepted, you could ask the user to confirm their identity by inputting a code sent to their phone. You could also ask for password characters to be input before every potentially damaging action, such as transferring funds.

Short timeouts

Use relatively short timeouts on sessions. If there has been no activity in a session for a few minutes, the session should be ended and future requests directed to an authentication page. This reduces the likelihood that an attacker can access an account if a legitimate user forgets to log off when they have finished work.

Table 7.2 Actions to reduce the likelihood of hacking

7 - 16

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Denial of service attacks (1 of 2)

7 - 17

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Denial of service attacks (2 of 2)

7 - 18

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Brute force attacks (1 of 2)

7 - 19

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Brute force attacks (2 of 2)

7 - 20

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Authentication

7 - 21

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Authentication approaches

The three approaches are as follows.
• Knowledge. Example, password.
• Possession. Example, mobile device.
• Attribute. Example, fingerprint.

Figure 7.4

7 - 22

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Authentication methods (1 of 2)

7 - 23

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Authentication methods (2 of 2)

7 - 24

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Weakness

Explanation

Insecure passwords

Users choose passwords that are easy to remember. However, it is also easy for attackers to guess or generate these passwords, using either a dictionary or a brute force attack.

Phishing attacks

Users click on an email link that points to a fake site that tries to collect their login and password details.

Password reuse

Users use the same password for several sites. If there is a security breach at one of these sites, attackers then have passwords that they can try on other sites.

Forgotten passwords

Users regularly forget their passwords, so you need to set up a password recovery mechanism to allow these to be reset. This can be a vulnerability if users’ credentials have been stolen and attackers use that mechanism to reset their passwords.

Table 7.3 Weaknesses of password-password-based authentication

7 - 25

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Federated identity (1 of 2)

7 - 26

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Federated identity (2 of 2)

7 - 27

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Federated identity

The sequence of actions is as follows. 
• The user requests authentication from the service.
• The service diverts the request to the trusted authenticator.
• The trusted authenticator requests credentials from the user.
• The user provides credentials to the trusted authenticator.
• The trusted authenticator returns authentication token to the service.
• The service provides authentication response to the user.

Figure 7.5

7 - 28

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Authorization (1 of 2)

7 - 29

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Authorization (2 of 2)

7 - 30

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Access control policies

7 - 31

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Access control lists (1 of 2)

7 - 32

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Access control lists (2 of 2)

7 - 33

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Access control lists

An illustration represents various permissions available to different groups for accessing resources.

Figure 7.8

7 - 34

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Encryption (1 of 2)

7 - 35

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Encryption (2 of 2)

7 - 36

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Encryption and decryption

The process of encryption and decryption is as follows. 
• Plain text.
• Encrypt, using secret key.
• Encrypted text.
• Decrypt, using secret key.
• Plain text.

Figure 7.9

7 - 37

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Symmetric encryption

7 - 38

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Symmetric encryption

The process of encryption and decryption is as follows. 
• Alice encrypts a secret message with an encryption key.
• Bob uses the encryption key to decrypt the encrypted text and accesses the secret message.

Figure 7.10

7 - 39

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Asymmetric encryption

7 - 40

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Figure 7.11

Asymmetric encryption

The process of encryption and decryption is as follows.
• Bob uses his private key to encrypt the following message. I am really Bob.
• Alice uses Bob’s public key to decrypt the encrypted text. She accesses the message, I am really Bob, and verifies Bob’s identity.

7 - 41

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Encryption and authentication (1 of 2)

7 - 42

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Encryption and authentication (2 of 2)

7 - 43

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Encryption for authentication

The process of encryption and decryption is as follows.
• Bob uses his private key to encrypt the following message. I am really Bob.
• Alice uses Bob’s public key to decrypt the encrypted text. She accesses the message, I am really Bob, and verifies Bob’s identity.

Figure 7.12

7 - 44

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

TLS and digital certificates (1 of 2)

7 - 45

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

TLS and digital certificates (2 of 2)

7 - 46

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Certificate element

Explanation

Subject information

Information about the company or individual whose website is being visited. Applicants apply for a digital certificate from a certificate authority who checks that the applicant is a valid organization.

Certificate authority information

Information about the certificate authority (CA) who has issued the certificate.

Certificate information

Information about the certificate itself, including a unique serial number and a validity period, defined by start and end dates.

Digital signature

The combination of all of the above data uniquely identifies the digital certificate. The signature data are encrypted with the CA’s private key to confirm that the data are correct. The algorithm used to generate the digital signature is also specified.

Public key information

The public key of the CA is included along with the key size and the encryption algorithm used. The public key may be used to decrypt the digital signature.

Table 7.5 Digital certificates

7 - 47

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Using symmetric and asymmetric encryption in TLS

A process diagram illustrates symmetric and asymmetric encryption in T L S.

Figure 7.13

7 - 48

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

TLS explained (1 of 2)

7 - 49

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

TLS explained (2 of 2)

7 - 50

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Data encryption

7 - 51

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Encryption levels

The four encryption levels are as follows.
• Application. The application decides what data should be encrypted and decrypts that data immediately before they are used.
• Database. The D B M S may encrypt the entire database when it is closed, with the database decrypted when it is reopened. Alternatively, individual tables or columns may be encrypted/decrypted.
• Files. The operating system encrypts individual files when they are closed and decrypts them when they are reopened.
• Media. The operating system encrypts disks when they are unmounted and decrypts these disks when they are remounted.

Figure 7.14

7 - 52

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Key management (1 of 2)

7 - 53

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Key management (2 of 2)

7 - 54

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Using a KMS for encryption management

The process is as follows.
• A two way interaction is seen between application and A P I key management system. The interaction is done by calls.
• A two-way interaction is seen between application and unencrypted data. Unencrypted data has a two-way interaction with encryption engine.
• The key management system of A P I gives the keys to the encryption engine.
• The key management system of A P I has a two-way interaction with key store.
• The encryption engine has a two-way interaction with stored encrypted data.

Figure 7.15

7 - 55

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Long-term key storage (1 of 2)

7 - 56

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Long-term key storage (2 of 2)

7 - 57

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Privacy (1 of 2)

7 - 58

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Privacy (2 of 2)

7 - 59

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Business reasons for privacy (1 of 2)

7 - 60

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Business reasons for privacy (2 of 2)

7 - 61

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Data protection laws

7 - 62

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Data protection laws

The two laws are as follows.
• Responsibilities of the data controller include data storage, data use, security, and subject access.
• Rights of the data subject include data access, error correction, data deletion, and consent.

Figure 7.16

7 - 63

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Data protection principle

Explanation

Awareness and control

Users of your product must be made aware of what data are collected when they are using your product, and must have control over the personal information that you collect from them.

Purpose

You must tell users why data are being collected and you must not use those data for other purposes.

Consent

You must always have the consent of a user before you disclose their data to other people.

Data lifetime

You must not keep data for longer than you need to. If a user deletes an account, you must delete the personal data associated with that account.

Table 7.6 Data protection principles (1 of 2)

7 - 64

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Data protection principle

Explanation

Secure storage

You must maintain data securely so that it cannot be tampered with or disclosed to unauthorized people.

Discovery and error correction

You must allow users to find out what personal data you store. You must provide a way for users to correct errors in their personal data.

Location

You must not store data in countries where weaker data protection laws apply unless there is an explicit agreement that the stronger data protection rules will be upheld.

Table 7.6 Data protection principles (2 of 2)

7 - 65

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Privacy policy (1 of 2)

7 - 66

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Privacy policy (2 of 2)

7 - 67

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Key points 1 (1 of 2)

7 - 68

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Key points 1 (2 of 2)

7 - 69

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Key points 2 (1 of 2)

7 - 70

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

Key points 2 (2 of 2)

7 - 71

Copyright © 2020, Pearson Education, Inc. All Rights Reserved

This work is protected by United States copyright laws and is provided solely for the use of instructors in teaching their courses and assessing student learning. Dissemination or sale of any part of this work (including on the World Wide Web) will destroy the integrity of the work and is not permitted. The work and materials from it should never be made available to students except by instructors using the accompanying text in their classes. All recipients of this work are expected to abide by these restrictions and to honor the intended pedagogical purposes and the needs of other instructors who rely on these materials.

Warning

Copyright