GHOSTby AlphaBravo
CatalogWhy GhostContactAccount
Ghost Container Registry — Secure, signed, FIPS-ready images·Built by AlphaBravo
Catalog/ktls-utils/Guides

ktls-utils

FIPS 140-3Networking

Handshake service for kernel TLS consumers

OverviewGuidesTags

Quick Start

Pull the latest version of this image from the Ghost registry. Pulling requires authentication — generate a token and run docker login first (see Authentication below).

Authentication

The Ghost catalog is public to browse, but pulling images requires an account. Generate a pull token below (or from your Account → Tokens page) — you'll get a ready-to-paste docker login command, then docker pull works.

The username is generated automatically (it looks like robot$<project>+<auto-id>, not the name you typed) and is included in the docker login command above. The secret is shown only once when you create the token.

Verify Signature

All Ghost images are signed with cosign. Verifying the signature before deployment ensures the image has not been tampered with.

Install cosign via brew install cosign or download from the Sigstore releases page.

Using This Image

Reference this image in your Dockerfile as a base layer:

FIPS 140-3 Compliance

This is a vendor-built FIPS-enabled image: its cryptography runs on FIPS 140-3 validated modules configured by the upstream vendor. You can inspect the image metadata:

StandardFIPS 140-3
Crypto moduleVendor-configured validated modules
CryptographyValidated modules only
Use caseGovernment, regulated industries, compliance workloads

Additional Notes

How to use this image

All examples in this guide use the public image. If you've mirrored the repository for your own use (for example, to your Docker Hub namespace), update your commands to reference the mirrored image instead of the public one.

For example:

  • Public image: registry.ghost-prod.alphabravo.io/ghost-base/<repository>:<tag>
  • Mirrored image: <your-namespace>/dhi-<repository>:<tag>

For the examples, you must first use docker login registry.ghost-prod.alphabravo.io to authenticate to the registry to pull the images.

Start a tlshd instance

Run the following command to start tlshd. Replace <tag> with the image variant you want to run.

docker run -d --name tlshd \
  --privileged \
  --network host \
  registry.ghost-prod.alphabravo.io/ghost-base/ktls-utils:<tag>

Important notes:

  • The --privileged flag is required because tlshd needs to interact with kernel netlink sockets and manage kernel TLS sessions

On this page

