Skip to content

Commit a6437d8

Browse files
authored
[202305] Support FIPS for armhf (sonic-net#18283)
* [Security] Fix the krb5 vulnerability issue (sonic-net#17914) ### Why I did it Fix the krb5 vulnerable issue CVE-2021-36222 allows remote attackers to cause a NULL pointer dereference and daemon crash CVE-2021-37750 NULL pointer dereference in kdc/do_tgs_req.c via a FAST inner body that lacks a server field DSA 5286-1 remote code execution ##### Work item tracking - Microsoft ADO **(number only)**: 26577929 #### How I did it Upgrade the krb5 version to 1.18.3-6+deb11u14+fips. * [Build] Fix krb5 package not found issue (sonic-net#17926) Why I did it Fix the build issue caused by the wrong version specified. See the build error logs: Try 4: /usr/bin/wget --retry-connrefused failed to get: -O --2024-01-26 11:38:23-- https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libk5crypto3_1.18.3-6+deb11u14+fips_amd64.deb Resolving sonicstorage.blob.core.windows.net (sonicstorage.blob.core.windows.net)... 20.60.59.131 Connecting to sonicstorage.blob.core.windows.net (sonicstorage.blob.core.windows.net)|20.60.59.131|:443... connected. HTTP request sent, awaiting response... 404 The specified blob does not exist. 2024-01-26 11:38:23 ERROR 404: The specified blob does not exist.. Try 5: /usr/bin/wget --retry-connrefused failed to get: -O make[1]: *** [Makefile:12: /sonic/target/debs/bullseye/symcrypt-openssl_0.10_amd64.deb] Error 8 make[1]: Leaving directory '/sonic/src/sonic-fips' Work item tracking Microsoft ADO (number only): 26577929 The package not installed but PR passed issue is traced in another issue sonic-net#17927 How I did it Add the libkrb5-dev and the depended packages to fix docker-sonic-vs build failure. The package libzmq3-dev has dependency on the libkrb5-dev. * [202305] Support FIPS for armhf * Remove no use mirror * Fix fips options issue
1 parent 524dea6 commit a6437d8

File tree

5 files changed

+27
-17
lines changed

5 files changed

+27
-17
lines changed

Makefile.work

+3-6
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ rules/config.user:
141141

142142
include rules/config
143143
-include rules/config.user
144+
include rules/sonic-fips.mk
144145

145146
ifneq ($(DEFAULT_CONTAINER_REGISTRY),)
146147
override DEFAULT_CONTAINER_REGISTRY := $(DEFAULT_CONTAINER_REGISTRY)/
@@ -177,12 +178,6 @@ endif
177178
SLAVE_IMAGE = $(SLAVE_BASE_IMAGE)-$(USER_LC)
178179
DOCKER_ROOT = $(PWD)/fsroot.docker.$(BLDENV)
179180

180-
# Support FIPS feature, armhf not supported yet
181-
ifeq ($(PLATFORM_ARCH),armhf)
182-
ENABLE_FIPS_FEATURE := n
183-
ENABLE_FIPS := n
184-
endif
185-
186181
ifeq ($(ENABLE_FIPS_FEATURE), n)
187182
ifeq ($(ENABLE_FIPS), y)
188183
$(error Cannot set fips config ENABLE_FIPS=y when ENABLE_FIPS_FEATURE=n)
@@ -216,6 +211,8 @@ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \
216211
DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) \
217212
DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
218213
GZ_COMPRESS_PROGRAM=$(GZ_COMPRESS_PROGRAM) \
214+
FIPS_VERSION=$(FIPS_VERSION) \
215+
FIPS_GOLANG_VERSION=$(FIPS_GOLANG_VERSION) \
219216
j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile)
220217

221218
$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \

platform/vs/docker-sonic-vs.mk

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ else
3434
$(DOCKER_SONIC_VS)_DEPENDS += $(GOBGP)
3535
endif
3636

37+
ifeq ($(ENABLE_FIPS_FEATURE), y)
38+
$(DOCKER_SONIC_VS)_DEPENDS += $(FIPS_KRB5_ALL)
39+
endif
40+
3741
$(DOCKER_SONIC_VS)_FILES += $(CONFIGDB_LOAD_SCRIPT) \
3842
$(ARP_UPDATE_SCRIPT) \
3943
$(ARP_UPDATE_VARS_TEMPLATE) \

platform/vs/docker-sonic-vs/Dockerfile.j2

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s
99
ENV DEBIAN_FRONTEND=noninteractive
1010

1111
RUN apt-get update && apt-get install -y gnupg
12-
COPY ["sonic-dev.gpg.key", "/etc/apt/"]
13-
RUN apt-key add /etc/apt/sonic-dev.gpg.key
14-
RUN echo "deb http://packages.microsoft.com/repos/sonic-dev/ jessie main" >> /etc/apt/sources.list
15-
RUN apt-get update
1612

1713
RUN apt-get install -y net-tools \
1814
arping \
@@ -42,7 +38,6 @@ RUN apt-get install -y net-tools \
4238
iptables \
4339
jq \
4440
libzmq5 \
45-
libzmq3-dev \
4641
uuid-dev \
4742
# For installing Python m2crypto package
4843
# (these can be uninstalled after installation)
@@ -68,7 +63,11 @@ RUN apt-get install -y net-tools \
6863
libasan6 \
6964
{%- endif %}
7065
dbus \
71-
redis-server
66+
redis-server \
67+
# For libkrb5-dev
68+
comerr-dev \
69+
libgssrpc4 \
70+
libkdb5-10
7271

