1 The Muen Separation Kernel
2 ==========================
4 Muen is an Open Source separation kernel (SK) for the Intel x86/64 architecture
5 that has been formally proven to contain no runtime errors at the source code
6 level. It is developed in Switzerland by https://www.codelabs.ch[codelabs
7 GmbH]. Muen was designed specifically to meet the challenging requirements of
8 high-assurance systems on the Intel x86/64 platform. To ensure Muen is suitable
9 for highly critical systems and advanced national security platforms, codelabs
10 closely cooperates with the high-security specialist secunet Security Networks
13 image::doc/images/example.svg[Example Architecture, width=70%, align="center"]
15 A separation kernel is a specialized microkernel that provides an execution
16 environment for components that exclusively communicate according to a given
17 security policy and are otherwise strictly isolated from each other. The
18 covert channel problem, largely ignored by other platforms, is addressed
19 explicitly by these kernels. SKs are generally more static and smaller than
20 dynamic microkernels, which minimizes the possibility of kernel failure,
21 enables the application of formal verification techniques and the mitigation of
24 Muen uses Intel's hardware-assisted virtualization technology VT-x as core
25 mechanism to separate components. The kernel executes in VMX root mode, while
26 user components, so called 'subjects', run in VMX non-root mode. Hardware
27 passthrough is realized using Intel's VT-d DMA and interrupt remapping
28 technology. This enables the secure assignment of PCI devices to subjects.
30 NOTE: Muen is under active development and verification of kernel properties is
39 The following list outlines the most-prominent features of the Muen kernel:
41 * Minimal SK for the Intel x86/64 architecture written in SPARK 2014
42 * Full availability of source code and documentation
43 * Proof of absence of runtime errors
45 * Nested paging (EPT) and memory typing (PAT)
46 * Fixed cyclic scheduling using Intel VMX preemption timer
47 * Static assignment of resources according to system policy
48 * PCI device passthrough using Intel VT-d (DMAR and IR)
49 * PCI config space emulation
50 * Support for Message Signaled Interrupts (MSI)
51 * Minimal Zero-Footprint Run-Time (RTS)
53 * Shared memory channels for inter-subject communication
55 * Support for 64-bit native and 32/64-bit VM subjects
56 - Native 64-bit Ada subjects
57 - Native 64-bit SPARK 2014 subjects
60 - MirageOS unikernels <<mirageos>>
65 _Tau0_ (τ₀) is the Muen System Composer. In its current static mode of
66 operation, the task of Tau0 is to compose a system image while making sure that
67 certain invariants are not violated. The Tau0 concept is a mechanism to
68 gradually increase the flexibility of component-based systems running on top of
69 Muen, while keeping a high level of assurance regarding the correctness of
70 isolation enforcement. Read more about Tau0 https://muen.sk/tau0.html[here].
75 The Muen platform includes re-usable components which implement common services:
77 * AHCI (SATA) driver subject written in SPARK 2014
78 * Device Manager (DM) written in SPARK 2014
79 * Subject Monitor (SM) written in SPARK 2014
80 * Subject Loader (SL) written in SPARK 2014
81 * Subject Lifecycle Controller written in SPARK 2014
82 * Timeserver subject written in SPARK 2014
83 * Debugserver subject written in Ada 2012
84 * PS/2 driver subject written in Ada 2012
85 * Virtual Terminal (VT) subject written in Ada 2012
87 Furthermore the <<muenfs>>, <<muennet>> and <<muenblock>> Linux kernel modules
88 provide virtual filesystem, network interface and block I/O drivers based on
89 inter-subject memory channels.
93 The Muen platform includes a versatile toolchain which facilitates the
94 specification and construction of component-based systems in different
97 The <<mugenhwcfg>> tool for automated hardware description generation simplifies
98 the addition of support for new target machines. There is also a Debian
99 Live-based bootable image <<mugenhwcfg-live>> with persistence to simplify the
100 collection of hardware configurations from new targets.
107 The following detailed project documentation is available:
109 * Muen System Specification +
110 https://muen.sk/muen-system-spec.pdf
112 * Muen Kernel Specification +
113 https://muen.sk/muen-kernel-spec.pdf
115 * Muen Component Specification +
116 https://muen.sk/muen-component-spec.pdf
118 * Bootloader Signed Block Stream of Commands Specification +
119 https://muen.sk/bsbsc-spec.pdf
121 * Original Muen master thesis +
122 https://muen.sk/muen-report.pdf
124 * Muen project presentation +
125 https://muen.sk/muen-slides.pdf
127 * Presentation given at High Integrity Software Conference HIS 2014 +
128 http://www.slideshare.net/AdaCore/slides-his-2014secunethsr
130 * Technical articles on Muen +
131 https://muen.sk/articles.html
135 The muen-dev@googlegroups.com mailing list is used for project announcements and
136 discussions regarding the Muen separation kernel.
138 * To subscribe to the list, send a (blank) mail to
139 mailto:muen-dev+\subscribe@googlegroups.com[].
140 Note: A Google account is *not* required, any email address should work.
141 * To post a message to the list write an email to muen-dev@googlegroups.com.
142 * The list has a Google Groups web interface:
143 https://groups.google.com/group/muen-dev.
148 The Muen sources are available through the following git repository:
150 $ git clone --recursive https://git.codelabs.ch/git/muen.git
152 A browsable version of the repository is available here:
154 https://git.codelabs.ch/?p=muen.git
156 A ZIP archive of the current Muen sources can be downloaded here:
158 https://git.codelabs.ch/?p=muen.git;a=snapshot;h=HEAD;sf=zip
160 NOTE: The ZIP archive cannot be used to build the example system since it does
161 not contain all sub-projects.
169 The Muen SK has been developed and successfully tested using the development
170 environment listed in the following table.
172 |===================================================================
173 | Operating systems | Debian GNU/Linux 12 x86_64 +
175 | Linux kernel/KVM | >= 5.2.0 with GUEST_CR3 fix <<lnxcr3>>
176 | Ada compiler | GNAT FSF 12.2
177 | GCC version | gcc (GCC) 12.2
178 | SPARK version | 12.1
179 | Emulator | qemu-system-x86_64 (>= 3.1.0)
180 | Intel AMT SoL client | amtterm (>= commit 0ece513...)
181 | Intel vPro AMT / WSMan | amtc (github.com/schnoddelbotz/amtc)
182 |===================================================================
184 The following hardware is used for the development of Muen. There is a good
185 chance similar hardware works out-of-the box if the microarchitecture is Ivy
188 |===================================================================
189 | ASUS Prime Z690-P D4 | Alder Lake | i5-125000
190 | iBASE MI995VF-X27 | Coffee Lake | Xeon E-2176M
191 | Lenovo ThinkPad T480s | Kaby Lake | i7-8650U
192 | HPE DL380 Gen10 Server | Skylake | Xeon Gold 6130
193 | Lenovo ThinkPad X260 | Skylake | i7-6500U
194 | Intel NUC 6i7KYK | Skylake | i7-6770HQ
195 | UP^2^ maker board | Apollo Lake | Atom E3950
196 | Intel NUC 6CAYH | Apollo Lake | Celeron J3455
197 | Intel NUC 5i5MYHE | Broadwell | i5-5300U
198 | Cirrus7 Nimbus | Haswell | i7-4765T
199 | Lenovo ThinkPad T440s | Haswell | i7-4600U
200 | Lenovo ThinkPad T430s | Ivy Bridge | i7-3520M
201 | Kontron Technology KTQM77/mITX | Ivy Bridge | i7-3610QE
202 |===================================================================
204 The first step to build Muen is to install the required packages. See the
205 `tools/docker/Dockerfile.muen-dev-env` file in the project repository for the
206 current list of required packages.
208 Muen is built using a GNAT FSF toolchain provided via <<alire>>, see the
209 project's website about instructions on how to install the `alr` command-line
210 tool for your distribution. Then clone and build the Muen meta crate for alire,
211 which takes care of installing and configuring the toolchain:
213 $ git clone https://git.codelabs.ch/alire/muen-dev-env.git
220 There is also a ready-made Docker image which contains all necessary tools for
221 Muen development. You can install it using the following command:
223 $ docker pull ghcr.io/codelabs-ch/muen-dev-env
227 To build the Muen tools, RTS, kernel and example components change to the Muen
228 source directory and issue the following command:
232 This will create a bootable ISO image containing the example system. See below
233 for deployment instructions.
235 The following command gives a short description of the top-level Makefile
243 The build system provides two ways to instantly deploy and test the created
248 To ease kernel development and testing, the Muen project makes use of nested
249 virtualization provided by QEMU/KVM. In order for this to work, a Linux
250 kernel (>= 5.2.0) with applied KVM GUEST_CR3 fix <<lnxcr3>> and the
251 `qemu-system-x86_64` binary must be installed on the build machine.
253 Issue the following command in the Muen project directory to start the nested
254 virtualization of a Muen system:
258 The system serial output is written to `emulate/serial.out`. Follow the
259 on-screen instructions on how to connect to the QEMU curses console or how to
260 SSH into the NIC Linux guest VM.
262 NOTE: As the virtual terminal (VT) over curses is timing sensitive and QEMU/KVM
263 cannot guarantee tick-exact timing depending on the host CPU and system load,
264 this console is just an emergency console. Use SSH to interact with the booted
269 The top-level Makefile provides two convenient targets to deploy Muen to real
270 hardware: `iso` and `deploy`. The first creates a bootable ISO image which can
271 be burned on a CD-ROM or dumped on a USB stick, the second uses network boot to
272 shorten round-trips during development.
276 To create a bootable USB stick containing the Muen system, enter the following
277 commands in the top-level directory:
279 $ make HARDWARE=hardware/lenovo-t440s.xml SYSTEM=xml/demo_system_vtd.xml iso
281 Then follow the instructions on the screen.
285 For fast deployment of the Muen system image to real hardware, the iPXE
286 <<ipxe>> boot firmware installed on a USB stick in conjunction with Intel Active
287 Management Technology (AMT) is used. Please refer to the amtterm <<amt>>
288 documentation on how to configure AMT on the target hardware.
290 To build and install iPXE with the Muen specific boot script issue the
293 $ sudo apt-get install liblzma-dev
294 $ git clone git://git.ipxe.org/ipxe.git
295 $ wget https://muen.sk/muen.ipxe
297 $ make bin/ipxe.usb EMBED=../../muen.ipxe
298 $ sudo dd if=bin/ipxe.usb of=/dev/sdX
300 The `/dev/sdX` device is the USB stick (e.g. `/dev/sdc`, without partition
301 number). *All existing data will be erased*.
303 When booting from the created stick the first NIC (net0) is configured as follows:
305 IP Address : 192.168.254.2
306 Netmask : 255.255.255.0
307 Gateway : 192.168.254.1
309 After initialization of the network adapter iPXE tries to download and
310 chainload the iPXE configuration from the following URL:
312 http://192.168.254.1:8000/boot.cfg
314 The development machine must be connected to the target hardware via an
315 interface with IP address 192.168.254.1. To actually serve the created system
316 image to the bootloader, issue the following command in the top-level Muen
319 $ export AMT_PASSWORD=<your AMT password>
322 To view the output of the Muen kernel debug console use the command:
324 $ amtterm 192.168.254.2
326 If your hardware differs from the default configuration, additionally specify
327 the `HARDWARE` variable:
329 $ make deploy HARDWARE=hardware/intel-nuc-dc53427hye.xml
333 - [[[lnxcr3]]] Linux KVM GUEST_CR3 fix, https://patchwork.kernel.org/patch/11165185/
334 - [[[alire]]] ALIRE: Ada LIbrary REpository, https://alire.ada.dev/
335 - [[[ipxe]]] iPXE boot firmware, https://ipxe.org/
336 - [[[amt]]] Intel AMT SoL client + tools, https://www.kraxel.org/cgit/amtterm/
337 - [[[mirageos]]] MirageOS, https://mirage.io
338 - [[[muenblock]]] Muenblock Linux kernel module, https://git.codelabs.ch/?p=muen/linux/muenblock.git
339 - [[[muenfs]]] Muenfs Linux kernel module, https://git.codelabs.ch/?p=muen/linux/muenfs.git
340 - [[[muennet]]] Muennet Linux kernel module, https://git.codelabs.ch/?p=muen/linux/muennet.git
341 - [[[mugenhwcfg]]] Muen hardware config generator, https://git.codelabs.ch/?p=muen/mugenhwcfg.git
342 - [[[mugenhwcfg-live]]] Mugenhwcfg Live, https://github.com/codelabs-ch/mugenhwcfg-live/releases
347 --------------------------------------------------------------------------------
348 Copyright (C) 2013-2024 Reto Buerki <reet@codelabs.ch>
349 Copyright (C) 2013-2024 Adrian-Ken Rueegsegger <ken@codelabs.ch>
351 This program is free software: you can redistribute it and/or modify it under
352 the terms of the GNU General Public License as published by the Free Software
353 Foundation, either version 3 of the License, or (at your option) any later
355 --------------------------------------------------------------------------------