diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a7fa1a55..68c6e1ba 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -68,6 +68,14 @@ RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/s && echo "source ~/completions/kubectl.bash" >> ~/.bashrc \ && echo "alias k=kubectl" >> ~/.bashrc \ && echo "complete -o default -F __start_kubectl k" >> ~/.bashrc + +# Install trivy +RUN mkdir /tmp/trivy \ + && curl -L https://github.com/aquasecurity/trivy/releases/download/v0.19.2/trivy_0.19.2_Linux-64bit.tar.gz | tar xvz -C /tmp/trivy -f - contrib trivy \ + && chmod +x /tmp/trivy/trivy \ + && mv /tmp/trivy/trivy /usr/local/bin/trivy \ + && mkdir -p /trivy/contrib \ + && mv /tmp/trivy/contrib/* /trivy/contrib/ # Clean up RUN apt-get autoremove -y \ diff --git a/Makefile b/Makefile index 030e65d8..c7be66fe 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,13 @@ IMAGE_MAJOR_VERSION = $(shell echo "$(IMAGE_VERSION)" | cut -d '.' -f1 ) IMAGE_MINOR_VERSION = $(shell echo "$(IMAGE_VERSION)" | cut -d '.' -f2 ) IMAGE = $(REGISTRY)/$(REPOSITORY)/hello-kubernetes +.PHONY: scan-for-vulns +scan-for-vulns: + trivy image --format template --template "@/trivy/contrib/sarif.tpl" $(IMAGE):$(IMAGE_VERSION) + +.PHONY: build-images +build-images: build-image-linux + .PHONY: build-image-linux build-image-linux: docker build --no-cache \ diff --git a/src/app/Dockerfile b/src/app/Dockerfile index fb87cbae..a61d1b77 100644 --- a/src/app/Dockerfile +++ b/src/app/Dockerfile @@ -1,4 +1,4 @@ -FROM node:15-alpine +FROM node:16-alpine3.13 ARG IMAGE_CREATE_DATE ARG IMAGE_VERSION diff --git a/src/app/package.json b/src/app/package.json index 3135a9be..3ec86a19 100644 --- a/src/app/package.json +++ b/src/app/package.json @@ -1,6 +1,6 @@ { "name": "hello-kubernetes", - "version": "1.10.0", + "version": "1.10.1", "description": "Hello Kubernetes!", "author": "Paul Bouwer", "license": "MIT",