日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

實踐示例:MaxCompute底層脫敏使用方法(新版公測中)

當項目用戶具備查詢MaxCompute項目中某些敏感數據權限,但又不希望用戶看到完整的敏感數據信息時,可對查詢結果進行數據動態脫敏。本文為您介紹如何開啟MaxCompute的動態脫敏功能,并提供參考示例。

背景信息

MaxCompute本身不具備動態脫敏能力,依賴于DataWorks數據保護傘的數據脫敏功能。您需先開通DataWorks的數據保護傘服務,才可為目標MaxCompute項目開啟動態脫敏功能。開啟動態脫敏功能后,您可基于數據保護傘的數據識別規則,配置項目的脫敏規則(即對哪些敏感數據進行脫敏)。

新版MaxCompute底層脫敏功能如下:

該功能可以有效保護諸如手機號、身份證號、銀行卡號、車牌號、IP地址等敏感信息。動態脫敏功能僅會對查詢結果進行脫敏,不會影響底層存儲的數據。

使用限制

  • 僅DataWorks專業版及以上版本,才可使用此功能。DataWorks基礎版暫時無法使用此功能,如您的DataWorks為基礎版,請升級DataWorks為合適版本。詳情請參見版本升級

  • 僅華北2(北京)、華東2(上海)、華東1(杭州)、西南1(成都)、華南1(深圳)、華北2(北京政務云)、華東2(上海金融云)、中國(香港)、新加坡、德國(法蘭克福)、馬來西亞(吉隆坡)、美國(硅谷)地域支持使用MaxCompute底層脫敏。

  • 若啟用MaxCompute底層脫敏并設置相應脫敏規則,則查詢敏感數據時,會將MaxCompute底層脫敏作為生效規則;若未啟用MaxCompute底層脫敏或未配置相應脫敏規則,則查詢敏感數據時,會將已配置的上層脫敏場景規則作為生效規則。

  • MaxCompute底層脫敏不支持對MaxCompute數據表的主鍵字段進行脫敏。

  • 僅當MaxCompute項目中已存在數據并且數據創建超過24小時,才能使用此功能。

準備工作

  1. 準備待脫敏的MaxCompute項目和數據。具體操作,請參見創建MaxCompute項目導入數據

  2. 訪問數據保護傘服務并開通。具體操作,請參見進入數據保護傘

    服務聲明頁面,勾選我已閱讀并接受以上協議條款,單擊立刻開通

開啟數據脫敏功能

  1. 選擇脫敏場景。

    1. 進入數據保護傘

    2. 在左側導航欄,單擊規則配置 > 數據脫敏管理,進入數據脫敏管理

    3. 脫敏場景區域選擇底層脫敏場景 > MaxCompute引擎層脫敏_新

    說明

    如果需要在DataWorks界面上展示脫敏效果,需要打開數據開發/數據地圖展示脫敏創建數據脫敏場景更多內容請參見創建數據脫敏場景

  2. 新建數據脫敏規則

  3. (可選)白名單配置

    若脫敏規則指定的數據不需要對某些用戶進行脫敏展示,您可配置脫敏規則白名單。

    1. 數據脫敏管理頁面,單擊白名單配置

    2. 單擊右上方的+白名單

    3. 新建白名單對話框,選擇敏感字段類型用戶組范圍生效時間

      說明

      設置白名單生效時間后,若不在白名單脫敏時間的區間內,用戶在查詢該敏感信息時將會繼續脫敏。

  4. 項目空間配置。

    1. MaxCompute引擎層脫敏_新,展示MaxCompute引擎層脫敏的所有MaxCompute項目空間。

    2. 擊目標項目空間的狀態開關,即可使該項目空間的MaxCompute底層脫敏規則生效。

      說明

      若啟用MaxCompute底層脫敏并設置相應脫敏規則,則查詢敏感數據時,會將MaxCompute底層脫敏作為生效規則;若未啟用MaxCompute底層脫敏或未配置相應脫敏規則,則查詢敏感數據時,會將已配置的上層脫敏場景規則作為生效規則。

查詢數據并確認脫敏結果

