LoginSignup
0
0

More than 3 years have passed since last update.

AWS KernelLivePatching(プレビュー)を試してみた、けど

Last updated at Posted at 2020-04-30

AmazonLinux2のカーネルを無停止でパッチを当てられるKernel Live Patching(プレビュー)を試してみました。
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/al2-live-patching.html

現在(2020-05-01)新規EC2を作成する場合は、最新のカーネルで起動してしまうのでパッチ当てが試せない状況です。
→ 試してみました。

前提条件

  • Amazon Linux 2であること
  • x86_64アーキテクチャであること(arm64でないこと)
  • カーネルバージョンが4.14.165-131.185を含め以降のバージョンであること
    • そうでない場合は先に通常のカーネルバージョンアップが必要

設定

sudo yum install -y yum-plugin-kernel-livepatch
sudo yum kernel-livepatch enable -y
# rpm -qa | grep kernel-livepatch
sudo yum update kpatch-runtime
sudo systemctl enable kpatch.service
sudo amazon-linux-extras enable livepatch

適用可能なパッチのリスト(2020-05-25修正)

適用可能なパッチのリストです。

sh-4.2$ yum updateinfo list
Loaded plugins: extras_suggestions, kernel-livepatch, langpacks, priorities, update-motd
ALAS2-2020-1426         important/Sec. bind-export-libs-32:9.11.4-9.P2.amzn2.0.3.x86_64
ALAS2-2020-1426         important/Sec. bind-libs-32:9.11.4-9.P2.amzn2.0.3.x86_64
ALAS2-2020-1426         important/Sec. bind-libs-lite-32:9.11.4-9.P2.amzn2.0.3.x86_64
ALAS2-2020-1426         important/Sec. bind-license-32:9.11.4-9.P2.amzn2.0.3.noarch
ALAS2-2020-1426         important/Sec. bind-utils-32:9.11.4-9.P2.amzn2.0.3.x86_64
ALAS2-2020-1425         important/Sec. kernel-4.14.177-139.254.amzn2.x86_64
ALAS2LIVEPATCH-2020-009 important/Sec. kernel-livepatch-4.14.173-137.229-1.0-2.amzn2.x86_64
ALAS2-2020-1425         important/Sec. kernel-tools-4.14.177-139.254.amzn2.x86_64
ALAS2-2020-1418         important/Sec. libicu-50.2-4.amzn2.x86_64
updateinfo list done

パッチをあてると

sh-4.2$ sudo yum update --security

リストに出なくなりました。

sh-4.2$ yum updateinfo list
Loaded plugins: extras_suggestions, kernel-livepatch, langpacks, priorities, update-motd
updateinfo list done

制約

  • While applying a kernel live patch, you can't perform hibernation, use advanced debugging tools (such as SystemTap, kprobes, and eBPF-based tools), or access ftrace output files used by the Kernel Live Patching infrastructure.
  • Kernel Live Patching is not supported by AWS Systems Manager Patch Manager.
  • Amazon Linux 2 instances with 64-bit ARM (arm64) architecture are not supported.

hibernationやSystems Manager Patch Managerが利用できない等の制約があるそうです。
こちらは問題ないと思うのですが

AWS provides kernel live patches for an Amazon Linux 2 kernel version for up to 3 months after its release. After the 3-month period, you must update to a later kernel version to continue to receive kernel live patches.

実質3ヶ月に1回の「カーネルのバージョンアップが必要」=「(新しいバージョンにするには)再起動が発生」という縛りがあります。
live patchはカーネルのバージョンアップとは別扱いのようです。

雑感

  • EC2管理には大変便利!
  • でもFargate(ECS)のEFS対応がリリースされて、正直EC2自体これから使うのかなって気もします。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0