VPC Service Controls in Google Cloud

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.

Analogy

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.

2
questions asked per request: who are you, and where are you
API
level at which the perimeter works, not the network cable
Org
level at which policies are managed

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.

i
Do not confuse the names

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.

Risk 1

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.

Risk 2

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.

Risk 3

Malicious insiders

A person with legitimate access decides to copy data to a project they control outside the company.

Risk 4

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.

Analogy

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.

ScenarioWith IAM onlyWith IAM plus VPC-SC
Valid key used from a thief’s computerRequest succeedsBlocked, the caller is outside the perimeter
Copy a table to a personal projectSucceeds if the user has rights on bothBlocked, the destination is outside the perimeter
Permissions granted too broadlyMore people can read dataExtra people still must be inside the allowed boundary
Internal engineer working from a trusted networkSucceedsSucceeds
!
Important

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.

TermSimple meaningEveryday picture
OrganizationThe top of your cloud treeThe whole company campus
ProjectA container for resourcesOne building on the campus
APIThe doorway to a serviceA service counter window
Service perimeterA boundary around projects and servicesA fence with guarded gates
Access levelConditions about the callerA visitor pass with rules
Ingress ruleAllows a specific request to enterA named guest on the gate list
Egress ruleAllows a specific request to leaveAn approved delivery truck leaving
Dry runPractice mode with logs onlyA fire drill
Analogy

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.

ControlWorks atMain questionBlind spot
IAMIdentity and permissionWho may do this action?Ignores where the caller is or where data goes
Firewall rulesNetwork packetsWhich traffic may pass?Cannot see what an API call does with data
Private Google AccessNetwork routeHow does traffic reach Google APIs?Does not limit which projects can be reached
Organization policiesResource settingsWhich configurations are allowed?Does not judge individual requests
VPC Service ControlsAPI requestsIs this request crossing the boundary?Does not cover unsupported services or non-API channels
Analogy

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.

i
Think in layers

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"]
Figure 1. The main building blocks of VPC Service Controls and how they relate.

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.

ComponentPurposeManaged by
Access policyHolds perimeters and access levels for an organization or scopeSecurity or platform administrators
Service perimeterDefines the protected boundarySecurity team, with project owners consulted
Access levelDescribes trusted callersSecurity team
Ingress and egress rulesAllow narrow exceptionsSecurity team with application owners
Audit logsRecord violationsGoogle Cloud, read by security and operations
Analogy

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
Figure 2. Requests inside the perimeter flow normally, while crossing requests are blocked.

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.

CaseDefault resultHow to allow it
Inside to insideAllowed by the perimeter, IAM still appliesNothing needed
Outside to insideBlockedAccess level or ingress rule
Inside to outsideBlockedEgress rule
Outside to outsideNot affected by this perimeterNot applicable
Analogy

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.

Check 1

Is it supported?

Look up each product you use in the current list of supported products.

Check 2

Is it restricted?

Support is not protection. The service must be on your perimeter’s restricted list.

Check 3

Any known limits?

Read the product’s VPC-SC notes for features that need extra rules or are unavailable.

Check 4

Tested in dry run?

Real traffic reveals surprises that documents cannot.

Analogy

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.

!
Common trap

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.

TaskSame perimeterAcross the boundary
Copy a file between bucketsWorksNeeds an egress rule, and an ingress rule if another perimeter receives it
Query tables from two projectsWorksNeeds rules, or move both into one perimeter
Export query resultsWorks to an inside destinationBlocked unless allowed by an egress rule
Subscribe to a topicWorksNeeds rules on both sides
Send logs to long-term storageWorks to an inside destinationNeeds a narrow rule or an inside destination
Analogy

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.

i
Habit

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.
Analogy

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 typeGood forWatch out
Address rangeOffice networks, VPN exitsShared addresses may include more people than you expect
RegionBroad geographic limitsEstimates can be wrong, and attackers can use local addresses
IdentityNamed people or service accountsIdentities alone do not prove where the caller is
Device stateAllowing only managed, healthy devicesRequires extra licensed products and setup
Analogy

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.

!
Be careful

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.

1

Find the violation

Read the audit log entry for the blocked request, and note the caller, source, service and method.

2

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.

3

Write the narrowest rule

Name the exact identity, the exact target project, the exact service and only the methods needed.

4

Test in dry run

Apply the rule to the dry-run configuration and watch the logs for a while.

5

Enforce and document

Apply to the enforced configuration and record who requested it, why and when it should be reviewed.

