<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Zero to Hero - external-secret-operator</title>
    <link rel="self" type="application/atom+xml" href="https://zerotohero.dev/tags/external-secret-operator/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://zerotohero.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2024-12-22T00:00:00+00:00</updated>
    <id>https://zerotohero.dev/tags/external-secret-operator/atom.xml</id>
    <entry xml:lang="en">
        <title>Using External Secrets Operator with HashiCorp Vault to Create Kubernetes Secrets</title>
        <published>2024-12-22T00:00:00+00:00</published>
        <updated>2024-12-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Volkan Özçelik
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://zerotohero.dev/inbox/eso-vault/"/>
        <id>https://zerotohero.dev/inbox/eso-vault/</id>
        
        <content type="html" xml:base="https://zerotohero.dev/inbox/eso-vault/">&lt;p&gt;When working with Kubernetes, securely managing secrets is a crucial part of your infrastructure. Traditional approaches—like directly embedding secrets in manifests or manually managing &lt;code&gt;Secret&lt;&#x2F;code&gt; objects—can become cumbersome and less secure over time. Enter the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;external-secrets.io&quot;&gt;External Secrets Operator (ESO)&lt;&#x2F;a&gt;, a powerful way to integrate external secret stores with Kubernetes. One such secret store is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.vaultproject.io&quot;&gt;HashiCorp Vault&lt;&#x2F;a&gt;, a proven solution for securely storing and accessing secrets.&lt;&#x2F;p&gt;
