VK Cloud logo

Access policy

VK Object Storage allows configuring access to a bucket and objects using an access policy.

Enabling and disabling the access policy

  1. Go to the VK Cloud management console.

  2. Select the project where the desired bucket is located.

  3. Go to the Object Storage → Buckets section.

  4. Click more-icon for the desired bucket and select Settings.

  5. Go to the Access Policies tab.

  6. Click the Edit Bucket Policy button.

  7. Enable or disable the access policies.

Enabling and disabling ACL

  1. Go to the VK Cloud management console.

  2. Select the project where the desired bucket is located.

  3. Go to the Object Storage → Buckets section.

  4. Click more-icon for the desired bucket and select Settings.

  5. Go to the Access Policies tab.

  6. Click the Edit Ownership control ACL button.

  7. Enable or disable the Access Control Lists (ACL) option.

Retrieving the current access policy configuration

  1. Install and configure the AWS CLI, if it is not installed yet.

  2. Retrieve the configuration using the command:

    aws s3api get-bucket-policy \  --bucket <BUCKET_NAME> \  --query Policy \  --output text \  --endpoint <ENDPOINT_URL>

    Here:

    • <BUCKET_NAME> — the name of the bucket for which you need to retrieve the access policy configuration.

    • <ENDPOINT_URL> — must match the account region:

      • https://hb.vkcloud-storage.ru or https://hb.ru-msk.vkcloud-storage.ru — the domain of the Moscow region;
      • https://hb.kz-ast.vkcloud-storage.ru — the domain of the Kazakhstan region.

Applying a new access policy configuration

  1. Install and configure the AWS CLI, if it is not installed yet.

  2. Create a new configuration file <CONFIGURATION>.json.

  3. In the file, specify the access policy configuration.

  4. Upload the new configuration using the command:

    aws s3api put-bucket-policy \  --bucket <BUCKET_NAME> \  --policy=file://<CONFIGURATION>.json  --endpoint <ENDPOINT_URL>

    Here:

    • <BUCKET_NAME> — the name of the bucket for which you need to apply the access policy configuration.

    • <CONFIGURATION> — the name of the access policy configuration file in JSON format.

    • <ENDPOINT_URL> — must match the account region:

      • https://hb.vkcloud-storage.ru or https://hb.ru-msk.vkcloud-storage.ru — the domain of the Moscow region;
      • https://hb.kz-ast.vkcloud-storage.ru — the domain of the Kazakhstan region.

Editing the access policy configuration

  1. Install and configure the AWS CLI, if it is not installed yet.

  2. Save the configuration locally to a file <CONFIGURATION>.json using the command:

    aws s3api get-bucket-policy \  --bucket <BUCKET_NAME> \  --query Policy \  --output text \  --endpoint <ENDPOINT_URL> \  > <CONFIGURATION>.json

    Here:

    • <BUCKET_NAME> — the name of the bucket for which you need to edit the access policy configuration.

    • <ENDPOINT_URL> — must match the account region:

      • https://hb.vkcloud-storage.ru or https://hb.ru-msk.vkcloud-storage.ru — the domain of the Moscow region;
      • https://hb.kz-ast.vkcloud-storage.ru — the domain of the Kazakhstan region.
    • <CONFIGURATION> — the name of the access policy configuration file in JSON format.

  3. Make the necessary changes to the <CONFIGURATION>.json file. If necessary, set other configuration parameters.

  4. Apply the new configuration:

    aws s3api put-bucket-policy \  --bucket <BUCKET_NAME> \  --policy=file://<CONFIGURATION>.json  --endpoint <ENDPOINT_URL>

    Here:

    • <BUCKET_NAME> — the name of the bucket for which you need to apply the access policy configuration.

    • <CONFIGURATION> — the name of the access policy configuration file in JSON format.

    • <ENDPOINT_URL> — must match the account region:

      • https://hb.vkcloud-storage.ru or https://hb.ru-msk.vkcloud-storage.ru — the domain of the Moscow region;
      • https://hb.kz-ast.vkcloud-storage.ru — the domain of the Kazakhstan region.

Deleting the access policy configuration

  1. Install and configure the AWS CLI, if it is not installed yet.

  2. Delete the configuration using the command:

    aws s3api delete-bucket-policy \  --bucket <BUCKET_NAME> \  --endpoint <ENDPOINT_URL>

    Here:

    • <BUCKET_NAME> — the name of the bucket for which you need to delete the access policy configuration.

    • <ENDPOINT_URL> — must match the account region:

      • https://hb.vkcloud-storage.ru or https://hb.ru-msk.vkcloud-storage.ru — the domain of the Moscow region;
      • https://hb.kz-ast.vkcloud-storage.ru — the domain of the Kazakhstan region.
Was this article helpful?