Analogy

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
Figure 3. A controlled flow of data: an egress rule on one side, and an ingress rule on the other.

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 ruleGood answerPoor answer
Who is allowed to send?One named service accountAny identity
Where may data go?One named destination projectAny project
What may it do?Only the needed methodsAll methods of all services
Who reviews the rule?A named owner, reviewed regularlyNobody remembers
Analogy

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.

i
Tip

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.

OptionHow broadEffortBest when
Same perimeterEverything between the projectsLowThe projects are closely related and equally sensitive
Ingress and egress rulesExactly what you writeMediumSpecific flows between separate perimeters
Perimeter bridgeAll restricted services of both sidesLowOlder designs, short-term needs; prefer rules for new work
Analogy

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.
Analogy

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"]
Figure 4. A simplified view of how a request is evaluated. Real evaluation also looks at egress rules and destinations.

Step by step

1

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.

2

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.

3

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.

4

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.

5

Decide and record

The request is allowed or denied. Denials, and dry-run denials, are written to audit logs with a unique ID.

6

Apply IAM

For allowed requests, normal IAM checks run. The perimeter never grants permission. It only allows requests to proceed to the IAM check.

i
Key idea

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.

Analogy

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"]
Figure 5. Private traffic from the cloud network and from on-premises systems reaches Google APIs through restricted addresses.

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.

SettingPurposeMistake to avoid
Restricted address rangeReach only VPC-SC-supported APIs privatelyUsing the broader private range and silently allowing unsupported APIs
DNS mappingMake Google API names resolve to the chosen rangeForgetting some API names, so traffic leaks out by the public route
RoutesCarry the traffic to the rangeMissing routes in on-premises networks
Private Google AccessLet machines without public addresses reach Google APIsAssuming it also controls which projects can be reached
Analogy

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.
Analogy

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.

!
Watch out

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.

1

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.

2

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.

3

Confirm prerequisites

You need a Google Cloud organization, the right administrator roles, and logging enabled so that violations are recorded.

4

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.

5

Read the violation logs

Watch for several weeks, covering monthly jobs and unusual events. Group the violations by caller, target and service.

6

Add access levels and rules

For each legitimate violation, choose the narrowest fix. For each illegitimate one, celebrate: the perimeter just proved its value.

7

Enforce, then expand

When the logs are quiet, enforce the perimeter. Then repeat the cycle with the next group of projects.

i
Start small

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.

Analogy

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
Figure 6. The rollout loop: observe, adjust, repeat, and only then enforce.

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.

ModeBlocks requests?Writes logs?Use for
EnforcedYesYes, for violationsReal protection
Dry runNoYes, marks what would have been blockedLearning, testing changes
Analogy

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.

WhoNeeds toSuitable level of access
Security administratorsCreate and change perimeters, levels and rulesAdministrator role on the policy, a very small group
Platform engineersPropose changes and read configurationEditor on a scoped policy, or reader plus a change process
Application teamsUnderstand why their requests are blockedReader access, and permission to use troubleshooting tools
AuditorsReview configuration and logsReader 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.
!
Lockout risk

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.

Analogy

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 logPlain meaningUsual fix
No matching access levelThe caller is outside and does not satisfy any access level or ingress ruleAdd the caller to a narrow access level or ingress rule, or move the work inside
Resources not in the same perimeterThe request connects a protected resource with one in another perimeter or outsideAdd ingress or egress rules, or place both resources in one perimeter
Network not in the same perimeterThe request came from a network that belongs to a different perimeter or noneFix project placement, or add an ingress rule for that network
Service not allowed from the VPCThe called API is not in the list of VPC accessible servicesAdd 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.
Analogy

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.

i
Tip

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"]
Figure 7. A simple decision path for any blocked request.

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

1

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.

2

Read the details

Open the log entry or the troubleshooting tool and note caller, source, target and reason.

3

Decide on intent

Ask the owners: should this traffic exist at all? If not, leave it blocked.

4

Choose the narrowest remedy

Prefer a specific rule over a broad access level, and a broad level over a bridge.

5

Test, apply, record

Test in dry run, apply, then record the reason and an owner for later review.

!
Be patient

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.

Analogy

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.

Pipeline

Run inside if possible

Builds that run inside the perimeter need fewer exceptions and are easier to audit.

IaC

Narrow identity

Give automation identities only the rules they need, and avoid using personal accounts for automation.

Agents

Learn from logs

Service agent violations are listed in logs. Allow only the specific flows that are truly needed.

Schedules

Ask for the calendar

Collect all recurring jobs, with dates, so that nothing waits to surprise you on the first of the month.

Analogy

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.