&lt;p&gt;In this post, we’ll walk through the key Custom Resource Definitions (CRDs) you need to set up in your cluster to fetch secrets from Vault and have them automatically synchronized as Kubernetes secrets.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;overview&quot;&gt;Overview&lt;&#x2F;h2&gt;
&lt;p&gt;ESO acts as a bridge between external secret stores (in this case, Vault) and Kubernetes &lt;code&gt;Secret&lt;&#x2F;code&gt; objects. To make this happen, you’ll define a store resource that tells ESO &lt;strong&gt;where&lt;&#x2F;strong&gt; and &lt;strong&gt;how&lt;&#x2F;strong&gt; to retrieve secrets. You’ll then define another resource that specifies &lt;strong&gt;which&lt;&#x2F;strong&gt; secrets to fetch and how to transform them into Kubernetes secrets.&lt;&#x2F;p&gt;
&lt;p&gt;In other words:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SecretStore&#x2F;ClusterSecretStore:&lt;&#x2F;strong&gt; Defines the external secret provider configuration&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;ExternalSecret:&lt;&#x2F;strong&gt; Defines the specific secrets you want to pull from your chosen store and how to map them into Kubernetes secrets&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;key-resources&quot;&gt;Key Resources&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-secretstore-or-clustersecretstore&quot;&gt;1. SecretStore or ClusterSecretStore&lt;&#x2F;h3&gt;
&lt;p&gt;The &lt;code&gt;SecretStore&lt;&#x2F;code&gt; or &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; resource provides information about your Vault instance, including:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Endpoint:&lt;&#x2F;strong&gt; The URL of the Vault server&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Authentication method:&lt;&#x2F;strong&gt; How ESO should authenticate to Vault (e.g., using a Kubernetes Service Account token, Vault token, or another method)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Paths and parameters:&lt;&#x2F;strong&gt; Details like which Vault mount paths and keys to read from&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;When to use &lt;code&gt;SecretStore&lt;&#x2F;code&gt; vs. &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt;?&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SecretStore:&lt;&#x2F;strong&gt; Used when you want the configuration to be namespace-specific&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;ClusterSecretStore:&lt;&#x2F;strong&gt; Used when you want a cluster-wide configuration accessible by multiple namespaces&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; vault-backend&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  provider&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    vault&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      server&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;https:&#x2F;&#x2F;vault.example.com&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;secret&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt; # The path where secrets are stored in Vault&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      version&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;v2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      auth&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        tokenSecretRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; vault-token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; tells ESO how to communicate with a Vault server at &lt;code&gt;vault.example.com&lt;&#x2F;code&gt;, using a token stored in the &lt;code&gt;vault-token&lt;&#x2F;code&gt; Secret.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-externalsecret&quot;&gt;2. ExternalSecret&lt;&#x2F;h3&gt;
&lt;p&gt;The &lt;code&gt;ExternalSecret&lt;&#x2F;code&gt; resource references the &lt;code&gt;SecretStore&lt;&#x2F;code&gt; or &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; and tells ESO which keys from Vault to sync and how to project them into a Kubernetes Secret.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ExternalSecret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; my-app-secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  namespace&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  refreshInterval&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; 1h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  secretStoreRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; vault-backend&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  target&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; my-app-k8s-secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    creationPolicy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Owner&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; secretKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; api-key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;       # Key in the resulting K8s Secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      remoteRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; my-app&#x2F;api-key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;     # Path&#x2F;key in Vault&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In this &lt;code&gt;ExternalSecret&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;secretStoreRef&lt;&#x2F;code&gt; points to the &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; named &lt;code&gt;vault-backend&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;It requests a secret named &lt;code&gt;my-app&#x2F;api-key&lt;&#x2F;code&gt; from Vault&lt;&#x2F;li&gt;
&lt;li&gt;It maps that key into a Kubernetes Secret named &lt;code&gt;my-app-k8s-secret&lt;&#x2F;code&gt; under the &lt;code&gt;api-key&lt;&#x2F;code&gt; key&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;how-it-works&quot;&gt;How it Works&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Define the Store:&lt;&#x2F;strong&gt;
Set up a &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; or &lt;code&gt;SecretStore&lt;&#x2F;code&gt; resource that points to your Vault instance and specifies authentication details.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Request the Secret:&lt;&#x2F;strong&gt;
Create an &lt;code&gt;ExternalSecret&lt;&#x2F;code&gt; resource that references the store and specifies the exact secrets you need.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ESO Synchronizes the Secret:&lt;&#x2F;strong&gt;
The External Secrets Operator continuously reconciles resources. When it sees your &lt;code&gt;ExternalSecret&lt;&#x2F;code&gt;, it connects to Vault (using the instructions from the store resource), fetches the requested secret, and creates or updates the corresponding Kubernetes Secret object in your cluster.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;analogies&quot;&gt;Analogies&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Think of the &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; as a “GPS coordinate” that tells ESO where to find the treasure (your secrets) in Vault.&lt;&#x2F;li&gt;
&lt;li&gt;The &lt;code&gt;ExternalSecret&lt;&#x2F;code&gt; is your “shopping list,” telling ESO which items (specific keys&#x2F;values) to bring back from that secret store and how to pack them into a Kubernetes Secret.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;pros-and-cons&quot;&gt;Pros and Cons&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;pros&quot;&gt;Pros:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Separation of concerns: Store configuration is separate from secret retrieval specifications&lt;&#x2F;li&gt;
&lt;li&gt;Reusability: You can reuse the same &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; for multiple &lt;code&gt;ExternalSecrets&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Security: Keeps sensitive data in Vault, only syncing what’s necessary to Kubernetes&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;cons&quot;&gt;Cons:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Initial complexity: Requires understanding CRDs and writing additional YAML manifests&lt;&#x2F;li&gt;
&lt;li&gt;Extra components: Relies on running ESO and Vault integrations&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;By defining a &lt;code&gt;SecretStore&lt;&#x2F;code&gt; or &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; and one or more &lt;code&gt;ExternalSecrets&lt;&#x2F;code&gt;, you can seamlessly integrate HashiCorp Vault secrets into your Kubernetes cluster with the External Secrets Operator. This pattern centralizes and secures your secret management workflow, providing a more maintainable and secure approach than manually managing Secret objects.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-takeaways&quot;&gt;Key Takeaways:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;SecretStore&lt;&#x2F;code&gt; or &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; to define how to connect to Vault&lt;&#x2F;li&gt;
&lt;li&gt;Use &lt;code&gt;ExternalSecret&lt;&#x2F;code&gt; to specify which secrets to pull from Vault&lt;&#x2F;li&gt;
&lt;li&gt;ESO automatically keeps your Kubernetes secrets in sync with Vault’s secrets&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;further-reading&quot;&gt;Further Reading&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;external-secrets.io&quot;&gt;External Secrets Operator Documentation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.vaultproject.io&quot;&gt;HashiCorp Vault Documentation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Building a Custom Webhook Provider for External Secrets Operator: A Step-by-Step Guide</title>
        <published>2024-12-12T00:00:00+00:00</published>
        <updated>2024-12-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Volkan Özçelik
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://zerotohero.dev/go/eso-webhook-pitfalls/"/>
        <id>https://zerotohero.dev/go/eso-webhook-pitfalls/</id>
        
        <content type="html" xml:base="https://zerotohero.dev/go/eso-webhook-pitfalls/">&lt;p&gt;In this tutorial, we’ll walk through creating a custom webhook provider for External Secrets Operator (ESO) from scratch. We’ll build a simple Go server that serves as a webhook, deploy it to Kubernetes, and configure ESO to use it for secret management.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;understanding-the-architecture&quot;&gt;Understanding the Architecture&lt;&#x2F;h2&gt;
