+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. Ülevaade
| Pealkiri |
Standard |
|
5.4.2.1 Threat model
|
You use the guidance on threat modelling to define the product scope, assumptions and security objectives. | Category | Details | | Purpose | | Drive engineering decisions for binary hardening, port configuration and user access |
control for SafeGate-X1. | Scope boundaries | In scope: SafeGate-X1 firmware, local API (HTTPS), maintenance SSH, local |
touchscreen. Out of scope: corporate network infrastructure, physical lock mechanics. | Assumptions | 1. 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 objectives | Integrity: prevent unauthorised gate triggers. |
Availability: ensure the gate is operable during emergencies. Safety: ensure fail-safe logic is never overridden by software. | Crown jewels | Gate 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 | ID | | Threat scenarios | | Boundary | | Likelihood | | Impact | | Priority | | T1 | | RCE via web API: attacker exploits a buffer overflow in the web server to gain shell access | | Trust Boundary A (HTTPS) | | Medium | | High | | Top | | | T2 | | Privilege escalation: attacker uses a compromised web service to gain root privilege and disable logs | | Trust Boundary B (system) | | High | | High | | Top | | | T3 | | Port scanning/discovery: attacker identifies legacy services (e.g. Telnet) left on by mistake | | Trust Boundary A (network) | | High | | Medium | | High | | | T4 | | Credential stuffing: attacker attempts to log in via SSH using common default passwords | | Trust Boundary A (SSH) | | High | | High | | High | | | T5 | | Binary tampering: attacker replaces the gate-logic binary with a version that keeps the gate open | | Local storage | | Low | | High | | Medium | |
|
|
5.4.2.2 Controls, defaults and verification
|
This section maps the threats to specific principles and verification methods. | Threat | | Mitigation control (principle) | | Secure by default setting | | Verification method | | T1/T3 | | Attack surface minimisation: use a Distroless build and a strict firewall | | All ports blocked except 443/22; no shell tools (sh, curl) in production | | Nmap scan gate: automated port audit must match the MRSM exposed_ports list | | | T2 | | Least privilege: run app as non-root with Linux capabilities | | App runs as UID 1001; no SUDO rights for the app user | | Systemd audit: automated check of CapabilityBoundingSet in service files | |
| T4 | Strong identity: disable password auth; use signed SSH certificates | PasswordAuthentication no in sshd_config | Config validation: script checks SSH config against hardened baseline before release | | T5 | Vulnerability and patch management: signed updates and immutable file system | Root file system is mounted read-only by default | Mount 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. | Principle | Threat ID | Technical evidence (what to look for) | Verification | Auditor spot-check step |
gate (how it was tested) | Attack | T1, T3 | Distroless image; empty | Nmap-Scan-Gate | Run ls /bin/sh on the | | surface | | /bin/ and /usr/bin/ of | | device; it should return ‘File not | | minimisation | | non-essential tools | | found’ |
| Least privilege | | T2 | systemd unit file showing | Systemd-Unit-Audit | | Run ps aux and verify the | | | | User=1001 and restricted | | | gate process is owned by | | | | capabilities | | | gate-service, not root | | Strong identity | | T4 | sshd_config with | | SSH- | Attempt to SSH using a | | | | PasswordAuthentication | | Config- | password; the connection must | | | | no | | Validation | be immediately rejected | | Vulnerability | T5 | Partition table | Mount-Check-CI | | Run touch /usr/bin/test; | | and patch | | showing/mounted as ro (read | | | it should return ‘Read-only file | | management | | only) | | | system’ |
|
1.1 Viited
1.2 Tuvastatud nõuded
1.3 Seotud regulatsioonid
2. Tuvastatud nõuded
3. Seotud regulatsioonid
Regulatsioonid
| Allikas |
Regulatsioon |
|