1

Design

Decide what to protect, which projects belong together, and who owns the perimeter. Write down the goal in one sentence.

2

Dry run

Create the perimeter in dry-run mode. Collect logs, discover dependencies and prepare rules.

3

Enforcement

Promote the dry-run configuration to enforced during a quiet period, with the team on standby.

4

Operation

Watch violations, answer questions, and handle requests for new rules through a review process.

5

Change

New projects join, services are added, partners come and go. Each change is tested in dry run before it becomes real.

6

Review

Every quarter, review rules and access levels. Remove those whose owners cannot explain them.

7

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.

Analogy

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.
DesignStrengthWeaknessGood for
One perimeterSimple, few exceptionsWeak internal separationSmall organizations, first rollouts
By environmentKeeps test away from productionNeeds rules for promotion flowsMost teams
By sensitivityStrong protection for the most valuable dataComplex data sharingRegulated industries
Per applicationStrongest isolationHeavy management effortHigh-risk or high-value systems
Analogy

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.
ThreatDoes VPC-SC help?Other layer to add
Stolen key used from the internetYes, stronglyShort-lived credentials, key rotation
Copy to a personal projectYes, stronglyOrganization policies, monitoring
Malware on a VM sending data to a websiteNo, this is network trafficFirewall egress rules, proxy controls
Over-broad IAM rolesPartly, since the caller must be insideLeast privilege, access reviews
Insider using allowed accessLimitedData access logging, monitoring, separation of duties
Data in an unsupported serviceNoCheck the supported list, choose supported services
Analogy

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.

!
Do not rely on one wall

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.

Guardrail

Organization policies

Prevent risky settings and limit locations and actions before problems begin.

Permission

Least-privilege IAM

Gives each person and program only what they need.

Identity

Short-lived credentials

Reduce the value of any stolen secret.

Watching

Logs and alerts

Notice odd behavior by allowed users and early probing by attackers.

Content

Encryption and keys

Protects the data itself, even if other layers fail.

Discovery

Data scanning

Finds where sensitive data really lives, so the perimeter covers the right projects.

Analogy

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

Violations
how many requests are blocked per hour, by perimeter
Callers
which identities cause the most violations
Targets
which services and projects are most often hit
New sources
violations from addresses never seen before
Rule age
how long since each exception was last reviewed
Changes
edits made to perimeters and access levels

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.

Analogy

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.

ActivityWhenWhoRough effort
Design and inventoryBefore the first perimeterSecurity with application ownersDays to weeks
Dry-run period and rule writingBefore enforcingSecurity and platform teamsWeeks
Answering developer questionsContinuouslyPlatform supportFalls over time with good documentation
Quarterly reviewEvery few monthsSecurityHours to days
Onboarding a new projectEach new projectPlatform teamHours 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.
Analogy

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

ApproachStrengthWeaknessGood fit
VPC Service ControlsStops cross-boundary API access and copyingOnly for supported services, needs planningSensitive or regulated data on Google Cloud
IAM onlySimple, always presentIgnores location and destinationLow-risk data
Separate projects and organization policies onlySimple isolation, setting guardrailsDoes not judge individual requestsGood baseline for everyone
Private networks and firewalls onlyControls network pathsCannot see API-level copyingProtecting 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.

i
Decision hint

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

Pattern 1

Dry run first, always

Every new perimeter and every significant change goes through dry run before it is enforced.

Pattern 2

Separate by environment

Keep production and non-production in different perimeters, with only narrow, reviewed flows between them.

Pattern 3

Narrow, named exceptions

Every ingress or egress rule names an identity, a target and methods, and has an owner and a review date.

Pattern 4

Configuration as code

Keep perimeters and rules in version control with reviews, so every change is traceable and reversible.

Pattern 5

Inside-out pipelines

Run build and deployment tools inside the perimeter, so they need almost no exceptions.

Pattern 6

Restricted network paths

Use the restricted address range for private access, so unsupported APIs cannot become hidden exits.

Three costly anti-patterns

ANTI-PATTERN 01Avoid
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.

ANTI-PATTERN 02Avoid
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.

ANTI-PATTERN 03Avoid
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.
“A perimeter is only as strong as its exceptions, and only as useful as the care you take in writing them.”

Common mistakes and quick fixes

