こんにちは
株式会社クラスアクト インフラストラクチャ事業部の大塚です。
今回はInspectorについて簡単にメモってまとめていこうと思います。
ハンズオンする環境イメージ
今回構築する環境イメージです。サブネットにEC2を用意して、
その中にSSM Agentをインストールします(今回はプリインストールされています。)
その後、Inspectorを有効化して脆弱性を確認していき、簡単ではありますが解消してみます。
Inspectorとは
AWSが提供する脆弱性管理サービス
Amazon EC2インスタンス、Amazon ECR(Elastic Container Registry)のコンテナイメージ、およびAWS Lambda関数を自動的に検出・スキャンし、ソフトウェアの脆弱性や意図しないネットワーク露出を継続的に監視します
EC2インスタンスにSSMエージェントがインストールされている場合、Inspectorはイベント駆動型のスキャンを実現(例:パッケージ変更時の即時評価)
ハンズオン
EC2を用意します。今回はubuntuの22.04を使っていきます。
インスタンスタイプは無料利用枠で問題ないです。
SGは全部開けているものを選択しておきます。

次にこのEC2にアタッチするIAMロールを作成します。
このIAMロールにはAmazonSSMManagedInstanceCoreのポリシーをアタッチします。


デプロイしたubuntuにssh接続し、SSMエージェントがプリインストールされていることを確認します。
以下のコマンドを実行します。
SSM Agentがプリインストールされていることを確認する
ubuntu@ip-172-31-39-219:~$ sudo su -
root@ip-172-31-39-219:~# snap list amazon-ssm-agent
Name Version Rev Tracking Publisher Notes
amazon-ssm-agent 3.3.2299.0 11797 latest/stable/… aws✓ classic
SSM Agentを起動
root@ip-172-31-39-219:~# snap start amazon-ssm-agent
Started.
root@ip-172-31-39-219:~# snap services amazon-ssm-agent
Service Startup Current Notes
amazon-ssm-agent.amazon-ssm-agent enabled active -
アクティブ化して少し待つと、ダッシュボードが表示されます。
スキャンが開始されるので、待機します。

インスタンス別のタブを確認すると対象のインスタンスが表示されると思います。

今回出た脆弱性一覧の一部を表に起こしておきます。
| 重大性 | タイトル | タイプ | 経過時間 | ステータス |
|---|---|---|---|---|
| High | CVE-2025-22056 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-22035 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-22068 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-40114 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | Port range 0 to 65535 is reachable from an Internet Gateway - TCP | Network Reachability | 13 minutes | Active |
| High | Port range 0 to 65535 is reachable from an Internet Gateway - UDP | Network Reachability | 13 minutes | Active |
| High | CVE-2025-40780 - bind9-dnsutils, bind9-host and 1 more | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-22041 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-7425 - libxml2 | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-22097 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-22038 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2023-53034 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-8677 - bind9-dnsutils, bind9-host and 1 more | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-37838 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-22040 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-40778 - bind9-dnsutils, bind9-host and 1 more | Package Vulnerability | 4 minutes | Active |
| High | CVE-2025-22020 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-23138 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-22058 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-22033 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-5244 - binutils, libbinutils and 2 more | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-22055 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-22062 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-8225 - binutils, libbinutils and 2 more | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-22064 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-22063 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-39728 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-39682 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-22054 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
| Medium | CVE-2025-22039 - linux-image-aws | Package Vulnerability | 4 minutes | Active |
Inspectorの画面で、今回一番上に出力されたCVE-2025-22056 - linux-image-awsのリンクを押下すると、検出結果の概要であったり、対策方法などが提示されています。今回の対応方法はapt update && apt upgradeを実行しろと書いていますね。
※今回確認したところこれだけだと解決しませんでした。

ちなみにCVE-2025-22056と検索をかけると以下のような記事がヒットしました。
検知されたセキュリティホールを修正するために、サーバで以下を実行してみます。
※apt update && apt ugrade -y以外は22056を修正しようと色々確認した残骸です。解決できませんでしたが一応残しているだけです。
実行後、rebootをかけて再起動します。
root@ip-172-31-39-219:~# apt update && apt upgrade -y
root@ip-172-31-39-219:~# uname -r
6.8.0-1040-aws
root@ip-172-31-39-219:~# apt install --install-recommends linux-generic-hwe-22.04
root@ip-172-31-39-219:~# vi /etc/default/grub
最終行に以下を追加
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 6.8.0-86.87~22.04.1"
root@ip-172-31-39-219:~# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/40-force-partuuid.cfg'
Sourcing file `/etc/default/grub.d/50-cloudimg-settings.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
GRUB_FORCE_PARTUUID is set, will attempt initrdless boot
Found linux image: /boot/vmlinuz-6.8.0-1040-aws
Found initrd image: /boot/microcode.cpio /boot/initrd.img-6.8.0-1040-aws
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
root@ip-172-31-39-219:~# reboot
改めてsshして以下のコマンドを実行します。
ubuntu@ip-172-31-39-219:~$ sudo su -
root@ip-172-31-39-219:~# snap restart amazon-ssm-agent
2025-11-01T01:47:07Z INFO Waiting for
"snap.amazon-ssm-agent.amazon-ssm-agent.service" to stop.
Restarted.
root@ip-172-31-39-219:~# snap services amazon-ssm-agent
Service Startup Current Notes
amazon-ssm-agent.amazon-ssm-agent enabled active -
その後、Inspectorを改めて覗いてみると、ステータスがActiveであるものが減っており、closed(≒解決している)になっているものが増えているのがわかります。
すべてをclosedにするのは難しい(false positiveなどの可能性もあるため)とは思いますが、Inspectorを使うことで、どのようなセキュリティホールがあるか、お手軽に確認できますね。

Inspectorの停止
Inspector>設定>全般のInspectorを非アクティブ化を押下します。






