Lesson 1 of 3 Data Security Controls

Protecting Data States

Data needs different protection depending on whether it is stored, moving or being processed. This lesson covers the three data states and the main controls for each.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe controls for data at rest, in transit and in use.
  • Identify the limits of encryption at rest.

Data at rest

Data at rest is stored on disks, databases, file shares, backups, removable media and cloud storage. It is protected by access control, encryption and physical security. Encryption can be applied at several levels: full-disk encryption protects lost devices; file and folder encryption protects specific content; database transparent encryption protects data files; and field-level encryption or tokenisation protects individual values such as card numbers.

Encryption at rest protects against theft of media and some insider threats, but not against an authorised user or a compromised application that reads data through normal channels, so access control and monitoring remain essential.

The level at which encryption is applied determines which threat it addresses, because data is decrypted automatically for anyone who passes the layer that holds the key. Full-disk encryption unlocks the whole disk when the device starts, so it protects a laptop that is stolen while switched off but does nothing once the user has logged in. Transparent database encryption protects the database files and backups if they are copied, but the database decrypts every row for any account with query permissions. Field-level encryption and tokenisation, which replaces a value such as a card number with a meaningless token and keeps the real value in a separate, tightly controlled vault, protect individual values even from many authorised database users. Choosing the level starts with asking which attacker the control is meant to stop.

Every encryption control is only as strong as its key management. If the keys are stored on the same server as the encrypted data, an attacker who compromises the server obtains both. Keys should be held in a separate key management service or hardware security module, with access restricted and logged.

Scenario questions

Which encryption layer?

Exam skills 2.6.1

Choose the encryption layer that stops the threat in each case.

Log in to try this activity Interactive activities are free with an account.

Data in transit

Data in transit moves across networks, between users and systems or between systems. It is protected by encryption protocols such as TLS for web and application traffic, IPsec and TLS VPNs for network links, SSH for administration and SFTP or FTPS for file transfer, together with proper certificate validation. Link encryption protects each hop; end-to-end encryption protects data from sender to recipient so intermediaries cannot read it.

The difference between link and end-to-end encryption matters whenever data passes through intermediate systems. With link encryption, each connection is encrypted separately, so the data is decrypted and re-encrypted at every node along the way, such as a load balancer or mail relay. Link encryption also hides routing information on each link, but any compromised node sees the plaintext. With end-to-end encryption, only the sender and the final recipient hold the keys, so intermediate nodes forward data they cannot read, although they can still see addressing information. A messaging service that encrypts messages end to end protects them even from the service provider's own servers.

Certificate validation is what makes transport encryption trustworthy. TLS without validation encrypts the connection but does not prove who is at the other end, so an attacker in the middle can present their own certificate and read everything. Applications that disable certificate checks to avoid errors during testing, and then ship with the checks still disabled, are a common real-world cause of interception.

True or false

Link and end-to-end encryption

Exam skills 2.6.1

Distinguish link encryption, end-to-end encryption and certificate validation.

Log in to try this activity Interactive activities are free with an account.

Data in use

Data in use is being processed in memory or displayed to users, and is usually unencrypted at that moment. Protections include access control, least privilege, memory isolation, screen privacy, and confidential computing, in which trusted execution environments keep data encrypted in memory and isolated from the operating system and cloud provider. Homomorphic encryption, which allows computation on encrypted data, is an emerging technique with high performance costs.

Data in use is the hardest state to protect because processing normally requires plaintext. A program that calculates a customer's credit score must read the customer's income, so the value sits unencrypted in memory while the calculation runs. Attackers target this state with memory scraping malware, which has been used to read card numbers from the memory of point-of-sale terminals after they were decrypted for processing. Controls therefore focus on limiting who and what can reach the processing environment, minimising how long sensitive values stay in memory, and, where the risk justifies the cost, processing inside a hardware-protected trusted execution environment.

The following table summarises the three states with examples and their main controls.

StateExamplesMain controls
At restDatabases, laptops, backups, cloud storageEncryption, access control, physical security
In transitWeb sessions, email, replication linksTLS, IPsec, SSH, VPNs, certificate validation
In useApplication memory, open documentsAccess control, isolation, confidential computing

The following diagram compares the three data states and their main controls.

The three data states and their main controls. Data at rest is protected by storage encryption and access control, data in transit by protocols such as TLS and IPsec, and data in use, which must be decrypted to be processed, by least privilege, field-level encryption or tokenisation, hardening, monitoring and confidential computing. An attacker who compromises the application reads data in use through its authorised connection, where at-rest and in-transit encryption no longer apply.
Each state needs its own controls.
Sort into groups

Which data state?

Exam skills 2.6.1

Identify the state of the data in each situation.

Log in to try this activity Interactive activities are free with an account.
Worked example

Matching control to state

A company encrypts its database files and uses TLS between the application and the database. An attacker compromises the application server and reads customer records through the application's database connection. Why did encryption not help?

Encryption at rest protects the stored files, and TLS protects the network connection, but the compromised application accessed data in use through an authorised channel, where it is decrypted. The controls that address this are least-privilege database accounts for the application, field-level encryption or tokenisation of the most sensitive values, application hardening and monitoring for abnormal queries.

Check yourself

Which data state is protected by confidential computing?

Show answer

Data in use, by keeping it encrypted and isolated in memory during processing.

Exam Tips

Remember for the exam

  • Encryption at rest does not stop an authorised but compromised application.
  • Data in use is the hardest state to protect.
  • End-to-end encryption protects data from intermediaries.