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:
- Obtain Identity and Access Management (IAM) roles and permissions
- Create a Google Cloud project
- Enable billing for your Google Cloud project
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
In the Google Cloud console, go to the SWP Policies page.
Click Create a policy.
Enter a name for the policy that you want to create, such as
policy1.Enter a description of the policy, such as
My new swp policy.In the Regions list, select the region where you want to create the policy, such as
us-central1.If you want to create rules for your policy, then click Add rule. For more information, see Create a Secure Web Proxy rule.
Click Create.
Cloud Shell
Use your preferred text editor to create a
policy.yamlfile.Add the following to the
policy.yamlfile that you created:description: basic Secure Web Proxy policy name: projects/PROJECT_ID/locations/REGION/gatewaySecurityPolicies/policy1Replace the following:
PROJECT_ID: ID of your projectREGION: region where your policy is created, such asus-central1
Create the Secure Web Proxy policy.
gcloud network-security gateway-security-policies import policy1 \ --source=policy.yaml \ --location=REGION
What's next
- Configure rules
- Deploy Secure Web Proxy as a Private Service Connect service
- Deploy Secure Web Proxy as next hop