Skip to content

Commit 23dd10a

Browse files
authored
Merge pull request #6202 from influxdata/jdstrand/use-gpg-not-sha256
chore: always verify GPG fingerprint
2 parents 6c88cae + 001b20f commit 23dd10a

File tree

8 files changed

+37
-40
lines changed

8 files changed

+37
-40
lines changed

Dockerfile.pytest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FROM golang:latest
77
# Primary key fingerprint: 24C9 75CB A61A 024E E1B6 3178 7C3D 5715 9FC2 F927
88
# Subkey fingerprint: 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E
99
ADD https://repos.influxdata.com/influxdata-archive.key ./influxdata-archive.key
10-
RUN gpg --no-default-keyring --homedir /nonexistent --show-keys ./influxdata-archive.key | grep -q "24C975CBA61A024EE1B631787C3D57159FC2F927" && cat influxdata-archive.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
10+
RUN gpg --no-default-keyring --homedir $(mktemp -d) --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 | grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' && cat influxdata-archive.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
1111

1212
RUN echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' | tee /etc/apt/sources.list.d/influxdata.list
1313

content/influxdb/v1/introduction/install.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ For Ubuntu/Debian users, add the InfluxData repository with the following comman
7575
# Primary key fingerprint: 24C9 75CB A61A 024E E1B6 3178 7C3D 5715 9FC2 F927
7676
# Subkey fingerprint: 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E
7777
wget -q https://repos.influxdata.com/influxdata-archive.key
78-
echo '943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key' | sha256sum -c && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
78+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 | grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
7979
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
8080
```
8181
{{% /code-tab-content %}}
@@ -85,8 +85,8 @@ echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repo
8585
# influxdata-archive.key GPG fingerprint:
8686
# Primary key fingerprint: 24C9 75CB A61A 024E E1B6 3178 7C3D 5715 9FC2 F927
8787
# Subkey fingerprint: 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E
88-
wget -q https://repos.influxdata.com/influxdata-archive.key
89-
echo '943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key' | sha256sum -c && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
88+
curl --silent --location -O https://repos.influxdata.com/influxdata-archive.key
89+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 | grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
9090
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
9191
```
9292
{{% /code-tab-content %}}

content/influxdb/v2/install/_index.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ with your OS version:_
4343
For newer releases (for example, Ubuntu 20.04 LTS and newer, Debian Buster
4444
and newer) that support subkey verification:
4545

