El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Configuring Spark Dynamic Masking

Updated on 2024-12-13 GMT+08:00
NOTE:
  • This section is available for MRS 3.3.1-LTS or later version only.
  • The dynamic data masking feature cannot be enabled if jobs are submitted on the console.

Scenario

Enabling Spark dynamic masking allows for the utilization of data within the masked column for computations, while keeping it concealed during the output of calculation results. The cluster's masking policy is dynamically transferred in accordance with lineage relationships, optimizing data utility while safeguarding privacy.

Constraints

  • Data masking is not applicable to Hudi tables.
  • Masking for non-SQL methods is not supported.
  • Masking for direct HDFS read/write operations is not supported.
  • Masking for complex data types like arrays, maps, and structs is not supported.
  • Spark jobs are restricted to submission via spark-beeline (JDBC connection) mode.
  • In instances where the masking policy transfer results in a conflict with an existing policy on the target table, the latter's policy will be overridden as Custom: ***.
  • Presently, data types such as int, char, varchar, date, decimal, float, bigint, timestamp, tinyint, smallint, double, string, and binary are amenable to data masking. Post-policy configuration for data types like int, date, decimal, float, bigint, timestamp, tinyint, smallint, and double, discrepancies may arise between the spark-beeline query outcome and anticipated results; the output will not reflect original values. To align query results with policy expectations, employing the Nullify data masking policy is advised.
  • For data types not supported by the data masking policy, or when data masking transfer is implicated in the output column, the Nullify policy is the default recourse.

Procedure

  1. Modify the JDBCServer instance configuration. Log in to FusionInsight Manager, choose Cluster > Services > Spark, click Configurations, click All Configurations, and choose JDBCServer(Role).
    • If you plan to use Ranger authentication, add the following custom parameters in the custom area:

      Parameter

      Value

      spark.dynamic.masked.enabled

      true

      spark.ranger.plugin.authorization.enable

      true

      Modify the following parameter:

      Parameter

      Value

      spark.ranger.plugin.masking.enable

      true

      spark.sql.authorization.enabled

      true

    • If you plan to use Hive metadata authentication instead of Ranger authentication, add the following custom parameters in the custom area:

      Parameter

      Value

      spark.ranger.plugin.use.hive.acl.enable

      true

      spark.dynamic.masked.enabled

      true

      spark.ranger.plugin.authorization.enable

      false

      Modify the following parameter:

      Parameter

      Value

      spark.ranger.plugin.masking.enable

      true

    NOTE:
    1. If you plan to use Hive metadata authentication instead of Ranger authentication and Hive policy initialization is not complete in Ranger, perform the following operations:
      • Enable the Ranger authentication function of Hive and restart Hive and Spark.
      • Enable the Ranger authentication function of Spark and restart Spark.
      • Disable the Ranger authentication function of Hive and restart Hive.
      • Disable the Ranger authentication function of Spark and restart Spark.
    2. Log in to the Ranger web UI. If the Hive component exists under Hadoop SQL, the Hive policy has been initialized. Otherwise, the Hive policy has not been initialized.
    3. If the HetuEngine component is installed in the cluster and the masking policies of the Ranger and HetuEngine spaces need to be automatically updated when the Spark dynamic masking policy is transferred, set spark.dynamic.masked.hetu.policy.sync.update.enable to true. You also need to change the Ranger user type of the built-in user Spark2x to admin.
  2. Save the configuration and restart the Spark service.
  3. Log in to the Spark client node and run the following commands:

    cd Client installation directory

    source bigdata_env

    source Spark/component_env

    For clusters with Kerberos authentication enabled, additionally run the following command:

    kinit test (Enter the password for authentication and change the password upon your first login.)

  4. Run the beeline commands of Spark to submit a task and create a Spark table.

    spark-beeline

    create table sparktest(a int, b string);

    insert into sparktest values (1,"test01"), (2,"test02");

  5. Configure a masking policy for the sparktest table and check whether the masking takes effect. For details, see Adding a Ranger Access Permission Policy for Spark2x.

    select * from sparktest;

  6. Verify the transfer of the data masking policy.

    create table sparktest02 as select * from sparktest;

    select * from sparktest02;

    Should the information above be displayed, it indicates the dynamic masking configuration is operational. Access the Ranger masking policy management page to view the automatically generated masking policy for the sparktest02 table.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback