Amazon S3¶
Amazon S3またはAmazon Simple Storage Serviceは、Amazon Web Services(AWS)によって提供されるスケーラブルなクラウドストレージサービスです。バックアップ、アーカイブ、コンテンツ配信、ウェブサイトホスティング、アプリケーションデータの保存など、さまざまな目的に使用されます。Wallarmを設定して、検出されたhitsの情報を含むファイルをAmazon S3バケットに送信することができます。情報はJSON形式のファイルで10分ごとに送信されます。
各hitのデータフィールド:
-
time
- hit検出の日時(Unix Timestamp形式) -
request_id
-
ip
- 攻撃者のIP -
Hitソースタイプ:
datacenter
、tor
、remote_country
-
application_id
-
domain
-
method
-
uri
-
protocol
-
status_code
-
attack_type
-
block_status
-
payload
-
point
-
tags
ファイルは、wallarm_hits_{timestamp}.json
またはwallarm_hits_{timestamp}.jsonl
という命名規則でS3バケットに保存されます。形式は、統合設定時の選択により、JSON ArrayまたはNew Line Delimited JSON(NDJSON)のいずれかになります。
統合のセットアップ¶
Amazon S3との統合を設定する際は、どの認証方法を使用するかを決定する必要があります:
-
Role ARNによる方法(推奨) - external IDオプション付きのロールを使用してリソースへのアクセスを許可する方法は、セキュリティを向上させ「confused deputy」攻撃を防止する方法としてAWSにより推奨されています。Wallarmは組織アカウント固有のIDを提供します。
-
Secret access keyによる方法 - より一般的で簡単な方法で、AWS IAMユーザーの共有access keyを使用します。この方法を選択する場合は、統合で使用するS3バケットへの書き込み権限のみを持つ別のIAMユーザーのaccess keyを使用することを推奨します。
Amazon S3統合の設定手順:
-
Wallarm用のAmazon S3バケットを作成します。作成手順についてはこちらをご参照ください。
-
選択した認証方法に応じて、以下のステップを実行します。
-
AWS UIにて、S3 → 対象バケット → Propertiesタブに移動し、バケットのAWS RegionとAmazon Resource Name(ARN)のコードをコピーします。
例として、リージョンが
us-west-1
、ARNがarn:aws:s3:::test-bucket-json
の場合です。 -
Wallarm Console UIにて、Integrationsセクションを開きます。
- AWS S3ブロックをクリックするか、Add integrationボタンをクリックしてAWS S3を選択します。
- 統合名を入力します。
- 先にコピーしたS3バケットのAWSリージョンコードを入力します。
- S3バケット名を入力します。
- 提供されたWallarmアカウントIDをコピーします。
- 提供されたexternal IDをコピーします。
- AWS UIにて、IAM → Access Management → Rolesから新しいロールの作成を開始します。
- 信頼エンティティタイプとしてAWS account → Another AWS Accountを選択します。
- WallarmのAccount IDを貼り付けます。
- Require external IDを選択し、Wallarmから提供されたexternal IDを貼り付けます。
-
Nextをクリックし、ロール用のポリシーを作成します:
-
ロールの作成を完了し、ロールのARNをコピーします。
-
Wallarm Console UIに戻り、統合作成ダイアログのRole ARNタブに、コピーしたロールのARNを貼り付けます。
- AWS UIにて、S3 → 対象バケット → Propertiesタブに移動し、バケットのAWS Regionコード(例:
us-west-1
)をコピーします。 - IAM → Dashboard → Manage access keys → Access keysセクションに移動します。
- 保管してあるaccess keyのIDを取得するか、新規作成または紛失したキーをこちらの説明に従って復旧します。いずれにしても、有効なキーとそのIDが必要です。
- Wallarm Console UIにて、Integrationsセクションを開きます。
- AWS S3ブロックをクリックするか、Add integrationボタンをクリックしてAWS S3を選択します。
- 統合名を入力します。
- 先にコピーしたS3バケットのAWSリージョンコードを入力します。
- S3バケット名を入力します。
- Secret access keyタブで、access key IDとキー自体を入力します。
-
-
Wallarmデータの形式として、JSON ArrayまたはNew Line Delimited JSON(NDJSON)のいずれかを選択します。
-
Regular notificationsセクションで、過去10分間のhitsが送信対象として選択されていることを確認します。選択されていない場合、データはS3バケットに送信されません。
-
Test integrationをクリックし、構成の正しさ、Wallarm Cloudの利用可能性、通知形式を確認します。
Amazon S3の場合、統合テストは過去10分間に検出されたhitsのデータが含まれるJSONファイルをバケットに送信します。以下はそのJSONファイルの例です:
[ { "time":"1687241470", "request_id":"d2a900a6efac7a7c893a00903205071a", "ip":"127.0.0.1", "datacenter":"unknown", "tor":"none", "remote_country":null, "application_id":[ -1 ], "domain":"localhost", "method":"GET", "uri":"/etc/passwd", "protocol":"none", "status_code":499, "attack_type":"ptrav", "block_status":"monitored", "payload":[ "/etc/passwd" ], "point":[ "uri" ], "tags":{ "lom_id":7, "libproton_version":"4.4.11", "brute_counter":"c188cd2baa2cefb3f3688cb4008a649e", "wallarm_mode":"monitoring", "final_wallarm_mode":"monitoring" } }, { "time":"1687241475", "request_id":"b457fccec9c66cdb07eab7228b34eca6", "ip":"127.0.0.1", "datacenter":"unknown", "tor":"none", "remote_country":null, "application_id":[ -1 ], "domain":"localhost", "method":"GET", "uri":"/etc/passwd", "protocol":"none", "status_code":499, "attack_type":"ptrav", "block_status":"monitored", "payload":[ "/etc/passwd" ], "point":[ "uri" ], "tags":{ "lom_id":7, "libproton_version":"4.4.11", "brute_counter":"c188cd2baa2cefb3f3688cb4008a649e", "wallarm_mode":"monitoring", "final_wallarm_mode":"monitoring" } } ]
{"time":"1687241470","request_id":"d2a900a6efac7a7c893a00903205071a","ip":"127.0.0.1","datacenter":"unknown","tor":"none","remote_country":null,"application_id":[-1],"domain":"localhost","method":"GET","uri":"/etc/passwd","protocol":"none","status_code":499,"attack_type":"ptrav","block_status":"monitored","payload":["/etc/passwd"],"point":["uri"],"tags":{"lom_id":7,"libproton_version":"4.4.11","brute_counter":"c188cd2baa2cefb3f3688cb4008a649e","wallarm_mode":"monitoring","final_wallarm_mode":"monitoring"}} {"time":"1687241475","request_id":"b457fccec9c66cdb07eab7228b34eca6","ip":"127.0.0.1","datacenter":"unknown","tor":"none","remote_country":null,"application_id":[-1],"domain":"localhost","method":"GET","uri":"/etc/passwd","protocol":"none","status_code":499,"attack_type":"ptrav","block_status":"monitored","payload":["/etc/passwd"],"point":["uri"],"tags":{"lom_id":7,"libproton_version":"4.4.11","brute_counter":"c188cd2baa2cefb3f3688cb4008a649e","wallarm_mode":"monitoring","final_wallarm_mode":"monitoring"}}
-
Add integrationをクリックします。
Wallarm Cloud IP addresses
To provide Wallarm Cloud access to your system, you may need a list of its public IP addresses:
保存されるデータ量を制御するため、古いオブジェクトを自動的に削除するようにAmazon S3バケットを設定することをこちらの説明に従い推奨します。
統合の無効化と削除¶
You can delete or temporarily disable the integration. While deleting stops sending notificatioins and completely deletes all configuration, disabling just stops sending notifications which you can at any moment re-enable with the same settings.
If for the integration the System related events are selected to trigger notifications, Wallarm will notify about both of these actions.
システムの利用不可および不正な統合パラメータ¶
Notifications to the system are sent via requests. If the system is unavailable or integration parameters are configured incorrectly, the error code is returned in the response to the request.
If the system responds to Wallarm request with any code other than 2xx
, Wallarm resends the request with the interval until the 2xx
code is received:
-
The first cycle intervals: 1, 3, 5, 10, 10 seconds
-
The second cycle intervals: 0, 1, 3, 5, 30 seconds
-
The third cycle intervals: 1, 1, 3, 5, 10, 30 minutes
If the percentage of unsuccessful requests reaches 60% in 12 hours, the integration is automatically disabled. If you receive system notifications, you will get a message about automatically disabled integration.