หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

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

Creating a Custom Policy

Updated on 2022-12-07 GMT+08:00

Custom policies can be created as a supplement to the system policies of DLI. You can add actions to custom policies. For the actions supported for custom policies, see "Permissions Policies and Supported Actions" in the Elastic Volume Service API Reference.

You can create custom policies in either of the following two ways:

  • Visual editor: Select cloud services, actions, resources, and request conditions without the need to know policy syntax.
  • JSON: Create a policy in the JSON format from scratch or based on an existing policy.

. This section describes common DLI custom policies.

Policy Field Description

The following example assumes that the authorized user has the permission to create tables in all databases in all regions:

{
    "Version": "1.1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "dli:database:create_table"
            ],
            "Resource": [
                "dli:*:*:database:*"
            ]
        }
    ]
}
  • Version

    1.1 indicates a fine-grained permission policy that defines permissions required to perform operations on specific cloud resources under certain conditions.

  • Effect

    The value can be Allow and Deny. If both Allow and Deny are found in statements, the Deny overrides the Allow.

  • Action

    Specific operation on a resource. A maximum of 100 actions are allowed.

    NOTE:
    • The format is Service name:Resource type:Action, for example, dli:queue:submit_job.
    • Service name: product name, such as dli, evs, and vpc. Only lowercase letters are allowed. Resource types and operations are not case-sensitive. You can use an asterisk (*) to represent all operations.
    • Resource type: For details, see Table 4.
    • Action: action registered in IAM.
  • Condition

    Conditions determine when a policy takes effect. A condition consists of a condition key and operator.

    A condition key is a key in the Condition element of a statement. There are global and service-level condition keys.

    • Global condition keys (prefixed with g:) apply to all actions. For details, see condition key description in Policy Syntax.
    • Service-level condition keys (prefixed with the abbreviation of a service, for example, dli:. Currently, DLI does not provide service-level condition keys.) apply only to the actions of the corresponding service.

    An operator is used together with a condition key to form a complete condition statement. For details, see Table 1.

    IAM provides a set of DLI predefined condition keys. The following table lists the predefined condition keys of DLI.

    Table 1 DLI request conditions

    Condition Key

    Operator

    Description

    g:CurrentTime

    Date and time

    Time when an authentication request is received

    NOTE:

    The time is expressed in the format defined by ISO 8601, for example, 2012-11-11T23:59:59Z.

    g:MFAPresent

    Boolean

    Whether multi-factor authentication is used during user login

    g:UserId

    String

    ID of the current login user

    g:UserName

    String

    Current login user

    g:ProjectName

    String

    Project that you have logged in to

    g:DomainName

    String

    Domain that you have logged in to

  • Resource

    The format is Service name:Region:Domain ID:Resource type:Resource path. The wildcard (*) indicates all options. For details about the resource types and path, see Table 4.

    Example:

    dli:*:*:queue:* indicates all queues.

Creating a Custom Policy

You can set actions and resources of different levels based on scenarios.

  1. Define an action.

    The format is Service name:Resource type:Action. The wildcard is *. Example:

    Table 2 Action

    Action

    Description

    dli:queue:submit_job

    Submission operations on a DLI queue

    dli:queue:*

    All operations on a DLI queue

    dli:*:*

    All operations on all DLI resource types

    For more information about the relationship between operations and system permissions, see Common Operations Supported by DLI System Policy.

  2. Define a resource.

    The format is Service name:Region:Domain ID:Resource type:Resource path. The wildcard (*) indicates all resources. The five fields can be flexibly set. Different levels of permission control can be set for resource paths based on scenario requirements. If you need to set all resources of the service, you do not need to specify this field. For details about the definition of Resource, see Table 3. For details about the resource types and paths in Resource, see Table 4.

    Table 3 Resource

    Resource

    Description

    DLI:*:*:table:databases.dbname.tables.*

    DLI, any region, any account ID, all table resources of database dbname

    DLI:*:*:database:databases.dbname

    DLI, any region, any account ID, queue of database dbname

    DLI:*:*:queue:queues.*

    DLI, any region, any account ID, any queue resource

    DLI:*:*:jobs:jobs.flink.1

    DLI, any region, any account ID, Flink job whose ID is 1

    Table 4 DLI resources and their paths

    Resource Type

    Resource Names

    Path

    queue

    DLI queue

    queues.queuename

    database

    DLI database

    databases.dbname

    table

    DLI table

    databases.dbname.tables.tbname

    column

    DLI column

    databases.dbname.tables.tbname.columns.colname

    jobs

    DLI Flink job

    jobs.flink.jobid

    resource

    DLI package

    resources.resourcename

    group

    DLI package group

    groups.groupname

    datasourceauth

    DLI cross-source authentication information

    datasourceauth.name

  3. Combine all the preceding fields into a JSON file to form a complete policy. You can set multiple actions and resources. You can also create a policy on the visualized page provided by IAM. For example:

    The authorized user has the permission to create and delete any database, submit jobs for any queue, and delete any table under any account ID in any region of DLI.

    {
        "Version": "1.1",
        "Statement": [
            {
                "Effect": " Allow",
                "Action": [
                      "dli:database:create_database",
                    "dli:database:drop_database",
                      "dli:queue:submit_job",
                      "dli:table:drop_table"
                ],
                "Resource": [
                      "dli:*:*:database:*",
                    "dli:*:*:queue:*",
                    "dli:*:*:table:*"
                ]
            }
        ]
    }

Example Custom Policies

  • Example 1: Allow policies
    • Allow users to create tables in all databases of all regions:
      {
          "Version": "1.1",
          "Statement": [
              {
                  "Effect": "Allow",
                  "Action": [
                      "dli:database:create_table"
                  ],
                  "Resource": [
                      "dli:*:*:database:*"
                  ]
              }
          ]
      }
    • Allow users to query column col in the table tb of the database db:
      {
          "Version": "1.1",
          "Statement": [
              {
                  "Effect": "Allow",
                  "Action": [
                      "dli:column:select"
                  ],
                  "Resource": [
                      "dli:*:*:column:databases.db.tables.tb.columns.col"
                  ]
              }
          ]
      }
  • Example 2: Deny policies

    A deny policy must be used in conjunction with other policies to take effect. If the permissions assigned to a user contain both Allow and Deny actions, the Deny actions take precedence over the Allow actions.

    • Deny users to create or delete databases, submit jobs (except the default queue), or delete tables.
      {
          "Version": "1.1",
          "Statement": [
              {
                  "Effect": "Deny",
                  "Action": [
                      "dli:database:create_database",
                      "dli:database:drop_database",
                      "dli:queue:submit_job",
                      "dli:table:drop_table"
                  ],
                  "Resource": [
                      "dli:*:*:database:*",
                      "dli:*:*:queue:*",
                      "dli:*:*:table:*"
                  ]
              }
          ]
      }
    • Deny users to submit jobs in the demo queue.
      {
          "Version": "1.1",
          "Statement": [
              {
                  "Effect": "Deny",
                  "Action": [
                      "dli:queue:submit_job"
                  ],
                  "Resource": [
                      "dli:*:*:queue:queues.demo"
                  ]
              }
          ]
      }

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback