Skip to content

Commit 8594fb8

Browse files
authored
Merge pull request #87 from andyzhangx/fix-CVE-2021-3997
fix: CVE-2021-3997 in image build
2 parents 79a34dc + 98191a7 commit 8594fb8

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/trivy.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
export REGISTRY=test
2222
export IMAGE_VERSION=latest
2323
export DOCKER_CLI_EXPERIMENTAL=enabled
24-
make
25-
make container-build
24+
make container
2625
2726
- name: Run Trivy vulnerability scanner
2827
uses: aquasecurity/trivy-action@master

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM ubuntu
15+
FROM k8s.gcr.io/build-image/debian-base:bullseye-v1.0.0
16+
17+
RUN apt update && apt-mark unhold libcap2
18+
RUN clean-install ca-certificates mount
19+
# install updated packages to fix CVE issues
20+
RUN clean-install libssl1.1 libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libgmp10
1621

1722
# Copy iscsiplugin.sh
1823
COPY iscsiplugin.sh /iscsiplugin.sh

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ OUTPUT_TYPE ?= docker
2929
ARCH ?= amd64
3030
IMAGE_TAG = $(REGISTRY)/$(IMAGENAME):$(IMAGE_VERSION)
3131

32-
.PHONY: container-build
33-
container-build:
32+
.PHONY: container
33+
container:
34+
make
3435
docker buildx build --pull --output=type=$(OUTPUT_TYPE) --platform="linux/$(ARCH)" \
3536
-t $(IMAGE_TAG) --build-arg ARCH=$(ARCH) .
3637

0 commit comments

Comments
 (0)