+5.4.2 SafeGate-X1 example
---+5.4.2.1 Threat model
---+5.4.2.2 Controls, defaults and verification
---+5.4.2.3 Applying the three layers
---+5.4.2.4 Illustrative example of third-party verification

5.4.2 SafeGate-X1 example

Scenario. Imagine you are the manufacturer of SafeGate-X1, a specialised hardware controller used to manage security gates and water valves in a factory.

The product:

  • a standalone Linux-based controller –it sits in a physical cabinet, not a cloud;
  • the application – a C++ binary that listens for ‘open/close’ commands and logs telemetry;
  • the user interface – a small local touch-screen and a restricted SSH port for maintenance.

The goal. You want to prove to your industrial clients that SafeGate-X1 is not just a black box and is built following the secure by design principles of least privilege , minimal attack surface, strong

identity and vulnerability and patch management .

Disclaimer: This Machine-processable attestation example and the SafeGate-X1 scenario are provided solely as conceptual models to illustrate the practical integration of secure by design principles into automated verification workflows. They do not constitute formal legal or technical advice and should not be treated as a definitive proof of compliance with specific regulatory frameworks, such as the EU Cyber Resilience Act, or as a substitute for certified audit processes.

1. Resumen

Título Estándar
5.4.2.1 Threat model

You use the guidance on threat modelling to define the product scope, assumptions and security objectives.

CategoryDetails
PurposeDrive engineering decisions for binary hardening, port configuration and user access

control for SafeGate-X1.

Scope boundariesIn scope: SafeGate-X1 firmware, local API (HTTPS), maintenance SSH, local

touchscreen.

Out of scope: corporate network infrastructure, physical lock mechanics.

Assumptions1. The local network is untrusted (hostile actors may have plugged into the switch).

2. Physical access to the cabinet is restricted but possible (tampering must be detected).

Security objectivesIntegrity: prevent unauthorised gate triggers.

Availability: ensure the gate is operable during emergencies.

Safety: ensure fail-safe logic is never overridden by software.

Crown jewelsGate actuator control (GPIO), cryptographic signing keys, audit logs.

SafeGate-X1 is modelled as a set of interacting processes with varying trust levels.

  • Trust Boundary A (External/Network): Separates the untrusted factory LAN from the device’s listening services (HTTPS/SSH).
  • Trust Boundary B (User/System): Separates the non-privileged gate-service user from the restricted root system functions.
  • Privileged Path (The Update Channel): A high-integrity path from the Update Server to the internal flash storage.
  • Privileged Path (Admin Maintenance): A short-lived, certificate-signed path for the Maintenance Engineer to access the OS shell.

Figure 4: Trust boundaries diagram

Source: Built with https://mermaid.live .

Note that Figure 4 provides an illustrative system representation for this simplified example. It is not intended to prescribe a standard notation or a particular tool. Other suitable approaches, including dedicated threat-modelling tools, may be used.

The threats in this example are specific to the illustrated product and should be adapted to the product’s functionality and deployment context. The example below uses likelihood/impact ratings for prioritisation as an example

IDThreat scenariosBoundaryLikelihoodImpactPriority
T1RCE via web API: attacker exploits a buffer overflow in the web server to gain shell accessTrust Boundary A (HTTPS)MediumHighTop
T2Privilege escalation: attacker uses a compromised web service to gain root privilege and disable logsTrust Boundary B (system)HighHighTop
T3Port scanning/discovery: attacker identifies legacy services (e.g. Telnet) left on by mistakeTrust Boundary A (network)HighMediumHigh
T4Credential stuffing: attacker attempts to log in via SSH using common default passwordsTrust Boundary A (SSH)HighHighHigh
T5Binary tampering: attacker replaces the gate-logic binary with a version that keeps the gate openLocal storageLowHighMedium
5.4.2.2 Controls, defaults and verification

This section maps the threats to specific principles and verification methods.