MistakeWhat happensBetter habit
Enforcing without dry runSurprise outagesObserve in dry run for a full business cycle
Assuming all services are coveredData leaks through an unrestricted serviceCheck support and restriction per service
Broad access levelsPerimeter protects almost nothingNarrow conditions, combine address and identity
One-sided cross-perimeter rulesRequests still failAdd the egress rule on the sender and the ingress rule on the receiver
Forgetting a Shared VPC service projectStrange failures of VMs in that projectKeep the whole Shared VPC family together
Wrong DNS or routesTraffic leaves by public paths and looks like outside trafficMap Google API names to restricted addresses everywhere
Locking out administratorsCannot fix the perimeterTest an admin access level before enforcing
Not waiting for propagationStacking fixes on top of each otherMake one change, wait, then test
Rules without ownersForgotten, ever-growing exceptionsOwner, 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.

ScenarioLikely causeRecovery move
A production job suddenly fails after enforcementA dependency was missed in dry runRead 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 projectNo access level for the admin networkUse the break-glass procedure, correct the access level, then review how it happened
Data export to a partner stopsMissing egress or ingress rule on one sideCheck both perimeters, add the missing half of the crossing
Developers cannot use a service from a laptopThe laptop is outside any access levelProvide a managed access route such as a VPN, not a wide level
A new project works strangelyIt was created outside the perimeter or in the wrong oneAdd it to the correct perimeter after a dry-run check
A fix does not seem to workPropagation delay or the wrong configuration was changedWait, 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.
Analogy

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.

i
What to notice

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 decisionWhy it mattersA simple default
Exception requestsPrevents silent, wide holesWritten request, security review, second approval
NamingMakes logs and configuration readableEnvironment, data type and owner in each name
Change processAvoids accidental outagesDry run first, then enforce in a quiet period
OwnershipSomeone answers when something breaksNamed owner per perimeter and per rule
Review cycleStops rules from piling upQuarterly review with removal of unused rules
Developer guideReduces support loadOne page on reading errors and requesting help
Analogy

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.

1

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.

2

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.

3

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.

4

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.

5

Week five: networks

Study restricted addresses, DNS mapping and Shared VPC. Check how your practice network reaches Google APIs.

6

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.

Q1Is VPC Service Controls a firewall?
No. A firewall controls network traffic between machines and networks. VPC Service Controls controls API requests to supported Google Cloud services, based on the project, the caller’s origin and the destination. Use both, since each covers different risks.
Q2Does it replace IAM?
No. A perimeter never grants permission. It only decides whether a request may proceed to the IAM check. A request must pass both. Weak IAM inside the perimeter remains a risk.
Q3Do I need a Google Cloud organization?
Yes. Access policies are managed at the organization level, so you need an organization resource to use VPC Service Controls. Smaller teams may need to set one up first.
Q4Which services does it protect?
A published list of supported products, which grows over time. A service must be both supported and added to the perimeter’s restricted services to be protected. Always check the current list.
Q5What is dry run, and should I always use it?
Dry run records the violations a perimeter would cause without blocking anything. Yes, use it first for every new perimeter and for every significant change, and observe for at least one full business cycle.
Q6My request was blocked. What do I do first?
Copy the unique ID from the error message, then use the audit log or the troubleshooting tool to see the violation reason. Decide whether the request should be allowed, and if so, write the narrowest rule and test it in dry run.
Q7What is the difference between an access level and an ingress rule?
An access level describes a trusted kind of caller and applies broadly to the perimeter. An ingress rule describes one exact allowed request, naming the identity, source, target service and methods. Narrow ingress rules are usually safer than wide access levels.
Q8Why do I need rules on both sides when data moves between two perimeters?
The sending perimeter treats the move as data leaving and needs an egress rule. The receiving perimeter treats it as data arriving and needs an ingress rule. If either side is missing, the request fails.
Q9Can I protect machines that have no public address?
Yes. Machines in private networks reach Google APIs through private paths. For perimeter designs, configure DNS and routes to use the restricted address range, so that requests are recognized as coming from your network and unsupported APIs are not reachable.
Q10Will it stop malware from sending data to the internet?
Not by itself. VPC Service Controls guards Google API access. Traffic from a machine to an arbitrary website is a network matter, so use firewall egress rules, proxies and monitoring for that.
Q11How quickly do changes take effect?
Changes can take several minutes to spread, sometimes close to half an hour. Make one change at a time, wait, and then test, so you can tell which change had which effect.
Q12Can I lock myself out?
Yes, it is possible. Always prepare and test an access path for administrators, such as a managed network access level, before enforcing, and keep a documented break-glass procedure.
Q13What if a screen or setting in this guide differs from what I see?
Cloud tools evolve quickly. Read the current Google Cloud documentation for VPC Service Controls and for the services you use. The ideas in this guide stay stable even when names and layouts change.

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.