LoginSignup
4
0

Incident Receiverを構築してみる

Last updated at Posted at 2023-12-13

Incident Receiverとは?

Incident ReceiverはZscalerが提供するICAPSサーバです。
データ保護ソリューションにおいて、DLPポリシーに違反したコンテンツに遭遇した場合、ユーザのデータプライバシーを考慮し、Zscalerはクラウド内に該当コンテンツを保存することはありません。そのためユーザ側で該当コンテンツを確認したい場合は、Incident Receiverを構築し、Zscalerクラウドから該当コンテンツを転送させる必要があります。

Incident Receiverの動作環境

Incident Receiverは仮想マシンとして動作し、そのイメージはZscalerから提供します。2023/12時点で以下のプラットフォームに対応しています。

  • VMware ESX/ESXi 6.0 以上、Oracle VirtualBox
  • AWS
  • Azure

Incident Receiverの動作

Incident ReceiverはICAPSサーバとして動作しますが、DLPポリシーに違反したコンテンツだけでなく、そのメタデータも受信します。Incident Receiver自体ではそれらを保管することはせず、指定されたストレージ(AWS S3やSFTPサーバなど)に転送します。

image.png

  1. 保護すべきデータがクラウドアプリへアップロードされる
  2. Zscalerクラウド(ZIA)でDLPポリシー違反と判定される
  3. ICAPSを用いてユーザ環境のIncident Receiverへ証跡情報(該当コンテンツおよびメタデータ)を送信
  4. Incident Receiverは証跡情報を受信し、ストレージに保管

Incident ReceiverをAWS上に構築する手順

ここではAWS EC2でIncident Receiverを構築(ストレージはAWS S3)する手順をご紹介します。
詳細についてはこちらのドキュメントをご参照ください。

  1. ZscalerサポートにIncident Receiverイメージの共有を依頼
  2. ストレージを用意
  3. セキュリティグループを作成
  4. IAM ロール, ポリシーを作成
  5. Incident Receiverインスタンスを起動
  6. Incident Receiverの登録
  7. Incident Receiverの構成

前提知識

  • ZIAでのDLPポリシー作成がわかる
  • AWSは何となくさわれる。セキュリティグループ、バケット、KMSがわかる。
  • CLIは苦じゃない

1. ZscalerサポートにIncident Receiverイメージの共有を依頼

利用中のZIAクラウド(zscalerthreeなど)、テナントID、AWSのRejion、アカウントIDを添えてZscalerサポートにIncident Receiverのイメージを共有するよう依頼してください。

2. ストレージを用意

AWS EC2上にIncident Receiverを構築する場合、AWS S3かSFTPサーバが必要です。
なお、Incident Receiverは受信したファイルをストレージに転送するだけなので、ストレージの管理はユーザ自身で行なっていただく必要があります。

ここではAWS S3バケットを使用します。
AWS S3コンソールに行き、バケットを作成します。作成したバケットをクリックし、プロパティからARNをコピーします。
image.png

DLPポリシー違反のコンテンツとそのメタデータは別々のバケットに格納させることができますが、Zscaler Workflow Automationを使用しない場合は同一でも構いません。ここでは同一のバケットを使用します。

3. セキュリティグループを作成

AWS EC2でIncident Receiver用のセキュリティグループを作成します。世界中のZscalerクラウドからコンテンツがICAPS経由で転送されてくるので、それらのインバウンド接続を許可する必要があります(セキュリティグループの設定手順詳細は割愛)。

  • ZscalerクラウドのIPアドレスはZscaler Hub IP Addressesとして公開されています。数が多いので大変です。なおクラウド面に注意してください。

image.png

  • ICAPSで使用するポートは1344を使います。
  • Incident Receiverは通常のAmazon Linuxのように公開鍵での接続ではなく、パスワード認証を使用するため、SSHがアクセスできるソースIPアドレスも制限した方が良いでしょう。
    image.png

4. IAM ロール、 ポリシーを作成

Incident ReceiverインスタンスがAWS S3にアクセスできるようIAM ロールとポリシーを作成します。

4.1. こちらからJSONサンプルをダウンロードします。

4.2. KMS (Key Management Service)の内容を確認します(ここではKMSがある前提です)。
KMSコンソールに行き、カスタマー管理型のキーをクリック、使用するキーをクリックし、ARNをコピーします。
image.png

4.3. IAMポリシーを作成します。
4.3.1. IAM に移動にし、左側のメニューからポリシーをクリックし、ポリシーの作成をクリックします。
image.png
4.3.2. ポリシーエディタでJSONをクリックし、4.1 でダウンロードしたJSONの内容をペーストします。
4.3.3. S3バケット、KMSのARNに変更します。上述の通り、S3バケットはコンテンツとメタデータを別のバケットにすることができますが、ここでは同一のものを使用します。
image.png
4.3.4. 次へ、をクリックし、名前を入力し、ポリシーの保存、をクリックします。

