DirectorySecurity Advisories
Sign In
Directory
spiffe-helper-fips logoFIPS

spiffe-helper-fips

Last changed

Create your Free Account

Be the first to hear about exciting product updates, critical vulnerability alerts, compare alternative images, and more.

Sign Up
Versions
Overview
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Image for spiffe-helper-fips

A secure, minimal container image for the SPIFFE Helper utility that automates X.509 SVID certificate rotation for services that can't natively fetch X.509-SVIDs.

Chainguard Images are regularly-updated, minimal container images with low-to-zero CVEs.

Download this Image

This image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/spiffe-helper-fips:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard registry.

Compatibility Notes

This image is based on the upstream SPIFFE Helper utility, which automates X.509 SVID certificate rotation for services that can't natively fetch X.509-SVIDs. The image is built on Wolfi, providing regular security updates and a minimal attack surface. Additionally, Chainguard's SPIFFE Helper Fips image maintains compatibility with standard SPIFFE workload API socket locations, and is fully compatible with existing spiffe-helper configuration files.

FIPS Support

The spiffe-helper-fips Chainguard Image ships with a validated redistribution of the OpenSSL's FIPS provider module. For more on FIPS support in Chainguard Images, consult the guide on FIPS-enabled Chainguard Images on Chainguard Academy

Getting Started

The spiffe-helper-fips is designed to automate X.509-SVID certificate rotation for services. This guide demonstrates how to use the Chainguard SPIFFE-helper fips image with MySQL and SPIRE for secure TLS certificate management.

Start by cloning the Repository:

git clone https://github.com/spiffe/helm-charts-hardened.git
cd helm-charts-hardened/examples/mysql-using-spire

Then install SPIRE and its CRDs:

helm upgrade --install -n spire-server spire-crds spire-crds \
  --repo https://spiffe.github.io/helm-charts-hardened/ \
  --create-namespace --version 0.3.0

helm upgrade --install -n spire-server spire spire \
  --repo https://spiffe.github.io/helm-charts-hardened/ \
  --version 0.17.1 -f spire-values.yaml

Next, deploy the MySQL client:

kubectl apply -f mysqlclient-configmap.yaml
kubectl apply -f mysqlclient-statefulset.yaml

Wait for the client to be ready

kubectl wait pod mysqlclient-0 --for=condition=ready --timeout=60s

Retrieve the client's certificate x500UniqueIdentifier identifier:

# Run, and get the x500UniqueIdentifier value:
kubectl exec -it mysqlclient-0 -c main -- bash -c 'openssl x509 -in /certs/tls.crt -noout -text | grep Subject:'

Additionally, update the x500UniqueIdentifier in custom-mysql-values.yaml and replace the default ghcr.io/spiffe/spiffe-helper image with the Chainguard FIPS image:

cat > custom-mysql-values.yaml <<EOF
initdbScripts:
  usertls.sql: |
    CREATE USER 'mysqlclient'@'%' REQUIRE SUBJECT '/C=US/O=SPIRE/CN=mysqlclient.default.svc.cluster.local/x500UniqueIdentifier=a753b06724b81d4a2f14f615d40550ed';
    GRANT ALL PRIVILEGES ON *.* TO 'mysqlclient'@'%' WITH GRANT OPTION;