本文示例在odpscmd界面通過SQL語句查詢數據并確認脫敏結果。

  1. 配置訪問域名。

    執行具體查詢SQL前,請先在odpscmd服務的Config配置文件中配置訪問域名。

    不同地域的域名配置,具體如下。

    上海
    set odps.internet.access.list=dsg-cn-shanghai.data.aliyun.com:80,dsg-cn-shanghai.data.aliyun.com:443,dsg-oss-dic-ori.oss-cn-shanghai.aliyuncs.com:80,dsg-cn-shanghai.data.aliyun.com:443;
    杭州
    set odps.internet.access.list=dsg-cn-hangzhou.data.aliyun.com:80,dsg-cn-hangzhou.data.aliyun.com:443,dsg-oss-dic-ori-hz.oss-cn-hangzhou.aliyuncs.com:80,dsg-oss-dic-ori-hz.oss-cn-hangzhou.aliyuncs.com:443;
    北京
    set odps.internet.access.list=dsg-cn-beijing.data.aliyun.com:80,dsg-cn-beijing.data.aliyun.com:443,dsg-oss-dic-ori.oss-cn-beijing.aliyuncs.com:80,dsg-oss-dic-ori.oss-cn-beijing.aliyuncs.com:443;
    成都
    set odps.internet.access.list=dsg-cn-chengdu.data.aliyun.com:80,dsg-cn-chengdu.data.aliyun.com:443,dsg-oss-dic-ori-cd.oss-cn-chengdu.aliyuncs.com:80,dsg-oss-dic-ori-cd.oss-cn-chengdu.aliyuncs.com:443;
    香港
    set odps.internet.access.list=dsg-cn-hongkong.data.aliyun.com:80,dsg-cn-hongkong.data.aliyun.com:443,dsg-oss-hongkong.oss-cn-hongkong.aliyuncs.com:80,dsg-oss-hongkong.oss-cn-hongkong.aliyuncs.com:443;

    主要參數說明如下。

    命令

    含義

    odps.internet.access.list

    表示運行執行函數時訪問相關域名,用于查詢數據保護傘的脫敏信息。

    以杭州地域SchemaNamedefault示例,配置文件代碼如下:

    project_name=data_shield_hz
    # app access id and key are optional for individual users
    # app_access_id=<app_accessid>
    # app_access_key=<app_accesskey>
    access_id=客戶aid
    access_key=客戶ak
    # this endpoint is for office environment
    end_point=http://service.odps.aliyun.com/api
    # this url is for odpscmd update
    update_url=http://odps.alibaba-inc.com/official_downloads
    # download sql results by instance tunnel
    use_instance_tunnel=true
    # the max records when download sql results by instance tunnel
    instance_tunnel_max_record=10000
    set odps.internet.access.list=dsg-cn-hangzhou.data.aliyun.com:80,dsg-cn-hangzhou.data.aliyun.com:443,dsg-oss-dic-ori-hz.oss-cn-hangzhou.aliyuncs.com:80,dsg-oss-dic-ori-hz.oss-cn-hangzhou.aliyuncs.com:443;
  2. 執行查詢SQL。

    執行具體查詢SQL前,請先在當前會話中通過set命令調用脫敏服務,不同地域調用底層脫敏服務的命令如下。

    說明

    MaxCompute底層數據脫敏僅支持會話級別使用。

    上海
    set odps.output.field.formatter={"name":"aegis:<SchemaName>:masking_v2","param":["alias","index"]};
    set odps.isolation.session.enable=true;
    杭州
    set odps.output.field.formatter={"name":"aegis_hz:<SchemaName>:masking_v2","param":["alias","index"]};
    set odps.isolation.session.enable=true;
    北京
    set odps.output.field.formatter={"name":"aegis_bj:<SchemaName>:masking_v2","param":["alias","index"]};
    set odps.isolation.session.enable=true;
    成都
    set odps.output.field.formatter={"name":"aegis_cd:<SchemaName>:masking_v2","param":["alias","index"]};
    set odps.isolation.session.enable=true;
    香港
    set odps.output.field.formatter={"name":"aegis_hk:<SchemaName>:masking_v2","param":["alias","index"]};
    set odps.isolation.session.enable=true;

    主要參數說明如下。

    命令

    含義

    odps.output.field.formatter

    表示要調用ODPS的脫敏函數(此脫敏函數要求脫敏字段為String類型)。

    • aegis_hz:<SchemaName>masking_v2:表示函數名稱(name)。

      其中SchemaName是根據MaxCompute項目是否配置Schema三層模型,若已配置則需要配置對應的SchemaName。關于Schema的介紹詳情,請參見Schema操作

    • ["alias","index"]:表示參數信息(默認參數)。

    odps.isolation.session.enable

    表示當前調用是會話級別。會話結束后,脫敏功能便會失效。

    以杭州地域為例,完整實現MaxCompute底層數據脫敏腳本如下所示。

    set odps.output.field.formatter={"name":"aegis_hz:default:masking_v2","param":["alias","index"]};
    set odps.isolation.session.enable=true;
    select * from table;
  3. 查看脫敏結果。

    image.png