Build a secure, multi-tenant private network access architecture using OSS access points and VPC gateway endpoints

Updated at:

A company hosts a core Object Storage Service (OSS) bucket—such as company-data-lake—on Alibaba Cloud. This bucket stores data for multiple departments, such as finance, R&D, and marketing. The goal is to provide fine-grained, isolated access to a centralized, enterprise-level data lake or repository. To achieve this, the following access control requirements must be met:

  • Private network access: All data access must occur over the internal network of an Alibaba Cloud Virtual Private Cloud (VPC). Public network access is prohibited to avoid Internet traffic costs from a NAT Gateway.

  • Permission isolation: Different departmental VPCs access the same bucket but require prefix-level isolation. For example, the finance VPC can access only the finance/ prefix, and the R&D VPC can access only the dev/ prefix.

  • Management decoupling: Hundreds of users access the same bucket. Use access points to delegate permission management to different business units. This avoids maintaining thousands of policy lines in a single bucket policy.

  • Access control: Restrict specific VPCs to access the bucket only through specific access points.

Solution overview

This solution uses a combination of OSS access points and VPC gateway endpoints:

  • OSS access point: Create a separate access point for each accessor. Use an access point policy to manage permissions for each one. This avoids maintaining complex permission rules in a single bucket policy.

  • VPC gateway endpoint: Create a gateway endpoint for OSS in the VPC. This routes requests to the OSS internal endpoint through the Alibaba Cloud internal network, bypassing the public network.

Access path:

ECS instance → VPC route table → Gateway endpoint → OSS internal network → Access point (authentication via access point policy) → Bucket (authentication via bucket policy)

Procedure

Step 1: Create a VPC gateway endpoint

When you create a gateway endpoint, a route to OSS is automatically added to the VPC route table. This enables ECS instances to access OSS over the internal network.

  1. Log on to the Virtual Private Cloud console.

  2. In the left navigation pane, choose Endpoints > Gateway Endpoints.

  3. Click Create Endpoint:

    • Set Service Type to Alibaba Cloud Service.

    • Set Service Name to com.aliyun.<region>.oss. For example, com.aliyun.cn-hangzhou.oss.

    • Set VPC to the VPC where your services are located.

    • For Route Table, select the route table attached to the vSwitch of the ECS instance that needs to access OSS.

  4. After the endpoint is created, a route to OSS is automatically added to the VPC route table.

Step 2: Create an OSS access point

Create a separate access point for each business unit to implement isolated permission management.

  1. Log on to the OSS console.

  2. Go to the target bucket. In the left navigation pane, choose Access Points > Create Access Point.

  3. Configure the access point parameters:

    • Set Access Point Name to a name, such as finance-ap.

    • Set Network Type to VPC.

    • Set VPC ID to the ID of the VPC for which you created the gateway endpoint in Step 1.

    • For Configure Access Point Policy, grant the access point permissions for specific operations, resources, and users.

  4. After you save the configuration, the system generates an access point alias and an access point domain name.

Step 3: Configure policies

Configure the access point policy, bucket policy, and VPC gateway endpoint policy to grant the required access permissions across the entire access path.

1. Configure the access point policy

The access point policy defines the operations that traffic entering through this access point can perform. The following example grants the Resource Access Management (RAM) role ACS:RAM:1234567890123456:role/FinanceRole permission to perform the GetObject and PutObject operations through the finance-ap1 access point:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": [
        "ACS:RAM:1234567890123456:role/FinanceRole" 
      ],
      "Action": [
        "oss:GetObject",
        "oss:PutObject"
      ],
      "Resource": [
        "acs:oss:cn-hangzhou:1234567890123456:accesspoint/finance-ap1"
      ]
    }
  ]
}

2. Configure the bucket policy (delegate access to the access point)

After you create an access point, use a bucket policy to delegate access permissions and define which access points can access the bucket.

There are three types of access point permission delegation:

  • oss:DataAccessPointArn: Delegates access permissions for a specific access point.

  • oss:DataAccessPointAccount: Delegates access permissions for all access points under the current Alibaba Cloud account.

  • oss:AccessPointNetworkOrigin: Delegates access permissions for all access points from a specific network source.

The following example delegates permission to all access points of the finance department to access data under the finance/ prefix in the bucket through a VPC:

{
  "Version": "1",
  "Statement": [{
    "Effect": "Allow",
    "Action": [
      "oss:*"
    ],
    "Principal": "*",
    "Resource": [
      "acs:oss:*:137918634953****:company-data-lake/finance/*"
    ],
    "Condition": {
      "StringEquals": {
        "oss:DataAccessPointArn": [
           "acs:oss:cn-hangzhou:1234567890123456:accesspoint/finance-ap1",
           "acs:oss:cn-hangzhou:1234567890123456:accesspoint/finance-ap2",
           "acs:oss:cn-hangzhou:1234567890123456:accesspoint/finance-ap3"
        ]
      }
    }
  }]
}

For more information about policy configurations for other delegation scenarios, see Add a bucket policy.

3. Configure the VPC gateway endpoint policy (VPC policy)

In the VPC gateway endpoint policy, set the bucket associated with the access point as an allowed target to implement network-layer access control.

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "oss:*",
      "Principal": [
        "123456789012****"
      ],
      "Resource": [
         "acs:oss:*:*:example-bucket",
         "acs:oss:*:*:example-bucket/*"
      ]
    }
  ]
}

Notes

  • Domain name switch: After you start using an access point, you must use the access point domain name or alias in your SDK or CLI calls, not the original bucket domain name.

    • Incorrect example: my-bucket.oss-cn-hangzhou-internal.aliyuncs.com

    • Correct example: finance-ap-xxxx.oss-cn-hangzhou.oss-accesspoint.aliyuncs.com

  • Region consistency: The VPC gateway endpoint, OSS access point, and bucket must be in the same region.

  • Permission evaluation: To successfully access a resource, a user must be granted permissions by the RAM policy, the access point policy, and the bucket policy.

  • Endpoint type limitation: VPC gateway endpoints support only private network access within the same region. For cross-region access, use a reverse proxy or Cloud Enterprise Network (CEN).

  • Resource limits: A single UID can create up to 1,000 access points. This is sufficient for most multi-tenant scenarios.

References