primary:
  extraFlags: "--ssl-ca=/certs/ca.pem --ssl-cert=/certs/tls.crt --ssl-key=/certs/tls.key --require-secure-transport=ON"

  initContainers: |
    - name: setup-helper-volume-p1
      image: busybox:1.36.1-uclibc
      imagePullPolicy: IfNotPresent
      command:
      - sh
      - -c
      - 'cp -a /bin/busybox /helper'
      securityContext: {{- omit .Values.primary.containerSecurityContext "enabled" | toYaml | nindent 8 }}
      volumeMounts:
      - name: spiffe-helper
        mountPath: /helper
    - name: setup-helper-volume-p2
      image: cgr.dev/chainguard/spiffe-helper-fips:latest
      imagePullPolicy: IfNotPresent
      command:
      - /helper/busybox
      - sh
      - -c
      - '/helper/busybox cp -a /spiffe-helper /helper && /helper/busybox rm -f /helper/busybox'
      securityContext: {{- omit .Values.primary.containerSecurityContext "enabled" | toYaml | nindent 8 }}
      volumeMounts:
      - name: spiffe-helper
        mountPath: /helper
    - name: init-tls
      image: cgr.dev/chainguard/spiffe-helper-fips:latest
      imagePullPolicy: Always
      command:
      - /spiffe-helper
      - -config
      - /etc/spiffe-helper.conf
      - -daemon-mode=false
      securityContext: {{- omit .Values.primary.containerSecurityContext "enabled" | toYaml | nindent 8 }}
      volumeMounts:
      - name: spiffe-workload-api
        mountPath: /spiffe-workload-api
        readOnly: true
      - name: spiffe-helper-configmap
        mountPath: /etc/spiffe-helper.conf
        subPath: spiffe-helper.conf
        readOnly: true
      - name: certdir
        mountPath: /certs

  sidecars: |
    - name: refresh-tls
      image: {{  include "mysql.image" . }}
      imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
      command:
      - /helper/spiffe-helper
      - -config
      - /etc/spiffe-helper.conf
      env:
      - name: MYSQL_PWD
        valueFrom:
          secretKeyRef:
            name: {{ template "mysql.secretName" . }}
            key: mysql-root-password
      securityContext: {{- omit .Values.primary.containerSecurityContext "enabled" | toYaml | nindent 8 }}
      volumeMounts:
      - name: spiffe-workload-api
        mountPath: /spiffe-workload-api
        readOnly: true
      - name: spiffe-helper-configmap
        mountPath: /etc/spiffe-helper.conf
        subPath: spiffe-helper.conf
        readOnly: true
      - name: certdir
        mountPath: /certs
      - name: spiffe-helper
        mountPath: /helper
      - name: mysql-sockdir
        mountPath: /opt/bitnami/mysql/tmp

  extraVolumeMounts:
  - name: certdir
    mountPath: /certs
  - name: mysql-sockdir
    mountPath: /opt/bitnami/mysql/tmp

  extraVolumes: |
    - name: certdir
      emptyDir: {}
    - name: spiffe-helper
      emptyDir: {}
    - name: mysql-sockdir
      emptyDir: {}
    - name: spiffe-helper-configmap
      configMap:
        name: {{ include "mysql.primary.fullname" . }}-spiffe-helper
    - name: spiffe-workload-api
      csi:
        driver: "csi.spiffe.io"
        readOnly: true
EOF

Following that, deploy MySQL with the above configuration:

helm upgrade --install mysql mysql \
  --version 9.15.0 \
  --repo https://charts.bitnami.com/bitnami \
  -f custom-mysql-values.yaml

Wait for MySQL to be ready

kubectl wait pod mysql-0 --for=condition=ready --timeout=60s

Now that it's running, you can test the connection:

kubectl exec -it mysqlclient-0 -- bash -c \
  'mysql -u mysqlclient --protocol tcp \
   --ssl-key /certs/tls.key \
   --ssl-cert /certs/tls.crt \
   --ssl-ca /certs/ca.pem \
   -h mysql.default.svc.cluster.local'

If everything is working as expected, the mysql> prompt will appear in your terminal:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.35 Source distribution

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Documentation and Resources:

Contact Support

If you have a Zendesk account (typically set up for you by your Customer Success Manager) you can reach out to Chainguard's Customer Success team through our Zendesk portal.

What are Chainguard Images?

Chainguard Images are a collection of container images designed for security and minimalism.

Many Chainguard Images are distroless; they contain only an open-source application and its runtime dependencies. These images do not even contain a shell or package manager. Chainguard Images are built with Wolfi, our Linux undistro designed to produce container images that meet the requirements of a secure software supply chain.

The main features of Chainguard Images include:

-dev Variants

As mentioned previously, Chainguard’s distroless Images have no shell or package manager by default. This is great for security, but sometimes you need these things, especially in builder images. For those cases, most (but not all) Chainguard Images come paired with a -dev variant which does include a shell and package manager.

Although the -dev image variants have similar security features as their distroless versions, such as complete SBOMs and signatures, they feature additional software that is typically not necessary in production environments. The general recommendation is to use the -dev variants only to build the application and then copy all application artifacts into a distroless image, which will result in a final container image that has a minimal attack surface and won’t allow package installations or logins.

That being said, it’s worth noting that -dev variants of Chainguard Images are completely fine to run in production environments. After all, the -dev variants are still more secure than many popular container images based on fully-featured operating systems such as Debian and Ubuntu since they carry less software, follow a more frequent patch cadence, and offer attestations for what they include.

Learn More

To better understand how to work with Chainguard Images, we encourage you to visit Chainguard Academy, our documentation and education platform.

Licenses

Chainguard Images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" version of this image:

  • Apache-2.0

  • GCC-exception-3.1

  • GPL-3.0-or-later

  • LGPL-2.1-or-later

  • MIT

  • MPL-2.0

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Compliance

This is a FIPS validated image for FedRAMP compliance.

This image is STIG hardened and scanned against the DISA General Purpose Operating System SRG with reports available.

Learn more about STIGsGet started with STIGs

Related images

Category
FIPS
STIG
application

Safe Source for Open Sourceâ„¢
Media KitContact Us
© 2024 Chainguard. All Rights Reserved.
Private PolicyTerms of Use

Product

Chainguard Images