Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Container Registry
  • Getting started
    • All guides
    • Installing and configuring Docker
    • Authentication in Container Registry
      • Getting information about existing registries
      • Getting information about a registry access policy
      • Creating a registry
      • Configuring access to a registry
      • Updating a registry
      • Deleting a registry
    • Scanning Docker images for vulnerabilities
    • Creating a trigger for a registry
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Troubleshooting
  • FAQ
  1. Step-by-step guides
  2. Managing a registry
  3. Configuring access to a registry

Configuring access to a registry

Written by
Yandex Cloud
Updated at April 22, 2025

You can set up policies for accessing a registry from specific IP addresses.

Management console
CLI
Terraform
  1. In the management console, select the folder the registry was created in.
  2. In the list of services, select Container Registry.
  3. Select the registry to configure access to.
  4. In the left-hand panel, click Access for IP address.
  5. Click Set.
  6. Enter the IP address and specify an action: PULL to allow pulling and PUSH to allow pushing Docker images to the registry.
  7. To configure access for multiple IPs, click Add.
  8. Click Save.
  1. View the list of available registries, their names and IDs:

    yc container registry list
    

    Result:

    +----------------------+--------+----------------------+
    |          ID          |  NAME  |      FOLDER ID       |
    +----------------------+--------+----------------------+
    | crpd50616s9a******** | my-reg | b1g88tflru0e******** |
    +----------------------+--------+----------------------+
    
  2. Specify registry access settings:

    yc container registry set-ip-permissions <registry_name> \
      --pull <IP_address> \
      --push <IP_address>
    

    Where:

    • --pull: Flag that allows pulling Docker images from the registry.
    • --push: Flag that allows pushing Docker images to the registry.

    To learn more about the command, see the CLI reference.

    As a result of executing this command, all the permissions set for IP addresses will be deleted. To continue, type yes and press Enter.

    Result:

    WARN: All current ip permissions will be deleted. Are you sure?[y/N]
    
  3. Check the current permissions:

    yc container registry list-ip-permissions <registry_name>
    

    Result:

    +--------+-----------+
    | ACTION |    IP     |
    +--------+-----------+
    | PULL   | 10.1.2.11 |
    | PUSH   | 10.1.2.11 |
    +--------+-----------+
    

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

  1. Specify registry access settings in the Terraform configuration file.

    resource "yandex_container_registry_ip_permission" "my_ip_permission" {
      registry_id = <registry_ID>
      push        = [ "<IP_address>", "<IP_address>" ]
      pull        = [ "<IP_address>", "<IP_address>" ]
    }
    

    Where:

    • my_registry: Registry ID. If the configuration already contains the yandex_container_registry resource, you can specify it, e.g., yandex_container_registry.my_registry.id.
    • pull: IP addresses that can be used to pull Docker images from the registry. This is an optional parameter.
    • push: IP addresses that can be used to push Docker images to the registry. This is an optional parameter.

    For more information about the yandex_container_registry_ip_permission parameters in Terraform, see the provider documentation.

  2. Create resources:

    1. In the terminal, change to the folder where you edited the configuration file.

    2. Make sure the configuration file is correct using the command:

      terraform validate
      

      If the configuration is correct, the following message is returned:

      Success! The configuration is valid.
      
    3. Run the command:

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

    Terraform will create all the required resources. You can check the new resources using the management console or this CLI command:

    yc container registry list-ip-permissions <registry_name>
    

Was the article helpful?

Previous
Creating a registry
Next
Updating a registry
© 2025 Direct Cursus Technology L.L.C.