&lt;p&gt;The External Secrets Operator (ESO) can fetch secrets from various providers, including custom webhooks. In this setup:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;ESO sends requests to our webhook with a key&lt;&#x2F;li&gt;
&lt;li&gt;The webhook returns a structured JSON response&lt;&#x2F;li&gt;
&lt;li&gt;ESO processes this response and creates Kubernetes secrets accordingly&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;step-1-creating-the-webhook-server&quot;&gt;Step 1: Creating the Webhook Server&lt;&#x2F;h2&gt;
&lt;p&gt;First, let’s create a simple Go server that responds to webhook requests. Here’s a basic implementation:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;package&lt;&#x2F;span&gt;&lt;span&gt; main&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;encoding&#x2F;json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;net&#x2F;http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;&#x2F;&#x2F; Response structure matching ESO&amp;#39;s expectations&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span&gt; Response&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    Namespaces&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt; map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;NamespaceData&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;namespaces&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span&gt; NamespaceData&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    Secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt; map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;Secret&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;secrets&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span&gt; Secret&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;     string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;         `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;type&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    Value&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;    string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;         `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;value&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    Metadata&lt;&#x2F;span&gt;&lt;span&gt; SecretMetadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;metadata&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    Expires&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;  string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;         `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;expires&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    NotBefore&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt; string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;        `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;notBefore&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span&gt; SecretMetadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    Labels&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;            map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;labels&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    Annotations&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;       map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;annotations&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    CreationTimestamp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt; string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;           `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;creationTimestamp&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    LastUpdated&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;       string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;           `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;json:&amp;quot;lastUpdated&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;func&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;HandleFunc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;&#x2F;webhook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; webhookHandler&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Println&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Server is running on :8080&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    log&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Fatal&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;ListenAndServe&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;:8080&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; nil&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;func&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; webhookHandler&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;ResponseWriter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Request&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;Method&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;MethodGet&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Method not allowed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;StatusMethodNotAllowed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;URL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Query&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;coca-cola.cluster-001&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Invalid key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;StatusBadRequest&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    response&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span&gt; Response&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        Namespaces&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt; map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;NamespaceData&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;            &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;coke-system&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                Secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt; map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;Secret&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;                    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;admin-credentials&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                        Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;k8s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                        Value&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;super-secret-secret&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                        Metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; SecretMetadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                            Labels&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt; map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;                                &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;managed-by&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;coke-system&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;                            },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                            Annotations&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt; map&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;                                &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;inject-sidecar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;                            },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                            CreationTimestamp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;2024-01-01&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                            LastUpdated&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:      &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;2024-01-01&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;                        },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                        Expires&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:   &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;2024-01-01&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;                        NotBefore&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;2024-01-01&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;                    },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;                },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;            },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;        },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Header&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Content-Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;application&#x2F;json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;NewEncoder&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Encode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;response&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;step-2-containerizing-the-webhook&quot;&gt;Step 2: Containerizing the Webhook&lt;&#x2F;h2&gt;
&lt;p&gt;Create a Dockerfile to package the webhook:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;docker&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;FROM&lt;&#x2F;span&gt;&lt;span&gt; golang:1.20-alpine &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;AS&lt;&#x2F;span&gt;&lt;span&gt; builder&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;WORKDIR&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;app&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;COPY&lt;&#x2F;span&gt;&lt;span&gt; main.go .&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;RUN&lt;&#x2F;span&gt;&lt;span&gt; go build -o webhook-server main.go&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;FROM&lt;&#x2F;span&gt;&lt;span&gt; alpine:latest&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;WORKDIR&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;root&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;COPY&lt;&#x2F;span&gt;&lt;span&gt; --from=builder &#x2F;app&#x2F;webhook-server .&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;EXPOSE&lt;&#x2F;span&gt;&lt;span&gt; 8080&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;CMD&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;&amp;quot;.&#x2F;webhook-server&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;step-3-deploying-to-kubernetes&quot;&gt;Step 3: Deploying to Kubernetes&lt;&#x2F;h2&gt;
&lt;p&gt;Deploy the webhook using a Kubernetes Deployment and Service:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; apps&#x2F;v1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Deployment&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; eso-webhook&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  labels&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    app&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; eso-webhook&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  replicas&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  selector&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    matchLabels&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      app&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; eso-webhook&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  template&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      labels&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        app&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; eso-webhook&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      containers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; eso-webhook&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        image&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; localhost:5000&#x2F;eso-webhook:v1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        ports&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;        -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; containerPort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; 8080&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; v1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; eso-webhook&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; LoadBalancer&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  selector&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    app&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; eso-webhook&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  ports&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; protocol&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; TCP&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      port&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; 80&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      targetPort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; 8080&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;step-4-configuring-external-secrets-operator&quot;&gt;Step 4: Configuring External Secrets Operator&lt;&#x2F;h2&gt;
&lt;p&gt;Now comes the crucial part: configuring ESO to use our webhook. This involves two components:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;A ClusterSecretStore that defines how to access our webhook&lt;&#x2F;li&gt;
&lt;li&gt;An ExternalSecret that specifies what secrets to fetch&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;clustersecretstore-configuration&quot;&gt;ClusterSecretStore Configuration&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; webhook-backend&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  provider&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    webhook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;http:&#x2F;&#x2F;eso-webhook.default.svc.cluster.local&#x2F;webhook?key={{ .remoteRef.key }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      method&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; GET&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        jsonPath&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;$.namespaces&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;externalsecret-configuration-with-advanced-templating&quot;&gt;ExternalSecret Configuration with Advanced Templating&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ExternalSecret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; coke-admin-credentials&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  namespace&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; coke-system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  refreshInterval&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;15s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  secretStoreRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; webhook-backend&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  target&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; admin-credentials&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    creationPolicy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Owner&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    template&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      engineVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; v2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        labels&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          managed-by&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;{{ index .coke-system.secrets.admin-credentials.metadata.labels &amp;quot;managed-by&amp;quot; }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        annotations&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          inject-sidecar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;{{ index .coke-system.secrets.admin-credentials.metadata.annotations &amp;quot;inject-sidecar&amp;quot; }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;{{ .coke-system.secrets.admin-credentials.type }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        username&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;{{ .coke-system.secrets.admin-credentials.value | b64dec }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        password&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;{{ .coke-system.secrets.admin-credentials.value | b64dec | upper }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        created-at&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;{{ now | date &amp;quot;2006-01-02T15:04:05Z07:00&amp;quot; }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; secretKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; coke-system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    remoteRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; coca-cola.cluster-001&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;understanding-the-template-engine&quot;&gt;Understanding the Template Engine&lt;&#x2F;h2&gt;
&lt;p&gt;The ExternalSecret configuration uses ESO’s v2 template engine, which provides powerful features for transforming secret data:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Engine Version&lt;&#x2F;strong&gt;: We specify &lt;code&gt;engineVersion: v2&lt;&#x2F;code&gt; to use the latest templating capabilities.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Accessing Hyphenated Fields&lt;&#x2F;strong&gt;: Fields with hyphens require the &lt;code&gt;index&lt;&#x2F;code&gt; function, e.g., &lt;code&gt;{{ index .metadata.labels &quot;managed-by&quot; }}&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Data Transformation&lt;&#x2F;strong&gt;: We can use functions like &lt;code&gt;b64dec&lt;&#x2F;code&gt; for base64 decoding and &lt;code&gt;upper&lt;&#x2F;code&gt; for uppercase conversion.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Time Functions&lt;&#x2F;strong&gt;: The &lt;code&gt;now&lt;&#x2F;code&gt; function with date formatting helps track secret creation times.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;common-pitfalls-and-solutions&quot;&gt;Common Pitfalls and Solutions&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Hyphenated Field Access&lt;&#x2F;strong&gt;: Always use the &lt;code&gt;index&lt;&#x2F;code&gt; function for fields with hyphens.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;JSON Path&lt;&#x2F;strong&gt;: Ensure your &lt;code&gt;jsonPath&lt;&#x2F;code&gt; in the ClusterSecretStore matches your webhook’s response structure.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Service Discovery&lt;&#x2F;strong&gt;: Use the full Kubernetes service DNS name for reliable webhook access.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Template Engine Version&lt;&#x2F;strong&gt;: Always specify &lt;code&gt;engineVersion: v2&lt;&#x2F;code&gt; for advanced templating features.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Creating a custom webhook provider for External Secrets Operator involves careful consideration of:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Webhook response structure&lt;&#x2F;li&gt;
&lt;li&gt;Kubernetes deployment configuration&lt;&#x2F;li&gt;
&lt;li&gt;ESO template engine features&lt;&#x2F;li&gt;
&lt;li&gt;Service networking and discovery&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;By following this guide, you can create a flexible secret management solution that integrates seamlessly with your Kubernetes infrastructure while maintaining security and scalability.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Debugging URL Encoding Issues with External Secrets Operator&#x27;s Webhook Provider</title>
        <published>2024-12-12T00:00:00+00:00</published>
        <updated>2024-12-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Volkan Özçelik
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://zerotohero.dev/inbox/eso-urlencode/"/>
        <id>https://zerotohero.dev/inbox/eso-urlencode/</id>
        
        <content type="html" xml:base="https://zerotohero.dev/inbox/eso-urlencode/">&lt;p&gt;When working with Kubernetes External Secrets Operator (ESO) and its webhook provider, you might encounter some interesting URL encoding challenges. In this post, I’ll walk through a specific issue we encountered and how we solved it, which might help others facing similar problems.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-setup&quot;&gt;The Setup&lt;&#x2F;h2&gt;