7372
# For sonic-config-engine Python 3 package
7473
# Install pyangbind here, outside sonic-config-engine dependencies, as pyangbind causes enum34 to be installed.
@@ -92,6 +91,8 @@ COPY {%- for deb in docker_sonic_vs_debs.split(' ') %} debs/{{ deb }}{%- endfor
9291
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; {%- for deb in docker_sonic_vs_debs.split(' ') %} dpkg_apt /debs/{{ deb }};{%- endfor %}
9392
{%- endif %}
9493

94+
RUN apt-get install -y libzmq3-dev
95+
9596
{% if docker_sonic_vs_pydebs.strip() -%}
9697
# Copy locally-built Debian package dependencies
9798
COPY {%- for deb in docker_sonic_vs_pydebs.split(' ') %} python-debs/{{ deb }}{%- endfor %} /debs/

rules/sonic-fips.mk

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# fips packages
22

3-
FIPS_VERSION = 0.9
3+
FIPS_VERSION = 0.11
44
FIPS_OPENSSL_VERSION = 1.1.1n-0+deb11u5+fips
55
FIPS_OPENSSH_VERSION = 8.4p1-5+deb11u2+fips
66
FIPS_PYTHON_MAIN_VERSION = 3.9
77
FIPS_PYTHON_VERSION = 3.9.2-1+fips
88
FIPS_GOLANG_MAIN_VERSION = 1.15
99
FIPS_GOLANG_VERSION = 1.15.15-1~deb11u4+fips
10-
FIPS_KRB5_VERSION = 1.18.3-6+deb11u1+fips
10+
FIPS_KRB5_VERSION = 1.18.3-6+deb11u4+fips
1111
FIPS_URL_PREFIX = https://sonicstorage.blob.core.windows.net/public/fips/$(BLDENV)/$(FIPS_VERSION)/$(CONFIGURED_ARCH)
1212

1313
SYMCRYPT_OPENSSL_NAME = symcrypt-openssl
@@ -40,7 +40,15 @@ FIPS_GOLANG_DOC = golang-$(FIPS_GOLANG_MAIN_VERSION)-doc_$(FIPS_GOLANG_VERSION)_
4040
FIPS_GOLANG_ALL = $(FIPS_GOLANG) $(FIPS_GOLANG_GO) $(FIPS_GOLANG_SRC) $(FIPS_GOLANG_DOC)
4141

4242
FIPS_KRB5 = libk5crypto3_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
43-
FIPS_KRB5_ALL = $(FIPS_KRB5)
43+
FIPS_KRB5_SUPPORT0 = libkrb5support0_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
44+
FIPS_KRB5_3 = libkrb5-3_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
45+
FIPS_KRB5_LIBGSSAPI = libgssapi-krb5-2_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
46+
FIPS_KRB5_LIBKADM5CLNT = libkadm5clnt-mit12_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
47+
FIPS_KRB5_LIBKADM5SRV = libkadm5srv-mit12_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
48+
FIPS_KRB5_LIBGSSRPC4 = libgssrpc4_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
49+
FIPS_KRB5_MULTIDEV = krb5-multidev_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
50+
FIPS_KRB5_DEV = libkrb5-dev_$(FIPS_KRB5_VERSION)_$(CONFIGURED_ARCH).deb
51+
FIPS_KRB5_ALL = $(FIPS_KRB5) $(FIPS_KRB5_SUPPORT0) $(FIPS_KRB5_3) $(FIPS_KRB5_LIBGSSAPI) $(FIPS_KRB5_LIBKADM5CLNT) $(FIPS_KRB5_LIBKADM5SRV) $(FIPS_KRB5_LIBGSSRPC4) $(FIPS_KRB5_MULTIDEV) $(FIPS_KRB5_DEV)
4452

4553
FIPS_DERIVED_TARGET = $(FIPS_OPENSSL_ALL) $(FIPS_OPENSSH_ALL) $(FIPS_GOLANG_ALL) $(FIPS_PYTHON_ALL) $(FIPS_KRB5_ALL)
4654
FIPS_PACKAGE_ALL = $(SYMCRYPT_OPENSSL) $(FIPS_DERIVED_TARGET)

sonic-slave-bullseye/Dockerfile.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ RUN apt-get install -y kernel-wedge
474474
# For gobgp and telemetry build
475475
RUN apt-get install -y golang-1.15 && ln -s /usr/lib/go-1.15 /usr/local/go
476476
{%- if ENABLE_FIPS_FEATURE == "y" %}
477-
RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/{{ CONFIGURED_ARCH }}/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_{{ CONFIGURED_ARCH }}.deb' \
478-
&& wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/{{ CONFIGURED_ARCH }}/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_{{ CONFIGURED_ARCH }}.deb' \
477+
RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.15-go_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \
478+
&& wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.15-src_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \
479479
&& dpkg -i golang-go.deb golang-src.deb \
480480
&& ln -sf /usr/lib/go-1.15 /usr/local/go \
481481
&& rm golang-go.deb golang-src.deb

0 commit comments

Comments
 (0)