0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Google Dataplex にて BigQuery に対する Sensitive Data Discovery の実行結果を表示してみた

Posted at

概要

Google Dataplex にて BigQuery に対する Sensitive Data Discovery の実行結果を表示してみました。下記のようにタグが設定されるようです。

image.png

センシティブデータを検出するサービスとして Cloud DLP (Data Loss Prevention)というサービスがあったようなのですが、Sensitive Data Discovery というサービスに組み込まれたようです。

Cloud Data Loss Prevention (Cloud DLP) is now a part of Sensitive Data Protection. The API name remains the same: Cloud Data Loss Prevention API (DLP API). For information about the services that make up Sensitive Data Protection, see Sensitive Data Protection overview.

引用元:データ プロファイル | Sensitive Data Protection Documentation | Google Cloud

Cloud Data Loss Prevention(Cloud DLP)は、Sensitive Data Protection の一部になりました。API の名前は Cloud Data Loss Prevention API(DLP API)のままです。Sensitive Data Protection を構成するサービスの詳細については、「Sensitive Data Protection の概要」を参照してください。

上記の翻訳

image.png

引用元:データ プロファイル | Sensitive Data Protection Documentation | Google Cloud

Sensitive Data Discovery の実行結果に基づきタグを実行したいと考えて、当初は Dataplex にタグを設定する手順を検証しましたが、BigQuery にデータを格納したほうがタグ付けする際には容易に利用できる可能性もあります。Dataplex と BigQuery のどちらにもデータを登録できるため、どちらにも登録する方がいいかもしれません。

image.png
image.png

本記事では、下記のサービスを利用できることを前提としています。

  • BigQuery
  • Dataplex
  • Sensitive Data Protection

実施手順

1. BigQuery にテーブル作成とデータの挿入を実施

1-1. テーブル作成

CREATE OR REPLACE TABLE bq-publisher-01.data_profiling_test.profile_table_10 ( 
  ID STRING,
  family_namae STRING,
  First_name STRING,
  mail_address STRING,
  address STRING,
  Customer_Lever STRING,
  Description STRING
);

image.png

1-2. データの挿入

INSERT INTO
  bq-publisher-01.data_profiling_test.profile_table_10 (
    ID,
    family_namae,
    First_name,
    mail_address,
    address,
    Customer_Lever,
    Description
  )
VALUES 
  ('1', 'Yamada', 'Taro', 'taro.yamada@example.com', 'Tokyo', 'Gold', 'First customer'),
  ('2', 'Suzuki', 'Hanako', 'hanako.suzuki@example.com', 'Osaka', 'Silver', 'Second customer'),
  ('3', 'Tanaka', 'Ichiro', 'ichiro.tanaka@example.com', 'Nagoya', 'Gold', 'Third customer'),
  ('4', 'Sato', 'Jiro', 'jiro.sato@example.com', 'Fukuoka', 'Bronze', 'Fourth customer'),
  ('5', 'Kobayashi', 'Saburo', 'saburo.kobayashi@example.com', 'Sapporo', 'Silver', 'Fifth customer');

image.png

1-3. データの確認

SELECT * FROM bq-publisher-01.data_profiling_test.profile_table_10  LIMIT 5

image.png

2. Sensitive Data Protection (Cloud Data Loss Prevention API)を実行

2-1. Navigation Menu にて Security -> Sensitive Data Protectionを選択

image.png

2-2. DISCOVERY -> SCAN CONFIGURATION -> + CREATE CONFIGURATIONを選択

image.png

2-3. Select a discovery typeにてBigQueryを選択

image.png

2-4. Select scopeにてScan one talbe(test mode)を選択して作成したテーブルを指定。

image.png

2-5. Manage SchedulesにてデフォルトのままCONTINUEを選択

image.png

2-6. Select inspection templateにてデフォルトのままCONTINUEを選択

image.png

2-7. Add actionsにてSend to Dataplex as tagsにチェックが入っていることを確認の上CONTINUEを選択

image.png

image.png

2-8. Set location to store configurationにてデフォルトのままCONTINUEを選択

image.png

2-9. Review and createにてデフォルトのままCREATEを選択

image.png

2-10. Confirm configuration creationウィンドウにてCREATE CONFIGURATIONを選択

image.png

2-11. DISCOVERY -> PROFILESをクリックして作成した Cofiguration が作成されたことを確認(下記図では一番下の項目) し、実行が完了されることを待機

image.png

2-12. 作成した Cofiguration が完了したことを確認

image.png

3. Dataplex にて確認

3-1. 作成した Configuration の詳細ページにてDataplex entryという項目の値をクリック

image.png

3-2. Dataplex の画面に移動後、Tagsにタグが追加されたことを確認。

image.png

image.png

実行結果を BigQuery に書き込む際の追加の手順

1. Configuration 作成時のAdd actionsSave data profile copies to BigQueryにて書き込み先のテーブル名を指定

image.png

image.png

2. 指定したテーブル名にlatest_v1というものが不可されたテーブルに json 形式で格納されていることを確認

image.png

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?