Lesson 4 of 4 Vulnerabilities of Systems and Architectures

Containers, Microservices, Distributed and High-Performance Systems

Modern applications are built from many small, distributed components. This lesson covers the risks of containers, microservices and their APIs, distributed systems and high-performance computing.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain container isolation risks and controls.
  • Describe security issues of microservices, APIs, distributed systems and HPC.

Containers

A container packages an application and its dependencies and runs as an isolated process sharing the host's operating system kernel, managed at scale by orchestrators such as Kubernetes. Because containers share the kernel, isolation is weaker than between virtual machines: a kernel vulnerability or a privileged container can allow container escape to the host.

Other risks include vulnerable or malicious images, secrets embedded in images, untrusted registries and weak orchestrator configuration. Mitigations include scanning images in the pipeline, using minimal, signed images from trusted registries, running containers as non-root with minimal capabilities and read-only file systems, storing secrets in secret managers, and hardening the orchestrator with role-based access control and network policies.

The difference between a container and a virtual machine explains the isolation gap. Each virtual machine has its own operating system kernel, and the hypervisor separates them using hardware features. Containers on a host all use the host's single kernel, which separates them with operating system features such as namespaces, which give each container its own view of processes and the network, and control groups, which limit the resources it can consume. A flaw in that shared kernel affects every container on the host. For workloads that must be strongly separated, such as code from different customers, organisations run containers inside lightweight virtual machines or on separate hosts.

Container images are a supply chain in their own right. An image built from a public base image inherits every package in it, including vulnerable ones, and an image downloaded from an untrusted registry may contain cryptocurrency miners or back doors. Scanning images when they are built and again while they run, signing approved images and configuring the orchestrator to run only signed images from the organisation's registry closes this path.

Select all that apply

Hardening containers

Exam skills 3.5.10

Identify the practices that reduce container risk.

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

Microservices and APIs

Microservices split an application into small, independently deployed services that communicate through application programming interfaces (APIs). Each service and API is an entry point, so the attack surface grows, and trust between services must be explicit.

Common weaknesses are broken object-level authorisation, weak service-to-service authentication, excessive data exposure and inconsistent logging. Mitigations include API gateways for authentication, rate limiting and input validation; mutual TLS or service mesh identities between services; authorisation checks in every service; and centralised logging and distributed tracing.

Broken object-level authorisation is the most common API flaw: the API checks that the caller is authenticated but not that the requested object belongs to the caller.

The following diagram shows broken object-level authorisation and its fix.

Broken object-level authorisation in an API. The gateway checks that the caller is authenticated but the service does not check that the requested object belongs to the caller, so changing an identifier in the request returns another user's data. The fix compares each object's owner with the caller's identity in the service that holds the data.
Object-level checks belong in the service that owns the data.
Scenario questions

Securing service-to-service calls

Exam skills 3.5.9

Choose the control that addresses each microservice weakness.

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

An invoice API

An API returns an invoice when called with its number, such as a request for invoice 1001. A customer changes the number in the request to 1002. What happens, and what is the fix?

The API checks that the caller is logged in, but not that the requested invoice belongs to the caller. A customer who changes the number to 1002 receives another customer's invoice.

The fix is an authorisation check on every object, comparing the object's owner with the caller's identity, in the service that holds the data, not only at the gateway.

Distributed and high-performance systems

Distributed systems, such as grid computing, peer-to-peer networks, distributed databases and blockchains, spread processing across many nodes. Risks include inconsistent security across nodes, insecure communication between them, untrusted participants and difficult monitoring. Blockchain provides integrity through cryptographic chaining and consensus, making records tamper-evident, but it does not provide confidentiality by default.

Blockchain's integrity comes from its structure. Each block contains a hash of the previous block, so changing a past transaction changes that block's hash and breaks the link to every later block. Because many independent nodes hold copies and agree on new blocks through a consensus mechanism, an attacker would have to rewrite the chain on most of them at once. On a public blockchain, however, every participant can read every transaction, so personal or confidential data should not be written to it, and the immutability that protects integrity also makes it impossible to erase data, which conflicts with privacy rights such as erasure.

High-performance computing (HPC) clusters run demanding scientific and analytical workloads shared by many users and projects. Performance pressure can lead to weak isolation, shared credentials and open research networks, and clusters are attractive for cryptocurrency mining and theft of valuable data. Mitigations include MFA, project-based access control, separate management networks and monitoring of job behaviour.

True or false

Blockchain and HPC

Exam skills 3.5.7 · 3.5.13

Check the security properties of distributed and high-performance systems.

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

Container isolation

A development team runs several customer-facing containers with the privileged flag so that they can access host devices for debugging. What is the risk and the best fix?

Privileged containers have almost the same access as the host, so a compromise of any one of them becomes a compromise of the host and every other container on it. The fix is to remove the privileged flag, grant only the specific capabilities needed, run as a non-root user and enforce this with admission policies in the orchestrator. Debugging access belongs in separate, non-production environments.

Check yourself

Why do containers isolate less strongly than virtual machines?

Show answer

Containers share the host's operating system kernel, so a kernel flaw can affect all of them.

Exam Tips

Remember for the exam

  • Containers share the kernel; isolation is weaker than VMs.
  • Authorise every API request for every object.
  • Blockchain gives integrity, not confidentiality.