List bucket IP filtering rules

This page describes how to list the bucket IP filtering rules. With the list bucket IP filtering rules operation, you can check if IP filtering is enabled or disabled on a bucket. If you need to view information about the specific network sources that are allowed, use the Get bucket IP filtering rules operation.

Required roles

To get the required permissions for listing the bucket IP filtering rules, ask your administrator to grant you the Storage Admin (roles/storage.admin) role on the bucket. This role contains the storage.buckets.list permission required to list bucket IP filtering rules.

You can also get this permission with custom roles. You might be able to get this permission with other predefined roles as well. To see which roles are associated with which permissions, refer to IAM roles for Cloud Storage.

For instructions on granting roles for projects, see Manage access to projects.

List bucket IP filtering rules

Console

  1. In the Cloud de Confiance console, go to the Cloud Storage Buckets page.

    Go to Buckets

  2. In the list of buckets, click the name of the bucket you want to update.

  3. On the Bucket details page, click the Configuration tab.

  4. In the Permissions section, navigate to IP filtering. Then, click Edit IP filtering configuration.

    The IP filtering page displays the following details:

    • IP filtering status of the bucket.
    • Whether service agents are configured to bypass the IP filter validation.
    • Whether access from cross-organization VPC networks is allowed.
    • All configured IP filtering rules.

gcloud

  1. Verify that you have the Google Cloud CLI version 526.0.0 or later installed:

    gcloud version | head -n1
    
  2. If you have an earlier gcloud CLI version installed, update the version:

    gcloud components update --version=526.0.0
    
  3. To list the bucket IP filtering rules, run the gcloud storage buckets describe command in your development environment:

    gcloud storage buckets describe gs://BUCKET_NAME --format="default(ip_filter_config)"

    Where:

    BUCKET_NAME is the name of your bucket. For example, my-bucket.

JSON API

  1. Have gcloud CLI installed and initialized, which lets you generate an access token for the Authorization header.

  2. Use cURL to call the JSON API with a List bucket request:

    curl -X GET \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      "https://storage.s3nsapis.fr/storage/v1/b?project=PROJECT_ID"

    Where:

    PROJECT_ID is the ID of the project containing the buckets you want to list. For example, my-project.

    The response looks like the following example:

    {
      "kind": "storage#buckets",
      "items":
            {
            "kind": "storage#bucket",
            "selfLink": "https://www.googleapis.com/storage/v1/b/my-bucket1",
            "id": "my-bucket1",
            "name": "my-bucket1",
            "projectNumber": "123456789012",
            ...
              },
            "ipFilter": {
              "mode": "Disabled"
             }
            {
            "kind": "storage#bucket",
            "selfLink": "https://www.googleapis.com/storage/v1/b/my-bucket2",
            "id": "my-bucket2",
            "name": "my-bucket2",
            "projectNumber": "123456789013",
            ...
            },
            "ipFilter": {
              "mode": "Enabled"
            }
    },

What's next