• Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language
    OCaml
  • License
    ISC License
  • Created over 7 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Albatross: orchestrate and manage MirageOS unikernels with Solo5

Albatross: orchestrate and manage MirageOS unikernels with Solo5

The goal of albatross is robust deployment of MirageOS unikernels using Solo5. Resources managed by albatross are network interfaces of kind tap, which are connected to already existing bridges, block devices, memory, and CPU. Each unikernel is pinned (cpuset / taskset) to a specific core.

Albatross allows remote management. To deploy or destroy a unikernel, no shell access is necessary. The remote channel is a mutually authenticated (with X.509 certificates) TLS connection. Console output of the unikernels is stored in memory in a ring buffer, and accessible remotely. Monitoring data (CPU and memory usage) of the unikernels can be collected as well, and pushed into an Influx time series database.

Albatross consists of multiple processes, each running with the least privileges. Albatross can be run next to other orchestration systems; it does not assume to be the single instance on a dom0 which creates and destroys virtual machines. Resource policies can be dynamically configured for each administrative domain (similar to DNS, a hierarchical naming scheme), and are checked statically (to decrease while going down the tree) and dynamically when a new unikernel is to be deployed.

When a unikernel is deployed, albatross tries its best to keep it running, even when the physical hardware reboots, or albatross is restarted. When the unikernel exits, depending on configuration and its exit code, it is re-started. The current set of running unikernels is persisted on disk, though there is no dependency or order for restarting them.

The scope of albatross is to provide a minimal orchestration system that avoids the need for shell access on the dom0. This leads to mostly immutable - or only mutable via albatross - infrastructure. Further dissemination of albatross into virtual machines, and a communication interface for deploying and destroying unikernels, is being researched on.

Components

Albatross consists of a set of binaries. Several daemons, which communicate in a request-response style over Unix domain sockets, are run in the host system:

  • albatrossd: privileged to create and destroy unikernels
  • albatross-console: reads the console output of unikernels
  • albatross-stats: statistics gathering (rusage, ifstat, BHyve debug counters)
  • albatross-tls-endpoint: remote deployment via TLS (and possibly inetd)
  • albatross-influx: statistic reporting from albatross-stats to influx

The main daemon is the privileged albatrossd, which supervises unikernels. It opens a listening Unix domain socket, reads the persisted unikernel configuration, starts these unikernels, and awaits commands. Access can be regulated by Unix file permissions -- only those users who can write to that socket can send commands.

Albatross-console does not keep any persistent state, but a ring buffer of console output from each unikernel. These messages can be retrieved by a client as a stream of messages (history, and whenever a new line is output, it is sent to the interested client). Each unikernel output can only be read by a single client, to avoid amplification of traffic if lots of clients are connected. Albatrossd sends a message to albatross-console whenever a new unikernel is started, upon reception albatross-console opens and reads the fifo which the unikernel will write their standard output to.

Albatross-stats periodically gathers statistics (memory, CPU, network, hypervisor) from all running unikernels.

Albatross-tls-endpoint listens on a TCP port, or uses systemd socket activation, or via inetd, and proxies requests from remote clients to the respective daemons described above. It enforces client authentication, and uses the common names of the client certificate chain as the administrative domain. The policies are embedded in CA certificates, and the command is embedded in the leaf certificate.

The albatross-client is provided for both local and remote management. It executes the provided command, and can also prepare certificate signing requests (--csr) to send the certificate at a later point. It also includes functionality for generating an initial CA (and server certificate), and signing certificate signing requests.

Albatross over TLS

Albatross uses PKI to authenticate both client and server. Requests are signed by a certificate authority (CA) that is trusted by the server. CA can delegate resources using policies, which happens by creating an intermediate CA. Revokation is not implemented, as delegation happens without the server knowing about it.

This example shows how one can delegate part of the resources to a user. There are 4 entities:

  • server: runs the albatross TLS endpoint
  • CA: root certificate authority
  • intermediate CA: user certificate authority
  • client: requests initiator

Note: there are 4 entities but depending on the security model some can exist on the same machine. For example, when client and intermediate CA can be combined, requests are automatically signed using albatross-client --destination (see step 8).

Setup

This step-by-step guide shows how files are generated and to which entity they belong. Filename is in bold when it's created by the current step.

  1. Generate the root CA certificate and server keypair
albatross-client generate ca db
description server CA intermediate CA client
private key server.key ca.key
public certificate server.pem cacert.pem
  1. server: start the endpoint using the server keypair and the root CA certificate
albatross-tls-endpoint cacert.pem server.pem server.key
  1. intermediate CA: we want to delegate part of the resources to a given user. The user generates a signing request to allow a memory of 1024MB to run 16 unikernels on CPU IDs 0 and 1.
albatross-client add_policy user 16 --mem 1024 --cpu 0 --cpu 1 --csr
description server CA intermediate CA client
private key server.key ca.key user.key
public certificate server.pem cacert.pem
certificate signing request user.req
  1. CA: CA signs the user's request, which generates an intermediate CA certificate containing the restriction policies (limited memory, cpu), which in turn will be used to sign user requests.
albatross-client sign cacert.pem db ca.key user.req
description server CA intermediate CA client
private key server.key ca.key user.key
public certificate server.pem cacert.pem user.pem
certificate signing request user.req
  1. client: the client wants to create an unikernel, it has to wrap the request in a certificate signing request which will be submitted to the intermediate CA.
albatross-client create hello hello-key.hvt --csr [--arg='--hello=albatross-hi'] [--cpu=1]
description server CA intermediate CA client
private key server.key ca.key user.key hello.key
public certificate server.pem cacert.pem user.pem
certificate signing request user.req hello.req
  1. intermediate CA: the intermediate CA signs the request
