Data states

Data at rest, in transit and in use each need their own lock

At restdisks, databases, backups, cloud storageThreata stolen laptop or a copied backupControlfull-disk, database and file encryptionkeys kept in a TPM or key vaultIn transitmoving across networks: web, email, APIsThreateavesdropping and on-path tamperingControlTLS 1.3, VPNs, SSHmutual TLS between servicesIn usein memory while being processedThreatmemory scraping on a compromised hostControlaccess control and isolationconfidential computing: encrypted memoryData lives in three states, and each needs its own protection; a gap in one undoes the other two.Encryption at rest protects a stolen disk but not a logged-in session. TLS protects the wire but not the serverat either end. Data in use is the hardest: it must be decrypted to be processed, so access control and isolationcarry the load, with hardware memory encryption (confidential computing) closing the gap.

Protect data at rest with encryption, data in transit with TLS, and data in use with access control and confidential computing.

Encryption at rest · Going deeper

Full-disk, file, database and cloud encryption, and when each helps

Full-disk encryption protects a powered-off device; database and cloud encryption depend on who holds the keys.

  • Full-disk encryption (BitLocker, FileVault) the whole drive, unlocked at boot with keys sealed in the TPM or secure enclave. Protects a lost or stolen device that is powered off; does nothing once a user is logged in.
  • File and folder encryption protects chosen files even on a running system, and can travel with the file.
  • Database encryption transparent data encryption covers the database files; column-level encryption protects specific fields even from database administrators.
  • Cloud storage encrypted by default with provider keys; customer-managed keys in a KMS add control and an audit trail, and deleting the key makes the data unreadable (crypto-shredding).
  • Removable media and backups encrypt them too; backups are a favourite target because they hold everything.
Ask two questions of any “encrypted” claim: when is it decrypted, and who holds the key?

Data classification

Classify data first, or every file gets the same protection

LevelExamplesWho may see itEncryptionShare outsidePublicpress releases, price listsanyonenot requiredyesInternalorg charts, policiesall staffin transitwith approvalConfidentialcontracts, customer liststeams who need itat rest and in transitunder NDA onlyRestrictedcard data, health records, keysnamed peoplealways; access loggednever by defaultThe data owner sets the level. The label travels with the file, and encryption, access rules and DLP read it.Classify data first, because every other control needs to know how much a file matters.Without classification, everything is protected the same: too little for card data, too much for the price list.Most companies use three or four levels. Government schemes use Top Secret, Secret and Confidential.Labels can be applied by people, by default location or automatically by content.

Data classification sets levels and handling rules; the data owner decides and labels carry the decision.

Data roles and types · Going deeper · 1 of 2

Owners, custodians, controllers, and the data types regulators care about

Know the data owner, data custodian, data controller and data processor, plus PII, PHI and sanitisation.

Roles

  • Data owner a senior business person accountable for the data: sets classification and approves access.
  • Data custodian operates the systems that store it: backups, encryption, access settings.
  • Data steward looks after quality and correct use.
  • Controller and processor (GDPR) the controller decides why and how personal data is used; a processor handles it on the controller’s behalf, such as a cloud payroll provider.

Types of sensitive data

PIIpersonally identifiable information: names, IDs, addresses
PHIprotected health information
Cardholder datacard numbers, governed by PCI DSS
Intellectual propertydesigns, source code, trade secrets

Location and end of life

Data sovereignty means data is subject to the laws of the country where it is stored, so many companies pin regions. At end of life, media is sanitised by clearing, purging or destroying it (NIST SP 800-88), with a certificate of destruction as evidence.

Data classification · Going deeper · 2 of 2

Masking hides, tokens substitute, encryption locks, hashes fingerprint

One card number:4111 1111 1111 1111(a public test number; it passes the Luhn check)TechniqueWhat is stored or shownReversible?Typical useMasking**** **** **** 1111noshow agents only the last four digitsTokenisationtok_7Qm2xR9vLpW3via the vault onlycharge cards while systems stay out of scopeEncryption5lzh73A4jMYePr5JZWAzmA…with the keyprotect stored data; the key is the secretHashing9bbef19476623ca56c17da…no, one-waycheck a value matches without storing itMasking hides, tokenisation substitutes, encryption locks with a key, hashing fingerprints one way.Each fits a different job. A token means nothing outside the vault, so systems holding only tokens fall out ofPCI DSS scope. Encryption is reversible by anyone with the key. A hash of something as guessable as a card numbercan be brute-forced, so it needs a secret key (HMAC). Best of all is minimisation: do not keep what you do not need.

Masking, tokenisation, encryption and hashing protect the same data in different ways; data minimisation beats them all.

Data loss prevention

DLP catches sensitive data on its way out the door

customers.xlsx2,400 card numberslabelled Restrictedemail to a personal addresscopy to a USB stickupload to a personal cloudDLP policycard-number pattern+ Luhn check + labelBlockEncrypt or askAllow and logDLP runs on endpoints (USB, print, clipboard), on the network and email gateway, and in cloud apps (CASB).Data loss prevention spots sensitive data on its way out and blocks, encrypts or logs it.DLP finds data by its label, by patterns such as card or passport numbers, or by fingerprints of known documents.Checks such as the Luhn digit cut false alarms. Start in monitor mode, tune, then block. DLP catches mistakesand careless insiders well; a determined attacker can still photograph a screen.

Data loss prevention (DLP) finds sensitive data by label, pattern or fingerprint and blocks, encrypts or logs it.

