4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Amazon Inspectorの実行結果(aws-cli編)

Last updated at Posted at 2016-07-20

cloudpack大阪の佐々木です。

マネージメントコンソールでの確認方法を書きましたが、
http://qiita.com/taishin/items/a8cc91b78f4f77e118a0

aws-cliをでのやり方です。
結果を加工したりする場合はこちらのほうがやりやすいかと思います。

ARNの確認

finding-arnを指定する必要があります。
finding-arnはマネージメントコンソールから確認できます。

デフォルトでは表示されていませんが、Show/hide columnsから表示させることができます。

Kobito.UyYCvN.png

コマンド

aws inspector describe-findings コマンドを使用します。
http://docs.aws.amazon.com/cli/latest/reference/inspector/describe-findings.html

$ aws inspector describe-findings --finding-arns arn:aws:inspector:ap-northeast-1:908475413463:target/xxxxxxxxxxxx/template/xxxxxxxxx/run/xxxxxxxx/finding/xxxxxxx

実行結果

レスポンスは下記のような感じです。

{
    "failedItems": {},
    "findings": [
        {
            "assetType": "ec2-instance",
            "confidence": 10,
            "numericSeverity": 9.0,
            "description": "Multiple CRLF injection vulnerabilities in session.c in sshd in OpenSSH before 7.2p2 allow remote authenticated users to bypass intended shell-command restrictions via crafted X11 forwarding data, related to the (1) do_authenticated1 and (2) session_x11_req functions.",
            "service": "Inspector",
            "title": "Instance i-xxxxxxxxxxxxxxxx is vulnerable to CVE-2016-3115",
            "indicatorOfCompromise": false,
            "assetAttributes": {
                "schemaVersion": 1,
                "agentId": "i-xxxxxxxxxxxxxxx",
                "ipv4Addresses": []
            },
            "userAttributes": [],
            "createdAt": 1468986526.663,
            "recommendation": "Use your Operating System's update feature to update package openssh, openssh-0:6.2p2-8.44.amzn1, openssh-clients-0:6.2p2-8.44.amzn1, openssh-server-0:6.2p2-8.44.amzn1. For more information see [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3115](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3115)",
            "updatedAt": 1468986526.663,
            "attributes": [
                {
                    "value": "openssh, openssh-0:6.2p2-8.44.amzn1, openssh-clients-0:6.2p2-8.44.amzn1, openssh-server-0:6.2p2-8.44.amzn1",
                    "key": "package_name"
                },
                {
                    "value": "CVE-2016-3115",
                    "key": "CVE_ID"
                },
                {
                    "value": "i-xxxxxxxxxxxxxxx",
                    "key": "INSTANCE_ID"
                }
            ],
            "schemaVersion": 1,
            "serviceAttributes": {
                "schemaVersion": 1,
                "rulesPackageArn": "arn:aws:inspector:ap-northeast-1:xxxxxxxxxxx:rulespackage/xxxxxxxxxxxx",
                "assessmentRunArn": "arn:aws:inspector:ap-northeast-1:xxxxxxxxxxx:target/xxxxxxxxxxxxx/template/xxxxxxxxxxxx/run/xxxxxxxxxxxxx"
            },
            "id": "CVE-2016-3115",
            "arn": "arn:aws:inspector:ap-northeast-1:xxxxxxxxxxxx:target/xxxxxxxxxxxxx/template/xxxxxxxxxxxxx/run/xxxxxxxxxxxx/finding/xxxxxxxxxxxx",
            "severity": "High"
        }
    ]
}

Output

Outputの項目は下記のような内容です。
マネージメントコンソールに表示されていないものもあります。

  • arn

    • 各FindingのARN。結果それぞれを一意に識別可能。
  • assetAttributes

    • agentId
      • EC2のインスタンスID
    • ipv4Addresses
      • IPアドレスだと思うけど、入らない・・・
  • assetType

    • 現状、ec2-instanceのみ
  • attributes

    • ルールパッケージによって異なりますが、ここではCVEのID、該当のパッケージ、インスタンスIDが出力されています。
  • confidence

    • 現状未使用で10
  • description

    • マネージメントコンソールの「説明」欄
  • id

    • 概要的なもの
    • マネージメントコンソールには該当欄なし
  • indicatorOfCompromise

    • 現状未使用で、全てfalse
    • 「セキュリティ侵害の痕跡」なので、今後の拡張があるかも
  • recommendation

    • マネージメントコンソールの「推奨事項」欄
  • serviceAttributes

    • ルールパッケージと評価のARN
  • severity

    • 重要度
      • High
      • Medium
      • Low
      • Informational
      • Undefined
  • numericSeverity

    • severityを数値化したもの
    • 現状は下記の模様
      • 0.0 Informational
      • 3.0 Low
      • 6.0 Middle
      • 9.0 High
  • title

    • マネージメントコンソール上の「結果」欄
  • userAttributes

    • ユーザーが付与したタグ情報

対象EC2、影響度、概要を把握するだけであれば、
assetAttributesのagentId、severity(numericSeverity)、description、recommendationをまとめればいいのではないかと思います。

4
2
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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?