Create a Secure Web Proxy policy

This page explains how to create a Secure Web Proxy policy.

A policy acts as a centralized container for all security rules that govern traffic flow through your Secure Web Proxy instance. Policies let you effectively manage access control for the proxy's outbound web traffic.

You can define a policy and associate it with your Secure Web Proxy instance. This helps ensure that all outgoing web traffic from your network adheres to a consistent set of security standards. For more information about Secure Web Proxy policies, see Policies overview.

Before creating a policy, make sure that you complete the following initial setup steps:

After creating a policy, you can create rules and add them to the policy. For more information about how to associate a policy with your Secure Web Proxy instance, see Set up a web proxy.

Console

  1. In the Google Cloud console, go to the SWP Policies page.

    Go to SWP Policies

  2. Click Create a policy.

  3. Enter a name for the policy that you want to create, such as policy1.

  4. Enter a description of the policy, such as My new swp policy.

  5. In the Regions list, select the region where you want to create the policy, such as us-central1.

  6. If you want to create rules for your policy, then click Add rule. For more information, see Create a Secure Web Proxy rule.

  7. Click Create.

Cloud Shell

  1. Use your preferred text editor to create a policy.yaml file.

  2. Add the following to the policy.yaml file that you created:

    description: basic Secure Web Proxy policy
    name: projects/PROJECT_ID/locations/REGION/gatewaySecurityPolicies/policy1
    

    Replace the following:

    • PROJECT_ID: ID of your project
    • REGION: region where your policy is created, such as us-central1
  3. Create the Secure Web Proxy policy.

    gcloud network-security gateway-security-policies import policy1 \
        --source=policy.yaml \
        --location=REGION
    

What's next