VPC Service Controls in Google Cloud
A friendly, start-to-finish guide to drawing a protective wall around your most sensitive cloud data, so that stolen keys and honest mistakes cannot carry it out the front door.
Imagine a bank vault with a strong door and a guard who checks every badge. The guard does a fine job. Then one day a thief steals a valid badge from an employee’s coat pocket. The guard sees a real badge, so the door opens. The badge was perfect, yet the person holding it should never have been there.
Much of cloud security works like that guard. It checks who you are, and if your identity is valid, it lets you through. It does not ask where you are standing, or where you plan to carry the contents afterwards. When a key is stolen, or an employee makes a quick copy “just for testing,” the guard has no reason to object.
VPC Service Controls is Google Cloud’s answer to this gap. It builds a wall around chosen projects and services, and it adds new questions at the gate: where is this request coming from, and where is the data going? In this guide you will learn what it is, how its parts fit together, how to roll it out without breaking anything, how to read its logs, and how teams run it in real life. No earlier knowledge is needed, and every new word is explained the first time it appears.
1What Is VPC Service Controls?
VPC Service Controls draws an invisible wall around your Google Cloud data, so that even a person holding a valid key cannot use it from the wrong place.
Google Cloud stores your data in services such as Cloud Storage, which keeps files, and BigQuery, which keeps tables for analysis. You reach these services by sending requests to their APIs, which are the online doorways that programs knock on. Normally the main question at the doorway is “who are you, and are you allowed?” That check is called IAM, short for Identity and Access Management.
VPC Service Controls, often shortened to VPC-SC, adds a second question: “where are you coming from, and where is the data going?” It lets you draw a service perimeter around chosen projects and services. Requests that stay inside the perimeter are fine. Requests that try to cross the wall, in or out, are blocked unless you wrote a rule that allows them.
Picture a museum. IAM is the ticket check at the door: only people with the right badge may enter a room. VPC Service Controls is the fence around the whole museum grounds, with a guard at each gate. Even if a thief steals a valid badge, the thief cannot use it from outside the fence. And even if a guard inside is careless, a painting cannot be carried out through the gates without permission.
The goal in one sentence
The main goal is to reduce the risk of data exfiltration, a technical word that means data being copied or moved out of a place where it should have stayed. That can happen by accident, through a mistake, or on purpose, through a thief or an unhappy insider. VPC-SC makes such copying much harder.
Who uses it
Organizations that hold sensitive or regulated data use it most: hospitals, banks, insurers, government bodies and companies with valuable research. Any team that needs to prove to an auditor that “this data cannot leave this boundary” finds it useful. Smaller teams can use it too, though they must be ready for the extra planning it requires.
A VPC (Virtual Private Cloud) is your private network in Google Cloud. VPC Service Controls is not a firewall for that network. The name is a little misleading, because the feature controls access to Google-managed services through their APIs. Chapter 4 explains this carefully.
Product names, screens and limits change over time. This guide teaches ideas that stay stable and points out where you should confirm details in the official Google Cloud documentation.
2The Problem: Data Walking Out the Front Door
Most cloud data leaks do not happen because a lock was picked. They happen because a valid key was used in a place or a way nobody expected.
Imagine a company that keeps customer records in a cloud storage bucket. The team does everything right: only a small group has permission, passwords are strong, and access is logged. Yet there are still several ways the data can leave.
Stolen credentials
A developer’s laptop is infected, or a secret key is pasted into a public code site. A thief now holds a valid identity and uses it from anywhere in the world.
Honest mistakes
Someone copies a file to a personal bucket “just for testing,” or makes a dataset public to share it quickly, and forgets to undo it.
Malicious insiders
A person with legitimate access decides to copy data to a project they control outside the company.
Misconfigured permissions
An administrator grants a broad role by mistake, and many more people than intended can read the data.
In all four cases, IAM is working as designed. The identity is valid, and the permission exists. IAM answers “who,” and it has no opinion about “from where” or “to where.” That gap is the reason VPC Service Controls exists.
A hotel key card opens your room. The card reader checks only whether the card is valid. It does not care if you walked in through the lobby or climbed through a window, nor whether you carry the hotel’s furniture to a truck outside. A security fence and gates around the hotel add the missing checks.
Why the perimeter idea helps
With a perimeter, a stolen key becomes much less useful. The thief works from outside the wall, so requests are refused even though the identity is valid. A mistaken copy to an outside bucket fails because the destination is outside the wall. A public setting on a bucket does not automatically let the whole internet in. Each of these problems is turned from a disaster into a log entry.
| Scenario | With IAM only | With IAM plus VPC-SC |
|---|---|---|
| Valid key used from a thief’s computer | Request succeeds | Blocked, the caller is outside the perimeter |
| Copy a table to a personal project | Succeeds if the user has rights on both | Blocked, the destination is outside the perimeter |
| Permissions granted too broadly | More people can read data | Extra people still must be inside the allowed boundary |
| Internal engineer working from a trusted network | Succeeds | Succeeds |
VPC Service Controls reduces risk. It does not make a system perfectly safe. It is one layer in a defense with several layers, and later chapters explain what it does not cover.
3Core Concepts From Zero
A handful of words carry the whole subject. Learn them first, and every later chapter becomes easy to read.
Organization, folder and project
Google Cloud arranges resources in a tree. At the top is the organization, which represents your company. Below it are optional folders, which group things such as departments. At the bottom are projects, which hold actual resources like buckets, tables and virtual machines. VPC Service Controls needs an organization, because policies are managed at that level.
Service and API
A service is a Google Cloud product such as Cloud Storage or BigQuery. Each service is used through its API, which is its public doorway. VPC-SC protects the doorway, not the building. This is why we say it works at the API level.
Service perimeter
A service perimeter is a boundary you define around a set of projects and a set of services. Inside the perimeter, the protected services can talk to each other and to the protected projects freely. Crossing the boundary is controlled.
Restricted services
The list of services that the perimeter protects is called the restricted services. If Cloud Storage is on the list, then Cloud Storage buckets in the protected projects are guarded by the wall. Services that are not on the list are not guarded by it.
Access policy and Access Context Manager
An access policy is the container that holds your perimeters and access levels for an organization. Access Context Manager is the Google Cloud service that stores and manages these objects. You will see its name in roles and logs.
Access level
An access level is a named set of conditions about the caller, such as “comes from the office network address range” or “is in an allowed country” or “is one of these identities.” An access level can be attached to a perimeter to let trusted outside callers in.
Ingress and egress rules
Ingress means coming in. An ingress rule allows specific requests from outside into the perimeter. Egress means going out. An egress rule allows specific requests from inside to reach outside resources. Both rules say who, to what, and for which operations.
Dry run and violations
A violation is a request that the perimeter blocks, or in practice mode would have blocked. Dry run is a practice mode where violations are only recorded in logs and nothing is blocked. It is the safest way to learn what a perimeter would do.
| Term | Simple meaning | Everyday picture |
|---|---|---|
| Organization | The top of your cloud tree | The whole company campus |
| Project | A container for resources | One building on the campus |
| API | The doorway to a service | A service counter window |
| Service perimeter | A boundary around projects and services | A fence with guarded gates |
| Access level | Conditions about the caller | A visitor pass with rules |
| Ingress rule | Allows a specific request to enter | A named guest on the gate list |
| Egress rule | Allows a specific request to leave | An approved delivery truck leaving |
| Dry run | Practice mode with logs only | A fire drill |
Think of a university. The organization is the whole university, projects are the buildings, and the library, laboratory and bank counters are services. The service perimeter is a fence around the science buildings. Access levels are visitor passes for trusted guests, ingress rules are written exceptions that let a named visiting professor in, and egress rules are approvals for sending a specific package out. A dry run is a practice day when guards only write notes and let everyone through.
4How It Differs From Firewalls, IAM and Private Networks
Many beginners assume VPC Service Controls is another kind of firewall. It is not, and understanding the difference prevents costly surprises.
IAM: who may do what
IAM attaches permissions to identities. It says “this person may read objects in that bucket.” It does not look at the network location of the caller, and it does not care where data goes next.
Firewalls: what network traffic may pass
A firewall in Google Cloud controls network traffic to and from virtual machines and other network resources, based on addresses, ports and protocols. It works at the network layer. It cannot see that a request to the Cloud Storage API is copying a customer table to an outside bucket, because that traffic looks like ordinary encrypted web traffic to a Google address.
Private networking: how traffic travels
Features such as Private Google Access let machines without public addresses reach Google APIs over Google’s internal paths. This protects the route, but it does not decide which projects the machine may talk to. A machine on a private path can still copy data to any bucket it has rights to, including one in a stranger’s project.
VPC Service Controls: where requests come from and go to
VPC-SC checks each API request against the perimeter. It considers the project of the target resource, the origin of the caller, and the identity and operation. It can stop a request that is fully allowed by IAM and by the firewall.
| Control | Works at | Main question | Blind spot |
|---|---|---|---|
| IAM | Identity and permission | Who may do this action? | Ignores where the caller is or where data goes |
| Firewall rules | Network packets | Which traffic may pass? | Cannot see what an API call does with data |
| Private Google Access | Network route | How does traffic reach Google APIs? | Does not limit which projects can be reached |
| Organization policies | Resource settings | Which configurations are allowed? | Does not judge individual requests |
| VPC Service Controls | API requests | Is this request crossing the boundary? | Does not cover unsupported services or non-API channels |
An office building has several protections. IAM is the badge reader on each door. A firewall is the guard who checks which vehicles may drive into the parking lot. Private routes are a secret tunnel for employees. VPC Service Controls is a rule at the loading dock: “No box leaves with company documents unless the destination address is on the approved list.” Each layer stops a different kind of problem.
Good security does not choose between these controls. It uses all of them. VPC-SC is the layer that catches the cases where credentials are valid but the request is in the wrong place or aimed at the wrong destination.
5Architecture and Components
The system has a small number of parts. Seeing how they connect makes the rest of the guide feel like a story, not a list.
flowchart TD ORG["Google Cloud Organization"] --> POL["Access policy"] POL --> PER["Service perimeter"] POL --> AL["Access levels from Access Context Manager"] PER --> PRJ["Protected projects"] PER --> SVC["Restricted services such as Cloud Storage and BigQuery"] PER --> ING["Ingress rules"] PER --> EGR["Egress rules"] PER --> VAS["VPC accessible services"] AL --> PER PER --> LOG["Audit logs of violations"]
The access policy
At the top sits the access policy of your organization. There is one main policy per organization. For large companies, scoped policies can be created for a folder or project, so that different teams manage their own perimeters without touching others.
The perimeter and what it holds
A perimeter lists the projects it protects, the services it restricts, and optional lists that fine-tune behavior: access levels that let outside callers in, ingress and egress rules for specific exceptions, and VPC accessible services, which limit which APIs may be reached from inside the perimeter’s networks.
The enforcement point
Enforcement happens inside Google’s API front end. When a request for a restricted service arrives, Google evaluates it against the perimeters that apply. You do not install an agent or a gateway for this. This is both convenient and a reason that the feature is configured as policy, not as network equipment.
The logs
Every blocked request, and every would-be block in dry run, creates an audit log entry with details about the caller, the target and the reason. These logs are the main tool for learning, debugging and monitoring.
| Component | Purpose | Managed by |
|---|---|---|
| Access policy | Holds perimeters and access levels for an organization or scope | Security or platform administrators |
| Service perimeter | Defines the protected boundary | Security team, with project owners consulted |
| Access level | Describes trusted callers | Security team |
| Ingress and egress rules | Allow narrow exceptions | Security team with application owners |
| Audit logs | Record violations | Google Cloud, read by security and operations |
A city has a rulebook (the access policy), districts with walls (perimeters), visitor pass types (access levels), special permits for named people or trucks (rules), and a record book at every gate (audit logs). The gate guards are Google’s own API front end, so the city does not need to hire guards of its own.
6Inside, Outside and the Wall
The simplest way to learn the behavior is to picture four kinds of requests and ask what happens to each.
flowchart LR
subgraph OUT["Outside the perimeter"]
ATT["Caller with stolen credentials"]
EXTB["Bucket in an outside project"]
end
subgraph IN["Inside the perimeter"]
VM["Application or virtual machine"]
BQ["BigQuery dataset"]
GCS["Cloud Storage bucket"]
end
ATT -. blocked .-> GCS
VM --> BQ
VM --> GCS
GCS -. blocked copy .-> EXTB
Case 1: inside to inside
An application in a protected project reads a table from BigQuery in another protected project of the same perimeter. This is the normal case. The perimeter allows it, and then IAM still checks permission. Nothing special is needed.
Case 2: outside to inside
A caller outside the perimeter tries to read a bucket inside it. Even with a valid identity, the request is refused unless an access level or an ingress rule describes it. This case protects you from stolen credentials used from far away.
Case 3: inside to outside
An application inside tries to copy data to a bucket in a project outside the perimeter. This is the exfiltration case. The request is refused unless an egress rule allows that destination. The copy fails even though the user may have write rights on the outside bucket.
Case 4: outside to outside
Two resources that are both outside the perimeter talk to each other. The perimeter does not care. It only guards the protected projects and their restricted services.
| Case | Default result | How to allow it |
|---|---|---|
| Inside to inside | Allowed by the perimeter, IAM still applies | Nothing needed |
| Outside to inside | Blocked | Access level or ingress rule |
| Inside to outside | Blocked | Egress rule |
| Outside to outside | Not affected by this perimeter | Not applicable |
Consider a walled garden party. Guests who are already in the garden may chat and share snacks. A stranger at the gate is turned away, unless their name is on the list. A guest who tries to carry the host’s silverware out is stopped at the gate, unless the host approved it. People outside the garden, chatting on the street, are none of the garden guards’ concern.
7Supported Services and Restricted Services
A perimeter only protects what it knows how to protect. Understanding service support avoids false confidence.
VPC Service Controls does not work with every Google Cloud product. Google publishes a list of supported products, which includes many storage, data analytics, machine learning, messaging and compute-related services. Some products are fully supported, and some have limitations, such as certain features that do not work inside a perimeter. The list grows over time, so always check the current list before you design.
Restricted services in the perimeter
When you configure a perimeter, you choose which services to restrict. You can restrict all supported services, or only a chosen few. A common starting point for beginners is to restrict the services that actually hold sensitive data, such as Cloud Storage and BigQuery, then widen the list as your confidence grows.
Unsupported or unrestricted services
If a service is not supported, or is not on the restricted list, its API is not guarded by the perimeter. Data in that service can still be reached according to IAM alone. Therefore, a careful design lists every service that touches sensitive data and checks that each one is both supported and restricted.
Features with limits
Some services behave differently inside a perimeter. For example, a feature may need an extra rule to work across projects, or may not be available at all. Read the notes for each service you depend on, and test in dry run before enforcing.
Is it supported?
Look up each product you use in the current list of supported products.
Is it restricted?
Support is not protection. The service must be on your perimeter’s restricted list.
Any known limits?
Read the product’s VPC-SC notes for features that need extra rules or are unavailable.
Tested in dry run?
Real traffic reveals surprises that documents cannot.
A security guard at a museum can only protect the rooms that are inside the guarded wing. If a priceless vase is in a corridor outside the wing, it has no guard. Listing every valuable room, and checking each is inside the guarded wing, is the first job of any security plan.
A team protects Cloud Storage and BigQuery, but forgets that exported data also lands in a messaging service or a logging sink that is not restricted. Follow the path of the data from start to end, and check every stop.
8Everyday Services Inside a Perimeter
Abstract rules become clear when you watch ordinary tasks, such as copying a file or running a query, meet the wall.
Cloud Storage: copying files
Copying a file between two buckets in projects of the same perimeter works normally. Copying to a bucket in a project outside the perimeter is blocked unless an egress rule allows that destination. Reading a file from outside the perimeter is blocked unless an access level or ingress rule allows the caller. This is why a bucket that was accidentally made too open becomes much less dangerous.
BigQuery: queries, exports and public data
BigQuery is a service for analysing large tables with questions called queries. A query that reads tables in several protected projects of one perimeter works well. A query that mixes your table with a table in a project outside the perimeter may be blocked. Exporting results to a bucket or table outside the perimeter is blocked unless a rule allows it. Reading a public dataset hosted by someone else may also count as crossing the boundary, so such reads often need a narrow egress rule. Dry run shows these cases clearly.
Messaging: publishing and subscribing
Messaging services such as Pub/Sub move small messages between programs. A topic and its subscriptions in the same perimeter work normally. If a subscription in one perimeter reads from a topic in another, both sides of the crossing need rules, just as for files and tables. Teams often forget these quiet background flows until the logs show them.
Virtual machines and applications
A virtual machine in a protected project that calls Cloud Storage or BigQuery in the same perimeter works as usual. If the machine’s calls leave through the wrong network path, for example the public internet, Google may see them as outside requests. This is why DNS and routing settings for private access matter so much.
Log exports
Many companies export logs to a bucket or a dataset in another project for long-term storage. That destination may be outside the perimeter, and the export can fail after enforcement. Plan the log destination as part of your design, either inside the perimeter or with a clear, narrow rule.
| Task | Same perimeter | Across the boundary |
|---|---|---|
| Copy a file between buckets | Works | Needs an egress rule, and an ingress rule if another perimeter receives it |
| Query tables from two projects | Works | Needs rules, or move both into one perimeter |
| Export query results | Works to an inside destination | Blocked unless allowed by an egress rule |
| Subscribe to a topic | Works | Needs rules on both sides |
| Send logs to long-term storage | Works to an inside destination | Needs a narrow rule or an inside destination |
Inside a company campus, an employee can carry a folder from one office to another without any paperwork. Carrying the same folder out of the gate needs a signed note. Copies, queries and subscriptions are all folders moving about, and the gate guard asks about each one that crosses the fence.
Whenever you design a data flow, draw it as arrows between projects and mark each arrow that crosses a perimeter. Every marked arrow needs a rule, a move into the perimeter, or a decision that the flow should not exist.
9Access Policies and Scoped Policies
The access policy is the folder in which all your perimeters and access levels live. Its structure decides who can change what.
Each organization has one organization-level access policy. All perimeters and access levels created in it are visible to those who manage it. In a small company, one policy is plenty. A single security team creates the perimeters and everyone else lives inside them.
Why scoped policies exist
In a large company, one central team cannot know every project’s needs. Scoped policies let administrators create a policy limited to a folder or a project, and delegate its management to the team that owns that area. A scoped policy can only affect the resources in its scope. This reduces risk, because a mistake by one team cannot lock out the entire company.
Single central policy
- Easy to understand and audit
- One team knows the whole picture
- Consistent rules everywhere
- Becomes a bottleneck as the company grows
Scoped policies
- Teams move at their own speed
- Mistakes stay inside their area
- Fits large and split organizations
- Needs shared standards and some central oversight
Good habits for policies
- Use clear, consistent names for perimeters and access levels, so the purpose is visible in logs.
- Write a short description in each object, saying who owns it and why it exists.
- Keep configuration in version control, so changes are reviewed and reversible.
- Limit who can edit the policy, because an edit can open or close many doors at once.
A school has a master rulebook for the whole school, and each department may have its own handbook for its own laboratory. The master rulebook keeps things consistent, while the department handbooks let the chemistry teacher decide who may enter the chemical store, without asking the headmaster each time.
10Access Levels: Describing Trusted Callers
Access levels answer one question: which outside callers should be treated as trusted guests?
An access level is created in Access Context Manager. It is a named bundle of conditions, and a request that meets the conditions “has” that access level. You then attach the access level to a perimeter, and requests from outside that satisfy it are allowed in.
What conditions can describe
- Network address ranges. For example, the public addresses of your office or your company’s VPN. Requests coming from those ranges qualify.
- Geographic regions. Requests that appear to come from selected countries qualify. This is helpful but not exact, since location is estimated from addresses.
- Identities. Selected users or service accounts qualify, regardless of where they are.
- Device conditions. With additional Google products for device management, a condition can require a company-managed, up-to-date device. Availability depends on your licenses.
Conditions can be combined. A level can say that a request must satisfy all conditions, or any of them. A careful team uses narrow combinations, such as “these identities, and from this VPN range.”
Access levels or ingress rules?
Access levels give a broad “trusted caller” status that applies to all restricted services and all projects in the perimeter. Ingress rules, covered next, can be narrower, naming the exact service and operation. A common pattern uses access levels for human administrators on a corporate network, and ingress rules for specific machines or partners.
| Condition type | Good for | Watch out |
|---|---|---|
| Address range | Office networks, VPN exits | Shared addresses may include more people than you expect |
| Region | Broad geographic limits | Estimates can be wrong, and attackers can use local addresses |
| Identity | Named people or service accounts | Identities alone do not prove where the caller is |
| Device state | Allowing only managed, healthy devices | Requires extra licensed products and setup |
A visitor pass at a company reception can have rules: “valid only today,” “only for the third floor,” “must be escorted.” Access levels are visitor passes for the cloud. A pass that says “any visitor from anywhere” is not a pass at all, so keep the rules specific.
Never create a level so wide that it lets nearly everyone in “to stop the errors.” A very wide level defeats the whole purpose of the perimeter. If you cannot narrow it, fix the design instead.
11Ingress Rules: Letting Specific Requests In
Ingress rules are written exceptions. They say that one precise kind of request from outside may enter, and nothing else may.
An ingress rule has two halves. The from half describes the caller: which identities, such as certain service accounts, and which sources, such as a particular access level, or specific projects or networks. The to half describes the target: which projects, which services and which methods, meaning which operations on those services.
An example in words
Your company has an automation system outside the perimeter that must read objects from one bucket service inside it. An ingress rule can say: “Allow the automation system’s service account, coming from this project, to call only the read operations of Cloud Storage, on this one protected project.” Any other caller, other service or other operation remains blocked.
Why narrow rules matter
Each rule is a small hole in the wall. A rule that names one identity, one service and a few operations is a tiny peep-hole. A rule that allows all identities, all services and all operations is a gaping door. The narrower the rule, the lower the risk if that identity is later compromised.
Find the violation
Read the audit log entry for the blocked request, and note the caller, source, service and method.
Ask whether it should be allowed
Confirm with the owners that this access is truly needed. Sometimes the better answer is to move the caller inside.
Write the narrowest rule
Name the exact identity, the exact target project, the exact service and only the methods needed.
Test in dry run
Apply the rule to the dry-run configuration and watch the logs for a while.
Enforce and document
Apply to the enforced configuration and record who requested it, why and when it should be reviewed.
A building’s security desk keeps a guest list. A good entry says: “Dana from the delivery company may enter through the back door on Tuesdays and go only to the mailroom.” A poor entry says: “Anybody who says they are a friend can go anywhere.” Ingress rules should read like the first entry.
12Egress Rules: Letting Specific Requests Out
Egress rules guard the most important exit: the path by which data could leave. Each one should be rare and well justified.
Real systems sometimes need to send data out. A company might export reports to a partner’s bucket, or an application inside the perimeter may need to read a public dataset hosted by Google or another party. Egress rules provide a controlled way to do that.
Structure of an egress rule
Like ingress rules, egress rules have a from half and a to half. The from half describes the caller inside the perimeter, usually an identity or a type of identity. The to half names the outside resources, such as specific projects, the services and the methods allowed. A rule might say: “Allow this one export job’s service account to write to this one project’s storage service, using only the create-object method.”
flowchart LR
subgraph P1["Perimeter A: production data"]
DA["Analytics project"]
end
subgraph P2["Perimeter B: partner sharing"]
DB["Shared dataset project"]
end
DA -->|Egress rule allows export| DB
EXT["Trusted partner network"] -->|Ingress rule allows read| DB
Two-sided crossings
When data moves between two perimeters, both sides may need a rule. The perimeter that the data leaves needs an egress rule, and the perimeter that receives it needs an ingress rule. If only one side is configured, the request still fails. Many first-time users are surprised by this, so remember that crossing a wall means passing two gates.
| Question for the rule | Good answer | Poor answer |
|---|---|---|
| Who is allowed to send? | One named service account | Any identity |
| Where may data go? | One named destination project | Any project |
| What may it do? | Only the needed methods | All methods of all services |
| Who reviews the rule? | A named owner, reviewed regularly | Nobody remembers |
In a factory, every truck leaving the gate must carry a signed shipping order that names the cargo and the receiver. A guard who lets any truck leave with anything is not guarding. Egress rules are the signed shipping orders, and each one should name exactly what leaves and where it goes.
Whenever someone requests an egress rule, ask, “Could the data stay inside and could the partner come to us instead?” Bringing a trusted party in through a narrow ingress rule is often safer than letting data out.
13Sharing Between Perimeters and Bridges
Real organizations have more than one perimeter, and sometimes those perimeters must exchange data. There are a few ways to do it, from old to modern.
The perimeter bridge
A perimeter bridge is an older feature that connects two perimeters, so projects in each can talk to each other for the services they restrict. It is simple, but it is broad. Once two perimeters are bridged, all their projects and services can interact, which may be much more than anyone wanted.
Ingress and egress rules instead
Modern designs prefer ingress and egress rules, which allow exactly one kind of crossing at a time. Google’s current guidance leans toward these rules for new designs. Because documentation evolves, check the latest recommendation before you create anything that connects perimeters.
Putting projects in one perimeter
Sometimes the best answer is not a rule at all. If two projects work together closely and hold similar data, put both in the same perimeter. Then all traffic between them is internal and needs no exception. The downside is a bigger perimeter, so weigh how much the two projects trust each other.
| Option | How broad | Effort | Best when |
|---|---|---|---|
| Same perimeter | Everything between the projects | Low | The projects are closely related and equally sensitive |
| Ingress and egress rules | Exactly what you write | Medium | Specific flows between separate perimeters |
| Perimeter bridge | All restricted services of both sides | Low | Older designs, short-term needs; prefer rules for new work |
Two neighboring companies can share a car park. A bridge is like removing the fence between them: everyone can walk anywhere. Rules are like a gate that opens only for named delivery vans. Merging into one perimeter is like becoming one company. Each choice has a different level of trust and effort.
14VPC Accessible Services
Besides guarding the data, you can also limit which Google APIs may be reached from the private networks inside the perimeter.
Machines inside your VPC networks can talk to many Google APIs. A perimeter can include a setting called VPC accessible services. It lists the services that may be reached from the perimeter’s networks. If you set it to only the services your applications really need, a compromised machine cannot use other Google APIs as an escape route.
What it protects against
Think of a virtual machine that has been taken over by an attacker. The attacker might try to call a Google API that you never intended anyone to use, perhaps one that can send data to the attacker’s account. If that API is not in the list of accessible services, the call fails right from the start.
How to use it wisely
- Begin by allowing all restricted services, and watch the logs to see which APIs your machines actually call.
- Then narrow the list to the services you really need, and add any supporting services that your tools use behind the scenes.
- Remember that the list restricts calls made through the networks inside the perimeter, not calls made from elsewhere.
- Document why each service is on the list.
In an office, the phone system can be set so that desk phones can call only the numbers the company needs, such as customers and colleagues, and cannot dial premium numbers abroad. If someone sneaks into the office and picks up a phone, the damage they can do is limited by what the phone system permits.
15Internal Working: How a Request Is Judged
When a request arrives at a Google API, a short chain of questions decides its fate. Knowing the chain makes every error message readable.
flowchart TD
R["API request arrives"] --> S{"Is the service restricted by a perimeter?"}
S -->|No| IAM["Only IAM is checked"]
S -->|Yes| P{"Is the target resource in the perimeter?"}
P -->|No| IAM
P -->|Yes| I{"Does the caller come from inside the perimeter?"}
I -->|Yes| OKI["Perimeter allows it, then IAM is checked"]
I -->|No| AL{"Does an access level or ingress rule allow it?"}
AL -->|Yes| OKI
AL -->|No| DENY["Request denied and a violation is logged"]
Step by step
Identify the target
Google finds which project and service the request is aimed at. If the project is not protected, or the service is not restricted, the perimeter has nothing to say.
Identify the origin
It looks at where the request came from: a project and network inside the perimeter, or an outside source with an address and an identity.
Compare with the perimeter
If target and origin are both inside, the request passes this stage. If the origin is outside, access levels and ingress rules are consulted.
Check the destination for copies
For operations that move data between resources, such as copies and exports, both sides are examined. A destination outside the perimeter triggers egress rule checks.
Decide and record
The request is allowed or denied. Denials, and dry-run denials, are written to audit logs with a unique ID.
Apply IAM
For allowed requests, normal IAM checks run. The perimeter never grants permission. It only allows requests to proceed to the IAM check.
A perimeter can only say “no” or “not my business.” It can never say “yes, you may.” Permission always comes from IAM. Both must agree before a request succeeds.
Boarding a plane has two checks. The security gate asks if you may enter the departure area, and the airline desk asks if you hold a ticket. Passing security does not give you a seat, and having a ticket does not let you skip security. The perimeter is the security gate, and IAM is the ticket check.
16Networks and Hybrid Setups
For private networks, on-premises offices and virtual machines without public addresses, a few network settings make the perimeter work as intended.
Why the network matters
A machine in a private network reaches Google APIs through a special route. If it uses the ordinary public addresses of Google APIs, the request may be treated like any outside request. Google offers special names and address ranges so that traffic from your networks arrives as part of your perimeter and is recognized as internal.
The restricted and private virtual addresses
Two special names exist for private access: restricted.googleapis.com and private.googleapis.com. The restricted one only reaches APIs that support VPC Service Controls, which means requests to unsupported APIs fail and cannot become a hidden escape route. The private one reaches most Google APIs, including some that VPC-SC does not cover. For perimeter-focused designs, the restricted address range is the safer choice.
DNS and routing
To send traffic to the restricted address range, your network’s DNS (the system that turns names into addresses) is set so that Google API names point to the restricted range. Routes must also be present so traffic can reach it. Private Service Connect endpoints for Google APIs offer another modern way to do the same job, with an option designed for VPC-SC. Confirm the current method in the documentation, since recommended paths change.
flowchart LR ONP["On premises network"] --> VPN["VPN or Interconnect"] VPN --> VPC["VPC network inside the perimeter"] VM2["Virtual machines"] --> DNS["DNS maps Google API names to restricted addresses"] VPC --> DNS DNS --> RV["Restricted Google API address range"] RV --> API["Google APIs checked by the perimeter"]
On-premises machines
Offices and data centers connected by VPN or Interconnect can also use the restricted address range, if routes and DNS are set up to send API traffic through the private link. Their requests then appear as coming from inside the perimeter’s network, and no public access level is needed for them.
| Setting | Purpose | Mistake to avoid |
|---|---|---|
| Restricted address range | Reach only VPC-SC-supported APIs privately | Using the broader private range and silently allowing unsupported APIs |
| DNS mapping | Make Google API names resolve to the chosen range | Forgetting some API names, so traffic leaks out by the public route |
| Routes | Carry the traffic to the range | Missing routes in on-premises networks |
| Private Google Access | Let machines without public addresses reach Google APIs | Assuming it also controls which projects can be reached |
Think of a company mail room with two mail chutes. One chute goes straight to the company’s own secure post office. The other goes to the public mail. DNS is the sign above each chute. If the sign is wrong, important parcels go into the public chute and are treated as outside mail.
17Shared VPC and Service Projects
Many companies use a shared network owned by one project and used by many. Perimeters must respect that structure.
A Shared VPC lets a central host project own a network that other service projects use. The virtual machines live in the service projects, but their traffic travels over the host project’s network. This is a popular way to keep networking under central control.
The rule of thumb
Put the host project and all of its service projects in the same perimeter. If a service project is outside the perimeter while the host is inside, its machines use a network that belongs to the perimeter, and requests may be blocked or treated in confusing ways. Keeping them together avoids a large class of problems.
Planning your perimeters around networks
- List all Shared VPC host projects and their service projects before you create perimeters.
- Keep a Shared VPC family in one perimeter, unless you have a clear plan for crossing rules.
- Remember that adding a new service project later means adding it to the perimeter too.
- Test network-heavy workloads, such as managed data services running in private networks, in dry run first.
An apartment complex has one shared courtyard and many apartments. If the courtyard sits inside the complex’s security fence, but one apartment is outside it, residents of that apartment walk through the courtyard gate every day and keep tripping the alarm. Keeping courtyard and apartments inside one fence prevents this daily trouble.
Moving a project into or out of a perimeter can break running workloads in minutes. Plan such moves in a maintenance window, test them first, and tell the application owners beforehand.
18Getting Started: A Safe Rollout Plan
The biggest risk with VPC Service Controls is not the technology. It is switching on a wall without knowing what already crosses it.
Name the data you must protect
List the datasets, buckets and systems that hold sensitive information. Decide what “leaving” means for each. A clear goal prevents endless rule writing.
Make an inventory
List projects, services used, networks, automation tools, partners and human users who touch the data. Surprises found now are cheaper than surprises later.
Confirm prerequisites
You need a Google Cloud organization, the right administrator roles, and logging enabled so that violations are recorded.
Create a dry-run perimeter
Put a small, low-risk group of projects in a perimeter, in dry-run mode. Restrict the services that matter most.
Read the violation logs
Watch for several weeks, covering monthly jobs and unusual events. Group the violations by caller, target and service.
Add access levels and rules
For each legitimate violation, choose the narrowest fix. For each illegitimate one, celebrate: the perimeter just proved its value.
Enforce, then expand
When the logs are quiet, enforce the perimeter. Then repeat the cycle with the next group of projects.
Do not begin with your most important production project. Start with a new or low-risk project, learn the tools and the error messages, and build a short internal guide. Then protect the crown jewels with confidence.
Before closing a busy road for construction, a city counts the cars, buses and ambulances that use it each day and plans diversions. Closing the road first and counting later would be chaos. A rollout plan is the traffic count that comes before the fence is built.
19Dry Run: Practice Without Risk
Dry run is the feature that makes VPC Service Controls safe to adopt. Treat it as a required step, never as an optional extra.
Every perimeter can have two configurations side by side: the enforced configuration, which actually blocks requests, and a dry-run configuration, which only logs what would happen. You can create a perimeter with only a dry-run configuration. You can also add a dry-run configuration to an enforced perimeter, to test a proposed change before applying it.
flowchart LR
A["Plan and inventory"] --> B["Create dry run perimeter"]
B --> C["Collect violation logs"]
C --> D["Add access levels and rules"]
D --> E{"Logs clean for long enough?"}
E -->|No| C
E -->|Yes| F["Enforce the perimeter"]
F --> G["Operate and review"]
G --> D
What dry run teaches you
- Which services and callers cross the boundary today.
- Which automation and scheduled jobs were forgotten.
- Which partners or tools depend on outside access.
- How much noise to expect once the perimeter is enforced.
How long to wait
Watch for at least one full business cycle. Monthly reports, quarterly audits and yearly tasks may use paths that a two-day test never sees. Many teams run dry mode for several weeks before enforcing, and longer for complex systems.
Using dry run for every change
Dry run is also the right way to test future changes. Propose the new rule or new project in the dry-run configuration, and watch the logs. Only when the picture is clean, promote the change into the enforced configuration.
| Mode | Blocks requests? | Writes logs? | Use for |
|---|---|---|---|
| Enforced | Yes | Yes, for violations | Real protection |
| Dry run | No | Yes, marks what would have been blocked | Learning, testing changes |
A school fire drill lets everyone practice the exit routes and reveals blocked doors without a real fire. If a door is jammed during a drill, it is a small lesson. If it is jammed during a real fire, it is a disaster. Dry run is the fire drill for your perimeter.
20Who May Manage Perimeters
The power to change a perimeter is the power to open every door in it. That power should belong to very few people.
Perimeters and access levels are managed through Access Context Manager, and access to them is controlled by IAM roles at the organization level or, for scoped policies, at the folder or project level. There are ready-made roles for administering, editing and only reading policies. Names change slowly, so confirm the exact roles in current documentation. The ideas below stay the same.
| Who | Needs to | Suitable level of access |
|---|---|---|
| Security administrators | Create and change perimeters, levels and rules | Administrator role on the policy, a very small group |
| Platform engineers | Propose changes and read configuration | Editor on a scoped policy, or reader plus a change process |
| Application teams | Understand why their requests are blocked | Reader access, and permission to use troubleshooting tools |
| Auditors | Review configuration and logs | Reader access only |
Good habits
- Give administrator rights to a small group, and review that group regularly.
- Require a written request and a second reviewer for any change to enforced perimeters.
- Keep changes in code and version control, so every change has an author, a reason and a time.
- Create a “break-glass” procedure for emergencies, with extra logging and an after-event review.
- Allow application teams to read logs of their own violations, so they can solve problems without waiting for a security person.
It is possible to configure a perimeter so strictly that even administrators cannot reach the resources they need to fix it. Always ensure the administrators’ own access path, such as the corporate network access level, is in place and tested before enforcing.
In a bank, only a few senior managers hold the keys to the vault’s control room, because whoever controls the control room controls every lock. They log every entry, and no single person can change the vault rules alone. Perimeter administration deserves the same level of care.
21Audit Logs and Understanding Violations
Every blocked request leaves a trail. Reading it is the main skill of anyone who runs a perimeter.
When a request is denied, or would be denied in dry run, Google Cloud writes an audit log entry in the project that holds the targeted resource, and at the organization level where configured. The entry says who called, from where, to what service and method, which perimeter applied, and the reason for the violation. The error shown to the caller includes a unique ID that points to that exact log entry.
Reading the error message
The user sees a message saying that the request is prohibited by the organization’s policy, together with a unique identifier. That identifier is the key. Anyone with permission can search the logs for it and see the full details, which saves guessing.
Common violation reasons
| Reason in the log | Plain meaning | Usual fix |
|---|---|---|
| No matching access level | The caller is outside and does not satisfy any access level or ingress rule | Add the caller to a narrow access level or ingress rule, or move the work inside |
| Resources not in the same perimeter | The request connects a protected resource with one in another perimeter or outside | Add ingress or egress rules, or place both resources in one perimeter |
| Network not in the same perimeter | The request came from a network that belongs to a different perimeter or none | Fix project placement, or add an ingress rule for that network |
| Service not allowed from the VPC | The called API is not in the list of VPC accessible services | Add the service to the list if it is truly needed |
What to record about each violation
- The caller identity and where it was running.
- The target project, service and method.
- Whether the entry is dry run or enforced.
- The decision: fix, allow with a rule, or leave blocked because it should be blocked.
When a security gate turns someone away, the guard writes a note with a case number: who came, what they wanted and why they were refused. The visitor receives only the case number, and the manager can look it up to see the complete story. The unique ID in the error is that case number.
Not every violation is a problem. Some violations are the perimeter doing its job against an unwanted caller. Treat each one as a question: “Should this have been allowed?” Both answers are valuable.
22Troubleshooting Blocked Requests
A calm, ordered method turns a frightening error into a ten-minute task.
flowchart TD
V["Request blocked"] --> U["Copy the unique ID from the error"]
U --> L["Find the audit log entry or use the troubleshooting tool"]
L --> R{"What is the violation reason?"}
R -->|No matching access level| N1["Caller is outside: consider a narrow access level or ingress rule"]
R -->|Resources not in same perimeter| N2["Crossing perimeters: consider rules or moving a project"]
R -->|Service not allowed from VPC| N3["Adjust the list of VPC accessible services"]
N1 --> T["Test the change in dry run first"]
N2 --> T
N3 --> T
T --> E["Apply the narrowest fix and document it"]
Tools that help
Google Cloud provides tools for this work. A troubleshooting tool takes the unique ID and explains the violation in plain language. A violation analyzer in the console groups violations and suggests the kind of rule that might fix them. Names and screens evolve, so look for the current options in the VPC Service Controls section of the console.
A calm routine
Capture the unique ID
Ask the person who saw the error to copy the full message. Do not rely on a screenshot of part of it.
Read the details
Open the log entry or the troubleshooting tool and note caller, source, target and reason.
Decide on intent
Ask the owners: should this traffic exist at all? If not, leave it blocked.
Choose the narrowest remedy
Prefer a specific rule over a broad access level, and a broad level over a bridge.
Test, apply, record
Test in dry run, apply, then record the reason and an owner for later review.
Changes to perimeters are not instant. They can take several minutes, sometimes close to half an hour, to spread everywhere. Wait before you decide that a fix did not work, and avoid stacking many quick changes on top of each other.
When your car shows a warning light, a mechanic plugs in a reader that prints a code and then looks up what the code means. The unique ID is the code, and the troubleshooting tool is the lookup book. Guessing without the code often means replacing parts that were never broken.
23Automation, CI/CD and Service Agents
Machines are the most common source of surprise violations. Pipelines, scheduled jobs and Google’s own helper accounts all cross boundaries.
Build and deployment pipelines
A continuous integration and delivery pipeline builds code, tests it and deploys it. If the pipeline runs outside the perimeter, for example on a hosted build service or a laptop, its calls into protected projects are outside-to-inside and need an ingress rule or an access level. If it runs inside, its calls are internal, but its calls to outside tools, such as public package sources or other projects, may need egress rules.
Infrastructure as code tools
Tools that create cloud resources from files run with a service account and call many APIs. If they run from a company laptop or a hosted runner, they come from outside. A common solution is to run them from a build service inside the perimeter, or to give their identity a very narrow ingress rule.
Service agents
Many Google Cloud services act on your behalf using special accounts called service agents. For example, a data analysis service may read from your storage bucket using its own agent. These agents are managed by Google, and VPC-SC has built-in handling for many of them, but some flows still need explicit rules, especially when data crosses projects. Dry run reveals which ones appear in your logs.
Scheduled jobs and partners
Monthly exports, yearly audits and partner integrations tend to hide until they fail. Ask each team for a list of recurring jobs before enforcing, and watch for them in dry-run logs.
Run inside if possible
Builds that run inside the perimeter need fewer exceptions and are easier to audit.
Narrow identity
Give automation identities only the rules they need, and avoid using personal accounts for automation.
Learn from logs
Service agent violations are listed in logs. Allow only the specific flows that are truly needed.
Ask for the calendar
Collect all recurring jobs, with dates, so that nothing waits to surprise you on the first of the month.
A company’s office has staff who work there every day, and also couriers, cleaners and maintenance contractors who arrive on their own schedules. A security plan that thinks only about staff will block the cleaners at the worst moment. Machines in the cloud are the couriers and cleaners, and each needs a pass.
24Data Flow and Lifecycle of a Perimeter
A perimeter is not a one-time installation. It has a life: it is born, it matures, it changes, and eventually parts of it are retired.
Design
Decide what to protect, which projects belong together, and who owns the perimeter. Write down the goal in one sentence.
Dry run
Create the perimeter in dry-run mode. Collect logs, discover dependencies and prepare rules.
Enforcement
Promote the dry-run configuration to enforced during a quiet period, with the team on standby.
Operation
Watch violations, answer questions, and handle requests for new rules through a review process.
Change
New projects join, services are added, partners come and go. Each change is tested in dry run before it becomes real.
Review
Every quarter, review rules and access levels. Remove those whose owners cannot explain them.
Retirement
When a project is shut down, remove it from perimeters and delete rules that referred to it.
Following one request through the life of a rule
Imagine a partner needs to read a monthly report. In month one, the request is blocked, and the violation appears in the logs. The security team and the partner agree on a narrow ingress rule. It is tested in dry run during the next cycle, and then enforced. For a year, the partner’s reads succeed quietly. At the yearly review, the owner confirms the partnership is still active. Two years later the partnership ends, and the rule is removed. Each stage has an owner and a date.
A garden fence needs care throughout its life. First it is designed and built, then it is tested by watching where people try to walk through. Over time gates are added and old ones removed, and every season someone walks the fence line to look for holes. A perimeter that is built and forgotten slowly fills with forgotten gates.
25How Many Perimeters Should You Have?
There is no single right number. The best design balances strong separation against the effort of managing many boundaries.
One big perimeter
A single perimeter around everything is simple to explain and has few internal exceptions. It protects against outside threats. Its weakness is that nothing separates one internal team’s data from another’s. A compromised project can reach all others in the perimeter, subject only to IAM.
Many small perimeters
One perimeter per application or per data set gives strong separation. A breach in one area cannot easily spread. The cost is more rules, since every cross-team flow now crosses a wall, and more work for administrators.
Common middle paths
- By environment: separate perimeters for production and non-production, so test projects cannot reach production data.
- By sensitivity: a strict perimeter for regulated data, and a lighter one for general work.
- By business unit: each department manages its own perimeter through a scoped policy.
- By purpose: a perimeter for shared tools such as logging and monitoring, with narrow rules to and from the others.
| Design | Strength | Weakness | Good for |
|---|---|---|---|
| One perimeter | Simple, few exceptions | Weak internal separation | Small organizations, first rollouts |
| By environment | Keeps test away from production | Needs rules for promotion flows | Most teams |
| By sensitivity | Strong protection for the most valuable data | Complex data sharing | Regulated industries |
| Per application | Strongest isolation | Heavy management effort | High-risk or high-value systems |
A hospital does not lock every room, nor leave every room open. It secures the pharmacy more strongly than the waiting area, and the operating rooms more strongly than the cafeteria. Choose the perimeters by asking where a break-in would hurt the most.
26Security Considerations and Limits
A good security tool is honest about what it does not do. Knowing the limits helps you build the other layers you need.
What VPC Service Controls helps with
- Stolen credentials used from outside the allowed boundary.
- Accidental or deliberate copying of data to projects outside the perimeter.
- Accidentally public resources, where the perimeter can still block outside callers.
- Limiting which APIs your private networks can reach.
- Giving auditors a clear, logged boundary.
What it does not do
- It is not a network firewall. It does not control traffic between virtual machines, or traffic to the open internet.
- It does not replace IAM. A perimeter never grants permission, and weak IAM remains a risk inside the wall.
- It does not cover everything. Unsupported or unrestricted services are not guarded.
- It cannot stop a trusted person inside from misusing data. An authorized insider who works from an allowed place can still read what IAM allows, and can copy data to places inside the perimeter or to their own screen.
- It does not encrypt or classify data. Those are separate controls.
- It cannot protect data that left through other channels. For example, a virtual machine sending data to a website on the internet is a network matter, not an API matter.
| Threat | Does VPC-SC help? | Other layer to add |
|---|---|---|
| Stolen key used from the internet | Yes, strongly | Short-lived credentials, key rotation |
| Copy to a personal project | Yes, strongly | Organization policies, monitoring |
| Malware on a VM sending data to a website | No, this is network traffic | Firewall egress rules, proxy controls |
| Over-broad IAM roles | Partly, since the caller must be inside | Least privilege, access reviews |
| Insider using allowed access | Limited | Data access logging, monitoring, separation of duties |
| Data in an unsupported service | No | Check the supported list, choose supported services |
A strong fence around a farm keeps out thieves, but it does not feed the animals, lock the barn door, or stop the farmer from giving the grain away. Each job needs its own tool. The fence is one important tool among several.
The most dangerous belief is “we have a perimeter, so we are safe.” Keep least privilege, logging, encryption, patching and monitoring in place, since each covers cases that a perimeter cannot.
27Companion Controls That Work With Perimeters
A perimeter is strongest when it stands among other protections. Here are the neighbors that matter most.
Organization policies
Organization policies are guardrails that limit which settings may be used in your cloud, for example where resources may be created, or whether certain risky actions are allowed at all. They stop bad configurations from being made in the first place, while the perimeter judges requests as they happen. Together they cover both “what may exist” and “what may move.”
Least-privilege IAM
IAM remains the main source of permission. Keep roles narrow, prefer groups to individuals, and review who holds powerful roles. Inside a perimeter, IAM is the last line that limits what an allowed caller can do.
Short-lived credentials
Credentials that expire quickly give a thief little time. Prefer attached platform identities and short-lived tokens to downloadable key files. Many organizations also block the creation of key files entirely using an organization policy.
Audit logging and monitoring
Beyond violations, record who reads or changes data. Data access audit logs may need to be switched on for services that hold sensitive information. Alerts on unusual behavior help catch an insider who works within the rules.
Encryption and key control
Data in Google Cloud is encrypted by default. Some organizations add customer-managed encryption keys for extra control over who can decrypt data. Encryption protects the content, and the perimeter protects the access path, so the two complement each other.
Sensitive data discovery
You cannot protect what you have not found. Tools that scan for sensitive data, such as customer identifiers, can help you decide which projects belong inside a strict perimeter.
Organization policies
Prevent risky settings and limit locations and actions before problems begin.
Least-privilege IAM
Gives each person and program only what they need.
Short-lived credentials
Reduce the value of any stolen secret.
Logs and alerts
Notice odd behavior by allowed users and early probing by attackers.
Encryption and keys
Protects the data itself, even if other layers fail.
Data scanning
Finds where sensitive data really lives, so the perimeter covers the right projects.
A house is safest with several protections working together: a fence, a strong front door, window locks, a safe for jewelry and an alarm. No single one is perfect, but a burglar who beats one still faces the others. VPC Service Controls is the fence, and the companion controls are the door, locks, safe and alarm.
28Monitoring, Alerting and Metrics
A perimeter that nobody watches slowly decays. A few simple alerts and dashboards keep it healthy.
Violations are written to audit logs, and logs can be turned into numbers. Cloud Logging lets you create log-based metrics, which count matching log entries over time. Cloud Monitoring can then draw charts and send alerts from those counts. This is how you learn about problems before users complain.
Useful numbers to watch
Alerts worth setting
- Sudden spike in violations. This may mean a broken deployment, a new misconfigured job, or an attacker probing.
- Violations from unusual places. A burst of denied requests from a country you never use deserves a look.
- Any change to an enforced perimeter. Administration changes are rare and important, so notify the security team each time.
- Dry-run violations after a change. If you test a new rule, alert on any new dry-run violations.
Keep the logs safe and long enough
Audit logs may be needed months later by investigators or auditors. Route copies of important logs to a protected storage place or analysis tool, with its own access controls. Be careful that the destination of the log export is itself compatible with your perimeter rules, otherwise the export may be blocked.
A museum with a good fence also has cameras and an alarm panel. A sudden surge of alarms at the east gate at midnight tells the guards where to look. Log-based metrics and alerts are the cameras and the alarm panel for your cloud fence.
29Cost and Operational Effort
The money cost of a perimeter is usually small. The people cost is where careful planning matters.
Direct cost
Check the current pricing documentation for any charge related to VPC Service Controls itself, because pricing can change. In any case, there are indirect costs: log storage, log analysis, and the services that run your monitoring. Audit logs of violations can grow large if a misconfigured job keeps failing, so watch the volume.
Operational effort
The real investment is time. Someone must plan the design, run the dry-run period, write and review rules, answer questions from developers, and review the configuration regularly. Estimating this effort honestly is part of the decision.
| Activity | When | Who | Rough effort |
|---|---|---|---|
| Design and inventory | Before the first perimeter | Security with application owners | Days to weeks |
| Dry-run period and rule writing | Before enforcing | Security and platform teams | Weeks |
| Answering developer questions | Continuously | Platform support | Falls over time with good documentation |
| Quarterly review | Every few months | Security | Hours to days |
| Onboarding a new project | Each new project | Platform team | Hours with a good template |
Ways to keep effort low
- Write a short guide, with common errors and fixes, for developers.
- Use templates for new projects that already include the perimeter membership.
- Standardize rules, so the same kind of request gets the same kind of answer.
- Manage configuration as code, which makes reviews faster and mistakes rarer.
Buying a fence is cheap compared with maintaining a gate staff, writing a visitor policy and training everyone. The fence itself is not what costs most, and a plan that forgets the people part will fail even if the fence is excellent.
30Advantages, Disadvantages and Trade-offs
Every control is a bargain. Look at both sides honestly, then decide how much perimeter you really need.
Advantages
- Reduces the risk of data exfiltration, including through stolen credentials
- Works at the API level for supported Google-managed services, with no agents to install
- Adds a boundary that is independent of IAM, giving real defense in depth
- Dry run lets you learn safely before enforcing
- Clear audit logs support investigation and compliance evidence
- Fine-grained ingress and egress rules allow narrow, documented exceptions
- Can limit which Google APIs private networks may reach
Disadvantages
- Needs a Google Cloud organization and careful administration
- Does not cover every service or every kind of data movement
- Can break workloads that cross boundaries in ways nobody remembered
- Rules and access levels can become complicated over time
- Changes take time to spread, which slows urgent fixes
- Some features and integrations have limits inside a perimeter
- Requires a team that understands it, or support requests pile up
Compared with other approaches
| Approach | Strength | Weakness | Good fit |
|---|---|---|---|
| VPC Service Controls | Stops cross-boundary API access and copying | Only for supported services, needs planning | Sensitive or regulated data on Google Cloud |
| IAM only | Simple, always present | Ignores location and destination | Low-risk data |
| Separate projects and organization policies only | Simple isolation, setting guardrails | Does not judge individual requests | Good baseline for everyone |
| Private networks and firewalls only | Controls network paths | Cannot see API-level copying | Protecting machines, not data services |
Trade-offs to think about
Protection versus agility. Each wall slows some legitimate work. A faster approval process for narrow rules keeps teams productive.
Coverage versus complexity. Restricting more services protects more, but it adds more exceptions to manage. Begin with the services that hold the most sensitive data.
Centralization versus ownership. A central team gives consistency, and scoped policies give speed. Many companies use both, with shared standards.
If a leak of your data would be a serious event for customers, regulators or your business, the effort of a perimeter is usually justified. If the data is public or low value, simpler controls may be enough.
31Design Patterns and Anti-patterns
Patterns are lessons that other teams paid for. Anti-patterns are the traps they fell into.
Six helpful patterns
Dry run first, always
Every new perimeter and every significant change goes through dry run before it is enforced.
Separate by environment
Keep production and non-production in different perimeters, with only narrow, reviewed flows between them.
Narrow, named exceptions
Every ingress or egress rule names an identity, a target and methods, and has an owner and a review date.
Configuration as code
Keep perimeters and rules in version control with reviews, so every change is traceable and reversible.
Inside-out pipelines
Run build and deployment tools inside the perimeter, so they need almost no exceptions.
Restricted network paths
Use the restricted address range for private access, so unsupported APIs cannot become hidden exits.
Three costly anti-patterns
What it looks like
A team enforces a perimeter on a Friday afternoon without a dry-run period, because “we know our systems.”
Why it hurts
Forgotten jobs, partner integrations and service agents fail all at once. The team scrambles over the weekend, and often fixes the pain by opening wide, careless exceptions.
Do this instead
Run dry mode for at least one full business cycle, fix the genuine dependencies with narrow rules, and enforce during a quiet period with the team on standby.
What it looks like
An access level allows “any identity from any region” so that remote workers stop complaining. Ingress rules allow all services and all methods.
Why it hurts
The perimeter exists on paper but stops almost nothing. A thief with a valid key walks straight through the hole that was meant to be a small gate.
Do this instead
Give remote workers a managed route, such as a company VPN with a known exit address, and write access levels around that route and around managed devices.
What it looks like
Exceptions are added for years and never reviewed. Nobody knows why a rule exists, so nobody dares to remove it.
Why it hurts
The wall fills with forgotten gates. Audits become painful, and a former partner’s identity may still hold access years later.
Do this instead
Give every rule an owner, a reason and a review date. Remove rules whose owners cannot be found, after a dry-run warning period.
32Best Practices and Common Mistakes
The habits below are simple. They come from many teams learning the hard way.
Best practices
- Protect the data first, not the whole company. Begin with the datasets that would hurt most if leaked.
- Verify service support. List every service on the data path and confirm each is supported and restricted.
- Keep Shared VPC families together. Host and service projects belong in one perimeter.
- Test administrators’ access path. Make sure your own team can still manage the perimeter after enforcement.
- Use the restricted network path. Configure DNS and routes so private traffic uses restricted addresses.
- Write rules as narrowly as you can. Name identities, target projects and methods.
- Document and review. Add owners, reasons and review dates to every exception.
- Monitor violations and changes. Alert on spikes and on edits to enforced perimeters.
- Train developers. A one-page guide on reading the unique ID saves hours.
Common mistakes and quick fixes
| Mistake | What happens | Better habit |
|---|---|---|
| Enforcing without dry run | Surprise outages | Observe in dry run for a full business cycle |
| Assuming all services are covered | Data leaks through an unrestricted service | Check support and restriction per service |
| Broad access levels | Perimeter protects almost nothing | Narrow conditions, combine address and identity |
| One-sided cross-perimeter rules | Requests still fail | Add the egress rule on the sender and the ingress rule on the receiver |
| Forgetting a Shared VPC service project | Strange failures of VMs in that project | Keep the whole Shared VPC family together |
| Wrong DNS or routes | Traffic leaves by public paths and looks like outside traffic | Map Google API names to restricted addresses everywhere |
| Locking out administrators | Cannot fix the perimeter | Test an admin access level before enforcing |
| Not waiting for propagation | Stacking fixes on top of each other | Make one change, wait, then test |
| Rules without owners | Forgotten, ever-growing exceptions | Owner, reason and review date for each rule |
33Failure Scenarios and Recovery
Things will occasionally go wrong. A prepared team recovers in minutes, and an unprepared team in days.
| Scenario | Likely cause | Recovery move |
|---|---|---|
| A production job suddenly fails after enforcement | A dependency was missed in dry run | Read the unique ID, add the narrowest rule, and test; if urgent and approved, use a controlled temporary exception with an expiry |
| Administrators cannot open the console for a project | No access level for the admin network | Use the break-glass procedure, correct the access level, then review how it happened |
| Data export to a partner stops | Missing egress or ingress rule on one side | Check both perimeters, add the missing half of the crossing |
| Developers cannot use a service from a laptop | The laptop is outside any access level | Provide a managed access route such as a VPN, not a wide level |
| A new project works strangely | It was created outside the perimeter or in the wrong one | Add it to the correct perimeter after a dry-run check |
| A fix does not seem to work | Propagation delay or the wrong configuration was changed | Wait, then confirm which configuration, enforced or dry run, holds the change |
Principles for recovery
- Understand before you loosen. A rushed wide exception may stay for years.
- Keep a break-glass path. A rarely used, heavily logged way for a few trusted people to regain control.
- Use temporary exceptions with an end date. If an urgent exception is unavoidable, record who approved it and when it must be removed.
- Review after every incident. Ask what the dry run missed, and add that lesson to your checklist.
- Keep configuration in version control. Rolling back a bad change is far easier when the previous version is saved.
A building has a fire exit that is alarmed, locked from outside, and opened only in emergencies, and every use is recorded and investigated. A break-glass path for perimeter administration works in the same way. It saves the day when needed, and its use is never casual.
34Real-World Usage Patterns
Different organizations use VPC Service Controls for different reasons. Find the story that looks like yours.
A health organization protecting patient records
A health provider stores patient data in cloud storage and analysis tables. It places the projects holding this data in a strict perimeter and restricts storage and analytics services. Only a managed hospital network and a few service accounts are allowed in. Even if a doctor’s password is stolen, an attacker outside the network cannot read the records.
A financial company meeting audit requirements
A financial services firm must prove to auditors that customer transaction data cannot be copied outside approved projects. The perimeter, its logs and its documented exceptions become the evidence. Quarterly reviews show that each exception has an owner and a reason.
A research group sharing data with a partner
A research institute shares one anonymized dataset with a partner university. Instead of making a bucket public, it places the dataset in its own small perimeter and writes a narrow ingress rule for the partner’s service account. The partner reads only the permitted data, and the rest of the institute’s data stays sealed.
A software company separating environments
A company with many developers creates one perimeter for production and another for development and testing. A narrow egress and ingress rule pair lets a carefully controlled pipeline promote tested software. Developers can experiment freely without any path to real customer data.
A government agency with strict data location rules
An agency keeps citizen data in selected regions and protects it with perimeters and organization policies. The perimeter ensures that data cannot be sent to projects outside the agency’s organization, while organization policies limit where resources can be created.
The wider picture
Industries with strict rules about data, such as health care, finance, insurance and public services, are the most common users. We describe these as general patterns, and do not claim that any named company uses VPC Service Controls in a specific way, because public information on this is limited. Many well-known data breaches in the cloud era involved valid credentials used from unexpected places, and this is the pattern that perimeters are designed to blunt.
The deeper lesson is about assumptions. Old security assumed that anyone inside the network is trusted. Modern security assumes that identities can be stolen and mistakes will happen, so it adds boundaries that hold even then. A perimeter turns “we hope nobody does this” into “this cannot happen without being noticed.”
35A Worked Walkthrough in Words
Let us follow a made-up security engineer named Ravi as he protects a customer data project from start to finish.
Ravi works at a small insurance company. The company keeps claim records in a storage bucket and an analysis dataset, both in one project called the claims project. The data is sensitive, and the auditors have asked for proof that it cannot leave the company’s cloud organization. Ravi decides to use VPC Service Controls.
First he lists who and what touches the claims project. The analytics team reads data from the office network. A nightly job copies a summary to a reporting project. A partner company reads one file each month. A build pipeline running on a hosted service deploys small tools. He also finds an old test script that copies data to a developer’s personal project, which makes everyone nervous.
He creates a perimeter in dry-run mode around the claims project and the reporting project, restricting the storage and analysis services. For three weeks he reads the logs. As expected, the monthly partner read and the hosted pipeline appear as violations. The old test script appears too, with a violation that says the destination is outside the perimeter. Ravi has the script removed, and happily records that the perimeter just found a real risk.
For the partner, he writes a narrow ingress rule that allows only the partner’s service account to read objects from one project. For the pipeline, he moves the deployment tool to a build service running inside the company’s projects. For human users, he creates an access level based on the office network’s address range and the company VPN. He also tests an access level for administrators, so that the security team will not be locked out.
After two quiet weeks of clean dry-run logs, Ravi enforces the perimeter on a Tuesday morning, with the team on standby. A few small questions arrive, and each one is answered with the unique ID and the troubleshooting tool. He sets up an alert for spikes in violations and for any change to the enforced perimeter. At the next quarterly review, he checks that every rule has an owner and a reason.
Ravi did not start by writing rules. He started by listing what crossed the boundary, practiced in dry run, wrote narrow exceptions, and checked his own access path. The technology was simple. The care was the real work.
36Team Workflow and Governance
A perimeter works best when the surrounding habits are clear. A few agreements prevent most confusion.
A request process
Create a simple, written process for asking for an exception. The request should say who needs access, to what, why, for how long, and who owns it. A security reviewer checks that the rule is narrow, and a second person approves it. A simple form is enough, as long as every exception leaves a record.
Standards for naming and documentation
Choose clear names for perimeters and access levels, such as the environment, the data type and the owner team. Write a short description for each object. When a new teammate reads the configuration, the names should explain the design.
Ownership
Decide who owns the perimeter design, who owns each rule, and who watches the logs. A common split is that a central security team owns the overall design and access levels, platform teams own rules for their areas, and application teams own the reasons for their requests.
Regular rhythm
Hold a short quarterly review. Check every rule for an owner and a reason, remove expired exceptions, and look at the top sources of violations. Share a short summary with the wider engineering community, so everyone learns from it.
| Team decision | Why it matters | A simple default |
|---|---|---|
| Exception requests | Prevents silent, wide holes | Written request, security review, second approval |
| Naming | Makes logs and configuration readable | Environment, data type and owner in each name |
| Change process | Avoids accidental outages | Dry run first, then enforce in a quiet period |
| Ownership | Someone answers when something breaks | Named owner per perimeter and per rule |
| Review cycle | Stops rules from piling up | Quarterly review with removal of unused rules |
| Developer guide | Reduces support load | One page on reading errors and requesting help |
A school library lets students borrow books through a clear process: a card, a desk, a return date and a fine for losing a book. The rules are simple and known by all. Nobody feels the system is arbitrary, and the books stay in good order. The same is true of a well-run exception process.
37A Learning Path You Can Follow
You do not need to learn everything at once. Move from simple and safe to detailed and powerful.
Week one: the basics of identity and projects
Learn organization, folder, project, API and IAM. Draw your own company’s tree on paper, and mark where sensitive data lives.
Week two: the perimeter idea
Read about service perimeters, restricted services and the four request cases. Explain them out loud to a colleague using the museum analogy.
Week three: a practice perimeter
In a sandbox organization, create a dry-run perimeter around one practice project. Cause a few violations on purpose and read the logs.
Week four: access levels and rules
Write one access level and one narrow ingress rule. Write an egress rule for a copy to another project, and test it in dry run.
Week five: networks
Study restricted addresses, DNS mapping and Shared VPC. Check how your practice network reaches Google APIs.
Week six: operations
Create a log-based metric and alert for violations, write a developer guide, and design a quarterly review checklist.
Keep a notebook of every violation you solve, with the reason and the fix. After a month it becomes your own handbook, and you will recognise common patterns quickly, which is the real skill behind running perimeters well.
38Frequently Asked Questions
Short, honest answers to the questions beginners ask most often.
39Summary and Key Takeaways
If you remember only a few ideas from this long guide, make them these.
Key Takeaways
- A perimeter is a wall around APIs, not a firewall for machines. VPC Service Controls checks where an API request comes from and where data is going, and adds a second question to IAM’s “who are you.”
- It targets data exfiltration. Stolen credentials used from outside, copies to personal projects and accidental public settings are all made much harder, though never impossible.
- Protection needs support and restriction. A service must be on the supported list and on your perimeter’s restricted list, and every stop on the data path must be checked.
- Use narrow exceptions. Prefer specific ingress and egress rules over broad access levels or bridges, and give every exception an owner, a reason and a review date.
- Dry run first, every time. Observe violations for a full business cycle, fix real dependencies, welcome the ones that expose risks, and enforce in a quiet period with the team on standby.
- Build the layers around it. Keep least privilege, restricted network paths, monitoring and alerts, tested administrator access and regular reviews, because a perimeter is one strong layer, not the whole defense.