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

Granting Temporary Access to OBS

Updated on 2024-08-15 GMT+08:00

Scenario

This case describes how to use temporary access keys (temporary AK/SK and security token) to access OBS in temporary authorization mode.

Assume that you want to enable an IAM user (user name: APPServer) to access the APPClient folder in bucket hi-company and apply for two different temporary access keys to distribute to APP-1 and APP-2. APP-1 can only access files in APPClient/APP-1. APP-2 can access only the files in APPClient/APP-2.

Procedure

  1. Log in to Huawei Cloud and click Console in the upper right corner.
  2. On the console, hover your cursor over the username in the upper right corner, and choose Identity and Access Management from the drop-down list.
  3. Create an IAM user APPServer. For details, see Creating an IAM User.
  4. Create a user-defined policy that allows access to the AppClient folder in bucket hi-company.

    1. In the navigation pane, choose Permissions > Policies/Roles > Create Custom Policy.
    2. Configure parameters for a custom policy.
      NOTE:

      Before configuring an IAM policy, you need to understand what permissions are required. An IAM user only has the permissions defined by the policy. In this example, user APPServer only has full permissions on objects in the APPClient folder.

      Figure 1 Configuring a custom policy
      Table 1 Parameters for configuring a custom policy

      Parameter

      Description

      Policy Name

      Enter a policy name.

      Policy View

      Set this parameter based on your own habits. JSON is used here.

      Policy Content

      {
          "Version": "1.1",
          "Statement": [
              {
                  "Action": [
                      "obs:object:*"
                  ],
                  "Resource": [
                      "obs:*:*:object:hi-company/APPClient/*"
                  ],
                  "Effect": "Allow"
              }
          ]
      }

      Scope

      The default value is Global services.

    3. Click OK. The custom policy is created.

  5. Create a user group and assign permissions.

    Add the created custom policy to the user group by following the instructions in the IAM document.

  6. Add the IAM user (APPServer) you want to authorize to the created user group by referring to Adding Users to or Removing Users from a User Group.

    NOTE:

    Due to data caching, it takes about 10 to 15 minutes for a custom policy to take effect after the authorization.

  7. The IAM user (APPServer) obtains temporary access keys (temporary access keys and security token) for APP-1 and APP-2.

    To obtain temporary access keys with different permissions, you need to set a temporary policy by adding the policy parameter in the request body. For details, see Obtaining a Temporary Access Key and Security Token Through a Token.

    The following is a sample request for obtaining a pair of temporary access keys. The temporary policy parameters are displayed in bold.

    A sample request for obtaining a pair of temporary access keys for the device app APP-1:

    {
        "auth": {
    	"identity": {
    	    "policy": {
    		"Version": "1.1",
    		"Statement": [
    		    {
    			"Action": [
    			    "obs:object:*"
    			],
    			"Resource": [
    			    "obs:*:*:object:hi-company/APPClient/APP-1/*"
    			],
    			"Effect": "Allow"
    		    }
    		]
    	    },
    	    "token": {
    		"duration-seconds": 900
    		
    	    },
    	    "methods": [
    		"token"
    	    ]
    	}
        }
    }

    A sample request for obtaining a pair of temporary access keys for the device app APP-2:

    {
        "auth": {
    	"identity": {
    	    "policy": {
    		"Version": "1.1",
    		"Statement": [
    		    {
    			"Action": [
    			    "obs:object:*"
    			],
    			"Resource": [
    			    "obs:*:*:object:hi-company/APPClient/APP-2/*"
    			],
    			"Effect": "Allow"
    		    }
    		]
    	    },
    	    "token": {
    		"duration-seconds": 900
    		
    	    },
    	    "methods": [
    		"token"
    	    ]
    	}
        }
    }

Verification

After APP-1 and APP-2 have the temporary access keys, they can access OBS through OBS APIs or SDKs. APP-1 can access only files in the APPClient/APP-1 folder, and APP-2 can access only files in the APPClient/APP-2 folder.

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