<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vagner Miranda</title>
    <description>The latest articles on DEV Community by Vagner Miranda (@jakner).</description>
    <link>https://dev.to/jakner</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3896100%2Fe0fa89cd-c90c-4206-bee2-9c0042b6bedd.png</url>
      <title>DEV Community: Vagner Miranda</title>
      <link>https://dev.to/jakner</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jakner"/>
    <language>en</language>
    <item>
      <title>Zero-Trust Logging: Secure Vector.dev Pipelines on GCP with Workload Identity</title>
      <dc:creator>Vagner Miranda</dc:creator>
      <pubDate>Fri, 24 Apr 2026 13:12:30 +0000</pubDate>
      <link>https://dev.to/jakner/zero-trust-logging-secure-vectordev-pipelines-on-gcp-with-workload-identity-3klb</link>
      <guid>https://dev.to/jakner/zero-trust-logging-secure-vectordev-pipelines-on-gcp-with-workload-identity-3klb</guid>
      <description>&lt;p&gt;(Introduction)&lt;br&gt;
Modern observability pipelines require more than just moving data from point A to point B; they require enterprise-grade security. When running Vector.dev on Google Cloud Platform (GCP), many engineers fall into the trap of using static JSON Service Account keys. These keys are a security liability.&lt;/p&gt;

&lt;p&gt;In this tutorial, I’ll show you how to implement a more secure approach using GCP Workload Identity, allowing Vector to authenticate natively and securely.&lt;/p&gt;

&lt;p&gt;(The Architecture)&lt;br&gt;
Our setup involves:&lt;/p&gt;

&lt;p&gt;Vector.dev running on Kubernetes (GKE).&lt;/p&gt;

&lt;p&gt;Google Service Account (GSA) with specific permissions (e.g., Pub/Sub Publisher).&lt;/p&gt;

&lt;p&gt;Workload Identity Federation to link the Kubernetes Service Account (KSA) to the GSA.&lt;/p&gt;

&lt;p&gt;(Step 1: Create the Google Service Account)&lt;br&gt;
First, create a dedicated service account for Vector and grant it only the necessary permissions:&lt;/p&gt;

&lt;p&gt;Bash&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud iam service-accounts create vector-aggregator &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--display-name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Vector Aggregator Service Account"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud projects add-iam-policy-binding &lt;span class="o"&gt;[&lt;/span&gt;YOUR_PROJECT_ID] &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--member&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"serviceAccount:vector-aggregator@[YOUR_PROJECT_ID].iam.gserviceaccount.com"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/pubsub.publisher"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Step 2: Bind Kubernetes to GCP IAM)&lt;br&gt;
Now, we allow the Kubernetes service account to act as the Google service account:&lt;/p&gt;

&lt;p&gt;Bash&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud iam service-accounts add-iam-policy-binding &lt;span class="se"&gt;\&lt;/span&gt;
    vector-aggregator@[YOUR_PROJECT_ID].iam.gserviceaccount.com &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/iam.workloadIdentityUser"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--member&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"serviceAccount:[YOUR_PROJECT_ID].svc.id.goog[vector-namespace/vector-ksa]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Step 3: Configure Vector to use Identity)&lt;br&gt;
In your vector.yaml, you don't need to specify a key_file. Vector is smart enough to use the environment's default credentials provided by Workload Identity:&lt;/p&gt;

&lt;p&gt;YAML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;sinks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;gcp_pubsub&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;google_cloud_pubsub&lt;/span&gt;
    &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;your_log_source&lt;/span&gt;
    &lt;span class="na"&gt;project&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[YOUR_PROJECT_ID]"&lt;/span&gt;
    &lt;span class="na"&gt;topic&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;vector-logs-topic"&lt;/span&gt;
    &lt;span class="c1"&gt;# No credentials_path needed!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Conclusion)&lt;br&gt;
By removing static keys, you reduce the risk of credential leakage and align your infrastructure with Zero-Trust principles. This setup is scalable, secure, and easier to manage in large-scale GCP environments.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>security</category>
      <category>gcp</category>
      <category>observability</category>
    </item>
  </channel>
</rss>
