Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku-24: Stop using deprecated apt-key add #259

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Mar 11, 2024

Switches to the new method for importing/specifying keys:
https://wiki.postgresql.org/wiki/Apt#Manual_Repository_Configuration

This improves security, since now instead of the Postgres key being allowed to sign any package (including those from Ubuntu's APT repo), it's only trusted for packages from apt.postgresql.org.

This resolves:

W: http://apt.postgresql.org/pub/repos/apt/dists/noble-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

We're also using the new deb822 format, instead of the one-line format, see:
https://manpages.ubuntu.com/manpages/noble/man5/sources.list.5.html

Now that we're not using apt-key add the gnupg package no longer needs to be installed earlier than the other packages, so has been moved to the main package install step. We do need ca-certificates installed early however, so that apt-get update can pull the HTTPS Postgres source (whilst apt.postgresql.org supports HTTP too and signing makes HTTPS less important, HTTPS is what's now used in the upstream setup docs, so we've switched to using HTTPS).

Fixes #248.
GUS-W-15213125.

@edmorley edmorley self-assigned this Mar 11, 2024
@edmorley edmorley marked this pull request as ready for review March 11, 2024 13:58
@edmorley edmorley requested a review from a team as a code owner March 11, 2024 13:58
@edmorley edmorley enabled auto-merge (squash) March 11, 2024 14:00
Switches the the new method for importing/specifying keys:
https://wiki.postgresql.org/wiki/Apt#Manual_Repository_Configuration

This improves security, since now instead of the Postgres key being
allowed to sign any package (including those from Ubuntu's APT repo),
it's only trusted for packages from `apt.postgresql.org`.

We're also using the new deb822 format, instead of the one-line format, see:
https://manpages.ubuntu.com/manpages/noble/man5/sources.list.5.html

Now that we're not using `apt-key add` the `gnupg` package no longer
needs to be installed earlier than the other packages, so has been moved
to the main package install step. We do need `ca-certificates` installed
early however, so that `apt-get update` can pull the HTTPS Postgres source
(whilst `apt.postgresql.org` supports HTTP too and signing makes HTTPS
less important, HTTPS is what's used in the upstream setup docs, so we're
now using HTTPS).

This resolves:

```
W: http://apt.postgresql.org/pub/repos/apt/dists/noble-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
```

Fixes #248.
GUS-W-15213125.
@edmorley edmorley force-pushed the edmorley/h24-apt-key-deprecation branch from b87a9a0 to c99a7d5 Compare March 11, 2024 15:23
@edmorley edmorley merged commit 2af43b3 into main Mar 11, 2024
4 checks passed
@edmorley edmorley deleted the edmorley/h24-apt-key-deprecation branch March 11, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecated usage of apt-key.
2 participants