Evident.io ESP のログ収集
Evident.io のログを収集するには、後続のセクションに詳述されている次の手順を実行します。
- Sumo Logic で、ホスト型コレクタと HTTP ソースを設定します。
- Evident.io 統合から AWS Simple Notification Service (SNS) への設定をします。
- SNS 通知をサブスクライブします。
- 未処理のメッセージの配信を有効化します。
Sumo Logic コレクタとソースの追加
- Sumo Logic で、ホスト型コレクタを設定します。
- HTTP ソースを設定します。
- Name (名前)。「Evident.io SNS Integration」と入力します。
- Source Category (ソース カテゴリ)。「security_evident」と入力します。
- [Advanced (詳細)] セクションで以下を設定します。
- Enable Timestamp Parsing (タイムスタンプ パースの有効化): [Extract timestamp information from log files (ログ ファイルからタイムスタンプ情報を抽出)] のチェック ボックスをアクティブ化します。
- Time Zone (タイム ゾーン): [Ignore time zone from log file (ログ ファイルからのタイムゾーンを無視)] を選択し、[(UTC) Etc/UTC] を選択します。
- Processing Rules (処理ルール)。次のマスク ルールを作成します。
- Name (名前)。適切なタイムスタンプのパースを有効にします。
- Filter (フィルタ)。
\"(?:created_at|updated_at|ended_at)\":\"\d+-\d+-\d+(T)\d+:\d+:\d+.\d+Z\"
と入力します。 - Type (タイプ)。[Mask messages that match (一致するメッセージをマスクする)] を選択します。
- 文字列をマスクします。「t」と入力します。
- [Apply (適用)] をクリックします。
- [Save (保存)] をクリックします。
- HTTP ソース アドレス URL をコピーし、次のセクションで使用します。
AWS SNS との Evident.io 統合の設定
AWS SNS との Evident.io 統合を設定するには、次の手順を実行します。
- Evident.io で 統合を追加します。
- AWS SNS 統合を有効にします。
SNS 通知へのサブスクライブ
ホスト型コレクタと HTTP ソースが設定できたら、ホスト型コレクタを Evident.io からのデータを収集するトピックにサブスクライブします。
- AWS マネジメント コンソールで、[SNS] > [Topics (トピック)] に移動し、「AWS SNS との Evident.io 統合の設定」で作成したトピックを見つけます。
- トピックのチェックボックスをオンにします。
- [Amazon SNS] の下にある [Actions (アクション)] メニューで [Subscribe to Topic (トピックにサブスクライブ)] を選択します。
- [Protocol (プロトコル)] から、[HTTPS] を選択して、最初の手順で作成した Sumo Logic HTTP ソース URL を [Endpoint (エンドポイント)] フィールドに貼り付けます。
- [Create Subscription (Subscriptionを作成)] をクリックします。
- 数分以内に Sumo Logic に確認メッセージが送信されます。
- Sumo Logic で
SubscribeURL
を検索して HTTP ソースからの確認メッセージを見つけます。
たとえば、次のクエリを使用します。
_sourceCategory=security_evident SubscribeURL
- その後、[Messages (メッセージ)] タブで、[JSON] フィールド
SubscribeURL
を探し、表示のとおり URL をクリップボードにコピーします。
- AWS マネジメント コンソールで、[SNS] > [Topics (トピック)] の順に選択します。
- [Amazon SNS] > [Actions (アクション)] から [Confirm a subscription (サブスクリプションを確認)] を選択します。
SubscribeURL
を [Subscription confirmation URL (サブスクリプション確認 URL)] フィールドに貼り付け、[Confirm subscription (サブスクリプション確認)] クリックします。
未処理メッセージの配信の有効化
トピックの未処理メッセージの配信を有効化します。
詳細については、http://docs.aws.amazon.com/sns/latest/dg/large-payload-raw-message.html を参照してください。
- [AWS Topic (AWS トピック)] を選択します。
- [Other subscription actions (その他のサブスクリプション アクション)] をクリックします。
- [Edit subscription attributes (サブスクリプション属性を編集)] をクリックします。
- [Raw message delivery (未処理メッセージの配信)] チェック ボックスをオンにします。
- [Set subscription attributes (サブスクリプション属性を設定)] をクリックします。
ログ メッセージのサンプル
{ "data":{ "id":"881237069", "type":"alerts", "attributes":{ "created_at":"2017-10-02t18:39:11.577Z", "status":"fail", "risk_level":"medium", "resource":"dgadoury", "updated_at":"2017-10-02t18:39:11.577Z", "started_at":"2017-10-02T18:39:11.578Z", "ended_at":null }, "relationships":{ "external_account":{ "data":{ "id":"3256", "type":"external_accounts" }, "links":{ "related":"https://esp.evident.io/api/v2/external_accounts/3256.json" } }, "region":{ "data":{ "id":"8", "type":"regions" }, "links":{ "related":"https://esp.evident.io/api/v2/regions/8.json" } }, "signature":{ "data":{ "id":"83", "type":"signatures" }, "links":{ "related":"https://esp.evident.io/api/v2/signatures/83.json" } }, "custom_signature":{ "data":null, "links":{ "related":null } }, "suppression":{ "links":{ "related":null } }, "metadata":{ "data":{ "id":"262926952", "type":"metadata" }, "links":{ "related":"https://esp.evident.io/api/v2/alerts/264543844/metadata.json" } }, "cloud_trail_events":{ "data":[ ], "links":{ "related":"https://esp.evident.io/api/v2/alerts/264543844/cloud_trail_events.json" } }, "tags":{ "data":[ ], "links":{ "related":"https://esp.evident.io/api/v2/alerts/264543844/tags.json" } }, "compliance_controls":{ "links":{ "related":"https://esp.evident.io/api/v2/alerts/2645:43844/compliance_controls.json" } } } }, "included":[ { "id":"2433", "type":"external_accounts", "attributes":{ "created_at":"2016-03-22t20:55:47.000Z", "name":"Test", "updated_at":"2016-10-05t01:05:22.000Z", "arn":"arn:aws:iam::926226587429:role/Evident_Service", "account":"123226587429", "external_id":"62dd0abc-5b44-410b-99d9-063f2c2b203e", "cloudtrail_name":null }, "relationships":{ "organization":{ "links":{ "related":"https://esp.evident.io/api/v2/organizations/1000.json" } }, "sub_organization":{ "links":{ "related":"https://esp.evident.io/api/v2/sub_organizations/2000.json" } }, "team":{ "links":{ "related":"https://esp.evident.io/api/v2/teams/3000.json" } }, "scan_intervals":{ "links":{ "related":"https://esp.evident.io/api/v2/external_accounts/5000/scan_intervals.json" } } } }, { "id":"8", "type":"regions", "attributes":{ "code":"ap_southeast_1", "created_at":"2014-06-05t23:42:37.000Z", "updated_at":"2014-06-05t23:42:37.000Z" } }, { "id":"83", "type":"signatures", "attributes":{ "created_at":"2014-06-09t22:33:54.000Z", "description":"Ensure RDS restorable windows are within bounds -- exceeding 5 minutes is problematic.", "identifier":"AWS:ELB-070", "name":"ELB SSL Expiry 90day", "resolution":"RDS Restorable Windows are the timeframe to which the latest data is restorable.ウィンドウが 5 分を超過するようになったら、システム内で何かが恒常的に遅延しており破損している可能性があります。この署名は、「最新の復旧可能な時間」が意図したとおりに作動しない事態が生じた時にユーザにアラート通知します。このような事態になると、バックアップからデータを復旧する必要が生じた場合の潜在的なリスクが増加します。全体として、このアラートは AWS からの一時的な遅延により ESP で PASS から FAIL に切り替わることが予想されます。このアラートが特定のアカウントについて常に失敗する場合、AWS サポートに連絡して確認を依頼することをお勧めします。詳細については、「最新の復旧可能な時間」が DB インスタンスを特定の時点まで遅延せずに復旧する機能にどう影響するかを説明した情報が AWS にあります。http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html", "risk_level":"Low", "updated_at":"2016-10-13t00:00:15.000Z" }, "relationships":{ "service":{ "links":{ "related":"https://esp.evident.io/api/v2/services/10.json" } } } } ] }
クエリのサンプル
Alerts by Status (ステータス別アラート)
_sourceCategory=security_evident
| json "data.id", "data.attributes" as id, data_attrib
| json "included.[0].attributes.name" as account_name
| json "included.[1].attributes.code" as region
| json "included.[2].attributes" as sig_attrib
| json field=data_attrib "resource", "status", "started_at", "created_at", "ended_at", "updated_at"
| json field=sig_attrib "description", "identifier", "name", "resolution", "risk_level"
| first(updated_at) by id, status
| count by status