Chapter 11 of 16 · Deutschnullos.de

Security

Max's requirement: NULLos should become more secure from the ground up than Linux, macOS, Windows, Android and iOS. And stay dead simple while doing it.

The idea: every program has an ID card

Next to spec there's a small file, the ID card (ausweis). It says what the program may do – in German, one line per right. For example dl (download):

datei lesen      argumente
datei schreiben  argumente
geräte           zufall
netz verbinden   alles
netz lauschen    nein
prozesse         nein

The kernel enforces this. The ID card sits inside the program itself (its own section of the ELF file) and is read on every start. It's like pledge/unveil on OpenBSD, only mandatory instead of voluntary. Almost every tool already has its ID card – 306 of them, all checked without errors (in the cards under “more”). If there's an unknown word in the ID card, the program doesn't start at all. Programs without an ID card get a transitional ID card without admin rights for now – later they'll only be allowed input and output.

Authority instead of mandatory rules

Max decided how rights get passed on (variant “intersection”): A program never gets more than its ID card allows, never more than whoever starts it has – and it gets the concrete things because the human names them.

Already in the kernel: users with rwx rights, the enforced ID card, rights only flow downward (if the kernel can't build the chain, the program doesn't start – instead of running without limits), and einschr – a program restricts itself, never back, and its children inherit that. /bin, /sys and /boot are write-protected even for the admin. Since this afternoon also “naming = allowing”: the shell s is a broker – what you type becomes the authority for the program it starts. A narrow program stays narrow. With scripts the arguments come from the script, not from you – that's why a script carries its own ID card in a header line # ausweis: …, and the shell restricts itself accordingly while running it. Honest limit: a cracked shell could start anything – that's why it's protected by fuzzing. Not yet: the guard that asks. coming soon

What's coming

All coming soon – the plan has 40 numbered measures (S1–S40).

What already exists

Honestly: what's still missing

According to the security status: the ID card is still in transition (programs without an ID card may still do almost everything except admin stuff), and the guard that asks is missing. Also not there yet: random placement of programs in memory (ASLR), protection against side channels (KPTI, Spectre) and IOMMU against foreign DMA. So the rule is: don't hang NULLos on the network unprotected yet.

Rules for all code