【小ネタ】特定の KB●●●●●●● がパッチベースラインで承認されているかを確認する方法

2024.06.07

はじめに

テクニカルサポートの 片方 です。
特定の KB●●●●●●● がパッチベースラインで承認されているかどうかを確認する方法をご紹介します。こちらは、AWS CLI の describe-effective-patches-for-patch-baseline コマンドを利用すると確認可能です。

確認してみた

先ずは以下について確認します。

  • 対象 KB●●●●●●● を決める
  • 対象パッチベースラインの arn を確認する

Note To retrieve information about an AWS managed patch baseline, specify the full Amazon Resource Name (ARN) of the baseline. For example, for the baseline AWS-AmazonLinuxDefaultPatchBaseline, specify arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7 instead of pb-0e392de35e7c563b7.

以下は、KB2124261 がパッチベースライン pb-abcdefgh123456789 で承認されているかどうかを確認する AWS CLI コマンド例と実行結果です。

AWS CLI コマンド例 (一部マスクします)

$ aws ssm describe-effective-patches-for-patch-baseline --baseline-id arn:aws:ssm:ap-northeast-1:123456789012:patchbaseline/pb-abcdefgh123456789 --query "EffectivePatches[][Patch][?KbNumber=='KB2124261'][]"

実行結果例

[
    {
        "Id": "12ef1bed-0dd2-4633-b3ac-60888aa8ba33",
        "ReleaseDate": "2010-09-15T02:00:00+09:00",
        "Title": "Security Update for Windows 7 (KB2124261)",
        "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install this update, you may have to restart your system.",
        "ContentUrl": "https://support.microsoft.com/en-us/kb/2124261",
        "Vendor": "Microsoft",
        "ProductFamily": "Windows",
        "Product": "Windows7",
        "Classification": "SecurityUpdates",
        "MsrcSeverity": "Important",
        "KbNumber": "KB2124261",
        "MsrcNumber": "MS10-065",
        "Language": "All"
    },
    {
        "Id": "1b571637-30ed-48d6-b2f3-24d374fdebb8",
        "ReleaseDate": "2010-09-15T02:00:00+09:00",
        "Title": "Security Update for Windows Server 2008 R2 x64 Edition (KB2124261)",
        "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install this update, you may have to restart your system.",
        "ContentUrl": "https://support.microsoft.com/en-us/kb/2124261",
        "Vendor": "Microsoft",
        "ProductFamily": "Windows",
        "Product": "WindowsServer2008R2",
        "Classification": "SecurityUpdates",
        "MsrcSeverity": "Important",
        "KbNumber": "KB2124261",
        "MsrcNumber": "MS10-065",
        "Language": "All"
    },
    {
        "Id": "2c32684e-0579-4c47-a479-c27d34476c1b",
        "ReleaseDate": "2010-09-15T02:00:00+09:00",
        "Title": "Security Update for Windows Server 2008 (KB2124261)",
        "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install thi
s update, you may have to restart your system.",
        "ContentUrl": "https://support.microsoft.com/en-us/kb/2124261",
        "Vendor": "Microsoft",
        "ProductFamily": "Windows",
        "Product": "WindowsServer2008",
        "Classification": "SecurityUpdates",
        "MsrcSeverity": "Important",
        "KbNumber": "KB2124261",
        "MsrcNumber": "MS10-065",
        "Language": "All"
    },
    {
        "Id": "2d8d9b6e-dff8-4708-b8db-689b90c03ea6",
        "ReleaseDate": "2010-09-15T02:00:00+09:00",
        "Title": "Security Update for Windows Server 2008 for Itanium-based Systems (KB2124261)",
        "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install thi
s update, you may have to restart your system.",
        "ContentUrl": "https://support.microsoft.com/en-us/kb/2124261",
        "Vendor": "Microsoft",
        "ProductFamily": "Windows",
        "Product": "WindowsServer2008",
        "Classification": "SecurityUpdates",
        "MsrcSeverity": "Important",
        "KbNumber": "KB2124261",
        "MsrcNumber": "MS10-065",
        "Language": "All"
    },
    {
        "Id": "8447a9e1-22e8-43d7-b9af-2db7a9a3f974",
        "ReleaseDate": "2010-09-15T02:00:00+09:00",
        "Title": "Security Update for Windows 7 for x64-based Systems (KB2124261)",
        "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install thi
s update, you may have to restart your system.",
        "ContentUrl": "https://support.microsoft.com/en-us/kb/2124261",
        "Vendor": "Microsoft",
        "ProductFamily": "Windows",
        "Product": "Windows7",
        "Classification": "SecurityUpdates",
        "MsrcSeverity": "Important",
        "KbNumber": "KB2124261",
        "MsrcNumber": "MS10-065",
        "Language": "All"
    },
    {
        "Id": "86c12c04-1fd7-40bb-9d82-f85bd4667ebe",
        "ReleaseDate": "2010-09-15T02:00:00+09:00",
        "Title": "Security Update for Windows Server 2008 x64 Edition (KB2124261)",
        "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install this update, you may have to restart your system.",
        "ContentUrl": "https://support.microsoft.com/en-us/kb/2124261",
        "Vendor": "Microsoft",
        "ProductFamily": "Windows",
        "Product": "WindowsServer2008",
        "Classification": "SecurityUpdates",
        "MsrcSeverity": "Important",
        "KbNumber": "KB2124261",
        "MsrcNumber": "MS10-065",
        "Language": "All"
    },
    {
        "Id": "f80c9113-2095-47e4-b178-ca9e3684c1a3",
        "ReleaseDate": "2010-09-15T02:00:00+09:00",
        "Title": "Security Update for Windows Server 2008 R2 for Itanium-based Systems (KB2124261)",
        "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install this update, you may have to restart your system.",
        "ContentUrl": "https://support.microsoft.com/en-us/kb/2124261",
        "Vendor": "Microsoft",
        "ProductFamily": "Windows",
        "Product": "WindowsServer2008R2",
        "Classification": "SecurityUpdates",
        "MsrcSeverity": "Important",
        "KbNumber": "KB2124261",
        "MsrcNumber": "MS10-065",
        "Language": "All"
    }
]

まとめ

本ブログが誰かのお役に立てれば幸いです。

参考資料

アノテーション株式会社について

アノテーション株式会社は、クラスメソッド社のグループ企業として「オペレーション・エクセレンス」を担える企業を目指してチャレンジを続けています。「らしく働く、らしく生きる」のスローガンを掲げ、様々な背景をもつ多様なメンバーが自由度の高い働き方を通してお客様へサービスを提供し続けてきました。現在当社では一緒に会社を盛り上げていただけるメンバーを募集中です。少しでもご興味あれば、アノテーション株式会社WEBサイトをご覧ください。