Skip to content

Shibd

The shibd image is built from ContainerFiles/shibd. This image has no dedicated CVE script; security updates are included during the build.

This container packages the Shibd service for use in the stack. The build installs the required packages, applies security updates and configuration, and prepares the service for integration.

graph LR
    A[Base image] --> B[Install packages]
    B --> C[Apply CVE patches]
    C --> D[Configure Shibd]
    D --> E[Container ready]
ContainerFile used for the build
# syntax=docker/dockerfile:1

ARG DEBIAN_IMAGE=debian:trixie-slim

FROM ${DEBIAN_IMAGE} AS shibboleth_build
ARG SHIBBOLETH_SP_UPSTREAM_VERSION=3.5.2+dfsg
ARG SHIBBOLETH_SP_SOURCE_VERSION=3.5.2+dfsg-1
ARG SHIBBOLETH_SP_PACKAGE_VERSION=3.5.2+dfsg-1+genestack2
ARG SHIBBOLETH_SP_DSC_SHA256=00e3b12e2da0e9240358c8e05c6f2d2ae7c413fd6175da5305ae4cc13f7d320a
ARG SHIBBOLETH_SP_ORIG_SHA256=b945e9eb218d3679dbb390df1a2c16678e5679b269c728b7d08dc7b02487b03a
ARG SHIBBOLETH_SP_DEBIAN_SHA256=8dce4a8d7fe513984dd7c82981a16885517313963f78b066d3b70df36e6114e2

