Architecture, grid, booting, emulation, virtualisation, cloud

See also deployment solutions.

Contents

Enterprise Architecture

Basics

Enterprise Architecture examples

Architecture of Open Source

REST

Basics

Technologies (queues, brokers)

Message queues

Enterprise Service Bus ESB

Context brokers

Modelling tools

Grid

Service Oriented Architecture (SOA), Microservices Architecture (MSA) and Service Mesh patterns

SOA and MSA

On the surface, Microservices and SOA are similar. The architecture consists of a set of services. However ...

Service Mesh

Firmware and booting

In general

According to Wikipedia

When a computer is turned off, its software‍ —‌ including operating systems, application code, and data‍—‌remains stored on non-volatile memory (NVMEM). When the computer is powered on, it typically does not have an operating system or its loader in RAM. The computer first executes a relatively small program stored in read-only memory (ROM, and later EEPROM, NOR flash) along with some needed data, to initialize RAM (especially on x86 systems), to access the nonvolatile device (usually block device, eg NAND flash) or devices from which the operating system programs and data can be loaded into RAM. See Debian booting for overview (firmware, bootloader, init shellscript, /sbin/init).

Firmware (BIOS/EFI/UEFI, trustworthy firmware)

BIOS (legacy)

Old school.

EFI (legacy)

Intel developed the original Extensible Firmware Interface (EFI) specifications. The Linux kernel has been able to use EFI at boot time since early 2000s, using the elilo EFI boot loader or, more recently, EFI versions of GRUB.

UEFI

The Unified Extensible Firmware Interface (UEFI) defines a software interface between OS and firmware and replaces the Basic Input/Output System (BIOS) firmware interface. UEFI can support remote diagnostics and repair of computers, even with no operating system installed. UEFI defines a boot manager as part of its specification (it does not rely on boot sectors). When a computer is powered on, the boot manager checks the boot configuration and based on its settings, then executes the specified OS boot loader or operating system kernel.

The boot configuration is defined by variables stored in NVRAM, including variables that indicate the file system paths to OS loaders or OS kernels.

UEFI provides a shell environment, which can be used to execute other UEFI applications, including UEFI boot loaders.

For Debian and UEFI see local Debian info.

Trustworthy firmware

Boot loaders

U-Boot

Das U-Boot is a boot loader. It can be built for all boards for which there's a configuration in /u-boot/configs, this includes e.g. qemu_arm64_defconfig and a few other qemu_'s. Also a generic linux boot loader can be build as 'sandbox'.

For all supported boards there are ready-to-use default configurations available; just type "make _defconfig". E.g. for a TQM823L module type: $ cd u-boot, $ make TQM823L_defconfig.

can be built natively to run on a Linux host using the 'sandbox' board. This allows feature development which is not board- or architecture- specific to be undertaken on a native platform. The sandbox is also used to run some of U-Boot's tests.

See doc/arch/sandbox/sandbox.rst for more details.

See local files in /home/marc/OPTEE/u-boot/out/arm/source/board/sandbox

U-Boot intended start-up flux

Should apply for both SPL and U-Boot proper Note: "SPL" stands for "Secondary Program Loader," which is explained later.

Execution typically starts with an architecture-specific (and possibly CPU-specific) start.S file, such as arch/arm/cpu/armv7/start.S

From there, three functions are called:

lowlevel_init(): - purpose: essential init to permit execution to reach board_init_f() - no global_data or BSS - there is no stack (ARMv7 may have one but it will soon be removed) - must not set up SDRAM or use console - must only do the bare minimum to allow execution to continue to board_init_f() - this is almost never needed - return normally from this function