4.4. IAMロールを作成します。
4.4.1. IAMに戻り、左側のメニューからロールをクリックし、ロールを作成、をクリックします。
image.png

4.4.2. 信頼されたエンティティタイプ=AWSのサービス、サービスまたはユースケース=EC2、とし次へ、をクリックします。
image.png

4.4.3. 許可ポリシーで4.3で作成したポリシーを検索、チェックし、次へ、をクリックします。
image.png

4.4.4. ロール名を入力し、ロールを作成、をクリックします。

5. Incident Receiverインスタンスを起動

5.1. EC2 コンソールに移動し、インスタンスをクリック、さらにインスタンスを起動、をクリックします。

image.png

5.2. インスタンス名を入力し、自分のAMI、自分と共有を選択し、Incident ReceiverのAMIを指定します。

image.png

5.3. インスタンスタイプはt2.mediumまたはt3.medium以上が必要です。ここではt2.mediumとします

5.4. キーペアを指定します。ただIncident Receiverはパスワード認証なのでキーペアは使用しません。

5.5. 3.で作成したセキュリティグループを選択します。また、パブリックIPを割り当てるようにしてください。

5.6. インスタンスの起動、をクリックします。

5.7. EC2 インスタンスに戻り、作成したインスタンスを検索します。インスタンスが実行中であることを確認し、アクション > モニタリングとトラブルシューティング > インスタンスのスクリーンショットを取得、を選択します。

image.png

5.8. zsroot password に記載されている内容を確認します。これがSSHでアクセスする際の初期パスワードです。

image.png

5.9. インスタンスに戻り、パブリックIPv4アドレスを確認します。

6. Incident Receiverの登録

6.1. ZIA Adminポータルに管理者としてログインし、管理 > DLPインシデントレシーバーを選択します。

image.png

6.2. Zscaler Incident Receiverタブを選択し、追加、をクリックします。

image.png

6.3. 名前、および、サーバURIとして、icaps://<Incident ReceiverインスタンスのパブリックIP>:1344/ を設定し、保存、をクリックします。

image.png

6.4. 作成されたIncident Receiverの項目で、ダウンロードをクリックしファイルを保存します。後でこのファイルをIncident ReceiverにSCPでコピーする必要があります。

image.png

6.5. DLPルール作成時に、インシデントレシーバーの設定において、6.3で設定したIncident Receiverを登録します(DLPルール作成の詳細は割愛)。
image.png

7. Incident Receiverの構成

7.1. Incident ReceiverインスタンスにSSHでzsrootユーザとして5.8.で確認した初期パスワードを用いてアクセスします。

% ssh zsroot@##.##.##.##
##############################################################
### ZscalerOS-R24 ZSCALER(tm) PRODUCTION
##############################################################
Welcome to Zscaler Incident Reciever VM!

Please change the generated zsroot password as soon as possible.

To setup the VM with your account, follow the user guide.

Several useful commands:
- sudo zirsvr change-password
- sudo zirsvr configure-network
- sudo zirsvr configure <client cert bundle zip filename>
- sudo zirsvr stop
- sudo zirsvr start
- sudo zirsvr status
- sudo zirsvr restart
- sudo zirsvr update-now
- sudo zirsvr force-update-now
- sudo zirsvr troubleshoot

7.2. zirsvr change-passwordコマンドを使用して初期パスワードを変更します。

[zsroot@ip-##.##.##.##] $sudo zirsvr change-password
Password:<初期パスワード>
-------------------------------------------------------------------
Changing local password for zsroot
New Password:<新しいパスワード>
Retype New Password:<新しいパスワード>

7.3. 6.4.でダウンロードしたファイルをIncident ReceiverインスタンスにSCPでコピーします。macOSの場合は以下の通りです。

% scp ZscalerIcapRootCaCerts.zip zsroot@3##.##.##.##:/home/zsroot

7.4. zirsvr configureコマンドで証明書をインストールします。icapsのポート番号は1344のまま、ストレージはS3を指定します。

[zsroot@ip-##.##.##.##] $sudo zirsvr configure ~/IncidentReceiverCertificate_VMNAME_IncidentReciever.zip 
-------------------------------------------------------------------
Stopping zirsvr service if running...
ZIRSVR service has been stopped
-------------------------------------------------------------------
TCP connecting to www.zscaler.com:443...
Successful TCP connect to www.zscaler.com:443.
/sc/conf/sc.conf does not exist
-------------------------------------------------------------------
Updating configuration file /sc/conf/sc.conf:
-------------------------------------------------------------------
icaps_port (Port of Incident Reciever server) [1344]:
Do you want to forward data to SFTP or S3? <sftp,s3> [sftp]: s3
-------------------------------------------------------------------

さらに、Workflow Automationは使用しない(n)、S3を使用するAWSリージョン名、データを格納するS3バケット名とディレクトリパス、最後にメタデータを格納するS3バケットを別にしない(n)を入力します。

The S3 configuration requires an EC2 instance or other VM type instance to have permission to write to AWS S3 storage.
The permissions must be setup manually, can be done before or after this configuration, but before this configuration is recommended.
The permission models supported here are following, see Admin Guide for more detail:
    1) Use EC2 instance profile (preferred). User need to attach an IAM role to a EC2 ZIRSVR VM that has permission to targeted S3 storage, configuration is under EC2 instance -> "Actions" "Security" -> "Modify IAM role".
    2) Use S3 credentials file (not recommended). User need to manually create a /root/.aws/credentials file with proper aws_access_key_id and aws_secret_access_key in this VM. This allows none-EC2 VM to sent data to S3. See https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html and https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