&lt;p&gt;We started with a basic &lt;code&gt;ClusterSecretStore&lt;&#x2F;code&gt; configuration using ESO’s webhook provider:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; webhook-backend&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  provider&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    webhook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;http:&#x2F;&#x2F;eso-webhook.default.svc.cluster.local:80&#x2F;webhook?{{ .remoteRef.key }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      method&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; GET&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        jsonPath&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Our webhook server was a simple Go application designed to handle requests and return secret values based on a path parameter. We expected clean, separate query parameters, but reality had different plans.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-problem&quot;&gt;The Problem&lt;&#x2F;h2&gt;
&lt;p&gt;When we started debugging why our webhook wasn’t working as expected, we added some basic logging to our Go server:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;URL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Query&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Println&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To our surprise, the key was empty! Further investigation by printing the raw URL revealed something interesting:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Method: GET&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;URL: &#x2F;webhook?key%3Dcoca-cola.cluster-001%26path%3Dnamespaces.cokeSystem.secrets.adminCredentials.value&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Protocol: HTTP&#x2F;1.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The entire query string was URL-encoded as a single parameter. Instead of getting our parameters separately, everything was encoded within the &lt;code&gt;key&lt;&#x2F;code&gt; parameter.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-solution&quot;&gt;The Solution&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;understanding-what-s-happening&quot;&gt;Understanding What’s Happening&lt;&#x2F;h3&gt;
&lt;p&gt;When ESO processes the template in our ClusterSecretStore URL, it’s taking the entire &lt;code&gt;remoteRef.key&lt;&#x2F;code&gt; value and inserting it as-is into the URL. If our &lt;code&gt;remoteRef.key&lt;&#x2F;code&gt; contains URL-special characters (like &lt;code&gt;=&lt;&#x2F;code&gt; and &lt;code&gt;&amp;amp;&lt;&#x2F;code&gt;), they get encoded, resulting in our doubly-nested query string.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;fixing-the-server-code&quot;&gt;Fixing the Server Code&lt;&#x2F;h3&gt;
&lt;p&gt;Here’s how we modified our webhook server to handle this situation properly:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;func&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; webhookHandler&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;ResponseWriter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Request&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Get the &amp;#39;key&amp;#39; query parameter&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    encodedKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;URL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Query&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Unescape the key parameter&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    decodedKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;QueryUnescape&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;encodedKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; nil&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Failed to decode key parameter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;StatusBadRequest&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Parse the decoded key as a query string&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    values&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;ParseQuery&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;decodedKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; nil&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Invalid key format&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;StatusBadRequest&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    authKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; values&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; values&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Validate and use the parameters&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; authKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;coca-cola.cluster-001&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Invalid authentication key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;StatusUnauthorized&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; &amp;quot;&amp;quot; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Path is required&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;StatusBadRequest&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Process the request...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The key improvements in this solution are:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Using &lt;code&gt;url.QueryUnescape()&lt;&#x2F;code&gt; to properly decode the URL-encoded parameter&lt;&#x2F;li&gt;
&lt;li&gt;Using &lt;code&gt;url.ParseQuery()&lt;&#x2F;code&gt; to parse the decoded string as a query string itself&lt;&#x2F;li&gt;
&lt;li&gt;Extracting the actual key and path values from the parsed query parameters&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;using-the-clustersecretstore&quot;&gt;Using the ClusterSecretStore&lt;&#x2F;h3&gt;
&lt;p&gt;With this server implementation, we can now use our ClusterSecretStore like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ExternalSecret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; example-external-secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  secretStoreRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; webhook-backend&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  target&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; example-secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; secretKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; adminPassword&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    remoteRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;key=coca-cola.cluster-001&amp;amp;path=namespaces.cokeSystem.secrets.adminCredentials.value&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;lessons-learned&quot;&gt;Lessons Learned&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Always implement detailed request logging when debugging webhook issues&lt;&#x2F;li&gt;
&lt;li&gt;Don’t assume how parameters will be encoded or structured in webhook requests&lt;&#x2F;li&gt;
&lt;li&gt;Use standard library functions for URL parsing and decoding instead of custom string manipulation&lt;&#x2F;li&gt;
&lt;li&gt;Remember that template variables in Kubernetes resources might be processed differently than you expect&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;URL encoding issues can be tricky to debug, especially when dealing with nested query parameters. By understanding how ESO processes template variables and using proper URL parsing tools, we can build robust webhook handlers that correctly handle these scenarios.&lt;&#x2F;p&gt;
&lt;p&gt;Remember to always implement proper logging during development and testing phases - it makes debugging these kinds of issues much easier. The Go standard library provides excellent tools for handling URL encoding and parsing, so make use of them instead of trying to parse query strings manually.&lt;&#x2F;p&gt;
&lt;p&gt;This solution provides a clean way to handle the URL encoding challenges while maintaining the security and functionality requirements of our webhook provider.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Using External Secrets Operator with HTTP Endpoints: A Complete Guide</title>
        <published>2024-12-12T00:00:00+00:00</published>
        <updated>2024-12-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Volkan Özçelik
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://zerotohero.dev/inbox/eso-webhook-provider/"/>
        <id>https://zerotohero.dev/inbox/eso-webhook-provider/</id>
        
        <content type="html" xml:base="https://zerotohero.dev/inbox/eso-webhook-provider/">&lt;p&gt;External Secrets Operator (ESO) is a powerful Kubernetes operator that helps manage secrets from external sources. While it’s commonly used with cloud provider secret managers like AWS Secrets Manager or HashiCorp Vault, ESO also supports fetching secrets from HTTP endpoints. In this guide, we’ll explore how to configure ESO to poll an HTTP endpoint and automatically create Kubernetes secrets from the response.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;understanding-the-webhook-provider&quot;&gt;Understanding the Webhook Provider&lt;&#x2F;h2&gt;
