The easiest way to get snpguard-image and snpguard-client is to pull the
pre-built tools image from the GitHub Container Registry:
docker pull ghcr.io/<owner>/snpguard-tools:latestAll tools share the same invocation pattern:
docker run --rm -it --privileged \
--network host \
-v $PWD:/work \
-v $HOME/.config:/root/.config \
ghcr.io/<owner>/snpguard-tools:latest \
<snpguard-image|snpguard-client> ...--privilegedgives the container access to/dev/kvm, which libguestfs uses to accelerate its internal QEMU appliance; without it libguestfs falls back to software emulation (TCG) and runs significantly slower--network hostlets the container reach services on the host (e.g. the attestation server atlocalhost:3000)-v $PWD:/workmakes local image files accessible inside the container-v $HOME/.config:/root/.configpersistssnpguard-clientconfig across runs
Install Rust via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shThen install the required system packages (Debian/Ubuntu):
apt-get install -y \
build-essential pkg-config libssl-dev \
protobuf-compiler \
musl-tools musl-dev \
libguestfs-dev libguestfs-tools linux-image-amd64 \
qemu-utilsAdd the MUSL cross-compilation target:
rustup target add x86_64-unknown-linux-muslThen clone and build:
git clone <repository-url>
cd snp-guard
git submodule update --init --recursive
make buildSee Getting the Tools above.
Generate TLS certificates:
./scripts/generate-tls-certs.sh --output data/tls --ip ${IP}If a hostname should be used instead of ${IP}, please provide the --dns <HOSTNAME> option instead of the --ip option. Multiple --ip <IP> or --dns <HOSTNAME> entries can be provided one after another.
Start the server. The server provides both the Attestation API and the Management Web UI.
Option A: pre-built Docker image (recommended)
docker run -d \
--name snp-guard \
-p 3000:3000 \
-v "$(pwd)/data:/data" \
-e DATA_DIR=/data \
-e NO_TLS= \
--restart unless-stopped \
ghcr.io/<owner>/snpguard-server:latestOption B: build from source
make run-serverOn first start, the server generates a master password and prints it to stdout. Copy it, then:
- Navigate to the Web Dashboard at
https://${HOSTNAME_OR_IP}:3000 - Log in with the master password
- Go to
Tokensto create an API token for your CLI client
Configure the client to connect to the attestation server:
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client config login \
--url https://${HOSTNAME_OR_IP}:3000 \
--token ${TOKEN}This implements TOFU (Trust On First Use). The client makes a raw TLS connection to the server and captures the certificate chain from the handshake. It then checks whether the chain is trusted by the built-in Mozilla/webpki root bundle:
- Public CA (e.g. fly.io, Let's Encrypt): no CA is pinned. Subsequent connections use the
built-in root bundle. Only
ingestion.pubandidentity.pubare stored. - Self-signed / private CA: the CA cert is pinned and stored as
ca.pem. Subsequent connections verify against it.
In both cases fingerprints are displayed for out-of-band verification, the token is validated via
/v1/health, and URL/token/keys are stored to ~/.config/snpguard/.
Security note -- public CA on shared platforms: Many PaaS providers (Koyeb, Render, Railway,
fly.io) issue wildcard TLS certificates (e.g. *.koyeb.app) shared across all customer apps.
TLS hostname verification succeeds for any app on the same platform, so a DNS-substitution attack
that redirects your server hostname to a malicious app on the same platform still passes TLS
checks. In this scenario the management API token sent in the Authorization header is exposed
to the attacker. The VMK release and artifact signatures are still protected by application-layer
cryptography (HPKE ingestion key, Ed25519 identity key), but management operations (register,
delete, list) authorized by the token alone are at risk.
Mitigation: run the server with a private CA certificate (use
./scripts/generate-tls-certs.sh) even on a PaaS platform, terminate TLS inside the container,
and pin the CA cert at config login. This binds connections to the exact certificate rather
than a shared platform wildcard.
Download a standard cloud image and convert it to a confidential-ready image. This process uses qemu-img and libguestfs to perform surgical, offline manipulation of the QCOW2 image, including root filesystem encryption (LUKS), partition management, and injecting the attestation agent into the initrd.
# Download latest Debian trixie
wget https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-amd64.qcow2
# Convert standard Debian to a confidential-ready Debian
cargo run --release --bin \
snpguard-image convert \
--in-image ./debian-13-genericcloud-amd64.qcow2 \
--out-image confidential.qcow2 \
--out-staging ./staging \
--firmware ./OVMF.AMDSEV.fdWhat the conversion does:
- Increase the target QCOW image and root filesystem partition sizes
- Encrypts the target root filesystem with LUKS2 (label:
snpguard-luks) - Generates a random Volume Master Key (VMK) for disk encryption
- Generates an unsealing keypair internally (used to encrypt the VMK)
- Encrypts the unsealing private key using the public SnpGuard server's ingestion key and places it in the staging directory
- Encrypts (seals) the VMK with the unsealing public key
- Uploads the sealed VMK into the guest image
- Installs
cryptsetup-initramfsin the guest image - Writes
/etc/default/grub.d/90_snpguard.cfgto disable UUID/PARTUUID in grub entries - Rewrites the root entry in
/etc/fstabto point at/dev/mapper/cryptroot - Installs the SnpGuard client binary and configuration files (CA cert, identity public key, attestation URL, sealed VMK)
- Installs initramfs-tools hooks (
hook.shandattest-online.shorattest-offline.sh) - Regenerates the initrd with hooks included (
update-initramfs -u -k all) - Regenerates the grub configuration (
update-grub) - Extracts boot artifacts (kernel, initrd, kernel parameters, firmware) to the staging directory
Prerequisites:
- The client binary must be built:
make build-client libguestfsandqemu-imgmust be installed on the system for theconvertsubcommand- SEV-SNP must be enabled in the guest firmware and hardware
- The image must use initramfs-tools (Debian/Ubuntu) - dracut is not yet supported
Notes:
- To use AMD SEV-SNP technology, SEV-SNP must be enabled in guest kernels, which is verified by the image tool. For example, default Debian cloud images support SEV-SNP starting from the Trixie distribution (Debian 13). Ubuntu introduced SEV-SNP support starting from Ubuntu Noble (Ubuntu 22.04).
- The image tool requires
qemu-imgandlibguestfsto be installed on the system for theconvertsubcommand to inspecet and modify the QCOW2 image. - The image tool lists the available kernels and initrd images with their kernel parameters. By default, the GRUB default kernel is selected automatically; if no default is set in the GRUB configuration, the first SEV-SNP supported entry is used. Pass
--interactiveto be prompted to choose interactively instead. - The OVMF firmware binary must include
SNP_KERNEL_HASHES, which is achieved by the special AmdSevX64 build. Refer to this guide to build OVMF withSNP_KERNEL_HASHESenabled. - For the image
converttool, if you've runsnpguard-client config login, the attestation URL, ingestion public key, CA certificate, and identity public key will be read from the stored configuration. Otherwise, you must provide them via--attest-url,--ingestion-public-key,--ca-cert, and--identity-puboptions.
Offline Attestation Mode (--offline-attestation)
By default the convert subcommand installs attest-online.sh, which contacts
the snpguard service on every boot to obtain the VMK and unlock the rootfs.
Pass --offline-attestation to install attest-offline.sh instead, which
implements a two-slot LUKS strategy that eliminates the network dependency from
steady-state boots:
| LUKS slot | Key | Unlocked by |
|---|---|---|
| 0 | Sealed VMK | Online attestation (snpguard service) |
| 1 | Hardware-bound derived key | SEV-SNP chip (offline, no network) |
The hardware-bound key is produced by the AMD Secure Processor using
snpguard-client derive-key with the following fields mixed in:
| Flag | What it binds |
|---|---|
--mix-measurement |
Launch digest (OVMF + kernel + initrd + cmdline). Also implicitly covers id_key_digest and author_key_digest, because the signed ID block that produces those digests commits to the measurement. |
--mix-image-id |
UUID identifying the registered image. The server explicitly filters attestation records by image_id; this flag ensures the derived key is tied to the same registration. |
--mix-policy |
Guest launch policy bitmask (controls hypervisor capabilities: debug mode, live migration, SMT, etc.). A policy change invalidates the offline key and forces re-enrollment via online attestation. |
--vmpl 0 |
Derives the key at VMPL 0, matching the server requirement that attestation reports must come from VMPL 0. |
The key can only be reproduced by an identical guest image running on the same physical AMD chip under the same launch policy.
Boot flow:
- The derived key is requested from the SEV-SNP chip (no network).
- LUKS slot 1 is tried with the derived key. If it matches, the rootfs is unlocked immediately and the boot continues — no network required.
- On failure (first boot or chip migration), the network is brought up and online attestation is performed via the snpguard service (slot 0).
- After a successful online attestation the derived key is enrolled into slot 1 (replacing any stale key from a previous chip), so subsequent boots proceed offline.
Network requirements:
- First boot: network is required to perform the initial online attestation and enrol the derived key into slot 1.
- Subsequent boots on the same chip: fully offline, no network needed.
- After chip migration (VM moved to different AMD hardware): network is required once on the new chip to re-enrol the derived key. The VCEK is chip-specific, so the derived key changes and slot 1 must be refreshed. Once re-enrolled, subsequent boots on the new chip are again offline.
# Convert with offline attestation support
cargo run --release --bin \
snpguard-image convert \
--in-image ./debian-13-genericcloud-amd64.qcow2 \
--out-image confidential.qcow2 \
--out-staging ./staging \
--firmware ./OVMF.AMDSEV.fd \
--offline-attestationStaging Directory Contents:
After conversion, the staging directory (./staging) contains:
firmware-code.fd: OVMF firmware binaryvmlinuz: Kernel binaryinitrd.img: Repacked initrd with SnpGuard client and hookskernel-params.txt: Kernel command-line parametersvmk.sealed: Sealed VMK blob (encrypted with unsealing public key)unsealing.key.enc: Encrypted unsealing private key (encrypted with the SnpGuard's server ingestion public key)
No-Hardening Mode (--no-hardening)
Pass --no-hardening to skip root filesystem encryption and hook injection entirely.
This is useful for testing artifact delivery and the launch pipeline without setting
up an attestation server. No server login is required.
snpguard-image convert \
--in-image ./debian-13-genericcloud-amd64.qcow2 \
--out-image confidential.qcow2 \
--out-staging ./staging \
--firmware ./OVMF.AMDSEV.fd \
--no-hardeningThe staging directory will contain the same boot artifacts as the hardened path
(firmware-code.fd, vmlinuz, initrd.img, kernel-params.txt) but no
vmk.sealed or unsealing.key.enc. After conversion, generate a
launch-config.json with make-launch-config and embed directly from the staging
directory (see steps 4a and 6 below).
Step 4a: Generate Launch Config (no-hardening only)
In the hardened workflow the attestation server generates launch-config.json
as part of manage register. In no-hardening mode there is no server, so
generate it locally:
snpguard-image make-launch-config \
--staging-dir ./staging \
--vcpus 4 \
--vcpu-type EPYC-Turin \
--allowed-smtOptional flags: --allowed-debug, --allowed-migrate-ma.
This writes staging/launch-config.json with the vCPU model, vCPU count, and
guest policy. The embed command requires this file to be present when using
--in-staging.
No-hardening: skip this step and go straight to step 6.
Register the new image with the server. This uploads the measurements and the encrypted key, and returns the signed launch artifacts.
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage register \
--os-name Debian13-CVM \
--vcpus 4 --vcpu-type EPYC-Turin \
--allowed-smt \
--min-tcb-bootloader 0 --min-tcb-tee 0 --min-tcb-snp 0 --min-tcb-microcode 0 \
--staging-dir ./staging \
--out-bundle ./launch-artifacts.tar.gzWhat registration does:
- Reads boot artifacts from the staging directory (or individual files if provided)
- Generates random ID-Block and Auth-Block keys (secp384r1 EC keys) on the server
- Generates measurements using
snpguestwith the firmware, kernel, initrd, and kernel parameters - Creates ID-Block and Auth-Block using the generated keys
- Computes key digests for lookup
- Encrypts ID and Auth keys with the ingestion public key (HPKE) and stores in database
- Stores the encrypted unsealing private key (from
unsealing.key.encif using staging directory) - Generates a random 16-byte image-id for the attestation record
- Stores the record in the database
- Exports launch artifacts bundle (if
--out-bundleis provided)
Using staging directory (recommended):
When using --staging-dir, the command expects:
firmware-code.fd: Firmware binaryvmlinuz: Kernel binaryinitrd.img: Initrd imagekernel-params.txt: Kernel parametersunsealing.key.enc: Encrypted unsealing private key (optional, generated during conversion)
Using individual files:
Alternatively, you can provide individual files:
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage register \
--os-name Ubuntu22.04 \
--enc-unsealing-private-key ./staging/unsealing.key.enc \
--firmware ./staging/firmware-code.fd \
--kernel ./staging/vmlinuz \
--initrd ./staging/initrd.img \
--kernel-params "$(cat ./staging/kernel-params.txt)" \
--vcpus 4 --vcpu-type EPYC-Turin \
--out-bundle ./launch-artifacts.tar.gzOptions:
--os-name <NAME>: Descriptive name for the OS/VM (required)--staging-dir <PATH>: Directory generated bysnpguard-image convert --out-staging(expects:firmware-code.fd,vmlinuz,initrd.img,kernel-params.txt, optionallyunsealing.key.enc)--enc-unsealing-private-key <PATH>: Encrypted unsealing private key (required if not using staging directory)--firmware <PATH>,--kernel <PATH>,--initrd <PATH>,--kernel-params <STRING>: Override individual files from staging directory--vcpus <N>: Number of virtual CPUs (default:4)--vcpu-type <TYPE>: EPYC variant:EPYC-Milan,EPYC-Genoa, orEPYC-Turin(default:EPYC-Turin)--allowed-debug: Allow debug mode (default:false)--allowed-migrate-ma: Allow migration with MA (default:false)--allowed-smt: Allow Simultaneous Multithreading (default:false)--min-tcb-bootloader <N>,--min-tcb-tee <N>,--min-tcb-snp <N>,--min-tcb-microcode <N>: Minimum TCB versions (default:0)--disable: Disable the record after creation (default:false)--out-bundle <PATH>: Export artifacts bundle after registration (same format asmanage export)
You can now view this registered image and its measurements in the Web Dashboard.
Optionally, you can embed the launch artifacts into the confidential image.
This creates a dedicated partition with the label LAUNCH_ARTIFACTS containing the boot
artifacts (kernel, initrd, ID-Block, Auth-Block) in an A/B directory structure.
Hardened workflow — embed from the bundle returned by manage register:
cargo run --release --bin \
snpguard-image embed \
--image ./confidential.qcow2 \
--in-bundle ./launch-artifacts.tar.gzNo-hardening workflow — embed directly from the staging directory (requires
launch-config.json to be present, generated by make-launch-config):
cargo run --release --bin \
snpguard-image embed \
--image ./confidential.qcow2 \
--in-staging ./stagingWhat the embed command does:
- Checks for an existing partition with the
LAUNCH_ARTIFACTSfilesystem label - If missing, creates a new 512MB partition, formats it as ext4, and sets the label
- Wipes the partition content (idempotent operation - safe to run multiple times)
- Extracts the bundle contents into
/Adirectory - Creates
/Bdirectory for future updates - Creates symlink
/artifacts -> Apointing to the active artifacts
The A/B structure enables atomic artifact updates: new attested artifacts are written to the inactive directory (e.g., /B), then the symlink is atomically switched to point to the new directory. On the next VM poweroff/poweron cycle, the new artifacts will be used.
Prerequisites:
libguestfsandqemu-imgmust be installed on the system- The image must have been converted using
snpguard-image convert - The launch artifacts bundle must have been generated using
snpguard-client manage register --out-bundle
Notes:
- The embed command is idempotent - you can run it multiple times safely
- The partition is identified by filesystem label, not GPT partition label (works even if GPT labels are stripped)
- Supports both
.tarand.tar.gzbundle formats - The A/B directory structure enables atomic artifact updates: new artifacts are written to the inactive directory, then the symlink is atomically switched. The new artifacts take effect on the next VM reboot.
- This step is optional - you can still provide artifacts externally when launching the VM using the
--artifactsparameter
Launch the confidential VM on the platform using the secured disk and the signed artifacts:
sudo ./scripts/launch-qemu-snp.sh \
--hda confidential.qcow2 \
--artifacts launch-artifacts.tar.gzThe launch script automatically reads the launch-config.json file from the artifacts bundle and enforces the correct vCPU count, vCPU model, and guest policy. These parameters must match exactly for VM to be launched.
Upon boot, the VM will verify itself against the server, receive the key, unlock the disk, and boot the OS.
Use the CLI to list and view records:
# List all records
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage list
# List with JSON output
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage list --json
# Show record details
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage show <record-id>
# Show with JSON output
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage show <record-id> --jsonAlternatively, use the Web Dashboard at https://${HOSTNAME_OR_IP}:3000 to view records with:
- Status: Active (green) or Disabled (gray)
- OS Name: Click to view details
- Requests: Number of successful attestations
- Actions: View or Delete
# Disable a record
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage disable <record-id>
# Enable a record
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage enable <record-id>Disabled records will cause attestation requests to fail, but the record remains in the database.
Export launch artifacts bundle:
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage export \
--id <record-id> \
--format tar \
--out-bundle artifacts.tar.gzFormats: tar, squash, or squashfs (default: tar)
Bundle Contents:
launch-config.json: Launch configuration (vCPU model, count, guest policy)firmware-code.fd: Firmware binaryvmlinuz: Kernel binaryinitrd.img: Initrd imagekernel-params.txt: Kernel command-line parametersid-block.bin: ID-Block binaryid-auth.bin: Auth-Block binary
cargo run --release --target x86_64-unknown-linux-musl --bin \
snpguard-client manage delete <record-id>This permanently removes the record and all associated artifacts.
Note: To update boot artifacts (kernel, initrd, firmware, kernel parameters) on a running VM,
use the renewal flow (snpguard-client attest renew) instead of deleting and re-creating the record.
Deletion is permanent and removes all associated artifacts.
-
config login --url <URL> --token <TOKEN>: Store management token (TOFU - Trust On First Use)- Captures TLS certificate chain from the server's TLS handshake
- Checks chain against built-in Mozilla root bundle to determine trust mode
- Public CA: no CA pinning; system roots used for all connections; no
ca.pemstored - Self-signed / private CA: CA cert pinned and stored as
ca.pem - Fetches ingestion and identity public keys from
/v1/public/info - Displays fingerprints for out-of-band verification; validates token via
/v1/health - Stores URL/token, ingestion.pub, identity.pub (and ca.pem if self-signed) to
~/.config/snpguard/
-
config logout: Remove all stored configuration files (token, URL, CA cert, ingestion public key, identity public key)
Both subcommands accept --url <URL> (default: contents of /etc/snpguard/attest.url) and
--ca-cert <PATH> (default: /etc/snpguard/ca.pem).
-
attest report --sealed-blob <PATH>: Perform online attestation and output the decrypted VMK in hex format to stdout. Used by the initrd hook during boot.--sealed-blob: Path to sealed VMK blob (default:/etc/snpguard/vmk.sealed)
-
attest renew [--grub-cfg <PATH>] [--interactive] [--out-bundle <PATH>] [--firmware <PATH>] [--kernel <PATH>] [--initrd <PATH>] [--kernel-params <STRING>]: Request an artifact renewal from inside the running VM. Must be run as root.Kernel discovery: The command parses
--grub-cfg(default:/boot/grub/grub.cfg) and checks each entry for SEV-SNP support (CONFIG_SEV_GUESTin the kernel config). With a single supported entry it is auto-selected; with multiple entries the GRUB default is chosen automatically, or pass--interactiveto pick manually. Individual--kernel,--initrd, and--kernel-paramsflags override the grub-discovered values; if all three are provided grub scanning is skipped entirely.Protocol: The SNP report binds
SHA512(payload_bytes)wherepayload_bytesis a pre-serializedRenewRequestPayloadcontaining both nonces and the submitted artifacts. The server response is Ed25519-signed; the client verifies the signature and checks the echoedclient_noncebefore trusting any content.Output --
--out-bundle <PATH>: Writes a gzip-compressed tar archive containing local artifacts (vmlinuz, initrd.img, kernel-params.txt, firmware-code.fd if provided) followed by server-returned artifacts (id-block.bin, id-auth.bin, launch-config.json).Output -- default (LAUNCH_ARTIFACTS partition): Mounts the block device behind
/dev/disk/by-label/LAUNCH_ARTIFACTS(ext4), reads the/artifactssymlink to determine the currently active slot (A or B), writes all artifacts into the other slot with per-file fsync, atomically replaces the/artifactssymlink via a temp-name rename, fsyncs the partition root, then unmounts. On next boot the bootloader follows the updated symlink and loads the new artifacts.Omitted per-artifact overrides are inherited from the current record on the server. The VM must be relaunched with the new artifacts for the pending record to be promoted to current.
Note: Both subcommands are intended for use inside the guest VM (initrd or running OS), not from the management host.
manage list [--json]: List all attestation records (RENEWAL column shows pending status)manage show <id> [--json]: Show details of a specific attestation record (prints pending-since when a renewal is in flight)manage enable <id>: Enable an attestation recordmanage disable <id>: Disable an attestation recordmanage delete <id>: Delete an attestation record and all associated artifactsmanage discard-pending <id>: Cancel a pending renewal (clears the pending record)manage export --id <id> --format <tar|squash|squashfs> --out-bundle <PATH> [--pending]: Export artifacts bundle;--pendingexports the in-flight renewal artifacts instead of the current onesmanage register: Register a new attestation record (see section 5 above for details)
All management commands use stored config by default (from config login), or provide --url and --ca-cert to override.
Problem: Client fails to connect to server
Solutions:
- Verify the URL is correct and uses HTTPS
- Check network connectivity from the guest VM
- Ensure TLS certificate is valid
- Check server logs for errors
Problem: Attestation verification fails
Solutions:
- Check Nonce Validity:
- Ensure the nonce was received from the server (not reused or expired)
- Ensure the nonce used within 60 seconds of generation
- Check server logs for nonce verification errors
- Check Binding Hash:
- Ensure the binding hash (SHA512(server_nonce || client_pub_bytes)) matches the report_data field
- Verify the client is using the correct server_nonce and client_pub_bytes
- Check Record Status: Ensure the attestation record is enabled
- Verify Key Digests: The ID-Block and Auth-Block key digests must match those stored in the record (keys are generated by the server)
- Check CPU Family: Ensure the vCPU type matches your actual CPU
- Review Server Logs: Check for detailed error messages
- Verify Report: Ensure
snpguestis generating valid reports
Problem: Server cannot verify the attestation report
Solutions:
- The server uses the integrated
snpguestbinary built from the submodule - Check network connectivity to AMD KDS (for certificate fetching)
- Verify the attestation report is not corrupted
- Check that the CPU family detection is correct
- Ensure the snpguest binary was built successfully:
make build-snpguest
Problem: File upload fails or is rejected
Solutions:
- Check file size limits:
- Firmware: <50 MB
- Kernel: <50 MB
- Initrd: <150 MB
- Ensure files are in the correct format
- Check server disk space
Problem: Image conversion fails or hooks are not installed
Solutions:
- Ensure the source image uses initramfs-tools (Debian/Ubuntu) - dracut is not yet supported
- Verify the client binary is built:
make build-client - Check that
libguestfsis installed on the system - Check that
cryptsetup-initramfscan be installed in the guest image - Verify network access during conversion (needed to install packages)
- Check conversion logs for errors during hook installation
- Verify the staging directory contains all required artifacts after conversion
- Ensure the converted initrd includes the SnpGuard client and hooks
- Test the converted image in a VM before production use
- Check boot logs for hook execution messages
The snpguard-image tool provides utilities for managing keys and converting VM images:
The keygen command is used internally by the convert command to generate unsealing keypairs. You typically don't need to use it manually, but it's available for advanced use cases:
keygen [--priv-out <PATH>] [--pub-out <PATH>]: Generate X25519 unsealing keypair--priv-out: Output path for private key (default:unsealing.key)--pub-out: Output path for public key (default:unsealing.pub)
Note: Keys generated by snpguard-image keygen use a non-standard PEM format (raw 32-byte keys wrapped in PEM). This is NOT standard PKCS#8 format. Standard tools like openssl may not recognize this format, but it works correctly with SnpGuard.
-
seal --pub-key <PATH> --data <PATH> --out <PATH>: Seal a file (e.g., VMK) with a public key--pub-key: Path to unsealing public key--data: Path to plaintext file to seal--out: Output path for sealed blob
-
unseal --priv-key <PATH> --sealed-data <PATH> --out <PATH>: Unseal a sealed blob--priv-key: Path to unsealing private key--sealed-data: Path to sealed blob--out: Output path for unsealed data
convert --in-image <PATH> --out-image <PATH> --out-staging <PATH> --firmware <PATH> [--attest-url <URL>] [--ingestion-public-key <PATH>] [--ca-cert <PATH>] [--identity-pub <PATH>]: Convert QCOW2 image to confidential-ready image--in-image: Input QCOW2 image path (required)--out-image: Output QCOW2 image path (required)--out-staging: Staging directory for temporary files (required)--firmware: Path to OVMF firmware binary (required)--attest-url: Attestation URL (optional, uses config fromsnpguard-client config loginif not provided)--ingestion-public-key: Path to ingestion public key (optional, uses config if not provided)--ca-cert: Path to CA certificate (optional, uses config if not provided)--identity-pub: Path to server Ed25519 identity public key (optional, uses config if not provided); baked into the initrd as/etc/snpguard/identity.pubso the guest can verify renewal responses
-
embed --image <PATH> --in-bundle <PATH>: Embed launch artifacts bundle into QCOW2 image--image: Path to the QCOW2 image file (required)--in-bundle: Path to the tar.gz bundle containing boot artifacts (required)
Creates or updates a dedicated partition with the
LAUNCH_ARTIFACTSfilesystem label containing the boot artifacts in an A/B directory structure. The command is idempotent and can be run multiple times safely.
You can integrate the attestation API into your own tools. See docs/api.md for details.
DATA_DIR: Root persistence directory (default:/data)
- Documentation: See
docs/directory for detailed documentation