Skip to content

Commit

Permalink
Verify awscli signature before installing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Apr 9, 2021
1 parent bc39f28 commit e608e38
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packaging/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y apt-utils createrepo curl git gnupg2 python3 unzip

COPY ./awscli-key.gpg .

ARG AWSCLI_VERSION=2.1.35

RUN curl -fSsL -o "awscliv2.zip" \
"https://awscli.amazonaws.com/awscli-exe-linux-x86_64-$***REMOVED***AWSCLI_VERSION***REMOVED***.zip" && \
unzip -q awscliv2.zip && \
# Download awscli, check GPG signature and install.
RUN export GNUPGHOME="$(mktemp -d)" && \
gpg2 --import ./awscli-key.gpg && \
fpr="$(gpg2 --with-colons --fingerprint aws-cli | grep '^fpr' | cut -d: -f10)" && \
gpg2 --export-ownertrust && echo "$***REMOVED***fpr***REMOVED***:6:" | gpg2 --import-ownertrust && \
curl -fsSL --remote-name-all \
"https://awscli.amazonaws.com/awscli-exe-linux-x86_64-$***REMOVED***AWSCLI_VERSION***REMOVED***.zip"***REMOVED***,.sig***REMOVED*** && \
gpg2 --verify awscli*.sig awscli*.zip && \
unzip -q awscli*.zip && \
./aws/install && \
rm -rf aws*
rm -rf aws* "$GNUPGHOME"

RUN addgroup --gid 1000 k6 && \
useradd --create-home --shell /bin/bash --no-log-init \
Expand Down
29 changes: 29 additions & 0 deletions packaging/awscli-key.gpg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBF2Cr7UBEADJZHcgusOJl7ENSyumXh85z0TRV0xJorM2B/JL0kHOyigQluUG
ZMLhENaG0bYatdrKP+3H91lvK050pXwnO/R7fB/FSTouki4ciIx5OuLlnJZIxSzx
PqGl0mkxImLNbGWoi6Lto0L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