&lt;p&gt;The Webhook provider in ESO allows you to fetch secrets from any HTTP endpoint that returns a JSON response. This is particularly useful when:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;You have an existing internal secrets service&lt;&#x2F;li&gt;
&lt;li&gt;You need to integrate with a custom secrets management system&lt;&#x2F;li&gt;
&lt;li&gt;You want to generate secrets dynamically through an API&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;configuration-steps&quot;&gt;Configuration Steps&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-setting-up-the-secretstore&quot;&gt;1. Setting up the SecretStore&lt;&#x2F;h3&gt;
&lt;p&gt;First, we need to configure a SecretStore that defines our HTTP endpoint and how to interact with it:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; SecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; webhook-secret-store&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  provider&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    webhook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; https:&#x2F;&#x2F;your-http-endpoint.com&#x2F;secrets&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        jsonPath&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;$.secrets[*]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      headers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;        -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Authorization&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          value&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Bearer &amp;lt;your-token-here&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This configuration tells ESO:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Which endpoint to call (&lt;code&gt;url&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;How to extract secrets from the response (&lt;code&gt;jsonPath&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;What headers to include in the request (&lt;code&gt;headers&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;2-creating-the-externalsecret&quot;&gt;2. Creating the ExternalSecret&lt;&#x2F;h3&gt;
&lt;p&gt;Next, we define an ExternalSecret that specifies which secrets to fetch and how often to refresh them:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ExternalSecret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; webhook-external-secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  refreshInterval&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;1h&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  secretStoreRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; webhook-secret-store&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; SecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  target&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; my-secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    creationPolicy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Owner&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; secretKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; username&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      remoteRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; username&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; secretKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      remoteRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This configuration:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Sets a refresh interval of 1 hour&lt;&#x2F;li&gt;
&lt;li&gt;References our SecretStore&lt;&#x2F;li&gt;
&lt;li&gt;Defines which secrets to fetch and how to map them to Kubernetes secret keys&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;best-practices-and-security-considerations&quot;&gt;Best Practices and Security Considerations&lt;&#x2F;h2&gt;
&lt;p&gt;When implementing this solution, consider the following best practices:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;HTTPS&lt;&#x2F;strong&gt;: Always use HTTPS endpoints to ensure secret data is encrypted in transit.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Authentication&lt;&#x2F;strong&gt;: Implement proper authentication using headers or other mechanisms to secure your endpoint.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Rate Limiting&lt;&#x2F;strong&gt;: Set appropriate refresh intervals to avoid overwhelming your HTTP endpoint.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Error Handling&lt;&#x2F;strong&gt;: Ensure your HTTP endpoint returns appropriate error codes and that ESO can handle them gracefully.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Access Control&lt;&#x2F;strong&gt;: Use Kubernetes RBAC to control which pods can access the created secrets.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;expected-http-response-format&quot;&gt;Expected HTTP Response Format&lt;&#x2F;h2&gt;
&lt;p&gt;Your HTTP endpoint should return a JSON response that matches your configured JSONPath. For example:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;json&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #689D6A;&quot;&gt;secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;: [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;      &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #689D6A;&quot;&gt;username&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;admin&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;      &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #689D6A;&quot;&gt;password&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;secure-password-123&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;  ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;&#x2F;h2&gt;
&lt;p&gt;If you encounter issues:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Check the ESO operator logs using:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;kubectl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; logs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; -l&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; app.kubernetes.io&#x2F;name=external-secrets&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Verify your HTTP endpoint is accessible from the cluster&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Confirm the JSONPath expression matches your response structure&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Ensure all required headers are properly configured&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Using External Secrets Operator with HTTP endpoints provides a flexible way to integrate custom secret management solutions with Kubernetes. By following this guide and best practices, you can securely manage and automatically update your Kubernetes secrets from any HTTP source.&lt;&#x2F;p&gt;
&lt;p&gt;Remember to always follow security best practices and thoroughly test your configuration in a non-production environment first.&lt;&#x2F;p&gt;
&lt;p&gt;For more information, refer to the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;external-secrets.io&#x2F;latest&#x2F;&quot;&gt;External Secrets Operator documentation&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>HUnderstanding ClusterSecretStore with JWT Authentication in Kubernetes</title>
        <published>2024-12-03T00:00:00+00:00</published>
        <updated>2024-12-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Volkan Özçelik
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://zerotohero.dev/inbox/cluster-secrets-store/"/>
        <id>https://zerotohero.dev/inbox/cluster-secrets-store/</id>
        
        <content type="html" xml:base="https://zerotohero.dev/inbox/cluster-secrets-store/">&lt;h1 id=&quot;understanding-clustersecretstore-with-jwt-authentication-in-kubernetes&quot;&gt;Understanding ClusterSecretStore with JWT Authentication in Kubernetes&lt;&#x2F;h1&gt;