46-
- Private key file: [`influxdata-archive.key`](https://repos.influxdata.com/influxdata-archive.key)
47-
- Public key: `943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515`
46+
- GPG key file: [`influxdata-archive.key`](https://repos.influxdata.com/influxdata-archive.key)
47+
- Primary key fingerprint: `24C975CBA61A024EE1B631787C3D57159FC2F927`
4848

4949
For older versions (for example, CentOS/RHEL 7, Ubuntu 18.04 LTS, or Debian
5050
Stretch) that don't support subkeys for verification:
5151

52-
- Private key file: [`influxdata-archive_compat.key`](https://repos.influxdata.com/influxdata-archive_compat.key)
53-
- Public key: `393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c`
52+
- GPG key file: [`influxdata-archive_compat.key`](https://repos.influxdata.com/influxdata-archive_compat.key)
53+
- Signing key fingerprint: `9D539D90D3328DC7D6C8D3B9D8FF8E1F7DF8B07E`
5454

5555
{{% /expand %}}
5656

@@ -136,8 +136,7 @@ binary releases:
136136
{{% code-placeholders "https://repos.influxdata.com/influxdata-archive.key" %}}
137137

138138
```sh
139-
curl --silent --location \
140-
https://repos.influxdata.com/influxdata-archive.key \
139+
curl --silent --location https://repos.influxdata.com/influxdata-archive.key \
141140
| gpg --import - 2>&1 \
142141
| grep 'InfluxData Package Signing Key <[email protected]>'
143142
```
@@ -344,16 +343,16 @@ To install {{% product-name %}} on Linux, do one of the following:
344343
2. Run the command for your OS version to install the InfluxData key,
345344
add the InfluxData repository, and install `influxdb`.
346345

347-
_Before running the command, replace the checksum and key filename with the
346+
_Before running the command, replace the fingerprint and key filename with the
348347
key-pair from the preceding step._
349348

350349
```bash
351350
# Ubuntu and Debian
352351
# Add the InfluxData key to verify downloads and add the repository
353-
curl --silent --location -O \
354-
https://repos.influxdata.com/influxdata-archive.key
355-
echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \
356-
| sha256sum --check - && cat influxdata-archive.key \
352+
curl --silent --location -O https://repos.influxdata.com/influxdata-archive.key
353+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 \
354+
| grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' \
355+
&& cat influxdata-archive.key \
357356
| gpg --dearmor \
358357
| sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null \
359358
&& echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \
@@ -366,10 +365,10 @@ To install {{% product-name %}} on Linux, do one of the following:
366365
```bash
367366
# RedHat and CentOS
368367
# Add the InfluxData key to verify downloads
369-
curl --silent --location -O \
370-
https://repos.influxdata.com/influxdata-archive.key \
371-
&& echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \
372-
| sha256sum --check - && cat influxdata-archive.key \
368+
curl --silent --location -O https://repos.influxdata.com/influxdata-archive.key
369+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 \
370+
| grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' \
371+
&& cat influxdata-archive.key \
373372
| gpg --dearmor \
374373
| tee /etc/pki/rpm-gpg/RPM-GPG-KEY-influxdata > /dev/null
375374

content/influxdb3/cloud-dedicated/reference/cli/influxctl/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ To download the Linux `influxctl` package, do one of the following:
176176
# Primary key fingerprint: 24C9 75CB A61A 024E E1B6 3178 7C3D 5715 9FC2 F927
177177
# Subkey fingerprint: 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E
178178
wget -q https://repos.influxdata.com/influxdata-archive.key
179-
echo '943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key' | sha256sum -c && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
179+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 | grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
180180
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
181181
182182
sudo apt-get update && sudo apt-get install influxctl

content/influxdb3/clustered/reference/cli/influxctl/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ To download the Linux `influxctl` package, do one of the following:
166166
# Primary key fingerprint: 24C9 75CB A61A 024E E1B6 3178 7C3D 5715 9FC2 F927
167167
# Subkey fingerprint: 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E
168168
wget -q https://repos.influxdata.com/influxdata-archive.key
169-
echo '943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key' | sha256sum -c && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
169+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 | grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null
170170
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
171171
```
172172

content/telegraf/v1/install.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ Before running the [install](#install) sample code, substitute the key-pair comp
126126
For newer OS releases (for example, Ubuntu 20.04 LTS and newer, Debian Buster
127127
and newer) that support subkey verification:
128128

129-
- Private key file: [`influxdata-archive.key`](https://repos.influxdata.com/influxdata-archive.key)
130-
- Public key: `943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515`
129+
- GPG key file: [`influxdata-archive.key`](https://repos.influxdata.com/influxdata-archive.key)
130+
- Primary key fingerprint: `24C975CBA61A024EE1B631787C3D57159FC2F927`
131131

132132
For older versions (for example, CentOS/RHEL 7, Ubuntu 18.04 LTS, or Debian
133133
Stretch) that don't support subkeys for verification:
134134

135-
- Private key file: [`influxdata-archive_compat.key`](https://repos.influxdata.com/influxdata-archive_compat.key)
136-
- Public key: `393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c`
135+
- GPG key file: [`influxdata-archive_compat.key`](https://repos.influxdata.com/influxdata-archive_compat.key)
136+
- Signing key fingerprint: `9D539D90D3328DC7D6C8D3B9D8FF8E1F7DF8B07E`
137137

138138
_For security, InfluxData periodically rotates keys and publishes the new key pairs._
139139

@@ -175,10 +175,10 @@ repository:
175175
<!------------------------BEGIN UBUNTU 20.04 LTS AND NEWER--------------------->
176176

177177
```bash
178-
curl --silent --location -O \
179-
https://repos.influxdata.com/influxdata-archive.key \
180-
&& echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \
181-
| sha256sum -c - && cat influxdata-archive.key \
178+
curl --silent --location -O https://repos.influxdata.com/influxdata-archive.key
179+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 \
180+
| grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' \
181+
&& cat influxdata-archive.key \
182182
| gpg --dearmor \
183183
| sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null \
184184
&& echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \
@@ -193,10 +193,9 @@ sudo apt-get update && sudo apt-get install telegraf
193193

194194
```bash
195195
# influxdata-archive_compat.key GPG Fingerprint: 9D539D90D3328DC7D6C8D3B9D8FF8E1F7DF8B07E
196-
curl --silent --location -O \
197-
https://repos.influxdata.com/influxdata-archive_compat.key \
198-
&& echo "393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key" \
199-
| sha256sum -c - \
196+
curl --silent --location -O https://repos.influxdata.com/influxdata-archive_compat.key
197+
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive_compat.key 2>&1 \
198+
| grep -q '^fpr:\+9D539D90D3328DC7D6C8D3B9D8FF8E1F7DF8B07E:$' \
200199
&& cat influxdata-archive_compat.key \
201200
| gpg --dearmor \
202201
| sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null

test/Dockerfile.test-oss.centos

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ LABEL "com.influxdata.docs"="https://docs.influxdata.com/influxdb/v2/install/?t=
1414

1515
ARG INFLUXDB_LATEST_PATCH=2.7.10
1616
ARG TELEGRAF_LATEST_PATCH=1.32.3
17-
ARG PUBLIC_SHA=943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515
1817
# ARG basearch=aarch64
1918

2019
# Install InfluxDB keys to verify client installs.
2120

2221
RUN curl --silent --location -O \
2322
https://repos.influxdata.com/influxdata-archive.key \
24-
&& echo "${PUBLIC_SHA} influxdata-archive.key" \
25-
| sha256sum -c && cat influxdata-archive.key \
23+
&& gpg --homedir $(mktemp -d) --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 \
24+
| grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' \
25+
&& cat influxdata-archive.key \
2626
| gpg --dearmor \
2727
| tee /etc/pki/rpm-gpg/RPM-GPG-KEY-influxdata > /dev/null
2828

test/Dockerfile.test-oss.ubuntu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ LABEL description="InfluxData Docs Test OSS install on Ubuntu"
1313

1414
LABEL "com.influxdata.docs"="https://docs.influxdata.com/influxdb/v2/install/?t=Linux"
1515

16-
ARG PUBLIC_SHA=943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515
17-
1816
# Install gnupg2 and curl to verify client installs.
1917
RUN apt-get update && apt-get install -y gnupg2 curl
2018

2119
# Install InfluxDB keys to verify client installs.
2220
RUN curl --silent --location -O \
2321
https://repos.influxdata.com/influxdata-archive.key \
24-
&& echo "${PUBLIC_SHA} influxdata-archive.key" \
25-
| sha256sum -c && cat influxdata-archive.key \
22+
&& gpg --homedir $(mktemp -d) --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 \
23+
| grep -q '^fpr:\+24C975CBA61A024EE1B631787C3D57159FC2F927:$' \
24+
&& cat influxdata-archive.key \
2625
| gpg --dearmor \
2726
| tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null \
2827
&& echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \

0 commit comments

Comments
 (0)