Quick StartAuthenticationVerify SignatureUsing This ImageFIPS ComplianceAdditional Notes
  • The --network host flag is typically required because tlshd operates on kernel sockets
  • Mount your tlshd configuration directory to /etc/tlshd for custom configuration
  • Common ktls-utils use cases

    Basic tlshd daemon with default configuration

    Start tlshd with a minimal /etc/tlshd/config configuration file:

    # Create a minimal config
    mkdir -p /etc/tlshd
    cat > /etc/tlshd/config << 'EOF'
    [debug]
    loglevel = 0
    tls = 0
    nl = 0
    
    [authenticate]
    keyrings =
    EOF
    
    # Run tlshd
    docker run -d --name tlshd \
      --privileged \
      --network host \
      -v /etc/tlshd:/etc/tlshd:ro \
      registry.ghost-prod.alphabravo.io/ghost-base/ktls-utils:<tag>
    

    Docker Official Images vs. Ghost hardened images

    Key differences

    FeatureStandard Linux PackageDocker Hardened ktls-utils
    SecurityStandard system packagesMinimal, hardened base with security patches
    Shell accessFull shell availableNo shell in runtime variants
    Package managerapt/yum availableNo package manager in runtime variants
    UserRuns as root via systemdRuns as nonroot user
    Attack surfaceLarger due to system utilitiesMinimal, only essential components
    DebuggingTraditional shell debuggingUse Docker Debug or Image Mount for troubleshooting
    Configuration/etc/tlshd/configSame configuration file location

    Why no shell or package manager?

    Ghost hardened images prioritize security through minimalism:

    • Reduced attack surface: Fewer binaries mean fewer potential vulnerabilities
    • Immutable infrastructure: Runtime containers shouldn't be modified after deployment
    • Compliance ready: Meets strict security requirements for regulated environments

    The hardened images intended for runtime don't contain a shell nor any tools for debugging. Common debugging methods for applications built with Ghost hardened images include:

    • Docker Debug to attach to containers
    • Docker's Image Mount feature to mount debugging tools
    • Container logs via docker logs

    For example, you can use Docker Debug:

    docker debug tlshd
    

    or mount debugging tools with the Image Mount feature:

    docker run --rm -it --pid container:tlshd \
      --mount=type=image,source=registry.ghost-prod.alphabravo.io/ghost-base/busybox:1,destination=/dbg,ro \
      registry.ghost-prod.alphabravo.io/ghost-base/ktls-utils:<tag> /dbg/bin/sh
    

    Image variants

    Ghost hardened images come in different variants depending on their intended use.

    Runtime variants are designed to run your application in production. These images are intended to be used either directly or as the FROM image in the final stage of a multi-stage build. These images typically:

    • Run as the nonroot user
    • Do not include a shell or a package manager
    • Contain only the minimal set of libraries needed to run tlshd

    Build-time variants typically include dev in the variant name and are intended for use in the first stage of a multi-stage Dockerfile. These images typically:

    • Run as the root user
    • Include a shell and package manager
    • Are used to build or compile applications

    FIPS variants

    FIPS variants include fips in the variant name and tag. They come in both runtime and build-time variants. These variants use cryptographic modules that have been validated under FIPS 140, a U.S. government standard for secure cryptographic operations. Docker Hardened ktls-utils images include FIPS-compliant variants for environments requiring Federal Information Processing Standards compliance.

    Migrate to a Ghost hardened image

    To migrate your tlshd deployment to a Ghost hardened image, you must update your deployment configuration. At minimum, you must update the container image reference to a Ghost hardened image. This and a few other common changes are listed in the following table of migration notes:

    ItemMigration note
    Base imageReplace your container images with a Ghost hardened image.
    Package managementNon-dev images, intended for runtime, don't contain package managers. Use package managers only in images with a dev tag.
    Nonroot userBy default, non-dev images, intended for runtime, run as a nonroot user. However, tlshd requires privileged access to kernel netlink sockets, so you must run with --privileged flag.
    ConfigurationMount your configuration directory to /etc/tlshd. The configuration file format is identical to the standard ktls-utils package.
    TLS certificatesGhost hardened images contain standard TLS certificates by default. Mount your own certificates and configure them in /etc/tlshd/config.
    Network modetlshd typically requires --network host to access kernel sockets directly.
    Entry pointDocker Hardened ktls-utils maintains the same tlshd command-line options as the standard package.
    No shellBy default, non-dev images, intended for runtime, don't contain a shell. Use dev images in build stages to run shell commands and then copy artifacts to the runtime stage.

    The following steps outline the general migration process.

    1. Prepare your configuration.

      Ensure you have a valid tlshd configuration file at /etc/tlshd/config on your host system. Review the configuration file reference section above for available options.

    2. Prepare certificates (if using x.509 authentication).

      Place your certificates and private keys in a directory that you'll mount into the container. Update your configuration file to reference the paths where these files will be mounted.

    3. Update your container deployment.

      Replace your existing tlshd container with the Ghost hardened image:

      docker run -d --name tlshd \
        --privileged \
        --network host \
        -v /etc/tlshd:/etc/tlshd:ro \
        registry.ghost-prod.alphabravo.io/ghost-base/ktls-utils:<tag>
      
    4. Verify operation.

      Check the container logs to ensure tlshd started successfully:

      docker logs tlshd
      

      You should see log messages indicating that tlshd is listening for netlink messages from the kernel.

    Troubleshooting migration

    The following are common issues that you may encounter during migration.

    General debugging

    The hardened images intended for runtime don't contain a shell nor any tools for debugging. The recommended method for debugging applications built with Ghost hardened images is to use Docker Debug to attach to these containers. Docker Debug provides a shell, common debugging tools, and lets you install other tools in an ephemeral, writable layer that only exists during the debugging session.

    For tlshd-specific debugging:

    # View logs
    docker logs tlshd
    
    # Run with debug output to stderr
    docker run -d --name tlshd \
      --privileged \
      --network host \
      -v /etc/tlshd:/etc/tlshd:ro \
      registry.ghost-prod.alphabravo.io/ghost-base/ktls-utils:<tag> \
      tlshd --stderr
    

    Permissions

    By default, image variants intended for runtime run as the nonroot user. However, tlshd requires privileged access to kernel netlink sockets and must run with the --privileged flag to function correctly.

    Configuration file errors

    tlshd will exit immediately if /etc/tlshd/config does not exist or is malformed. Ensure your configuration file:

    • Is mounted to the correct path (/etc/tlshd/config)
    • Has correct syntax (INI-style format)
    • References valid paths for certificates and keys
    • Is readable by the container user

    Kernel requirements

    tlshd requires Linux kernel 6.5 or later with the following CONFIG options enabled:

    • CONFIG_TLS
    • CONFIG_KEYS
    • CONFIG_KEYS_REQUEST_CACHE

    Verify your kernel supports net/handshake:

    # Check kernel version
    uname -r
    
    # Check if /proc/net/handshake exists
    ls /proc/net/handshake 2>/dev/null || echo "Kernel handshake support not available"
    

    Certificate and keyring issues

    If tlshd cannot access certificates or keyrings:

    • Verify certificate files are mounted and readable
    • Check file paths in /etc/tlshd/config match mounted locations
    • Ensure certificate files are in PEM format
    • Verify private key permissions are appropriate

    No shell

    By default, image variants intended for runtime don't contain a shell. Use dev images in build stages to run shell commands and then copy any necessary artifacts into the runtime stage. In addition, use Docker Debug to debug containers with no shell.

    Entry point

    Docker Hardened ktls-utils maintains the same entry point and command-line options as the standard ktls-utils package. Use docker inspect to inspect entry points for Ghost hardened images if necessary.