Continuing the configuration of S3 parameters.
-------------------------------------------------------------------
Are you using this VM with Zscaler Workflow Automation? <y/n> [n]: n
storage_s3_region_name (S3 region name (ie: us-east-1)) []: <AWSリージョン名>
storage_s3_data_bucket_name (S3 bucket name for data storage) []: <S3バケット名>
storage_s3_data_dir (S3 bucket directory name for data storage) []: /
Do you want to foward json file and attachment to different S3 bucket? <y,n> [n]: n
-------------------------------------------------------------------

以下ログです。

-------------------------------------------------------------------
Checking zscaler cloud servers configuration
	 The Update Download server at zdistribute.zscalerthree.net:443 has been successfully connected.
-------------------------------------------------------------------
Installing latest build...
Connecting to server...
Downloading latest version
Installing build /sc/smcdsc/zirsvr_upgrade.sh
Finished installation!
-------------------------------------------------------------------
Starting zirsvr service...
Update started at: 2023-12-## 08:22:28
Checking for update...
Latest build has already been installed, installed build sc_6.2r.477_prod.35.379986_114_zirsvr.
Update ended at: 2023-12-## 08:23:03
ZIRSVR service is running with pid 6598
-------------------------------------------------------------------
Checking client certificates
	 This VM is configured for cloud "zscalerthree.net", orgid "68685020", nodeid "56436".
	 Client certificate files /sc/conf/zscaler_zirsvr_certificate.crt, /sc/conf/zscaler_zirsvr_key.key look okay.
Checking ZIRSVR server certificates
	 ZIRSVR server certificate files /sc/conf/zirsvr_server.crt and /sc/conf/zirsvr_server.key look okay.
Checking configuration files
	 Configuration files look okay.
Checking zscaler cloud servers configuration
	 The Update Download server at zdistribute.zscalerthree.net:443 has been successfully connected.
Checking running services
	 Incident Reciever server is configured to listen on 1xx.xx.xx.xx:1344.
	 ZIRSVR service is running.
Checking S3 configuration and connection
	 AWS S3 is configured as
	             region: xxxxxxxxxx
	             bucket: xxxxxxxx
	          directory: /
	     aws credential: Use EC2 instance profile, if configured
	 Test S3 upload to region: ap-northeast-1, bucket: syasuda-ir, directory: / has been completed successfully.
	 S3 configuration is setup correctly, connection, read, and write are all successful.
Checking remote syslog server
	 Remote syslog server is disabled.
Checking installed version
	 VM label: "sc_6.2r.256_prod.20.xxx_114_zirsvr"
	 Installed package label: "sc_6.2r.477_prod.35.xxx_114_zirsvr"
Checking CDS server for new update
	 Connecting to server...
	 Connecting to update server 1xx.1xx.2xx.xx.
	 Installed build version: 379XXX
	 Latest available build version: 379XXX
Checking physical memory size
	 hw.physmem: 4267282432
	 Warning: physical memory configured for this VM is lower than recommended 8GB.
-------------------------------------------------------------------

もしErrorが発生した場合はその内容により対処が必要です。例えば、S3バケットが存在しない場合、以下のようなErrorが発生します。

Error upload file to region="<AWSリージョン名>", bucket="<S3バケット名>", error="The specified bucket does not exist"

または、S3バケットにアクセスできない場合、以下のようなErrorが発生します。

Error upload file to region="<AWSリージョン名>", bucket="<S3バケット名>", error="Access Denied"

インストレーションプロセスの中で、Incient ReciverからS3に、zscaler_test.txt というファイルが配置されます。

これで構成は完了です。

動作確認

DLPルールにマッチするファイルを使ってテストを実施します。指定したS3バケットに、インシデント毎にフォルダが作成され、その中に、JSONのメタデータ(サンプル)と該当ファイルが保存されます。

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