albatross-client sign user.pem db user.key hello.req
description server CA intermediate CA client
private key server.key ca.key user.key hello.key
public certificate server.pem cacert.pem user.pem hello.pem
certificate signing request user.req hello.req
  1. client: client sends the signed request to the server, albatross-client sign appended the intermediate CA certificate to hello.pem to form the full chain.
albatross-client certificate cacert.pem hello.pem hello.key --destination <REMOTE_IP:PORT>`
  1. Steps 5, 6, and 7 can be done in a single command - if there's no requirement to retain the signing request and certificate, and the user keys are on the local machine.
albatross-client create hello hello.hvt --ca=user.pem --ca-key=user.pem --server-ca=cacert.pem --destination <REMOTE_IP:PORT> [--arg='--hello=albatross-hi'] [--cpu=1]

Installation

Binary packages are available for Debian, Ubuntu and FreeBSD. How to install.

For other operating systems / distributions, run opam install albatross.

Also read the blog article for the motivation behind albatross and an overview of its functionality.

More Repositories

1

miou

A simple scheduler for OCaml 5
OCaml
85
star
2

miragevpn

An opinionated implementation of the OpenVPN protocol
OCaml
73
star
3

unipi

Serving content from a git repository via HTTPS (including let's encrypt provisioning) as MirageOS unikernel
OCaml
63
star
4

caldav

Calendar server (CalDAV, RFC 4791) implementation in OCaml
OCaml
59
star
5

udns

[deprecated, developmeht moved to https://github.com/mirage/ocaml-dns] ยตDNS - an opinionated Domain Name System (DNS) library
OCaml
55
star
6

unikernels

MirageOS unikernels
OCaml
50
star
7

tlstunnel

A TLS reverse proxy unikernel
OCaml
34
star
8

httpcats

OCaml
30
star
9

http-lwt-client

A HTTP client using HTTP/AF and lwt
OCaml
30
star
10

utcp

An implementation of the Transmission Control Protocol in OCaml
OCaml
29
star
11

u2f

U2F (FIDO Universal 2nd Factor) in OCaml
OCaml
26
star
12

catty

A unikernel as an IRC client
OCaml
24
star
13

ocaml-openpgp

WiP: RFC 4880 (OpenPGP) library and utilities in OCaml
OCaml
24
star
14

icalendar

OCaml
22
star
15

happy-eyeballs

An implementation of happy eyeballs (RFC 8305) in OCaml with lwt
OCaml
22
star
16

webauthn

Mirror of https://git.robur.coop/robur/webauthn/
OCaml
21
star
17

traceroute

MirageOS traceroute unikernel
OCaml
17
star
18

dnsvizor

draft space for a DNSmasq-like MirageOS unikernel
OCaml
17
star
19

memtrace-mirage

Memtrace library for MirageOS
OCaml
16
star
20

mollymawk

A web interface for albatross
OCaml
15
star
21

dns-primary-git

A MirageOS unikernel acting as primary DNS server, data stored in a remote git repository
OCaml
14
star
22

notty-miou

OCaml
13
star
23

builder

Scheduling build jobs on regular intervals, collecting artifacts
OCaml
13
star
24

vm

vm -- Manage KVM/QEMU virtual machines
Shell
13
star
25

git-kv

KV implementation on top of git (mirror of https://git.robur.coop/robur/git-kv)
OCaml
11
star
26

http-mirage-client

mirror of https://git.robur.coop/robur/http-mirage-client
OCaml
11
star
27

dns-letsencrypt-secondary

A MirageOS unikernel acting as secondary DNS server, provisioning certificate signing requests to valid certificates using let's encrypt
OCaml
11
star
28

mirage-monitoring

mirror of https://git.robur.coop/robur/mirage-monitoring
OCaml
11
star
29

builder-web

Mirror of https://git.robur.coop/robur/builder-web/
OCaml
10
star
30

lun

(โ–€ฬฟฤนฬฏโ–€ฬฟ ฬฟ)
HTML
10
star
31

ohex

Hexadecimal encoding and decoding, mirror of https://git.robur.coop/robur/ohex
OCaml
10
star
32

ocaml-pf

OCaml library for parsing the pf firewall rule format as used in FreeBSD 11
OCaml
9
star
33

orb

check opam package reproductibility
OCaml
8
star
34

mirage-noconfig

Try to infer config.ml for a MirageOS unikernel by looking at unikernel.ml
OCaml
8
star
35

dns-secondary

A MirageOS unikernel acting as a secondary DNS server
OCaml
7
star
36

mirage-fs-mem

An in-memory file system implementing the mirage-fs-lwt interface. Not persistent, be careful. :D
OCaml
7
star
37

qubes-miragevpn

OCaml
7
star
38

letsencrypt-unikernel

A unikernel that solves a let's encrypt (ACME) challenge
OCaml
6
star
39

miragevpn-handbook

5
star
40

ocaml-solo5-elftool

Mirror of https://git.robur.coop/robur/ocaml-solo5-elftool/
OCaml
4
star
41

bancos

A simple KV-store
C
3
star
42

miragevpn-spec

The specification we developed while working on MirageVPN
3
star
43

carton

OCaml
3
star
44

no-cstruct

3
star
45

utime

C
2
star
46

mugenhwcfg-live

Debian Live system for running mugenhwcfg
Shell
1
star
47

ocaml-h1

OCaml
1
star
48

mirage-noconfig-repo

Device interface & implementation descriptions for mirage-noconfig
1
star
49

kdf

Key deriving functions in OCaml
OCaml
1
star
50

opam-graph

Mirror of https://git.robur.coop/robur/opam-graph
OCaml
1
star