Skip to content

Commit

Permalink
bugfix tfsec installation
Browse files Browse the repository at this point in the history
  • Loading branch information
davenicoll committed May 18, 2023
1 parent b2047aa commit 0939cfd
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 64 deletions.
34 changes: 18 additions & 16 deletions Dockerfile/full-alpine-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ FROM alpine:latest
RUN apk update && \
apk upgrade && \
apk add --update --no-cache \
curl \
bash \
jq \
yq \
figlet \
unzip \
zip \
git \
shellcheck \
nano \
tar && \
rm -rf /var/cache/apk/*
curl \
bash \
jq \
yq \
figlet \
unzip \
zip \
git \
shellcheck \
nano \
tar && \
rm -rf /var/cache/apk/*

# Install languages, libraries and frameworks
RUN apk add --update \
Expand Down Expand Up @@ -71,7 +71,9 @@ RUN wget -nv https://github.com/terraform-linters/tflint/releases/download/v${tf
&& rm tflint_linux_amd64.zip

# Install tfsec (https://github.com/aquasecurity/tfsec)
RUN export tfsecrelease="$(curl --silent "https://api.github.com/repos/aquasecurity/tfsec/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')"
RUN wget https://github.com/aquasecurity/tfsec/releases/download/${tfsecrelease}/tfsec-linux-amd64
RUN mv tfsec-linux-amd64 /usr/bin/tfsec && chmod +x /usr/bin/tfsec
RUN tfsec --version
RUN export tfsecrelease="$(curl -Ls -o /dev/null -w %{url_effective} "https://github.com/aquasecurity/tfsec/releases/latest" | awk -F / '{print substr($NF,1);}')" \
&& echo "Installing tfsec v${tfsecrelease}" \
&& wget https://github.com/aquasecurity/tfsec/releases/download/${tfsecrelease}/tfsec-linux-amd64 \
&& mv tfsec-linux-amd64 /usr/bin/tfsec \
&& chmod +x /usr/bin/tfsec

35 changes: 18 additions & 17 deletions Dockerfile/full-ubuntu-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ FROM ubuntu:latest
RUN apt update -yq && \
apt upgrade -yq && \
apt install -yq --no-install-recommends --no-install-suggests \
ca-certificates \
apt-transport-https \
wget \
curl \
bash \
jq \
figlet \
unzip \
zip \
git \
shellcheck \
nano \
tar
ca-certificates \
apt-transport-https \
wget \
curl \
bash \
jq \
figlet \
unzip \
zip \
git \
shellcheck \
nano \
tar

# Install languages, libraries and frameworks
RUN apt install -yq --no-install-recommends --no-install-suggests \
Expand Down Expand Up @@ -73,7 +73,8 @@ RUN wget -nv https://github.com/terraform-linters/tflint/releases/download/v${tf
&& rm tflint_linux_amd64.zip

# Install tfsec (https://github.com/aquasecurity/tfsec)
RUN export tfsecrelease="$(curl --silent "https://api.github.com/repos/aquasecurity/tfsec/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')"
RUN wget https://github.com/aquasecurity/tfsec/releases/download/${tfsecrelease}/tfsec-linux-amd64
RUN mv tfsec-linux-amd64 /usr/bin/tfsec && chmod +x /usr/bin/tfsec
RUN tfsec --version
RUN export tfsecrelease="$(curl -Ls -o /dev/null -w %{url_effective} "https://github.com/aquasecurity/tfsec/releases/latest" | awk -F / '{print substr($NF,1);}')" \
&& echo "Installing tfsec v${tfsecrelease}" \
&& wget https://github.com/aquasecurity/tfsec/releases/download/${tfsecrelease}/tfsec-linux-amd64 \
&& mv tfsec-linux-amd64 /usr/bin/tfsec \
&& chmod +x /usr/bin/tfsec
31 changes: 16 additions & 15 deletions Dockerfile/standard-alpine-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ FROM alpine:latest
RUN apk update && \
apk upgrade && \
apk add --update --no-cache \
curl \
bash \
jq \
yq \
figlet \
unzip \
zip \
git \
shellcheck \
nano && \
rm -rf /var/cache/apk/*
curl \
bash \
jq \
yq \
figlet \
unzip \
zip \
git \
shellcheck \
nano && \
rm -rf /var/cache/apk/*

# Install terraform (https://github.com/hashicorp/terraform)
RUN export tfrelease="$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/hashicorp/terraform/releases/latest | awk -F / '{print substr($NF,2);}')" \
Expand All @@ -31,8 +31,9 @@ RUN export atmosrelease="$(curl -Ls -o /dev/null -w %{url_effective} https://git
&& chmod +x /usr/bin/atmos

# Install tfsec (https://github.com/aquasecurity/tfsec)
RUN export tfsecrelease="$(curl --silent "https://api.github.com/repos/aquasecurity/tfsec/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')"
RUN wget https://github.com/aquasecurity/tfsec/releases/download/${tfsecrelease}/tfsec-linux-amd64
RUN mv tfsec-linux-amd64 /usr/bin/tfsec && chmod +x /usr/bin/tfsec
RUN tfsec --version
RUN export tfsecrelease="$(curl -Ls -o /dev/null -w %{url_effective} "https://github.com/aquasecurity/tfsec/releases/latest" | awk -F / '{print substr($NF,1);}')" \
&& echo "Installing tfsec v${tfsecrelease}" \
&& wget https://github.com/aquasecurity/tfsec/releases/download/${tfsecrelease}/tfsec-linux-amd64 \
&& mv tfsec-linux-amd64 /usr/bin/tfsec \
&& chmod +x /usr/bin/tfsec

34 changes: 18 additions & 16 deletions Dockerfile/standard-ubuntu-amd64
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ FROM ubuntu:latest
RUN apt update -yq && \
apt upgrade -yq && \
apt install -yq --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
curl \
bash \
jq \
figlet \
unzip \
zip \
git \
shellcheck \
nano && \
rm -rf /var/lib/apt/lists/*
ca-certificates \
wget \
curl \
bash \
jq \
figlet \
unzip \
zip \
git \
shellcheck \
nano && \
rm -rf /var/lib/apt/lists/*

# Install terraform (https://github.com/hashicorp/terraform)
RUN export tfrelease="$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/hashicorp/terraform/releases/latest | awk -F / '{print substr($NF,2);}')" \
Expand All @@ -32,7 +32,9 @@ RUN export atmosrelease="$(curl -Ls -o /dev/null -w %{url_effective} https://git
&& chmod +x /usr/bin/atmos

# Install tfsec (https://github.com/aquasecurity/tfsec)
RUN export tfsecrelease="$(curl --silent "https://api.github.com/repos/aquasecurity/tfsec/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')"
RUN wget https://github.com/aquasecurity/tfsec/releases/download/${tfsecrelease}/tfsec-linux-amd64
RUN mv tfsec-linux-amd64 /usr/bin/tfsec && chmod +x /usr/bin/tfsec
RUN tfsec --version
RUN export tfsecrelease="$(curl -Ls -o /dev/null -w %{url_effective} "https://github.com/aquasecurity/tfsec/releases/latest" | awk -F / '{print substr($NF,1);}')" \
&& echo "Installing tfsec v${tfsecrelease}" \
&& wget https://github.com/aquasecurity/tfsec/releases/download/${tfsecrelease}/tfsec-linux-amd64 \
&& mv tfsec-linux-amd64 /usr/bin/tfsec \
&& chmod +x /usr/bin/tfsec

0 comments on commit 0939cfd

Please sign in to comment.