Disconnecting a security profile from a resource
Disconnecting from a virtual host
- In the management console
, select the folder containing the security profile. - In the list of services, select Smart Web Security.
- Select the security profile to disconnect from the Yandex Application Load Balancer virtual host.
- Navigate to the Connected hosts tab.
- Next to the host in question, click
and select Disconnect from profile. - Confirm your action.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
To view a list of HTTP routers in the default folder, run this command:
yc application-load-balancer http-router listResult:
+----------------------+-------------------+-------------+-------------+ | ID | NAME | VHOST COUNT | ROUTE COUNT | +----------------------+-------------------+-------------+-------------+ | ds7e9te73uak******** | my-first-router | 1 | 1 | +----------------------+-------------------+-------------+-------------+ -
To view a list of virtual hosts for the selected HTTP router, run this command:
yc application-load-balancer http-router get <HTTP_router_name_or_ID>Result:
id: ds7e9te73uak******** name: my-first-router folder_id: b1gt6g8ht345******** virtual_hosts: - name: test-virtual-host routes: - name: test-route http: match: path: prefix_match: / route: backend_group_id: ds7e12p7l6j4******** timeout: 60s auto_host_rewrite: false route_options: security_profile_id: fev3s055oq64******** created_at: "2024-08-05T08:34:03.973000654Z"Names of virtual hosts are specified in the
virtual_hosts.nameparameter. The example above features only one virtual host:test-virtual-host. -
To disconnect a security profile from a virtual host, run this command:
yc application-load-balancer virtual-host update <virtual_host_name> \ --http-router-name <HTTP_router_name> \ --security-profile-id ""Where:
<virtual_host_name>: Virtual host name from the previous step.--http-router-name: HTTP router name. This is a required setting. Instead of the HTTP router name, you can provide its ID in thehttp-router-idparameter.--security-profile-id: Security profile ID. This is a required setting.
Result:
done (1s) name: test-virtual-host routes: - name: test-route http: match: path: prefix_match: / route: backend_group_id: ds7e12p7l6j4******** timeout: 60s auto_host_rewrite: false route_options: {}
For more information about the yc application-load-balancer virtual-host update command, see the CLI reference.
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
You can disconnect a Yandex Smart Web Security profile from a Yandex Application Load Balancer in the virtual host settings.
-
In the Terraform configuration file, for the
yandex_alb_virtual_hostresource, deletesecurity_profile_idunderroute_options.resource "yandex_alb_virtual_host" "my-virtual-host" { name = "<virtual_host_name>" ... route_options { security_profile_id = "<security_profile_ID>" } } -
Apply the changes:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
You can check the resource updates using the management console
yc alb http-router get <HTTP_router_ID>
Use the update REST API method for the VirtualHost resource or the VirtualHostService/Update gRPC API call in Application Load Balancer.
Disconnecting from a domain
- In the management console
, select the folder containing the security profile. - In the list of services, select Smart Web Security.
- Select Domain protection → Domains.
- Select a domain.
- In the top-right corner, click
Edit. - Delete the connected security profile.
- Click Save.
Disconnecting from an API gateway
- In the management console
, select the folder the API gateway is in. - In the list of services, select API Gateway.
- Select the API gateway.
- In the top-right corner, click
Edit. - Delete the x-yc-apigateway:smartWebSecurity extension from the API gateway specification.