-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: new GPG binaries don't work on Node 14 Runtime (#1706)
The Node 14 runtime is based on Amazon Linux 2, but the updated GPG binaries require Amazon Linux 2023. Make the following changes: - Move the runtime to Node 20 (based on Amazon Linux 2023). - Use `gpg` from the base Amazon Linux 2023 layer that's already there - Update to `gpg-agent` and `openssl` CLI from an Amazon Linux 2023. ----- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information
Showing
12 changed files
with
64 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,47 @@ | ||
This directory contains ZIP files that are used as Lambda layers by our custom resources | ||
(private-key, pgp-secret and certificate-signing-request). | ||
Those Lambdas shell out to the `openssl` and `gpg` tools, | ||
which are not shipped with Node Lambda version older than 8. | ||
This directory contains ZIP files that are used as Lambda layers by our custom | ||
resources (private-key, pgp-secret and certificate-signing-request). Those | ||
Lambdas shell out to the following tools: | ||
|
||
If you ever need to update these, | ||
unzip these files, add any necessary binaries to it, | ||
and then zip them back up again. | ||
- `gpg` | ||
- `gpg-agent` | ||
- `openssl` | ||
|
||
Only `gpg` is installed on the Lambda Runtime by default, the others are not | ||
(inspect Docker image `public.ecr.aws/lambda/nodejs:20` to be sure). | ||
|
||
If you ever need to update these, unzip these files, add any necessary binaries | ||
to it, and then zip them back up again. | ||
|
||
The binaries contained in these files were downloaded from an EC2 instance | ||
running Amazon Linux 2. | ||
running Amazon Linux 2023. | ||
|
||
N.B: | ||
|
||
- Make sure the binaries are copied from a version of Amazon Linux that matches | ||
the Lambda Runtime version that is being used, see here: | ||
<https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html>. | ||
- Make sure that the file structure in the ZIP file does not contain an extra | ||
directory, but looks like: | ||
- `gpg` | ||
- `lib/libgcrypt.so.X` | ||
- etc. | ||
- `gpg` is probably linked against the major version dependencies only, so it will | ||
depend on `libgcrypt.so.8` (and not `libgcrypt.so.8.4.1`). Confirm with `ldd` and | ||
rename the files if necessary. | ||
|
||
# Potential update procedure | ||
|
||
```shell | ||
host$ exec docker run --net=host \ | ||
--rm -it \ | ||
-v $HOME:$HOME -w $PWD \ | ||
public.ecr.aws/amazonlinux/amazonlinux:2023 | ||
|
||
# Replace 'gnupg2-minimal' with 'gnupg2', copy gpg-agent out to the current directory | ||
container$ yum install gnupg2 -y --allowerasing | ||
container$ cp /usr/bin/gpg-agent . | ||
|
||
# Install openssl, copy CLI out | ||
container$ yum install -y openssl | ||
container$ cp /usr/bin/openssl . | ||
``` |
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+375 KB
...rce-handlers/layers/openssl-cli-layer.zip → ...ce-handlers/layers/openssl-cli-al2023.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters