@@ -98,22 +98,28 @@ RUN apt-get update \
9898 wireshark-common \
9999 freeradius \
100100 quilt \
101- {% if CONFIGURED_ARCH == "armhf" %}
102- && GRPCURL_ARCH=linux_armv6 \
103- {% elif CONFIGURED_ARCH == "arm64" %}
104- && GRPCURL_ARCH=linux_arm64 \
105- {% else %}
106- && GRPCURL_ARCH=linux_x86_64 \
107- {% endif %}
108- && GRPCURL_VERSION=1.9.3 && \
109- curl -L "https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz" \
110- -o /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
111- cd /tmp && \
112- tar xvf grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
113- mv grpcurl /usr/local/bin/grpcurl && \
114- chmod +x /usr/local/bin/grpcurl && \
115- rm -f /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
116- rm -rf /var/lib/apt/lists/*
101+ && rm -rf /var/lib/apt/lists/*
102+
103+ # Install Go toolchain for building grpcurl and gnoic from source
104+ # to ensure they use a patched Go stdlib (GO-2026-4337: crypto/tls)
105+ {% if CONFIGURED_ARCH == "armhf" %}
106+ RUN GO_ARCH=armv6l \
107+ {% elif CONFIGURED_ARCH == "arm64" %}
108+ RUN GO_ARCH=arm64 \
109+ {% else %}
110+ RUN GO_ARCH=amd64 \
111+ {% endif %}
112+ && GO_VERSION=1.25.8 \
113+ && curl -L "https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" -o /tmp/go.tar.gz \
114+ && tar -C /usr/local -xzf /tmp/go.tar.gz \
115+ && rm /tmp/go.tar.gz
116+
117+ ENV PATH="/usr/local/go/bin:$HOME/go/bin:$PATH"
118+
119+ # Build grpcurl from source with patched Go (GO-2026-4337)
120+ RUN go install github.com/fullstorydev/grpcurl/cmd/
[email protected] \
121+ && mv "$(go env GOPATH)/bin/grpcurl" /usr/local/bin/grpcurl \
122+ && chmod +x /usr/local/bin/grpcurl
117123# Security fixes: upgrade vulnerable system packages (S360 scan remediation)
118124RUN apt-get update && apt-get install -y --only-upgrade \
119125 telnet \
@@ -305,11 +311,11 @@ RUN pip3 install Flask \
305311 && pip3 install jinja2
306312
307313# gnxi/gnmi_cli_py ships pre-generated _pb2.py stubs; they are
308- # Pin to 6.31.1 to match grpcio-tools keep a known-good version.
314+ # Pin to 6.33.5 to match grpcio-tools keep a known-good version.
309315RUN set -e; \
310316 . /etc/os-release; \
311317 if [ "$VERSION_CODENAME" = "bookworm" ]; then \
312- pip install protobuf==6.31.1 ; \
318+ pip install protobuf==6.33.5 ; \
313319 else \
314320 pip install protobuf; \
315321 fi
@@ -354,7 +360,7 @@ RUN cd gnxi \
354360 && quilt push -a \
355361 && cd gnmi_cli_py \
356362 && pip install -r requirements.txt \
357- && pip3 install protobuf==6.31.1 --no-binary=protobuf
363+ && pip3 install protobuf==6.33.5 --no-binary=protobuf
358364{% else %}
359365
360366# Since gnxi were generated with proto 3.x we need to regenerate _pb2 with the new proto version
@@ -371,23 +377,18 @@ RUN cd gnxi \
371377# Deactivating a virtualenv.
372378# ENV PATH="$BACKUP_OF_PATH"
373379
374- # Install gnoic tool
375- # Without specifying the version there is a failure
376- # to determine the latest version automatically.
377- #
378- # root@a2014cb5bc54:~/gnoic# ./install.sh
379- # Warning: Failed to verify the package: https://api.github.com/repos/karimra/gnoic/releases/latest, the version is not specified
380- # Could not determine the latest release
381- # Failed to install gnoic
382- # For support, go to https://github.com/karimra/gnoic/issues
380+ # Build gnoic from source with patched Go (GO-2026-4337)
383381RUN git clone https://github.com/karimra/gnoic.git \
384382 && cd gnoic \
385383 && git checkout 27bc5a6 \
386- && chmod +x install.sh \
387- && ./install.sh --version 0.2.1 \
384+ && go build -o /usr/local/bin/gnoic . \
388385 && cd .. \
389386 && rm -rf gnoic
390387
388+ # Remove Go toolchain to reduce image size
389+ RUN rm -rf /usr/local/go "$(go env GOPATH 2>/dev/null || echo $HOME/go)"
390+ ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
391+
391392{% if PTF_ENV_PY_VER == "py3" %}
392393# Install the python-saithrift into the virtual environment
393394RUN echo "/usr/lib/python3/dist-packages/saithrift-0.9-py3.11.egg" >> /root/env-python3/lib/python3.11/site-packages/easy-install.pth
0 commit comments