Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Resources to explore

Check out popular resources, tools, and information from Red Hat. We'll recommend more as you browse.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

Deploying a sealed image mode system on AWS with secure boot

Establishing a hardware-anchored chain of trust on AWS

December 3, 2026
John Eckersberg
Related topics:
Containers
Related products:
Red Hat Enterprise Linux

    A sealed image mode system gives you something unusual: Cryptographic verification of every file on the root filesystem, anchored all the way back to UEFI firmware. If you've followed the bootc sealed images blog series, then you've seen how the chain of trust works and how to build and test a sealed image locally with bcvk. This article takes the next step: Deploying that same sealed image to AWS EC2 with your own custom UEFI secure boot keys.

    The challenge is that AWS handles UEFI firmware differently than a local VM. You can't just hand EC2 an OVMF variables file the way bcvk uses virt-fw-vars. Instead, you need to build a UEFI variable store blob offline and pass it to AWS when registering your AMI. This article walks through that workflow end to end, from building an AWS-specific image to verifying that composefs is enforcing verity=require on a running EC2 instance.

    What's different about AWS

    If you've been testing sealed images locally with bcvk, 3 things change when you move to AWS EC2:

    • Console device: EC2 x86_64 instances use ttyS0 for their serial console, not the virtio hvc0 that QEMU and bcvk use. Since the console kernel argument is baked into the signed UKI at build time, this means building a separate image for AWS. The example Containerfile is parameterized with build ARGs so you can produce both variants from a single file.
    • SSH access: bcvk injects SSH keys as systemd credentials with SMBIOS. EC2 uses instance metadata instead, which means the image needs cloud-init to pick up SSH keys at boot. This is another build ARG that adds cloud-init to the sealed rootfs for the AWS variant.
    • UEFI Secure Boot key enrollment: This is the big one. When bcvk creates a local VM, it uses virt-fw-vars to inject your PK, KEK, and db certificates directly into the OVMF firmware variables. EC2 doesn't expose its firmware that way. Instead, AWS supports passing a pre-built UEFI variable store blob when you register an AMI using aws ec2 register-image. You build this blob offline using python-uefivars from AWS Labs. The key management post covers the UEFI key hierarchy in detail if you need a refresher on platform key (PK), key exchange key (KEK), and signature database (db).

    Prerequisites

    You need an AWS account with credentials configured (aws sts get-caller-identity is enough). Your build host also needs a Red Hat subscription visible to Podman, because the image build pulls packages from Red Hat Enterprise Linux (RHEL) repositories inside the container. A no-cost developer subscription is sufficient.

    Install the required tools:

    • Podman
    • OpenSSL
    • just
    • bcvk (for disk image creation)
    • aws
    • jq
    • coldsnap (for uploading disk images as EBS snapshots, using cargo install –locked coldsnap)
    • cert-to-efi-sig-list from efitools
    • python-uefivars

    Clone the examples repository at the aws-sealing tag to follow along:

    $ git clone --branch aws-sealing \ https://github.com/redhat-cop/rhel-bootc-examples.git$ cd rhel-bootc-examples/sealing

    The Justfile includes a _check-aws-deps recipe to validate that all tools and credentials are present before any AWS recipe runs, so you get clear error messages if anything is missing.

    The workflow

    The AWS test is structured as a chain of idempotent Justfile recipes, each building on the previous:

    1. Keygen
    2. aws-build
    3. aws-disk
    4. aws-snapshot
    5. aws-register
    6. aws-launch
    7. aws-test

    After just keygen, a single command does the rest. You can run just aws-test to execute the entire chain, or run any step individually. Each recipe checks whether its output already exists before doing work, so if a step fails partway through, re-running resumes from the point of failure.

    Build the AWS image

    Start by generating secure boot keys if you haven't already:

    just keygen

    Then build the AWS-specific image:

    just aws-build

    This runs podman build with 2 build ARGs that differentiate it from the local image:

    • console_kargs="console=ttyS0,115200" targets the EC2 serial console
    • extra_packages="cloud-init" enables SSH key injection with instance metadata

    The resulting image uses the same multi-stage Containerfile as the local variant. The signed UKI contains a different composefs digest because the filesystem now includes cloud-init, but the security model is identical: Your db key signs both systemd-boot and the UKI, and the composefs digest embedded in the UKI covers every file on the root filesystem. The building a sealed image post covers this build process in detail.

    Create the disk image and upload as an EBS snapshot

    With the container image built, create a raw disk image:

    just aws-disk

    This calls bcvk to-disk to install the container image onto a raw disk with an ext4 root filesystem. Ext4 is required here because the default XFS does not support fs-verity. The output is target/aws-disk.raw.

    Next, upload the disk directly as an EBS snapshot:

    just aws-snapshot

    This uses coldsnap, a command from AWS Labs that uploads a disk image directly as an EBS snapshot.

    Enroll secure boot keys and register the AMI

    This is the AWS-specific piece that has no equivalent in the local bcvk workflow. Register an AMI from the snapshot with your custom secure boot keys enrolled:

    just aws-register

    AWS documents 2 approaches for creating an AMI with UEFI Secure Boot:

    • Enrolling keys from inside a running instance
    • Providing a pre-built variable store blob at AMI registration time

    This recipe uses a pre-built variable store. Because we sign our boot images at build time, they are already signed before enrollment, satisfying that option's requirement.

    The recipe converts your PEM certificates to EFI signature lists using cert-to-efi-sig-list:

    cert-to-efi-sig-list -g "$(cat target/keys/GUID.txt)" target/keys/PK.crt  PK.esl
    cert-to-efi-sig-list -g "$(cat target/keys/GUID.txt)" target/keys/KEK.crt KEK.esl
    cert-to-efi-sig-list -g "$(cat target/keys/GUID.txt)" target/keys/db.crt  db.esl

    Then it assembles them into an AWS-format UEFI variable store blob using python-uefivars:

    uefivars -i none -o aws -O target/uefi-data.bin -P PK.esl -K KEK.esl --db db.esl

    Finally, it registers the AMI with the blob:

    aws ec2 register-image \
        --boot-mode uefi \
        --uefi-data "$(cat target/uefi-data.bin)" \
        --block-device-mappings "DeviceName=/dev/sda1,Ebs={SnapshotId=snap-xxx,...}" \
        ...

    The --uefi-data parameter populates the instance's UEFI firmware variable store with your PK, KEK, and db certificates. When the instance boots, the firmware is in user mode with secure boot enforced, and it only loads boot binaries signed by your db key. Only your db certificate is enrolled. There is no Microsoft UEFI CA and the dbx (revocation list) is empty, so the instance exclusively boots binaries you have signed. Without this step, the firmware would be in setup mode, and secure boot wouldn't be enforced.

    Launch and verify

    With the AMI registered, launch an instance and verify the seal:

    just aws-launch

    This creates an ephemeral EC2 key pair and security group, launches the instance, and waits for SSH to become available. All created resource IDs are tracked in target/aws-resources.json for cleanup.

    Then run the verification:

    just aws-test

    The test SSHes into the instance and checks 4 things:

    --- kernel ---
    6.12.0-211.73.1.el10_2.x86_64
    --- secure boot ---
      Secure Boot: enabled (user)
      OK: Secure Boot is enabled
    --- root mount ---
    composefs:aee2f550... on / type overlay (ro,verity=require,...)
      OK: composefs root with verity=require
    --- cmdline ---
    composefs=aee2f550... rw console=ttyS0,115200 ...
    
    === COMPOSEFS BOOT VERIFIED (AWS) ===

    The secure boot check confirms that the UEFI firmware is in user mode and enforcing signature verification. It only loads boot binaries signed by your db key. The verity=require in the root mount confirms that the kernel is verifying every file read against its fs-verity digest. And the composefs=<digest> in the kernel command line confirms that the UKI delivered the correct digest to the initramfs. The deploying and verifying post covers these same checks for local VMs.

    After verification, aws-test automatically tears down all AWS resources with a trap. If you need to clean up manually (for example, after an aws-ssh session), run just aws-clean.

    Running the full flow

    For a complete end-to-end test, after generating keys with just keygen, a single command does the rest:

    just aws-test

    If any step fails, re-run the same command. The recipes check for existing outputs (disk image, snapshot, AMI, running instance) and skip completed steps. This makes the workflow resilient to transient failures.

    Several environment variables let you customize the behavior:

    AWS_REGION

    • Default: From aws configure
    • Description: AWS region for all operations

    AWS_INSTANCE_TYPE

    • Default: m5.large
    • Description: EC2 instance type (must support UEFI)

    AWS_SUBNET_ID

    • Default: Default VPC subnet
    • Description: Subnet to launch in

    AWS_SECURITY_GROUP_ID

    • Default: Auto-created
    • Description: Security group with SSH access

    AWS_SSH_USER

    • Default: cloud-user
    • Description: SSH username (cloud-init default for RHEL)

    Wrapping up

    The same chain of trust that works on a local VM now runs on AWS EC2. The UEFI firmware verifies systemd-boot against your enrolled db certificate. systemd-boot loads the signed UKI, which carries the composefs digest in its kernel command-line. The initramfs mounts the root as a composefs overlay with verity=require. Every subsequent file read is verified by the kernel against its fs-verity digest. A tampered file returns an I/O error – corrupted data is never served to userspace.

    The examples repository provides the full workflow in a set of composable, resumable Justfile recipes. For the foundational concepts, start with the sealed images blog series. To learn more about how image mode for RHEL delivers container-native OS management, see the RHEL image mode product page.

    Related Posts

    • Build bootable image mode for Red Hat Enterprise Linux with image builder

    • Provisioning image mode for Red Hat Enterprise Linux using Red Hat Satellite

    • Building Red Hat MCP-ready images with image mode for Red Hat Enterprise Linux

    • Bootable containers: Reduce friction with Red Hat Enterprise Linux image mode

    • Red Hat Enterprise Linux 10 Developer Preview for RISC-V updates to 10.3

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    Recent Posts

    • Deploying a sealed image mode system on AWS with secure boot

    • Resource management and capacity management on Red Hat OpenShift Virtualization

    • Layered defense in Red Hat Enterprise Linux

    • Kafka Monthly Digest: November 2026

    • Securing AI agent tool calls at the gateway with NeMo Guardrails

    What’s up next?

    Learning Path Image mode for Red Hat Enterprise Linux share and feature image

    Build a hardened Flask stack and deploy it in image mode for Red Hat Enterprise Linux

    Build a Python Flask application on Red Hat Enterprise Linux 10 using...
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI