Skip to content

Commit b8227ae

Browse files
committed
[signer] Remove non-signing tools from the signing container
The signing container was originally envisioned to cover both signing and odd small tasks (such as constructing multi-architecture ISO and USB disk images) that did not justify a dedicated container image. The architecture-independent utility toolchain is better placed to handle these odd small tasks, and removing this responsibility from the signing container allows us to reduce the attack surface by removing unnecessary packages. Strip out packages that are not required for signing, and update the checker to verify that signing a binary (with a locally generated test certificate) works as expected. Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
1 parent 2efe5b4 commit b8227ae

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

signer/Dockerfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,24 @@ FROM fedora:${FEDORA} AS signer
99
RUN echo "install_weak_deps=False" >> /etc/dnf/dnf.conf \
1010
&& dnf update -y \
1111
&& dnf install -y \
12-
genisoimage \
13-
mtools \
1412
opensc \
1513
openssl \
1614
openssl-pkcs11 \
1715
osslsigncode \
1816
pkcs11-provider \
19-
syslinux \
2017
&& dnf clean all -y
2118

2219
FROM signer AS check-signer
2320

2421
RUN dnf install -y \
25-
libcdio \
2622
shim-x64 \
2723
&& dnf clean all -y
2824

29-
RUN ln -s /bin/true dummy.lkrn
30-
31-
RUN ln -s /boot/efi/EFI/BOOT/BOOTX64.EFI dummy.efi
32-
33-
ADD https://github.com/ipxe/ipxe.git /ipxe
34-
35-
CMD /ipxe/src/util/genfsimg -o dummy.iso dummy.lkrn dummy.efi && \
36-
iso-info dummy.iso
25+
CMD openssl req -newkey rsa:2048 -nodes -keyout test.key \
26+
-subj '/CN=test/' -x509 -out test.crt && \
27+
osslsigncode sign -certs test.crt -key test.key \
28+
-in /boot/efi/EFI/BOOT/BOOTX64.EFI -out test.efi && \
29+
osslsigncode verify -CAfile test.crt test.efi
3730

3831
#
3932
# Service container for pcscd

0 commit comments

Comments
 (0)