2
1

More than 3 years have passed since last update.

Tableau - Row Level Security(RLS)

Last updated at Posted at 2019-12-16

基本的な考え方

  • Desktopでは、編集によるRLS解除が可能となるため、本質的にRLSの意味をなさない
  • ユーザーフィルターによるRLS実装は、性能インパクト(*1)およびメンテナンス性(*2)の観点から、大規模エンタープライズ用途には不適
  • 大規模実装では、権限テーブルとの動的結合を、ライブ接続 or Hyper抽出(複数の表, Normalized Extract, v2018.3以降, (*3))で利用することを推奨
  • Centralized RLS (Coming-soon) (*4)

(*1)
https://www.tableau.com/sites/default/files/whitepapers/designing-efficient-workbooks-v10_ja-jp_1.pdf
ユーザーフィルター
ワークブックにユーザーフィルターが含まれているとき、[ユーザーフィルターの作成] ダイアログ、または ISMEMBEROF() などのビルトインのユーザー関数のいずれかを使用した計算フィールドのいずれを使用した場合でも、モデルキャッシュは複数のユーザーセッションにわたって共有されることはありません。 これによりキャッシュの再利用率が大幅に下がり、Tableau Server にとっては負荷が増えることになります。 これらのフィルタータイプは、慎重に使用することをお勧めします。
https://interworks.com/blog/modonnell/2015/08/17/tableau-performance-checklist-filtering-dont-be-lazy-user-filters
Don’t be lazy with user filters. Security by user filters can impact performance on Tableau Server as the server cannot share connections and query caches if user filters are active. Consider building a summary view that is a user-agnostic overview using a pre-aggregated extract with underlying data hidden. For a detailed view, restrict it to specific users or active directory groups instead of user filters.

(*2)
ISMEMBEROF function only taking String literals
https://community.tableau.com/ideas/3314
ISMEMBEROFは引数として静的な文字列のみ受理するため、権限テーブル更新ごとにデータソース(or ワークブック)の更新(編集とパブリッシュ)が発生する
データソースやワークブック数が多数ある環境では、正確な更新作業をタイムリーに実施するためのメンテナンス負荷から、現実解になりにくい

(*3)
[複数の表] オプションを使用するヒント
https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/extracting_data.htm#noramlized_tips
MULTIPLE TABLE (NORMALIZED) HYPER EXTRACTS
https://tableauandbehold.com/2018/08/08/multiple-table-normalized-hyper-extracts/

(*4)
xxx

実装方法

データ行レベルでのアクセスの制限
https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/publish_userfilters.htm

(1.1) ユーザーフィルターによるVizレベルでの実装
https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/publish_userfilters.htm
ワークブックをパブリッシュする際には、ユーザーがワークブックを編集したり、フィルターを削除できないよう、追加手順を実行する必要があります。
https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/publish_userfilters_create.htm#publish-user-filters
ユーザー フィルターを使用してワークブックやデータ ソースをパブリッシュするときは、ワークブックを開くユーザーや Tableau Server データ ソースに接続するユーザーがフィルターを削除し、それによりすべてのデータへのアクセスを取得できないようパーミッションを設定する必要があります。
静的:[ユーザーフィルターの作成]ダイアログ
動的:ISMEMBEROF(),USERNAME()などユーザ関数、CONTAINS()関数などの利用

(1.2) ユーザーフィルターによるデータソース管理レベルでの実装
https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/publish_userfilters_create.htm#filter-data-source
パブリッシュされた各ワークブックでユーザー フィルターや特別なパーミッションを維持するのではなく、データ ソースをフィルターしてからパブリッシュし、データを使用する 1 対多の共有リソースとして使用できるようにします。

(2.1) 権限テーブル結合によるデータソースレベルの実装
権限テーブルを動的に結合する考え方
https://tableauandbehold.com/2016/03/07/how-to-set-up-your-database-for-row-level-security-in-tableau/
さらに、v2018.3以降の「複数の表」抽出を利用する方法
https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/extracting_data.htm#noramlized_tips
https://tableauandbehold.com/2018/08/08/multiple-table-normalized-hyper-extracts/

(2.2) 初期SQLと連携したデータソース(データベース機能)に閉じたライブ接続実装
Oracle VPD、SQL Serverストアドプロシージャ、など
https://tableauandbehold.com/2018/01/23/using-pass-through-functions-rawsql-for-row-level-security/

(3) URLパラメータによる制御
簡易実装は可能だが、セキュリティホールを包含するのでお奨めはしない

参考リソース

https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/publish_userfilters.htm
https://tableauandbehold.com/row-level-security/
https://tableauandbehold.com/2016/08/08/defusing-row-level-security-in-tableau-data-extracts-before-they-blow-up-part-1/
https://tableauandbehold.com/2016/08/10/defusing-row-level-security-in-your-extracts-before-they-blow-up-part-two/
https://tableauandbehold.com/2018/08/08/multiple-table-normalized-hyper-extracts/
https://www.linkedin.com/pulse/row-level-security-tableau-chris-short/
http://enterprisetableau.com/datasecurity/
https://interworks.com/blog/interworks/2013/04/05/tableau-qa-row-level-security/
https://community.tableau.com/thread/231612
https://tableauandbehold.com/2018/01/23/using-pass-through-functions-rawsql-for-row-level-security/
https://tableauandbehold.com/2019/01/26/hierarchical-row-level-security-best-practices/
https://tableauandbehold.com/2020/06/03/attribute-based-row-level-security-in-tableau-a-working-technique/
https://help.tableau.com/current/server/ja-jp/rls_bestpractices.htm
https://tc20.tableau.com/episodes/row-level-security-tableau-573

2
1
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
2
1