&lt;p&gt;When working with External Secrets Operator (ESO) in Kubernetes, configuring a ClusterSecretStore with JWT authentication requires careful consideration of several aspects. Let’s explore how to set this up correctly and understand its limitations.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;understanding-the-components&quot;&gt;Understanding the Components&lt;&#x2F;h2&gt;
&lt;p&gt;A typical setup involves:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;A webhook service that validates JWT tokens&lt;&#x2F;li&gt;
&lt;li&gt;A Kubernetes secret storing the JWT token&lt;&#x2F;li&gt;
&lt;li&gt;A ClusterSecretStore configuration that uses the token for authentication&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;basic-configuration&quot;&gt;Basic Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;Here’s a basic ClusterSecretStore configuration with JWT authentication:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; vsecm-scout&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  provider&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    webhook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;https:&#x2F;&#x2F;vsecm-scout.default.svc.cluster.local:8443&#x2F;webhook?key={{ .remoteRef.key }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      method&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; GET&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        jsonPath&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      headers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        Authorization&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Bearer {{ .jwt.token }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; jwt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        secretRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; jwt-token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      caBundle&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;your-ca-bundle-here&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;token-management-challenges&quot;&gt;Token Management Challenges&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;static-nature-of-configuration&quot;&gt;Static Nature of Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;One critical limitation to understand is that ClusterSecretStore configurations are static. When you rotate the JWT token by updating the Kubernetes secret, the ClusterSecretStore doesn’t automatically pick up the changes.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;# This secret update won&amp;#39;t automatically reflect in ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; v1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; jwt-token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Opaque&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;stringData&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;your-new-jwt-token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;handling-token-rotation&quot;&gt;Handling Token Rotation&lt;&#x2F;h3&gt;
&lt;p&gt;Given this limitation, there are several approaches to handle token rotation:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Manual Update Approach&lt;&#x2F;strong&gt;:&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;# Update the JWT secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;kubectl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; create secret generic jwt-token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; --from-literal=token=new-jwt-token -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; --dry-run=client -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; yaml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt; kubectl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; apply&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; -&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;# Force update of ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;kubectl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; replace&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; clusterSecretStore.yaml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Custom Controller Approach&lt;&#x2F;strong&gt;:
Create a controller that watches for secret changes and updates the ClusterSecretStore accordingly.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Webhook Service Adaptation&lt;&#x2F;strong&gt;:
Modify your webhook service to handle token fetching differently:&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;func&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; webhookHandler&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;ResponseWriter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Request&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Instead of validating a static token,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; fetch the current token from Kubernetes and validate against that&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    currentToken&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; getCurrentTokenFromK8s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt; nil&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D3869B;&quot;&gt;Error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Error fetching token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;StatusInternalServerError&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FB4934;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Validate the incoming token against the current token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Rest of your handler logic...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-token-lifetime&quot;&gt;1. Token Lifetime&lt;&#x2F;h3&gt;
&lt;p&gt;Consider the implications of token expiration:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Long-lived tokens are easier to manage but pose higher security risks&lt;&#x2F;li&gt;
&lt;li&gt;Short-lived tokens are more secure but require more complex rotation mechanisms&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;2-secret-access&quot;&gt;2. Secret Access&lt;&#x2F;h3&gt;
&lt;p&gt;Ensure proper RBAC for accessing the JWT secret:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; rbac.authorization.k8s.io&#x2F;v1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Role&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; jwt-secret-reader&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;rules&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; apiGroups&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: [&amp;quot;&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  resources&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: [&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  resourceNames&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: [&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;jwt-token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  verbs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: [&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-tls-configuration&quot;&gt;3. TLS Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;Always use TLS for the webhook endpoint:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;go&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;tlsConfig&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; := &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;tls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;Config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    MinVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt; tls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;VersionTLS12&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;    CipherSuites&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: []&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FABD2F;&quot;&gt;uint16&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        tls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;        tls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #83A598;&quot;&gt;TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;    },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;best-practices&quot;&gt;Best Practices&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Monitoring&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Monitor token expiration&lt;&#x2F;li&gt;
&lt;li&gt;Set up alerts for failed secret fetches&lt;&#x2F;li&gt;
&lt;li&gt;Track webhook endpoint health&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Error Handling&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Implement proper error reporting&lt;&#x2F;li&gt;
&lt;li&gt;Use appropriate HTTP status codes&lt;&#x2F;li&gt;
&lt;li&gt;Log authentication failures (but not sensitive data)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Documentation&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Document token rotation procedures&lt;&#x2F;li&gt;
&lt;li&gt;Maintain runbooks for common issues&lt;&#x2F;li&gt;
&lt;li&gt;Keep configuration templates updated&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;example-complete-setup&quot;&gt;Example: Complete Setup&lt;&#x2F;h2&gt;
&lt;p&gt;Here’s a complete example bringing everything together:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #EBDBB2; background-color: #1D2021;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;# JWT Secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; v1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; jwt-token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; Opaque&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;stringData&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;your-jwt-token&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;# ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; vsecm-scout&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  provider&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    webhook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;https:&#x2F;&#x2F;vsecm-scout.default.svc.cluster.local:8443&#x2F;webhook?key={{ .remoteRef.key }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      method&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; GET&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      result&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        jsonPath&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      headers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        Authorization&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;Bearer {{ .jwt.token }}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      secrets&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; jwt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;        secretRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; jwt-token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;          key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; token&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      caBundle&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;your-ca-bundle-here&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #928374;font-style: italic;&quot;&gt;# ExternalSecret Example&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;apiVersion&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; external-secrets.io&#x2F;v1beta1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ExternalSecret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; example-external-secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;spec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  refreshInterval&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt;1h&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  secretStoreRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    kind&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; ClusterSecretStore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; vsecm-scout&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  target&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; example-secret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;  data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt; secretKey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; mykey&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;    remoteRef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8EC07C;&quot;&gt;      key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #A89984;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B8BB26;&quot;&gt; myremotekey&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;While ClusterSecretStore with JWT authentication provides a robust way to secure external secrets access, it comes with important limitations regarding token rotation. Understanding these limitations and implementing appropriate strategies for token management is crucial for maintaining a secure and operational system.&lt;&#x2F;p&gt;
&lt;p&gt;Remember that security is a continuous process, and regular reviews of your authentication mechanisms, including JWT token management, should be part of your security practices.&lt;&#x2F;p&gt;
&lt;p&gt;When implementing this setup, always consider your specific use case and requirements, and be prepared to adapt these patterns to match your security needs and operational capabilities.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
