Amazon GuardDutyでサンプルイベントを作成してみた #reinvent

2017.11.30

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

はじめに

re:Invent2017で発表されたAmazon GuardDutyを試してみました。 GuardDutyでは、サンプルイベントを作成する事ができます。 サンプルイベントを確認し、どのようなセキュリティモニタリングが出来るのか確認してみました。

試してみた

GuardDutyは東京リージョンで利用可能です。 https://ap-northeast-1.console.aws.amazon.com/guardduty/home?region=ap-northeast-1#/ に接続し、Get startedを選択します。

GuardDutyの有効化を選択します。

全般>結果サンプルの生成 を選択します。

"最近の結果"にサンプルが生成されます。

"EC2 instance i-99999999 is communicating with a Drop Point."をエクスポートしてみます。

json形式でエクスポートできます。

[
  {
    "schemaVersion": "2.0",
    "accountId": "123456789123",
    "region": "ap-northeast-1",
    "partition": "aws",
    "id": "123456789abcdefghijklmnopqrstuvw",
    "arn": "arn:aws:guardduty:ap-northeast-1:123456789123:detector/123456789123/finding/123456789abcdefghijklmnopqrstuvw",
    "type": "Trojan:EC2/DropPoint",
    "resource": {
      "resourceType": "Instance",
      "instanceDetails": {
        "iamInstanceProfile": null,
        "imageId": null,
        "instanceId": "i-99999999",
        "instanceState": null,
        "instanceType": null,
        "launchTime": null,
        "networkInterfaces": null,
        "availabilityZone": null,
        "platform": null,
        "productCodes": null,
        "tags": null
      }
    },
    "service": {
      "serviceName": "guardduty",
      "detectorId": "abcdefghijklmnopqrstuvw123456789",
      "action": {
        "actionType": "NETWORK_CONNECTION",
        "networkConnectionAction": {
          "connectionDirection": "OUTBOUND",
          "remoteIpDetails": {
            "ipAddressV4": "xxx.xx.xx.xx",
            "organization": {
              "asn": -1,
              "asnOrg": "GeneratedFindingASNOrg",
              "isp": "GeneratedFindingISP",
              "org": "GeneratedFindingORG"
            },
            "country": {
              "countryName": "United States"
            },
            "city": {
              "cityName": "GeneratedFindingCityName"
            },
            "geoLocation": {
              "lat": 0,
              "lon": 0
            }
          },
          "remotePortDetails": {
            "port": 22,
            "portName": "SSH"
          },
          "localPortDetails": {
            "port": 2000,
            "portName": "Unknown"
          },
          "protocol": "TCP",
          "blocked": false
        }
      },
      "resourceRole": "TARGET",
      "additionalInfo": {
        "unusualProtocol": "UDP",
        "threatListName": "GeneratedFindingCustomerListName",
        "unusual": 22,
        "sample": true
      },
      "eventFirstSeen": "2017-11-29T20:39:48Z",
      "eventLastSeen": "2017-11-29T20:39:48Z",
      "archived": false,
      "count": 1
    },
    "severity": 5,
    "createdAt": "2017-11-29T20:39:48.441Z",
    "updatedAt": "2017-11-29T20:39:48.441Z",
    "title": "EC2 instance i-99999999 is communicating with a Drop Point.",
    "description": "EC2 instance i-99999999 is communicating with a remote host xxx.xx.xxx.x that is known to hold credentials and other stolen data captured by malware."
  }
]

Finding(結果)には、タイプがあります。 「Trojan:EC2/DropPoint」はEC2が通信しているリモートIPアドレスのクレデンシャルやその他のデータは、マルウェアによる盗用が確認されている事を示します。 EC2はマルウェアに感染している可能性があります。 詳細はユーザーガイドのAmazon GuardDuty Finding Typesをご覧ください。

結果は、マネージメントコンソールからも確認できます。

影響を受けるリソースについて、詳しくみてみます。 Resource typeはAccessKeyかInstanceになります。 現在、EC2とAWSクレデンシャルがサポートされています。 "結果"の生成に利用されたインスタンスID(i-99999999)とポート番号(2000)を確認できます。

アクションでは、TCPによるアウトバウンド通信が行われた事を確認できます。

Actorでは、アクティビティに関与したIP、ポート、場所、ドメインを確認できます。

Finding(結果)で確認出来る内容は、Amazon GuardDuty Findingsをご覧ください。

さいごに

GuardDutyでは、サンプルイベントを作成する事ができます。 サンプルイベントを確認し、どのようなセキュリティモニタリングが出来るのか確認してみました。 Amazon GuardDuty Finding Typesを確認すると、GuardDuty でモニタリング出来る内容を確認できるかと思います。

参考