Skip to content

eBPF-based security platform

3.0 KB
Raw Blame
% SPDX-License-Identifier: BSD-2-Clause
% Copyright (c) 2026 Authors of shirudo
%
% The steps of init in the initrd in their phases, where the keyrings
% are sealed, the guards attached and the register anchored, what a stop
% in each span leaves, and the run in the root file system after the
% switch (internals/boot-flow.rst).
\documentclass[tikz,dvisvgm]{standalone}
\usepackage{shirudo-figure}

% A step: its number and the color of its phase.
\newcommand\figcell[2]{%
  \fill[#2, opacity=0.16] (#1*40-20,60) rectangle ++(40,36);
  \draw[fig-line, thin] (#1*40-20,60) rectangle ++(40,36);
  \node[anchor=base] at (#1*40,83) {#1};}

\begin{document}
\begin{tikzpicture}
  \useasboundingbox (0,0) rectangle (840,380);

  \foreach \i in {1,2,3,4,18} {\figcell{\i}{fig-line}}
  \foreach \i in {5,...,9} {\figcell{\i}{fig-s1}}
  \foreach \i in {10,...,13} {\figcell{\i}{fig-s2}}
  \foreach \i in {14,...,17} {\figcell{\i}{fig-s3}}

  \begin{scope}[draw=fig-accent, line width=1.5bp]
    \foreach \x in {340,460,660} {
      \draw (\x,28) -- (\x,36);
      \draw (\x,58) -- (\x,100);
    }
  \end{scope}

  % What a stop in each span leaves.
  \begin{scope}[link, thin]
    \foreach \a/\b/\y in {20/460/122, 460/540/152, 540/560/182,
        560/700/212} {
      \draw (\a,\y) -- (\b,\y);
      \draw (\a,\y-5) -- (\a,\y+5);
      \draw (\b,\y-5) -- (\b,\y+5);
    }
  \end{scope}
  \draw[grid] (10,256) -- (830,256);

  \draw[box] (20,272) rectangle (330,370);
  \draw[box] (360,272) rectangle (820,370);

  \begin{scope}[every node/.append style={note, small, anchor=base}]
    \node[text=fig-accent] at (340,22) {keyrings sealed};
    \node[text=fig-accent] at (460,22) {guards attached};
    \node[text=fig-accent] at (660,22) {PCR 9 anchor};
    \node at (100,52) {settings, mounts};
    \node at (280,52) {images and keyrings};
    \node at (460,52) {guards, runtime};
    \node at (620,52) {boot event, restore, register};
  \end{scope}

  \begin{scope}[every node/.append style={note, small, anchor=base west}]
    \node at (470,126) {nothing attached, service skipped};
    \node at (550,156) {guards on, no runtime, service skipped};
    \node at (570,186) {nothing pending: service runs init again};
    \node at (710,216) {pending until};
    \node at (710,230) {a reboot};
    \node at (20,114) {if init stops:};
    \node at (20,248) {switch to the root file system: systemd extends
      PCR 11 at leave-initrd, and /run moves};
    \node at (32,312) {the private bpffs, its pins and maps};
    \node at (32,330) {the runtime and config mounts};
    \node at (32,348) {eventlog.pending, the initrd's record};
    \node at (372,312) {checks the frozen record and the pinned links,};
    \node at (372,330) {appends eventlog.pending, checks the config};
    \node at (372,348) {record and the archive, adds no register event};
    \node[font=\figsmall\bfseries] at (32,292) {crosses with /run/shirudo};
    \node[font=\figsmall\bfseries] at (372,292)
      {shirudo.service, from the runtime image};
  \end{scope}
\end{tikzpicture}
\end{document}