board_init_f(): - purpose: set up the machine ready for running board_init_r(): i.e. SDRAM and serial UART - global_data is available - stack is in SRAM - BSS is not available, so you cannot use global/static variables, only stack variables and global_data Non-SPL-specific notes: - dram_init() is called to set up DRAM. If already done in SPL this can do nothing SPL-specific notes: - you can override the entire board_init_f() function with your own version as needed. - preloader_console_init() can be called here in extremis - should set up SDRAM, and anything needed to make the UART work - there is no need to clear BSS, it will be done by crt0.S - for specific scenarios on certain architectures an early BSS *can* be made available (via CONFIG_SPL_EARLY_BSS by moving the clearing of BSS prior to entering board_init_f()) but doing so is discouraged. Instead it is strongly recommended to architect any code changes or additions such to not depend on the availability of BSS during board_init_f() as indicated in other sections of this README to maintain compatibility and consistency across the entire code base. - must return normally from this function (don't call board_init_r() directly)

board_init_r(): - purpose: main execution, common code - global_data is available - SDRAM is available - BSS is available, all static/global variables can be used - execution eventually continues to main_loop() Non-SPL-specific notes: - U-Boot is relocated to the top of memory and is now running from there. SPL-specific notes: - stack is optionally in SDRAM, if CONFIG_SPL_STACK_R is defined and CONFIG_SYS_FSL_HAS_CCI400 ...

The following options need to be configured:

Building U-Boot

In case of tool chain problems we recommend to use the ELDK (see https://www.denx.de/wiki/DULG/ELDK) which is extensively used to build and test U-Boot.

(1) Set CROSS_COMPILE If you are not using a native environment, you need GNU cross compiling tools in your path. In this case, you must set the environment variable CROSS_COMPILE in your shell. Note that no changes to the Makefile or any other source files are necessary. For example using the ELDK on a 4xx CPU, please enter: $ CROSS_COMPILE=ppc_4xx- $ export CROSS_COMPILE (2) Configure u-boot After installing the sources you must configure U-Boot for one specific board type. This is done by typing: $ make NAME_defconfig where "NAME_defconfig" is the name of one of the existing configurations; see configs/*_defconfig for supported names. (3) make all Finally, type "make all", and you should get some working U-Boot images ready for download to / installation on your system: - "u-boot.bin" is a raw binary image // found in /home/marc/OPTEE/u-boot/out/arm - "u-boot" is an image in ELF binary format // found in same dir - "u-boot.srec" is in Motorola S-Record format // found in same dir By default the build is performed locally and the objects are saved in the source directory. ? which is where? because the objects are found in /home/marc/OPTEE/u-boot/out/arm => so if we do have u-boot.bin available, why does the top level make say Makefile:1616: *** 'BL33=/home/marc/OPTEE/build/../u-boot/u-boot.bin' was specified, but '/home/marc/OPTEE/build/../u-boot/u-boot.bin' does not exist. Stop. make[1]: Leaving directory '/home/marc/OPTEE/trusted-firmware-a' make: *** [Makefile:207: arm-tf] Error 2 > what is BL33 good for? > what is trusted-firmware-a and its role?

Debian booting

See Debian booting for Debian.

Secure booting

UEFI Secure Boot and Shim

The UEFI 2.3.1 Errata C specification (or higher) defines a protocol known as Secure Boot, which can secure the boot process by preventing the loading of UEFI drivers or OS boot loaders that are not signed with an acceptable digital signature.

Shim is a boot loader to chain-load signed boot loaders under Secure Boot. Shim becomes the root of trust for all the other distro-provided UEFI programs. It embeds a further distro-specific CA key that is itself used for signing further programs (e.g. Linux, GRUB, fwupdate). This allows for a clean delegation of trust - the distros are then responsible for signing the rest of their packages. Shim itself should ideally not need to be updated very often, reducing the workload on the central auditing and CA teams.

Windows 10 allows OEMs to decide whether or not Secure Boot can be managed by users of their x86 systems. The Machine Owner Key (MOK) allows you to add signed files.

See secure Debian booting for Debian.

TPM

See Debian TPM for a starter.

Emulation

QEMU

For installation of QEMU refer to LTK. For local info refer to LTK.

Virtualisation

A hypervisor (or virtual machine monitor, VMM, virtualizer) is a kind of emulator; it is computer software, firmware or hardware that creates and runs multiple virtual machines (VM). A computer on which a hypervisor runs one or more virtual machines is called a host machine, and each virtual machine is called a guest machine.

Virtual Machines

VM solutions

Virtual machines (VMs) are an abstraction of physical hardware turning one server into many servers. Each VM includes a full copy of an operating system, the application, necessary binaries and libraries.

Linux virt-manager

The virt-manager application is a desktop user interface for managing virtual machines through libvirt. It primarily targets KVM VMs, but also manages Xen and LXC (linux containers). It presents a summary view of running domains, their live performance & resource utilization statistics. Wizards enable the creation of new domains, and configuration & adjustment of a domain’s resource allocation & virtual hardware. An embedded VNC and SPICE client viewer presents a full graphical console to the guest domain.

VM security

In 2016, AMD introduced Secure Encrypted Virtualization (SEV), the first x86 technology designed to isolate virtual machines (VMs) from the hypervisor. In 2017, AMD introduced the SEV-ES (Encrypted State) feature which added additionalprotection for CPU register state. In SEV-ES, the VM register state is encrypted on each hypervisor transitionso thatthe hypervisor cannotsee the data actively being used by the VM. SEV-Secure Nested Paging (SNP) adds strong memory integrity protection tohelp prevent malicious hypervisor-based attacks like data replay, memory re-mapping, and more in order to create an isolated execution environment.

Virtual Disks

Creating a virtual disk image (VDI) of optical media or a hard disk drive is done to make the content available to one or more virtual machines. VMs emulate a CD/DVD drive by reading an ISO image. This can also be faster than reading from the physical optical medium.

A hard disk drive or solid-state drive in a VM is implemented as a disk image, either Virtual hard disk images tend to be stored as either a collection of files (where each one is typically 2GB in size), or as a single file. Virtual machines treat the image set as a physical drive.

Platforms

Containers are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space.

Docker

Installation: see LTK.html.

Kubernetes

RBAC approach.

Cloud

Open source

NextCloud

OpenStack/OpenDev

Gluster

Commercial

Terraform and related

OVH

European cloud service provider

AWS

AWS basics
AWS security
AWS terminology (infrastructure): At application level, for IAM AWS uses OAuth 2.0. Application level is ABAC.

For analysis: use Steampipe or Turbot.

MSFT

Google

Less commercial

Cloud security