<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhimanyu Shahi on Medium]]></title>
        <description><![CDATA[Stories by Abhimanyu Shahi on Medium]]></description>
        <link>https://medium.com/@abhimanyu.shahi?source=rss-d251b8f5852c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Yvp1nANtXW5Heltw</url>
            <title>Stories by Abhimanyu Shahi on Medium</title>
            <link>https://medium.com/@abhimanyu.shahi?source=rss-d251b8f5852c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:03:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhimanyu.shahi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Private Secrets Across GCP Projects Without VPC Peering: A practical walkthrough using PSC, Hybrid…]]></title>
            <link>https://blog.searce.com/private-secrets-across-gcp-projects-without-vpc-peering-a-practical-walkthrough-using-psc-hybrid-e0c91f1b62fc?source=rss-d251b8f5852c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0c91f1b62fc</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[csp]]></category>
            <category><![CDATA[secrets]]></category>
            <category><![CDATA[ilb]]></category>
            <dc:creator><![CDATA[Abhimanyu Shahi]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 13:40:27 GMT</pubDate>
            <atom:updated>2026-09-11T07:46:30.837Z</atom:updated>
            <content:encoded><![CDATA[<h3>Private Secrets Across GCP Projects Without VPC Peering: A practical walkthrough using PSC, Hybrid NEGs, Regional ILB, and tag-conditioned IAM</h3><p>How to bypass VPC Peering and Private Google Access limitations to privately consume regional secrets across cross-project GCP environments using PSC, Hybrid NEGs, Regional ILB, and tag-conditioned IAM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*n8jj70eAHPIjQPY4c6zc0g.png" /></figure><p>Here is a scenario most GCP platform teams eventually hit: your dev workload runs in one project, your production regional secrets live in another, and you need private access between them — no public internet, no secret duplication, and no shared projects.</p><p>Naturally, you reach for standard GCP networking tools, but you quickly run into their built-in limitations:</p><ul><li><strong>VPC Network Peering</strong> connects your VPCs, but it cannot natively route traffic into Google-managed service networks.</li><li><strong>Private Google Access (PGA)</strong> handles global Google API endpoints or local VPC resources, but it will not bridge a regionalised Secret Manager endpoint across project boundaries.</li></ul><blockquote>You are left stuck. The typical workarounds teams fall back on — copying secrets into the dev project, granting overly broad IAM roles, or routing through bastions — all introduce the exact security risks you were trying to avoid in the first place.</blockquote><p>This post is for GCP network engineers, platform teams, and security architects who need a clean, zero-trust solution. We will walk through a production-ready blueprint using <strong>Private Service Connect (PSC)</strong>, <strong>Hybrid NEGs</strong>, a <strong>Regional Internal Load Balancer (ILB)</strong>, <strong>Cross-VPC Cloud DNS</strong>, and <strong>tag-conditioned IAM</strong> to solve this challenge — without compromising your security boundaries.</p><h3>Key Components</h3><ul><li><strong>Dev VPC</strong>: The client environment running workloads that require access to secrets.</li><li><strong>Prod VPC</strong>: Centralized infrastructure containing the target regional secret.</li><li><strong>Proxy-Only Subnet</strong>: Required in the Prod VPC to support Regional Internal Load Balancers.</li><li><strong>Prod Regional Secret</strong>: The secret stored in Google Cloud Secret Manager bound strictly to a specific region (e.g., us-central1).</li><li><strong>Hybrid Network Endpoint Group (NEG)</strong>: Bridges the Regional Internal Load Balancer backend directly to the target Private Service Connect network endpoint IP</li><li><strong>Prod Internal Load Balancer (ILB) &amp; PSC Service Attachment</strong>: Exposes the regional endpoint as a private service.</li><li><strong>Prod Private DNS Zone</strong>: Overrides standard domain routing for secretmanager.us-central1.rep.googleapis.com and is attached to the Dev VPC.</li><li><strong>Dev VM &amp; Service Account</strong>: The calling compute instance authenticated via IAM roles.</li></ul><h3><strong>1. Network Topology &amp; Proxy Subnet Setup</strong></h3><p>The network topology uses two distinct projects and VPCs:</p><ul><li><strong>Dev Project (tech-dev-prj)</strong>: VPC tech-dev-vpc containing subnet tech-dev-sb-01 (10.10.0.0/24).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M5YLF03nEjR2W0w9nXOjlQ.png" /></figure><ul><li><strong>Prod Project (tech-prod-prj)</strong>: VPC tech-prod-vpc containing primary subnet tech-prod-sb-01 (10.0.0.0/24).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1rNHPr5Okf9aevp8flRajQ.png" /></figure><p>Because GCP Regional Internal Proxy Load Balancers rely on Envoy proxies, you must first create a <strong>Cross-region Managed Proxy</strong> subnet in the Production VPC:</p><ul><li>Subnet Name: prod-cross-region-proxy-subnet</li><li>VPC Network: tech-prod-vpc</li><li>Region: us-central1 (Iowa)</li><li>Purpose: Cross-region Managed Proxy</li><li>Role: Active</li><li>IPv4 Range: 10.20.0.0/26 (Gateway 10.20.0.1)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oUNI27d70682HS8-n6XJlA.png" /></figure><h3><strong>2. Regional Secret Manager Setup</strong></h3><p>Regional Secret Manager limits secret data storage and endpoint interfaces to a specified GCP region:</p><ul><li><strong>Secret Name</strong>: tech-prod-testmdb-testuser-secret</li><li><strong>Project ID</strong>: tech-prod-prj</li><li><strong>Region</strong>: us-central1</li><li><strong>Payload Value</strong>: test123</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPqeLMc8ufEUSssa9oGVzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-xYum-6ABChNXZNtpTBlg.png" /></figure><h3><strong>3. Configure Resource Tags for Governance</strong></h3><p>To enforce fine-grained access control so that non-authorized service accounts cannot read production secrets even if they possess generic IAM secret access permissions, define an organizational tag:</p><ul><li>Tag Key: 445028069747/env</li><li>Tag Key ID: tagKeys/281477218127188</li><li>Tag Value: prod</li><li>Tag Value ID: tagValues/281481584772121</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcSvVjoL9RJuXNjUlatHRw.png" /></figure><p>Attach the env: prod tag directly to the regional secret resource.</p><h3><strong>4. Production PSC, Hybrid NEG, &amp; Load Balancer</strong></h3><p>Configure a Regional Internal Load Balancer pointing to the Google-managed network endpoints for Secret Manager.</p><p>Publish the Secret Manager endpoint through a regional Internal Load Balancer and PSC Google API endpoint:</p><ul><li><strong>PSC Target Endpoint</strong>: Create a PSC connection targeting the regional Google API secretmanager.us-central1.rep.googleapis.com within tech-prod-vpc in region us-central1, assigned internal target API endpoint IP 10.0.0.6.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kB1Gfp6uIKDbU7FO92G_UQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hSai1X4JiYR3W20lNqf1ng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DmOL6fTT4yf8SroIOKIZPw.png" /></figure><ul><li><strong>Hybrid Network Endpoint Group (NEG)</strong>: Configure a zonal Network Endpoint Group (tech-prod-psce-hybrid-neg-a) in us-central1-a targeting IP 10.0.0.6 on port 443.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UT9E9wSVH6FZsI-GvrcQaA.png" /></figure><ul><li><strong>Health Check</strong>: Create a TCP health check tech-prod-psc-ilb-hc monitoring port 443.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5GGKtxwgoOjMcZiEvVLALg.png" /></figure><ul><li>Internal Load Balancer: Provision regional load balancer tech-prod-usc-ilb: <br>- Frontend IP/Port: 10.0.0.12:443 (TCP)<br>- Backend: tech-prod-psce-hybrid-neg-a</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kk4XR5RuS73xFN6jIBVdoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAlQI01VbJXuGIx3cDK5uQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o44I5jrramrOgimOloflWA.png" /></figure><blockquote><strong>A Quick Note on Cost</strong>:</blockquote><blockquote>While standard Private Google Access (PGA) is free, using Private Service Connect + Regional Internal Load Balancer introduces minor infrastructure costs:</blockquote><blockquote><strong>Private Service Connect (PSC) Endpoint:</strong> Costs $0.01 / hour per endpoint (~$7.30 / month base) plus $0.01 / GB for data processing.</blockquote><blockquote><strong>Regional Internal Load Balancer (ILB):</strong> Incurs a $0.025 / hour base charge (~$18.25 / month, covering up to 5 forwarding rules in the region), $0.025 / hour per active proxy instance (~$18.25 / month), and $0.008 / GB for data processed.</blockquote><blockquote>For enterprise API and secret access where traffic volumes are small (fetching credentials or configuration payloads), the total monthly cost is negligible (typically around <strong>$25 to $44 / month</strong> in fixed base charges) — a small price for zero-trust, cross-VPC isolation.</blockquote><h3>5. Create a Secret Validation VM</h3><p>Create a test Compute Engine instance in tech-dev-prj to validate the access flow:</p><ul><li><strong>VM Name</strong>: dev-vm-01</li><li><strong>Subnet</strong>: tech-dev-sb-01</li><li><strong>Service Account</strong>: dev-vm-sa@tech-dev-prj.iam.gserviceaccount.com</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SbkAAsIwgGecbTOMql_Zvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YpocTx8qtb0kxL_rU2IdGQ.png" /></figure><h3>6. Cross-VPC DNS Integration</h3><p>To ensure compute instances automatically route requests for secretmanager.us-central1.rep.googleapis.com to the ILB frontend (10.0.0.12), you must configure a private DNS zone in tech-prod-prj.</p><p><strong>Create Private DNS Zone in The Production project</strong></p><ul><li>Zone Name: tech-prod-pdns-googleapis</li><li>DNS Name: <a href="http://googleapis.com/">googleapis.com</a>.</li><li>Zone Type: Private</li><li>A Record: secretmanager.us-central1.rep.googleapis.com. -&gt; 10.0.0.12(Dev PSC Internal IP).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sYdewj_1fYZ4JtMViI8aVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xo8goi2OGJVCcabf1qgYQ.png" /></figure><p><strong>Attach Network to Dev VPC</strong></p><p>Ensure the Private DNS zone is attached to tech-dev-vpc under the Cloud DNS zone settings.</p><p><strong>Crucial Edge Case</strong>: If the Dev VPC is not attached to the Private DNS Zone, hostname resolution will either default to public IP address lookups (34.x.x.x) or fail entirely. Attaching the network ensures internal resolution through the PSC forwarding rule.</p><h3>7. IAM Controls &amp; Network Tagging</h3><p>Assign the Dev VM Service Account permissions to access secrets, constrained strictly by the resource tag:</p><ul><li><strong>Service Account Assignment</strong>: Attach a dedicated Service Account (SA) to the Dev VM.</li></ul><h4>Why Tag-Based Conditions Outperform Project-Level Grants</h4><blockquote><em>Standard IAM roles granted at the project level create a broad blast radius: if a Service Account is assigned </em><em>roles/secretmanager.secretAccessor on </em><em>tech-prod-prj, it can read </em><strong><em>every</em></strong><em> secret in that project—both present and future. By binding a CEL tag condition (</em><em>resource.matchTag), we enforce </em><strong><em>Attribute-Based Access Control (ABAC)</em></strong><em>. Even if an attacker or compromised workload gains control of the Service Account token, access is restricted strictly to secrets explicitly tagged with </em><em>env: prod. All other production secrets remain completely inaccessible</em></blockquote><p><strong>Apply Tag-Conditioned IAM Binding</strong></p><p>In project tech-prod-prj, grant the Service Account the <strong>Secret Manager Secret Accessor</strong> (roles/secretmanager.secretAccessor) role with the following condition:</p><pre>{<br>  &quot;title&quot;: &quot;allow access prod secret&quot;,<br>  &quot;expression&quot;: &quot;resource.matchTag(\&quot;445028069747/env\&quot;, \&quot;prod\&quot;)&quot;<br>}</pre><p>(This prevents dev-vm-sa from accessing any other secrets in the project unless they carry the exact env=prod tag value).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VsUEelaSDQSuiQe8mPJIYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HFUYFtJzkM2XuqK3XjgUXQ.png" /></figure><p><strong>Network Tags</strong>: Apply network tags (e.g., prod-secret-access) to the Dev VM to enforce granular egress firewall rules allowing outbound traffic to 10.0.0.12 over port 443</p><h3>8. End-to-End Validation</h3><p>SSH into the Dev Compute Engine instance to verify that secret retrieval works over the private network.</p><h4>Step 1: Test DNS Resolution</h4><p>Run an nslookup command to confirm that DNS queries resolve internally via Private Service Connect:</p><pre>nslookup secretmanager.us-central1.rep.googleapis.com</pre><p><strong>Expected Output</strong>:</p><pre>Server: 169.254.169.254<br>Address: 169.254.169.254#53<br>Non-authoritative answer:<br>Name: secretmanager.us-central1.rep.googleapis.com<br>Address: 10.0.0.12</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qrZO1TOzdbwL1oC7HZkM1Q.png" /></figure><h4>Step 2: Fetch the Metadata Identity Token</h4><p>Retrieve an OAuth2 access token directly from the local metadata server:</p><pre>TOKEN=$(curl -s &quot;http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token&quot; \<br>  -H &quot;Metadata-Flavor: Google&quot; | jq -r &#39;.access_token&#39;)</pre><h4>Step 3: Validate via Direct IP (Host Header Override)</h4><p>To verify network connectivity prior to full DNS propagation, execute an HTTP GET using the PSC IP (10.0.0.12) with an explicit Host header override:</p><pre>curl -X GET \<br>  -H &quot;Authorization: Bearer $TOKEN&quot; \<br>  -H &quot;Host: secretmanager.us-central1.rep.googleapis.com&quot; \<br>  &quot;https://10.0.0.12/v1/projects/706605382541/locations/us-central1/secrets/tech-prod-testmdb-testuser-secret/versions/latest:access&quot; -k \<br>  | jq -r &#39;.payload.data&#39; | base64 --decode</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1xS_GjLzibRNd2AVPNpH7g.png" /></figure><h4>Step 4: Validate via Standard Private DNS FQDN.</h4><p>Once Private DNS is attached to the Dev VPC, execute standard API requests using the fully qualified domain name:</p><pre>curl -k -X GET -H &quot;Authorization: Bearer $TOKEN&quot; &quot;https://secretmanager.us-central1.rep.googleapis.com/v1/projects/706605382541/locations/us-central1/secrets/tech-prod-testmdb-testuser-secret/versions/latest:access&quot; | jq -r &#39;.payload.data&#39; | base64 --decode</pre><p><strong>Output</strong>:</p><pre>test123</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7MtuDyQ4O_CDA70UZwnXeQ.png" /></figure><h3>Conclusion</h3><p>Combining <strong>Private Service Connect (PSC)</strong> with <strong>Cross-VPC Private DNS attachment</strong> solves the limitation where Regional Secret Manager endpoints cannot be bridged via standard VPC Peering or PGA alone. This pattern delivers full private connectivity, maintains strong organizational boundaries between Dev and Prod environments, and follows GCP security best practices.</p><p>Before adopting this pattern in production, keep a few architectural considerations in mind:</p><ul><li><strong>Evaluate Simpler Alternatives</strong>: If strict project boundary isolation isn’t a hard requirement for your organization, a <strong>Shared VPC</strong> model with centralized secret management removes much of this networking complexity out of the box.</li><li><strong>Automate via Infrastructure-as-Code</strong>: If you are deploying this architecture across multiple environments, invest in <strong>Terraform</strong> early — manually managing static IP allocations, PSC forwarding rules, and cross-project DNS record bindings is where most teams introduce subtle configuration errors.</li></ul><p><strong>One final takeaway</strong>: This pattern isn’t just limited to Secret Manager. The combination of <strong>PSC + Hybrid NEG + Private DNS</strong> generalizes across Google Cloud. Any regionalized Google API endpoint using a .rep.googleapis.com domain can be exposed privately across VPC boundaries in the exact same way—making this a reusable enterprise blueprint rather than a one-off workaround.</p><p><strong>Acknowledgements: <br></strong>Special thanks to <strong>Samir Patel</strong> and <strong>Tirth Patel</strong> for leading the core architectural design and implementation of this solution, which enabled the Proof of Concept and technical breakdown detailed in this guide.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0c91f1b62fc" width="1" height="1" alt=""><hr><p><a href="https://blog.searce.com/private-secrets-across-gcp-projects-without-vpc-peering-a-practical-walkthrough-using-psc-hybrid-e0c91f1b62fc">Private Secrets Across GCP Projects Without VPC Peering: A practical walkthrough using PSC, Hybrid…</a> was originally published in <a href="https://blog.searce.com/">Searce</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>