ThreatMitigation control (principle)Secure by default settingVerification method
T1/T3Attack surface minimisation: use a Distroless build and a strict firewallAll ports blocked except 443/22; no shell tools (sh, curl) in productionNmap scan gate: automated port audit must match the MRSM exposed_ports list
T2Least privilege: run app as non-root with Linux capabilitiesApp runs as UID 1001; no SUDO rights for the app userSystemd audit: automated check of CapabilityBoundingSet in service files
T4Strong identity: disable password auth; use signed SSH certificatesPasswordAuthentication no in sshd_configConfig validation: script checks SSH config against hardened baseline before release
T5Vulnerability and patch management: signed updates and immutable file systemRoot file system is mounted read-only by defaultMount check: CI test verifies /usr/bin is not writable by any user
5.4.2.3 Applying the three layers

The SafeGate-X1 example can be read across the three layers as follows.

  • Control layer
    • Records the strategic objectives and their relationship to the identified threat scenarios (T1–T5), for example: ‘Unauthorised gate operation must be prevented.’
  • Implementation layer
    • Identifies relevant principles and controls, for example: ‘We apply least privilege and attack surface minimisation.’
    • Describes the technical settings used to implement them, for example: ‘We run as UID 1001 , use Linux capabilities and close all ports except 443.’
  • Assessment and verification layer
    • Records the checks performed, release gates and SBOM hashes, for example: ‘ Nmap and Lynis confirm these settings; we provide the cryptographic hashes of the evidence.’

Attack surface minimisation (T1/T3)

  • Logic. If the threat is an external compromise (RCE), we remove the tools an attacker needs to escalate (sh, curl, etc.).
  • Implementation. We use a Distroless (38) base image.
  • Gate. An automated Nmap scan runs against the deployed release candidate. It compares the active ports against the ports_allowed list in the JSON. If a mismatch is found, the release fails and the firmware is rejected.

The JSON fragment presented as Figure 5 illustrates how information from the three layers could be expressed in a machine-processable form. The field names and structure are illustrative only and do not define a specific schema or implementation format. In practice, this information may be represented using existing standards and specifications, like those described in Section 5.3.

Figure 5: Example of machine-processable security information

Least privilege (T2)

  • Logic. If the web service is compromised, it should not have permission to modify the system.
  • Implementation. The application is assigned UID 1001 with no entry in the sudoers file.
  • Gate. A Systemd audit script parses the service unit files. It verifies that CapabilityBoundingSet is restricted to only necessary network calls, ensuring that the principle of least privilege is hard-coded into the operating system execution.

Strong identity (T4)

  • Logic. Credential stuffing and brute-force attacks rely on passwords.
  • Implementation. We disable password logins entirely at the configuration level.
  • Gate. Before the gold image of the firmware is generated, a linter checks sshd_config to ensure PasswordAuthentication is set to no .

Vulnerability and patch management (T5)

  • Logic. Even following a compromise, the attacker should not be able to achieve persistence by modifying system files.
  • Implementation. The root file system is mounted as read-only .
  • Gate. A CI test runs a script inside a staging environment that attempts to touch /usr/bin/test_file . If the file is successfully created, the release gate fails, as it has been proved that the secure by default setting was not correctly applied.
5.4.2.4 Illustrative example of third-party verification

The following table shows how machine-processable security information may be consumed by third-party assessors to identify relevant claims, locate supporting evidence and perform targeted verification activities.

PrincipleThreat IDTechnical evidence (what to look for)VerificationAuditor spot-check step

gate (how it

was tested)

AttackT1, T3Distroless image; emptyNmap-Scan-GateRun ls /bin/sh on the
surface/bin/ and /usr/bin/ ofdevice; it should return ‘File not
minimisationnon-essential toolsfound’
Least privilegeT2systemd unit file showingSystemd-Unit-AuditRun ps aux and verify the
User=1001 and restrictedgate process is owned by
capabilitiesgate-service, not root
Strong identityT4sshd_config withSSH-Attempt to SSH using a
PasswordAuthenticationConfig-password; the connection must
noValidationbe immediately rejected
VulnerabilityT5Partition tableMount-Check-CIRun touch /usr/bin/test;
and patchshowing/mounted as ro (readit should return ‘Read-only file
managementonly)system’

1.1 Referencias

1.2 Requisitos identificados

1.3 Regulaciones relacionadas

2. Requisitos identificados

Requisitos
Fuente Requisito

3. Regulaciones relacionadas

Regulaciones
Fuente Regulación