Skip to content

eBPF-based security platform

ci: run the quickstart and quick guides

Andrea Lattuada30f30a0ed815
diff --git a/.github/scripts/check-guides.py b/.github/scripts/check-guides.py
new file mode 100644
index 00000000..ee2c0af3
--- /dev/null
+++ b/.github/scripts/check-guides.py
@@ -0,0 +1,237 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-2-Clause
+# Copyright (c) 2026 Authors of shirudo
+
+"""Run the commands and create the example files shown in the quick guides."""
+
+import argparse
+import re
+import shlex
+import subprocess
+import sys
+import uuid
+from pathlib import Path
+from textwrap import dedent
+
+ROOT = Path(__file__).resolve().parents[2]
+START = Path("Documentation/start")
+TUTORIALS = ("attest-target", "first-upatch", "publish-package")
+BLOCK = re.compile(r"^( *)\.\. code-block:: (\w+)$")
+DIRECTIVE = re.compile(r"^ *\.\. guide-check: (\w+)(?: (.+))?$")
+PROMPT = re.compile(r"^(operator\$|target#|\$) (.+)$")
+MODES = {
+ "boot", "capture", "connect", "fail", "guides", "match", "registry",
+ "remove", "skip", "stop", "write",
+}
+PLACEHOLDER = re.compile(r"<([a-z][a-z0-9-]*)>")
+
+
+def examples(page):
+ lines = (ROOT / page).read_text().splitlines()
+ action = ("run", "")
+ for i, line in enumerate(lines):
+ directive = DIRECTIVE.fullmatch(line)
+ if directive:
+ mode, argument = directive.groups()
+ if mode not in MODES or bool(argument) != (mode in ("capture", "fail", "match", "write")):
+ raise ValueError(f"{page}:{i + 1}: invalid guide-check comment")
+ action = (mode, argument or "")
+ continue
+ block = BLOCK.fullmatch(line)
+ if not block:
+ continue
+ indent, language = block.groups()
+ end = i + 1
+ while end < len(lines):
+ body_line = lines[end]
+ if body_line.strip() and not body_line.startswith(indent + " "):
+ break
+ end += 1
+ first = i + 1
+ while first < end and not lines[first].strip():
+ first += 1
+ body = dedent("\n".join(lines[first:end])).splitlines()
+ mode, argument = action
+ action = ("run", "")
+ if mode == "write":
+ yield f"{page}:{i + 1}", "operator$", "\n".join(body), mode, argument
+ continue
+ if language != "console":
+ if mode != "run":
+ raise ValueError(f"{page}:{i + 1}: {mode} requires a console block")
+ continue
+ commands = []
+ n = 0
+ while n < len(body):
+ prompt = PROMPT.fullmatch(body[n])
+ if not prompt:
+ n += 1
+ continue
+ at = f"{page}:{first + n + 1}"
+ side, command = prompt.groups()
+ while command.endswith("\\"):
+ n += 1
+ if n == len(body):
+ raise ValueError(f"{at}: unfinished shell continuation")
+ command += "\n" + body[n]
+ commands.append((at, side, command))
+ n += 1
+ for step in commands[:-1]:
+ yield *step, "run", ""
+ if commands:
+ yield *commands[-1], mode, argument
+ elif mode != "run":
+ raise ValueError(f"{page}:{i + 1}: {mode} has no command")
+ if action[0] != "run":
+ raise ValueError(f"{page}: guide-check comment has no block")
+
+
+def plan():
+ for step in examples(START / "quickstart.rst"):
+ if step[3] == "guides":
+ for tutorial in TUTORIALS:
+ yield from examples(START / "guides" / f"{tutorial}.rst")
+ yield step
+
+
+class Shell:
+ def __init__(self, argv):
+ self.process = subprocess.Popen(
+ argv, cwd=ROOT, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT, text=True, errors="replace",
+ )
+ self.marker = f"guide-{uuid.uuid4().hex}"
+ status, _ = self.run("set -o pipefail; shopt -s expand_aliases")
+ if status:
+ raise RuntimeError("could not initialize the guide shell")
+
+ def run(self, command):
+ self.process.stdin.write(
+ f"{command}\nprintf '\\n{self.marker} %d\\n' \"$?\"\n"
+ )
+ self.process.stdin.flush()
+ output = []
+ for line in self.process.stdout:
+ if line.startswith(self.marker + " "):
+ return int(line.split()[1]), "".join(output).removesuffix("\n")
+ print(line, end="", flush=True)
+ output.append(line)
+ raise RuntimeError("shell closed before reporting the command's status")
+
+ def close(self, command=None):
+ try:
+ if command:
+ self.process.stdin.write(command + "\n")
+ self.process.stdin.close()
+ except BrokenPipeError:
+ # A shell that closed its input can still have output to drain.
+ pass
+ for line in self.process.stdout:
+ print(line, end="", flush=True)
+ self.process.stdout.close()
+ return self.process.wait()
+
+
+def run(steps):
+ bash = ["bash", "--noprofile", "--norc", "-s"]
+ host = Shell(bash)
+ guest = None
+ values = {}
+ vm_started = False
+ registry_started = False
+ at = "guide prerequisites"
+ try:
+ status, _ = host.run(
+ 'test ! -e "$HOME/hello" && test ! -e "$HOME/hello-1.0.0.bee" '
+ '&& test ! -e build/test-vm/vms/quickstart '
+ '&& test ! -e basic.upatch && test ! -e basic.unload.upatch '
+ '&& test ! -e build/tutorial'
+ )
+ if status:
+ raise RuntimeError("use a fresh checkout and unused guide instance names")
+
+ for at, side, command, mode, argument in steps:
+ if mode == "skip":
+ continue
+ description = f"write {argument}" if mode == "write" else f"{side} {command}"
+ print(f"\n{at} {description}", flush=True)
+ if mode == "connect":
+ shell_command = shlex.split(command)
+ shell_command.append("VM_SSH_COMMAND=" + shlex.join(bash))
+ shell_command.insert(1, "-s")
+ guest = Shell(shell_command)
+ continue
+ if mode == "guides":
+ if guest.close(command):
+ raise RuntimeError("target shell failed to exit")
+ guest = None
+ if host.run(f"cd {shlex.quote(str(ROOT))}")[0]:
+ raise RuntimeError("could not return to the checkout")
+ continue
+ shell = guest if side == "target#" else host
+ if shell is None:
+ raise RuntimeError("guide command needs an open guest shell")
+ if mode == "write":
+ if argument.startswith("~/"):
+ path = '"$HOME"/' + shlex.quote(argument[2:])
+ else:
+ path = shlex.quote(argument)
+ command = f"printf '%s\\n' {shlex.quote(command)} > {path}"
+ else:
+ command = PLACEHOLDER.sub(lambda m: values[m[1]], command)
+ if mode == "registry":
+ command += " </dev/null"
+ if mode == "boot":
+ vm_started = True
+ command += " </dev/null"
+ status, output = shell.run(command)
+ if mode == "fail":
+ if not status or not re.search(argument, output, re.MULTILINE):
+ raise RuntimeError(f"expected failure matching {argument!r}, got {status}")
+ continue
+ if status:
+ raise RuntimeError(f"command exited with status {status}")
+ if mode == "match" and not re.search(argument, output, re.MULTILINE):
+ raise RuntimeError(f"output did not match {argument!r}")
+ if mode == "capture":
+ match = re.search(r"^(?:\w+: )?([0-9a-f]{64})$", output.rstrip().split("\n")[-1])
+ if not match:
+ raise RuntimeError(f"expected a hex value for <{argument}>")
+ values[argument] = match[1]
+ if mode == "registry":
+ registry_started = True
+ if mode == "remove":
+ registry_started = False
+ if mode == "stop":
+ vm_started = False
+ except (KeyError, OSError, RuntimeError) as error:
+ print(f"{at}: {error}", file=sys.stderr)
+ return 1
+ finally:
+ if guest:
+ guest.close()
+ if registry_started:
+ host.run("docker rm -f shirudo-registry")
+ if vm_started:
+ host.run(f"make -C {shlex.quote(str(ROOT / 'testing'))} vm-stop VM_NAME=quickstart")
+ host.close()
+ return 0
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--list", action="store_true", help="show the steps without running them")
+ args = parser.parse_args()
+ try:
+ steps = list(plan())
+ except ValueError as error:
+ return parser.error(str(error))
+ if args.list:
+ for at, side, command, mode, argument in steps:
+ print(f"{at} {side} [{mode} {argument}] {command.splitlines()[0]}")
+ return 0
+ return run(steps)
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/.github/scripts/guides-ci.sh b/.github/scripts/guides-ci.sh
new file mode 100644
index 00000000..7ed0a181
--- /dev/null
+++ b/.github/scripts/guides-ci.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# SPDX-License-Identifier: BSD-2-Clause
+# Copyright (c) 2026 Authors of shirudo
+#
+# Resolve the kernel pin and run the Linux guides on a prepared CI host.
+# Validate the Lima template on macOS.
+
+set -eu
+
+cd "$(git rev-parse --show-toplevel)"
+
+case "${1:-}" in
+kernel-run)
+ run_id=$(testing/vm/kernel-artifact.sh run-id)
+ printf 'Using kernel package run %s\n' "$run_id"
+ printf 'run_id=%s\n' "$run_id" >>"$GITHUB_OUTPUT"
+ ;;
+run)
+ # shellcheck source=/dev/null
+ . build/vm-toolchain.env
+ export BPF_VMLINUX_BTF="$PWD/artifacts/bpf-next-kernel-debs/vmlinux.btf"
+ export TEST_VM_TIMEOUT=900
+ sudo prlimit --pid "$$" --memlock=unlimited:unlimited
+ exec python3 .github/scripts/check-guides.py
+ ;;
+validate-lima)
+ command -v limactl >/dev/null || brew install lima
+ exec limactl validate --param "checkout=$PWD" infra/lima/shirudo.yaml
+ ;;
+*)
+ printf 'usage: %s kernel-run|run|validate-lima\n' "$0" >&2
+ exit 2
+ ;;
+esac
diff --git a/.github/workflows/guides-linux.yml b/.github/workflows/guides-linux.yml
new file mode 100644
index 00000000..293c055e
--- /dev/null
+++ b/.github/workflows/guides-linux.yml
@@ -0,0 +1,83 @@
+name: Linux quickstart
+
+on:
+ workflow_dispatch:
+ inputs:
+ kernel_run_id:
+ description: Optional override; defaults to the run testing/vm/kernel-artifact.sh pins
+ required: false
+ type: string
+
+permissions:
+ contents: read
+ actions: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ guides:
+ name: Quickstart and quick guides
+ runs-on: ubuntu-latest
+ timeout-minutes: 75
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+
+ - name: Resolve kernel package artifact
+ id: kernel-run
+ env:
+ KERNEL_RUN_ID: ${{ inputs.kernel_run_id }}
+ run: sh .github/scripts/guides-ci.sh kernel-run
+
+ - name: Download kernel CI artifact
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
+ with:
+ name: kernel-packages-x86-64-ci
+ repository: shirudo-dev/kernel
+ run-id: ${{ steps.kernel-run.outputs.run_id }}
+ github-token: ${{ secrets.KERNEL_REPO_READ_TOKEN }}
+ path: build/kernel-ci-artifact
+
+ - name: Restore the static target dependencies
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: build/target-deps
+ key: target-deps-${{ hashFiles('Makefile.target-deps') }}
+
+ - name: Restore the host OpenSSL toolchain
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: build/host-openssl
+ key: host-openssl-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/scripts/vm-toolchain.sh') }}
+
+ - name: Restore the host libtpms toolchain
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: build/host-libtpms
+ key: host-libtpms-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/scripts/vm-toolchain.sh', '.github/scripts/install-libtpms.sh') }}
+
+ - name: Restore the VM images
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: build/test-vm/cache
+ key: test-vm-images-${{ hashFiles('testing/vm/runtime-packages', 'testing/vm/operator-packages', 'testing/vm/prepare-runtime.sh', 'testing/vm/build-bundle.sh', 'testing/vm/arch.sh', '.github/scripts/install-clang.sh', '.github/scripts/install-static-libcrypto-deps.sh', 'testing/container/Containerfile', 'testing/container/packages', 'Makefile.target-deps') }}
+
+ - name: Prepare the test environment
+ env:
+ KERNEL_CI_ARTIFACT_DIR: ${{ github.workspace }}/build/kernel-ci-artifact
+ run: .github/scripts/tests.sh setup
+
+ - name: Run the Linux quickstart and quick guides
+ id: guides
+ timeout-minutes: 40
+ run: sh .github/scripts/guides-ci.sh run
+
+ - name: Upload quickstart guest console
+ if: failure() && steps.guides.outcome == 'failure'
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ with:
+ name: guest-console-quickstart
+ path: build/test-vm/vms/quickstart/console.log
+ if-no-files-found: ignore
diff --git a/.github/workflows/guides-macos.yml b/.github/workflows/guides-macos.yml
new file mode 100644
index 00000000..ce6113da
--- /dev/null
+++ b/.github/workflows/guides-macos.yml
@@ -0,0 +1,24 @@
+name: macOS quickstart
+
+on:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: macos-quickstart
+
+jobs:
+ lima:
+ name: Validate Lima template
+ runs-on: macos-15
+ timeout-minutes: 45
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+
+ - name: Validate Lima template
+ run: sh .github/scripts/guides-ci.sh validate-lima
diff --git a/Documentation/contribute/testing/test-coverage.rst b/Documentation/contribute/testing/test-coverage.rst
index e16eba1e..ce45ab42 100644
--- a/Documentation/contribute/testing/test-coverage.rst
+++ b/Documentation/contribute/testing/test-coverage.rst
@@ -933,6 +933,18 @@ signed config image.
guard, with ``5 head`` and ``6 set`` of the node's status at each
step
+Quickstart and quick guides
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+:src:`.github/scripts/check-guides.py` runs the Linux quickstart and
+quick guides against one interactive VM. It checks that the target is
+ready, denies the documented operations, and loads and unloads a signed
+upatch. It checks that the TPM answers a credential challenge and that
+the evidence matches the predicted register. The remaining guides check
+an upatch's map counter and install and remove a package through a local
+OCI registry. The macOS workflow checks the Lima template with
+``limactl validate``.
+
Unit suites and fuzz targets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/Documentation/contribute/testing/testing.rst b/Documentation/contribute/testing/testing.rst
index 609db6eb..c2e03d6c 100644
--- a/Documentation/contribute/testing/testing.rst
+++ b/Documentation/contribute/testing/testing.rst
@@ -77,6 +77,36 @@ successful run ID. The prerelease ``test-kernel-<run-id>`` includes both
bundle ZIPs, their matching ``kernel-ci-source.tar.zst`` and
``SHA256SUMS``. Verify the public downloads against ``SHA256SUMS``.
+Check the quickstart and quick guides
+-------------------------------------
+
+The ``Linux quickstart`` workflow runs on manual dispatch. It runs the
+console examples from :doc:`/start/quickstart` and the three
+:doc:`/start/guides/index` on one interactive x86-64 test VM. It uses the
+same kernel pin as the ``CI suite`` workflow. It runs the attestation
+tutorial before the other guides change the register. The log gives the
+page and line for each command. If a guide fails, CI uploads the QEMU
+console.
+
+Run the examples on a disposable Linux host from a fresh checkout after
+staging the kernel and preparing the operator environment as the
+quickstart describes. To see the commands without running them, add
+``--list``:
+
+.. code-block:: console
+
+ $ python3 .github/scripts/check-guides.py
+
+A reStructuredText comment of the form ``.. guide-check: match REGEX``
+checks the last command's output in the next console block. Use
+``fail REGEX`` for an expected failure, ``capture NAME`` for a hex value
+a later command uses as ``<NAME>``, and ``write PATH`` to save the next
+code block as a file. The other console commands must succeed.
+
+Manually dispatch the ``macOS quickstart`` workflow to check the Lima
+template from :doc:`/start/quickstart-macos` on a GitHub-hosted Apple
+silicon runner. It runs ``limactl validate``.
+
Test tiers
----------
diff --git a/Documentation/start/guides/attest-target.rst b/Documentation/start/guides/attest-target.rst
index 26bc3260..f2c0eadd 100644
--- a/Documentation/start/guides/attest-target.rst
+++ b/Documentation/start/guides/attest-target.rst
@@ -54,6 +54,8 @@ Take the first evidence
2. Make a nonce:
+ .. guide-check: capture nonce1
+
.. code-block:: console
operator$ NONCE1=$(openssl rand -hex 32)
@@ -89,6 +91,8 @@ Challenge the attestation key
1. Make a credential challenge for the attestation key:
+ .. guide-check: capture credential
+
.. code-block:: console
operator$ shirudo attest challenge --evidence="$RESULT/first.json" --ak-name="$AK" --trust-presented-ek --output="$RESULT/challenge.json"
@@ -131,6 +135,8 @@ Answer the challenge on the target
1. Make a second nonce on the operator host:
+ .. guide-check: capture nonce2
+
.. code-block:: console
operator$ NONCE2=$(openssl rand -hex 32)
@@ -157,6 +163,8 @@ Verify the enrollment
1. Verify the evidence with both key names, the credential and the
enrolled certificates:
+ .. guide-check: match activated the credential
+
.. code-block:: console
operator$ shirudo attest verify --evidence="$RESULT/enrolled.json" --nonce="$NONCE2" --ak-name="$AK" --ek-name="$EK" --expect-credential="$CRED" --cert="$KEYS/cert.der" --cert="$OWN" --allow-runtime-events
@@ -217,6 +225,8 @@ Predict the register
2. Add the events since boot, in their order:
+ .. guide-check: capture register-after-events
+
.. code-block:: console
operator$ shirudo attest predict --cert="$KEYS/cert.der" --cert="$OWN" --event=load:basic="$PAYLOAD" --event=unload:basic="$PAYLOAD"
@@ -237,6 +247,8 @@ Verify evidence
1. Make a fresh nonce:
+ .. guide-check: capture nonce3
+
.. code-block:: console
operator$ NONCE3=$(openssl rand -hex 32)
@@ -250,6 +262,8 @@ Verify evidence
3. Verify it with the pinned key and the predicted register:
+ .. guide-check: match ^verdict: ok$
+
.. code-block:: console
operator$ shirudo attest verify --evidence="$RESULT/ev.json" --nonce="$NONCE3" --ak-name="$AK" --expect-chain=<register-after-events>
@@ -271,6 +285,8 @@ Verify evidence
pinned``. Without a state expectation it checks no state at all, yet
still reports ``verdict: ok``:
+.. guide-check: match ^verdict: ok$
+
.. code-block:: console
operator$ shirudo attest verify --evidence="$RESULT/ev.json" --nonce="$NONCE3" --ak-name="$AK"
diff --git a/Documentation/start/guides/first-upatch.rst b/Documentation/start/guides/first-upatch.rst
index c95d8fc3..d4f096d4 100644
--- a/Documentation/start/guides/first-upatch.rst
+++ b/Documentation/start/guides/first-upatch.rst
@@ -41,6 +41,8 @@ Write the program
2. Write ``build/tutorial/sleep-count.bpf.c``:
+ .. guide-check: write build/tutorial/sleep-count.bpf.c
+
.. code-block:: c
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
@@ -157,6 +159,8 @@ Load it and read the map
4. Read the map:
+ .. guide-check: match ^\s*->\s+([3-9]|[1-9][0-9]+)$
+
.. code-block:: console
target# shirudo upatch map sleep-count calls
@@ -182,6 +186,8 @@ Unload it
1. Unload the upatch:
+ .. guide-check: match sleep-count detached and unpinned
+
.. code-block:: console
target# shirudo upatch unload /workspace/shirudo/build/tutorial/sleep-count.unload.upatch
@@ -192,6 +198,8 @@ Unload it
2. Check that the map is gone:
+ .. guide-check: match ^Pinned maps \(0\):$
+
.. code-block:: console
target# shirudo upatch map
diff --git a/Documentation/start/guides/publish-package.rst b/Documentation/start/guides/publish-package.rst
index 22c423d4..0e6471fd 100644
--- a/Documentation/start/guides/publish-package.rst
+++ b/Documentation/start/guides/publish-package.rst
@@ -39,6 +39,8 @@ Start a registry
1. Run a registry on the host's loopback interface:
+ .. guide-check: registry
+
.. code-block:: console
operator$ docker run -d --name shirudo-registry -p 127.0.0.1:5000:5000 docker.io/library/registry:3
@@ -69,6 +71,8 @@ Build the package
3. Write ``~/hello/Beefile``:
+ .. guide-check: write ~/hello/Beefile
+
.. code-block:: toml
[package]
@@ -84,6 +88,8 @@ Build the package
4. Write ``~/hello/README.md``:
+ .. guide-check: write ~/hello/README.md
+
.. code-block:: markdown
# hello
@@ -157,6 +163,8 @@ none, so here the target installs by direct reference.
2. List the installed packages:
+ .. guide-check: match ^\s+hello\s+1\.0\.0\s+direct$
+
.. code-block:: console
target# shirudo bpm list
@@ -169,6 +177,8 @@ none, so here the target installs by direct reference.
3. Check that its upatch is loaded:
+ .. guide-check: match ^\s+hello\s+yes\s
+
.. code-block:: console
target# shirudo upatch list
@@ -181,6 +191,8 @@ Remove it
1. Uninstall the package on the target:
+ .. guide-check: match hello detached and unpinned
+
.. code-block:: console
target# shirudo bpm uninstall hello
@@ -193,8 +205,18 @@ Remove it
The target runs the unload directives that shipped in the package and
removes the package. ``shirudo bpm list`` no longer lists it.
+ .. guide-check: match ^\s+none$
+
+ .. code-block:: console
+
+ target# shirudo bpm list
+ Installed packages:
+ none
+
2. Stop the registry on the host:
+ .. guide-check: remove
+
.. code-block:: console
operator$ docker rm -f shirudo-registry
diff --git a/Documentation/start/quickstart.rst b/Documentation/start/quickstart.rst
index b23e2972..9cc1b960 100644
--- a/Documentation/start/quickstart.rst
+++ b/Documentation/start/quickstart.rst
@@ -62,6 +62,8 @@ Use the test kernel artifact
From the checkout root, download and stage the CI kernel for your host:
+.. guide-check: skip
+
.. code-block:: console
operator$ testing/vm/kernel-artifact.sh fetch
@@ -110,6 +112,8 @@ Boot a test target
1. Boot a test VM named ``quickstart``:
+ .. guide-check: boot
+
.. code-block:: console
operator$ make -C testing vm VM_NAME=quickstart
@@ -138,6 +142,8 @@ Boot a test target
2. Open a root shell on the target:
+ .. guide-check: connect
+
.. code-block:: console
operator$ make -C testing vm-ssh VM_NAME=quickstart
@@ -157,6 +163,8 @@ Boot a test target
keeps an identical copy under ``/usr/local/bin``. That copy prints its
version, but every command that reads shirudo's state stops:
+ .. guide-check: fail Permission denied
+
.. code-block:: console
target# /usr/local/bin/shirudo status
@@ -177,6 +185,8 @@ Check enforcement
1. Read the status report:
+ .. guide-check: match ^Status:\s+ok$
+
.. code-block:: console
target# shirudo status
@@ -262,6 +272,8 @@ Check enforcement
3. Try to read one of shirudo's pins as root:
+ .. guide-check: fail Permission denied
+
.. code-block:: console
target# cat /run/shirudo/bpffs/tamper
@@ -396,6 +408,8 @@ Load it
2. List the upatches:
+ .. guide-check: match ^\s+basic\s+yes\s
+
.. code-block:: console
target# shirudo upatch list
@@ -435,6 +449,8 @@ nothing but the evidence, your certificates and your artifacts.
1. Make a fresh nonce on the operator host:
+ .. guide-check: capture nonce
+
.. code-block:: console
operator$ NONCE=$(openssl rand -hex 32)
@@ -462,6 +478,8 @@ nothing but the evidence, your certificates and your artifacts.
4. Predict the register from what you know:
+ .. guide-check: capture register-after-events
+
.. code-block:: console
operator$ shirudo attest predict --cert="$KEYS/cert.der" --cert="$OWN" --event=load:basic="$PAYLOAD"
@@ -480,6 +498,8 @@ nothing but the evidence, your certificates and your artifacts.
5. Verify the evidence against the prediction:
+ .. guide-check: match ^verdict: ok$
+
.. code-block:: console
operator$ shirudo attest verify --evidence="$EV" --nonce="$NONCE" --ak-name="$(jq -r .ak.name "$EV")" --expect-chain=<register-after-events>
@@ -534,6 +554,8 @@ Unload it
1. Unload the upatch:
+ .. guide-check: match basic detached and unpinned
+
.. code-block:: console
target# shirudo upatch unload basic.unload.upatch
@@ -547,6 +569,8 @@ Unload it
2. List the upatches:
+ .. guide-check: match ^\s+none$
+
.. code-block:: console
target# shirudo upatch list
@@ -567,12 +591,16 @@ them.
1. Leave the target shell:
+ .. guide-check: guides
+
.. code-block:: console
target# exit
2. Stop the VM:
+ .. guide-check: stop
+
.. code-block:: console
operator$ make -C testing vm-stop VM_NAME=quickstart