Hardening

Hardening removes every door you do not need, and locks the rest

Remove· unused software and services· unneeded ports and protocols· default and guest accountsLock down· change all default passwords· least privilege, no daily admin· host firewall, disk encryption· secure bootKeep current· patches and auto-updates· firmware and drivers· replace end-of-life systemsWatch· logs sent to the SIEM· EDR agent installed· file integrity monitoringStart from a baseline (CIS Benchmarks or vendor baselines), apply it automatically, and check for drift.Hardening shrinks the attack surface: everything not needed is removed, and the rest is locked down.Default installs favour convenience: services on, sample accounts, open ports. Each is a door. A secure baselinerecords the hardened state so every machine is built the same, and configuration management resets any drift.

Hardening applies a secure baseline such as the CIS Benchmarks to reduce the attack surface.

Managing devices · Going deeper

Mobile device management, BYOD and secure boot

MDM enforces policy on phones and laptops; BYOD separates work from personal; secure boot protects startup.

Mobile device management

MDM enrols devices and enforces policy: a passcode, encryption, OS version, approved apps, and remote wipe if a device is lost. Unified endpoint management (UEM) covers laptops and phones together.

  • Corporate-owned (COPE, CYOD) the company controls the whole device and may allow personal use.
  • Bring your own device (BYOD) a work container or work profile keeps company apps and data separate, and wipes only that part when someone leaves.

Trusting startup

  • Secure boot UEFI firmware runs only a bootloader signed by a trusted key, blocking bootkits.
  • Measured boot records each startup step in the TPM so a server can check (attest) the device is in a known-good state.

Harder cases

Embedded and IoT devices (cameras, printers, building controls) often ship with default passwords and rarely get updates. Change the defaults, put them on their own network segment and keep an inventory.

Endpoint detection

EDR judges what a program does, not what the file looks like

winword.exeopens invoice.docm from emailpowershell.exe -enc JABjAD0…Office starts encoded PowerShelldownload from evil.examplefetches a payload into memoryrundll32.exeruns it, no file on diskreads lsass.exe memorycredential dumpingEDR alert, highOffice → encoded PowerShell→ LSASS accesshost isolated from the networkautomatically, then sent to an analystSignature antivirus: no known-bad file at any step, so no alert.Antivirus asks “is this file known bad?”; EDR asks “is this behaviour normal?”, and can act.Endpoint detection and response records processes, network connections and file changes on every device, andflags suspicious chains, such as Word starting PowerShell. It can isolate a machine, kill a process and keep thetimeline for investigators. Fileless attacks that never drop a known file are exactly what it is for.

EDR records endpoint behaviour, detects suspicious chains and can isolate a device; antivirus matches known files.

Endpoint tools · Going deeper

Antivirus, EDR, XDR, MDR and application control

Know antivirus, EDR, XDR, MDR, HIPS, application allow listing and FIM.

  • Antivirus (EPP) blocks known malware by signature and heuristics. Still useful as a first filter.
  • EDR continuous recording and behaviour detection on endpoints, with response actions: isolate, kill, collect evidence.
  • XDR extends the same correlation across endpoints, email, identity, cloud and network.
  • MDR a managed service: an outside team watches and responds around the clock.
  • Host-based IPS (HIPS) blocks suspicious actions on the host, such as writing to system areas.
  • Application allow listing only approved programs may run. Very strong, demanding to maintain; deny listing blocks known-bad ones.
  • File integrity monitoring (FIM) alerts when critical system or configuration files change.

Secure development

Security is built into every stage of development, not tested in

Plansecurityrequirementsabuse casesDesignthreat model(e.g. STRIDE)Codesecure codingpeer reviewSASTBuilddependency scan(SCA), SBOMsecrets scanTestDAST, fuzzingpenetration testReleasesigned buildschange approvalRunWAF, monitoringpatchingfindings from production feed the next designshift left: a flaw caught in design or code is far cheaper to fixSecure software is built in at every stage, not tested in at the end.Threat modelling finds design flaws before any code exists. Automated scans in the pipeline catch insecure code,vulnerable dependencies and leaked secrets on every change. Testing and monitoring catch what slips through.NIST’s Secure Software Development Framework (SP 800-218) organises these practices.

A secure development lifecycle uses threat modelling, SAST, SCA, an SBOM, DAST and signed releases.

Application security testing · Going deeper

SAST, DAST, SCA, fuzzing, SBOMs and secure coding basics

Compare SAST, DAST, IAST, SCA and fuzzing; an SBOM lists every component.

Testing tools

  • SAST (static) reads source code for insecure patterns without running it. Early and thorough; noisy.
  • DAST (dynamic) attacks the running application from outside, like a user. Finds real, reachable issues; later in the cycle.
  • IAST instruments the running app to see inside while tests run.
  • SCA (software composition analysis) finds known-vulnerable open-source dependencies, the way Log4Shell spread.
  • Fuzzing feeds huge volumes of malformed input to find crashes and memory bugs.

Supply chain

A software bill of materials (SBOM, in SPDX or CycloneDX format) lists every component and version, so when the next Log4Shell lands you can answer “are we affected?” in minutes. Pin and verify dependencies, sign builds, and keep secrets in a vault, never in code.

Secure coding basics

Validate inputallow lists, server side
Encode outputfor the context it lands in
Handle errorsno stack traces to users
Least privilegefor the app’s own accounts

Lesson complete

You finished “Protecting devices, applications and data”

Nicely done.

Open in a new tab