---
title: "POST /projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy"
method: POST
path: "/projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy"
tags: ["instances"]
---

# POST /projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy

`POST /projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy`

Sets the Google Cloud Armor security policy for the specified instance.
For more information, seeGoogle
Cloud Armor Overview

## Path parameters

- `project` string, required
- `zone` string, required
- `instance` string, required

## Query parameters

- `requestId` string

## Request body

- InstancesSetSecurityPolicyRequest
  - `securityPolicy` string — A full or partial URL to a security policy to add to this instance. If this field is set to an empty string it will remove the associated security policy.
  - `networkInterfaces` string[] — The network interfaces that the security policy will be applied to. Network interfaces use the nicN naming format. You can only set a security policy for network interfaces with an access config.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/compute.md) · [All operations](https://skmtc.dev/google/apis/compute/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/compute/revisions/6120ed8969d4/schema)