RUN export DEBIAN_FRONTEND=noninteractive \
  && apt-get update \
  && apt-get install --no-install-recommends -y \
                                             apache2-dev \
                                             build-essential \
                                             ca-certificates \
                                             curl \
                                             cxxtest \
                                             debhelper-compat \
                                             devscripts \
                                             dh-apache2 \
                                             doxygen \
                                             graphviz \
                                             libboost-dev \
                                             libfcgi-dev \
                                             libkrb5-dev \
                                             liblog4shib-dev \
                                             libmemcached-dev \
                                             libsaml-dev \
                                             libsystemd-dev \
                                             libxerces-c-dev \
                                             libxml-security-c-dev \
                                             libxmltooling-dev \
                                             opensaml-schemas \
                                             patch \
                                             pkgconf \
                                             unixodbc-dev \
                                             xmltooling-schemas \
                                             xz-utils \
  && rm -rf /var/lib/apt/lists/*

WORKDIR /build
RUN curl -fsSLO "https://deb.debian.org/debian/pool/main/s/shibboleth-sp/shibboleth-sp_${SHIBBOLETH_SP_SOURCE_VERSION}.dsc" \
  && curl -fsSLO "https://deb.debian.org/debian/pool/main/s/shibboleth-sp/shibboleth-sp_${SHIBBOLETH_SP_UPSTREAM_VERSION}.orig.tar.xz" \
  && curl -fsSLO "https://deb.debian.org/debian/pool/main/s/shibboleth-sp/shibboleth-sp_${SHIBBOLETH_SP_SOURCE_VERSION}.debian.tar.xz" \
  && printf '%s  %s\n' \
       "${SHIBBOLETH_SP_DSC_SHA256}" "shibboleth-sp_${SHIBBOLETH_SP_SOURCE_VERSION}.dsc" \
       "${SHIBBOLETH_SP_ORIG_SHA256}" "shibboleth-sp_${SHIBBOLETH_SP_UPSTREAM_VERSION}.orig.tar.xz" \
       "${SHIBBOLETH_SP_DEBIAN_SHA256}" "shibboleth-sp_${SHIBBOLETH_SP_SOURCE_VERSION}.debian.tar.xz" \
     | sha256sum --check --strict \
  && dpkg-source --extract "shibboleth-sp_${SHIBBOLETH_SP_SOURCE_VERSION}.dsc"

COPY scripts/shibboleth-sp-3.5.2-memcache-connection-retry.patch /tmp/
WORKDIR /build/shibboleth-sp-${SHIBBOLETH_SP_UPSTREAM_VERSION}
RUN patch --batch --forward --fuzz=0 -p1 < /tmp/shibboleth-sp-3.5.2-memcache-connection-retry.patch \
  && grep -Fq 'retryDelays[] = { 100, 250, 500 }' memcache-store/memcache-store.cpp \
  && test "$(grep -Fc 'replaceClient("' memcache-store/memcache-store.cpp)" -eq 5 \
  && DEBFULLNAME="Rackspace Technology" DEBEMAIL="ODE@rackspace.com" \
     dch --newversion "${SHIBBOLETH_SP_PACKAGE_VERSION}" --distribution unstable \
         "Retry memcache operations after disconnected servers." \
  && dpkg-buildpackage --build=binary --no-sign -j"$(nproc)" \
  && mkdir -p /packages \
  && cp ../libshibsp12_*.deb \
        ../libshibsp-plugins_*.deb \
        ../shibboleth-sp-common_*.deb \
        ../shibboleth-sp-utils_*.deb \
        /packages/ \
  && test "$(find /packages -maxdepth 1 -name '*.deb' | wc -l)" -eq 4

FROM ${DEBIAN_IMAGE}
ARG CACHEBUST=0
ARG SHIBBOLETH_SP_PACKAGE_VERSION=3.5.2+dfsg-1+genestack2
LABEL maintainer="Rackspace"
LABEL vendor="Rackspace OpenStack Team"
LABEL org.opencontainers.image.name="shibd"
LABEL org.opencontainers.image.version="${SHIBBOLETH_SP_PACKAGE_VERSION}"
LABEL org.opencontainers.image.shibboleth.patch="memcache-connection-retry"

COPY --from=shibboleth_build /packages/ /tmp/shibboleth-packages/
RUN export DEBIAN_FRONTEND=noninteractive \
  && echo "Build revision: ${CACHEBUST}" \
  && apt-get update \
  && apt-get upgrade -y \
  && apt-get install --no-install-recommends -y \
                                             iproute2 \
                                             /tmp/shibboleth-packages/*.deb \
  && for package in shibboleth-sp-common libshibsp12 libshibsp-plugins shibboleth-sp-utils; do \
       test "$(dpkg-query -W -f='${Version}' "${package}")" = "${SHIBBOLETH_SP_PACKAGE_VERSION}"; \
     done \
  && plugin="$(find /usr/lib -path '*/shibboleth/memcache-store.so' -print -quit)" \
  && test -n "${plugin}" \
  && test -f "${plugin}" \
  && grep -aFq 'connection failed, retry %u/%u in %u ms' "${plugin}" \
  && grep -aFq 'recovered after %u retry attempt%s' "${plugin}" \
  && ldd "${plugin}" > /tmp/memcache-store.ldd \
  && ! grep -q 'not found' /tmp/memcache-store.ldd \
  && cat /tmp/memcache-store.ldd \
  && sed -i 's@fileName=.*@fileName=/dev/stdout@g' /etc/shibboleth/*.logger \
  && printf '\n========================================================================\n Installed Shibboleth SP packages\n========================================================================\n' \
  && dpkg-query -W -f '${Package} ${Version} (${Architecture})\n' \
       shibboleth-sp-common libshibsp12 libshibsp-plugins shibboleth-sp-utils \
  && printf '========================================================================\n' \
  && shibd -v \
  && printf '========================================================================\n\n' \
  && apt-get clean -y \
  && rm -rf /var/lib/apt/lists/* \
            /tmp/memcache-store.ldd \
            /tmp/shibboleth-packages

USER 42424:42424
ENTRYPOINT ["/usr/sbin/shibd"]

Build Arguments

Argument Default
CACHEBUST 0
Build Command
docker build \
--build-arg CACHEBUST=0 \
-f ContainerFiles/shibd \
-t shibd:local \
.

Dependencies

Container Image

The container image is available on Github Container Registry.