<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by George Souza Farias on Medium]]></title>
        <description><![CDATA[Stories by George Souza Farias on Medium]]></description>
        <link>https://medium.com/@george.farias?source=rss-eef649d31034------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dVqvz14C7B2sL4w_</url>
            <title>Stories by George Souza Farias on Medium</title>
            <link>https://medium.com/@george.farias?source=rss-eef649d31034------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:30:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@george.farias/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Odigos: Simplifying Observability in Distributed Systems]]></title>
            <link>https://medium.com/@george.farias/odigos-simplifying-observability-in-distributed-systems-0eaa446f52a5?source=rss-eef649d31034------2</link>
            <guid isPermaLink="false">https://medium.com/p/0eaa446f52a5</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <dc:creator><![CDATA[George Souza Farias]]></dc:creator>
            <pubDate>Sat, 08 Feb 2025 15:27:55 GMT</pubDate>
            <atom:updated>2025-02-08T15:27:55.584Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*1ouFTXxxR8QgtFqq.png" /></figure><h3>Introduction</h3><p>Imagine a world where you get <strong>instant insights</strong> — latency, error rates, performance metrics — without lifting a finger. No messy code changes, no tedious instrumentation, just <strong>plug-and-play observability</strong>. Sounds like a fantasy? Well, <strong>welcome to Odigos</strong>, where the impossible becomes reality.</p><p>In this post, we’ll take a trip down the <strong>observability rabbit hole</strong>, exploring how Odigos magically <strong>automates instrumentation</strong>, simplifies monitoring, and helps you make sense of your distributed systems — without the usual headaches. <strong>Let’s dive in!</strong> 🚀🐰</p><p><strong>Before we proceed, let&#39;s briefly discuss two key technologies that power Odigos: eBPF and OpenTelemetry</strong>.</p><ul><li><strong>eBPF (Extended Berkeley Packet Filter)</strong> is a powerful feature in the Linux kernel that allows programs to run efficiently in kernel space. It enables real-time collection of valuable data like network traces and system metrics with minimal overhead.</li><li><strong>OpenTelemetry</strong>, on the other hand, is an open-source observability framework that provides a standardized way to collect, process, and export telemetry data (logs, metrics, and traces) from your applications. It supports various programming languages and acts as a universal agent that collects observability signals, allowing you to unify your monitoring efforts across different platforms.</li></ul><p>Why Should I Instrument My Application?</p><p>Instrumentation is the foundation of observability. It gives you insights into how your application is performing in real-time. Without instrumentation, you&#39;re flying blind—you won&#39;t have visibility into critical data like latency, error rates, and system health.</p><p>To ensure your application is running smoothly, it&#39;s essential to monitor at least the <strong>four golden signals </strong>that help to answer the following questions:</p><ol><li><strong>Latency</strong>: How long does your system take to process the requests?</li><li><strong>Traffic</strong>: How much demand does your system place on?</li><li><strong>Errors</strong>: What is the rate of failed requests or unexpected behavior?</li><li><strong>Saturation</strong>: How is your system&#39;s resource consumption (such as CPU and memory) going?</li></ol><p>By instrumenting your application to capture these signals, you can proactively detect and resolve issues, optimize performance, and maintain a reliable, high-quality user experience.</p><h3>Odigos Architecture</h3><p>Odigos architecture is designed to automate and simplify observability across distributed systems, especially in Kubernetes environments. Here&#39;s a brief overview of its core components and flow:</p><p>1. <strong>Instrumentor</strong>: The instrumentor is responsible for automatically detecting applications in the cluster. It configures the necessary instrumentation for each application based on the user&#39;s selection in the Odigos UI or based on labels. This could involve adjusting settings like sampling rates or modifying the pipeline when needed.</p><p>2. <strong>Odiglet</strong>: This component performs the actual instrumentation of running applications. It identifies the application&#39;s language (e.g., Go or Python) and applies the appropriate OpenTelemetry instrumentation. Odigos uses <em>eBPF</em> to collect telemetry data without code changes for compiled languages.</p><p>3. <strong><em>Autoscaler</em></strong>: The autoscaler manages the deployment and configuration of collectors. These collectors gather telemetry data (traces, metrics, logs) and send it to the configured backend. The autoscaler scales are based on the traffic and the number of applications that generate telemetry data.</p><p>4. <strong>Scheduler</strong>: This service assigns applications to the appropriate collector pipeline, ensuring optimal distribution and handling of telemetry traffic.</p><p>5. <strong>UI</strong>: Odigos provides a user interface (UI) built with Next.js for managing observability configurations. This interface allows users to control instrumentation settings, choose destinations for the telemetry data, and adjust performance settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SoA8LdPR69Q119GG.jpeg" /><figcaption>Architecture of the Odigos observability system</figcaption></figure><h3>Odigos Pipeline</h3><p>Odigos automatically sets up an observability pipeline in your Kubernetes cluster, designed to seamlessly collect, process, and export OpenTelemetry data. This pipeline ensures that all telemetry signals, such as metrics, logs, and traces, are efficiently captured and routed to your preferred observability platform.</p><p>The pipeline consists of several key components, each playing a vital role in the flow of observability data:</p><h4>1. Instrumentations</h4><p>Instrumentation is the first step in the pipeline and is responsible for recording OpenTelemetry signals from your application. This can be done in two ways:</p><ul><li><strong>Language-Specific Instrumentations</strong>: Code is injected into your application&#39;s native programming language (e.g., Go, Java) to record telemetry data.</li><li><strong>eBPF-based Instrumentations</strong>: For applications that don&#39;t need code changes, Odigos uses <strong>eBPF</strong> programs to capture telemetry data directly from the Linux kernel, offering high-performance monitoring without affecting your application code.</li></ul><h4>2. OpenTelemetry SDK</h4><p>The <strong>OpenTelemetry SDK</strong> acts as a lightweight library within each instrumented process. It collects the telemetry signals from the instrumentation and sends them outside the application process boundary. This SDK efficiently exports traces, metrics, and logs from the application layer to the next stage in the pipeline.</p><h4>3. Node Collector</h4><p>Also known as the <strong>data-collection collector</strong>, this component runs as a <strong>DaemonSet</strong>, ensuring that each Kubernetes node has its instance of an OpenTelemetry collector. The <strong>Node Collector</strong> gathers telemetry data from all instrumented applications on that node, processes it, and sends it to the next stage in the pipeline.</p><h4>4. Cluster Gateway Collector</h4><p>At the top of the pipeline, the <strong>Cluster Gateway Collector</strong> runs as a Kubernetes <strong>Deployment</strong>. It is the central collector for telemetry data from all the Node Collectors in the cluster. The Cluster Gateway Collector further processes this data and forwards it to the final destination, such as your observability backend (e.g., Prometheus, Datadog, Jaeger).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tiAWcf_PLF-7TxwJ.png" /></figure><h3>Installing and Setting Up Odigos</h3><p>There are two main ways to install Odigos in a Kubernetes cluster:</p><ol><li><strong>Using the Odigos CLI</strong>: This is a quick and easy method to install and configure Odigos with minimal effort. It&#39;s ideal for fast setup and testing.</li><li><strong>Using a Helm Chart</strong>: For production environments or teams practicing GitOps, installing Odigos via Helm charts provides a declarative and automated approach. Helm charts integrate well with continuous delivery pipelines, directly enabling version control and configuration management from your Git repository.</li></ol><p>In this guide, we&#39;ll focus on the <strong>Helm Chart</strong> installation method, as it aligns better with GitOps principles, ensuring that your observability setup is managed and updated in a controlled, versioned manner.</p><h4>Add Odigos Helm Repository and Install</h4><p>First, add the Odigos Helm repository to your Helm configuration.</p><pre>helm repo add odigos https://helm.odigos.io<br>helm repo update<br>helm install odigos odigos/odigos --namespace odigos-system --create-namespace<br>kubectl label namespace odigos-system odigos.io/system-object=&quot;true&quot;</pre><h4>Verify the Installation</h4><p>You can verify that Odigos has been installed correctly by checking the pods in the odigos-system namespace:</p><pre>kubectl get pods -n odigos-system</pre><pre>NAME                                   READY   STATUS    RESTARTS   AGE<br>odiglet-nr6j6                          1/1     Running   0          98s<br>odigos-autoscaler-5fdb8cd7f6-htdfb     1/1     Running   0          98s<br>odigos-instrumentor-7bdcbbcf58-2nx29   1/1     Running   0          98s<br>odigos-instrumentor-7bdcbbcf58-k6ljz   1/1     Running   0          98s<br>odigos-scheduler-6767f4ff6-6cb6q       1/1     Running   0          98s<br>odigos-ui-6465cdfd9c-qr4sc             1/1     Running   0          98s</pre><p>Make sure all the pods are running without issues.</p><h3>Deploying Jaeger for Distributed Tracing</h3><p><strong>Jaeger</strong> is a widely used open-source tool for distributed tracing designed to help you monitor and troubleshoot microservices-based architectures. In this setup, Jaeger will serve as the backend for collecting, storing, and analyzing the telemetry data captured by Odigos, enabling a seamless observability experience for your distributed systems.</p><p>Install Jaeger using the following command:</p><pre>kubectl apply -f https://raw.githubusercontent.com/odigos-io/simple-demo/main/kubernetes/jaeger.yaml</pre><h4>Verify the Installation</h4><p>You can verify that Jaeger has been installed correctly by checking the pods in the tracing namespace:</p><pre>kubectl get pods -n tracing</pre><pre>NAME                      READY   STATUS    RESTARTS   AGE<br>jaeger-787c6f8d99-qdzpw   1/1     Running   0          3s</pre><h3>Setup Odigos Pipeline</h3><p>While Odigos can be configured via its UI, we will take a <strong>GitOps</strong> approach to maintain configurations declaratively in source control and automate the configuration process.</p><h4>Add Cluster Information</h4><p>The &quot;Add Cluster Info&quot; action in Odigos enriches telemetry signals with resource attributes from the Kubernetes cluster where Odigos is running. This allows you to include metadata — such as cluster name, node, and namespace — directly in the traces, metrics, and logs, making it easier to filter and analyze telemetry data.</p><pre>apiVersion: actions.odigos.io/v1alpha1<br>kind: AddClusterInfo<br>metadata:<br>  name: insert-env-cluster-name<br>  namespace: odigos-system<br>spec:<br>  actionName: insert-env-cluster-name<br>  clusterAttributes:<br>  - attributeName: k8s.cluster.name<br>    attributeStringValue: cluster-local<br>  - attributeName: deployment.environment<br>    attributeStringValue: local<br>  signals:<br>  - TRACES<br>  - METRICS<br>  - LOGS</pre><h4>Configure a Destination</h4><p>Now, we&#39;ll create the destination for Odigos to export the traces it collects from your applications. In this example, we&#39;ll use <strong>Jaeger</strong> as the destination, but Odigos supports many types of observability backends, both open-source and commercial.</p><p>You configure the destination and provide the required endpoint (in the case of Jaeger, typically the collector URL), and Odigos will start sending the collected traces to that destination.</p><pre>apiVersion: odigos.io/v1alpha1<br>kind: Destination<br>metadata:<br>  name: jaeger<br>  namespace: odigos-system<br>spec:<br>  data:<br>    JAEGER_URL: jaeger.tracing:4317<br>  destinationName: Jaeger<br>  signals:<br>  - TRACES<br>  type: jaeger</pre><h3>Show Time</h3><h4>Deploying the target application</h4><p>The official <a href="https://docs.odigos.io/quickstart/introduction">Odigos documentation</a> provides a <a href="https://github.com/odigos-io/simple-demo">demo application</a> consisting of 5 microservices written in <em>Go, Java, Python, .NET, and Node.js</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dKLmbbELwIOwTqYo.png" /><figcaption>Demo Application Diagram</figcaption></figure><pre>#Create Demo Namespace<br>kubectl create ns odigos-demo</pre><p>By default, we need to specify which applications should be instrumented by Odigos, and there are several ways to do this.</p><ol><li><strong>Using the UI</strong>: The simplest option is to configure instrumentation directly through the Odigos UI, where you can select specific applications.</li><li><strong>Labeling the Deployment</strong>: Adding a label directly to the <strong>Deployment</strong> manifest is another way. This tells Odigos to instrument that specific application automatically.</li><li><strong>Labeling the Namespace</strong>: If you want to instrument all applications within a specific namespace, you can label the entire namespace.</li><li><strong>Kubernetes Manifests</strong>: If you prefer to use kubectl or GitOps to manage your Kubernetes workloads, you can add a source to Odigos by creating a Source object.</li></ol><p>In this example, we&#39;ll use a source object:</p><pre>apiVersion: odigos.io/v1alpha1<br>kind: Source<br>metadata:<br>  name: odigos-demo-ns<br>  namespace: odigos-demo<br>spec:<br>  workload:<br>    name: odigos-demo<br>    namespace: odigos-demo<br>    kind: Namespace</pre><p>Now, let&#39;s deploy a demo application:</p><pre>kubectl apply -n odigos-demo -f https://raw.githubusercontent.com/odigos-io/simple-demo/main/kubernetes/deployment.yaml</pre><p>Check if everything is up and running:</p><pre>coupon-5b695469db-48ng6      1/1     Running   0          15m<br>frontend-5b998df799-r94fw    1/1     Running   0          15m<br>inventory-5b4788c78c-7688g   1/1     Running   0          15m<br>membership-8dc9c694d-bwqxk   1/1     Running   0          15m<br>pricing-6d6596b55b-kdwwg     1/1     Running   0          15m</pre><h3>Access the Odigos UI</h3><p>Odigos comes with a user-friendly UI for managing observability. To access the UI, you&#39;ll need to set up port forwarding:</p><pre>kubectl port-forward svc/ui 3000:3000 -n odigos-system</pre><p>Now, you can access the Odigos UI in your browser at <a href="http://localhost:3000.">http://localhost:3000.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILv3JUo4vzLjSqRDTsDxkQ.png" /><figcaption>Odigos&#39;s UI</figcaption></figure><h3>Access the Jaeger UI</h3><p>Once everything is set up, we can open Jaeger to view the traces. However, before doing so, it’s important to generate some traces by exporting and interacting with the demo application.</p><pre>kubectl port-forward svc/frontend 8080:8080 -n odigos-demo</pre><p>Now everything is set. Open the Jaeger UI to view the traces.</p><pre>kubectl port-forward -n tracing svc/jaeger 16686:16686</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fMW1efyTHtw44MH1zmLxmA.png" /><figcaption>Application&#39;s Traces are Correctly been sent to Jaeger</figcaption></figure><h3>That’s All, Folks!… Or Is It? 🐰🎩</h3><p>So, you’ve got <strong>Odigos up and running</strong>, auto-instrumenting applications like a pro, and sending traces to <strong>Jaeger</strong> without writing a single line of code. Pretty cool, right? But don’t get too comfortable — this is just <strong>the beginning</strong>.</p><p>Observability is a deep rabbit hole; you’ve only taken the <strong>first step down the burrow</strong>. There’s still so much more to explore:</p><ul><li><strong>Fine-tuning instrumentation</strong> — Adjust sampling rates, filter data, and optimize your pipeline.</li><li><strong>Exploring other destinations</strong> — Try sending telemetry to <strong>ElasticSearch, Prometheus, or Grafana</strong>.</li><li><strong>Scaling up observability</strong> — Monitor real production workloads and gain real-time insights.</li></ul><p>Odigos makes observability effortless, but the <strong>real magic happens when you start diving deeper</strong> into the data, uncovering performance bottlenecks, and fine-tuning your system like a <strong>true observability wizard</strong>.</p><p>So, what’s next? Keep exploring, experimenting, and most importantly — <strong>have fun breaking things (in a safe, monitored way, of course).</strong></p><p>See you on the other side of the <strong>rabbit hole!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0eaa446f52a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving your website security with HTTP headers in nginx-ingress]]></title>
            <link>https://medium.com/wearewebera/improving-your-website-security-with-http-headers-in-nginx-ingress-369e8f3302cc?source=rss-eef649d31034------2</link>
            <guid isPermaLink="false">https://medium.com/p/369e8f3302cc</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[nginx-ingress]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[George Souza Farias]]></dc:creator>
            <pubDate>Mon, 05 Apr 2021 10:23:57 GMT</pubDate>
            <atom:updated>2021-04-05T16:09:07.365Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*xjXI2c43NCPcIR-hXSSyIg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@chrispanas?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">chris panas</a> on <a href="https://medium.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>When we are deploying a website sometimes we do not take some aspects of HTTP header into account, those which have the ability to increase the security of our applications. As incredible as it may seem, HTTP headers can set, server-side, what the browser is allowed and not allowed, preventing various types of attacks, especially those that execute malicious <em>JavaScript </em>on the client-side<em>.</em></p><p>My idea with this article is to explain not only how to improve the security of your application or website, but also why you should do that as well. So, a little disclaimer, my intention is not to do a deep dive into concepts for obvious reasons, as many books could be written about them, so I’m going to keep it within the scope above</p><h3>Scanning your website</h3><p>Today we have plenty of tools that help us to validate the security level of our system, such as <a href="https://securityheaders.com/">Security Headers</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfFDz9Im18XXmYpjkVrPVg.png" /><figcaption>Website — Security Headers</figcaption></figure><p>Everything the tool needs is already publicly available in your website, just write down its address and click scan. Then the tool will evaluate the headers and gives you a score from <strong>F</strong> to <strong>A+</strong>, in order to get an A+ grade your site needs to issue all the HTTP response headers and this indicates a high level of commitment to improve security for your visitors.</p><h3>A brief summary of HTTP headers</h3><p>As already was said, HTTP headers transport additional information in request or response between client and server and <em>vice versa</em>. There are many kinds of HTTP headers with the most varied purposes, but they can be grouped according to their contexts, such as:</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Glossary/General_header">General headers</a>: apply to both requests and responses, but with no relation to the data transmitted in the body.<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers">¹</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Glossary/Request_header">Request headers</a>: contain more information about the resource to be fetched, or about the client requesting the resource.<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers">¹</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Glossary/Response_header">Response headers</a>: hold additional information about the response, like its location or about the server providing it.<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers">¹</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Glossary/Entity_header">Entity headers</a>: contain information about the body of the resource, like its <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length">content length</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types">MIME type</a>.<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers">¹</a></li></ul><h3>About the headers</h3><p>So, I’ve limited myself to use basically the HTTP headers used to improve some kind of security for your website. The values shown below are just for demo purpose, as you must decide which configuration fit for your organization needs. So, let’s see how it’s done.</p><ul><li><strong>X-Content-Type-Options:</strong> it makes the browser stop trying to MIME-sniff the content type and forces it to stick with the declared content-type. So, the idea is the browser doesn’t try to guess the MIME-type, it may be used to malicious purposes. So, we must set the following header:</li></ul><pre>X-Content-Type-Options: &quot;nosniff&quot;</pre><ul><li><strong>X-Frame-Options:</strong> it tells the browser whether you want to allow your site to be framed or not. By preventing the browser from framing your site you can defend yourself against attacks like <a href="https://portswigger.net/web-security/clickjacking">clickjacking</a>. It’s recommended set it to “sameorigin” in order to the frame just from you website by setting the value:</li></ul><pre><em>X-Frame-Options: &quot;sameorigin&quot;</em></pre><ul><li><strong>X-XSS-Protection: </strong>it tells the browser to stop pages from loading when they detect reflected cross-site scripting(<a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">XSS</a>) attacks. The configuration value is:</li></ul><pre><em>X-XSS-Protection: “1; mode=block”</em>;</pre><ul><li><strong>Referrer-Policy:</strong> it is a header that controls how much information the browser includes within the navigation. There are many options, one for each case, the most common are: <strong>no-referrer, same-origin, strict-origin.</strong></li></ul><pre>Referrer-Policy: &#39;same-origin&#39;;</pre><ul><li><strong>Permissions-Policy</strong>: It is a header that tells what are the features and APIs your website can or can’t access. It’s necessary to provide a <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy#directives">list of directives</a> of what we’d like to disable.</li></ul><pre>add_header Permissions-Policy &quot;accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()&quot;;</pre><ul><li><strong>Strict-Transport-Security(HSTS):</strong> It is very helpful to let the browser know that it must only be accessed using HTTPS, instead of using HTTP.</li></ul><pre>Strict-Transport-Security &quot;max-age=31536000; includeSubDomains; preload&quot; always;</pre><ul><li><strong>Content-Security-Policy</strong>: Now we’ve arrived to the danger zone, this header can literally break your website. Nevertheless, it is very effective in detecting and mitigating certain types of attacks. The idea behind this is to set values to <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP">control </a>what resources the user agent is allowed to load for that page.</li></ul><pre># Allow content to come from own origin and excludes subdomains<br>Content-Security-Policy: default-src &#39;self&#39;;</pre><pre># Allow content from a specific domain and subdomains<br>Content-Security-Policy: default-src &#39;self&#39; mydomain.com *.mydomain.com</pre><h3>How to implement the headers in ingress</h3><p>There are many ways to implement the headers, you can add them to your <a href="https://kubernetes.github.io/ingress-nginx/"><em>ingress-controller</em></a> configuration, and it will be applied globally to all websites behind it. Although it looks like the easiest way, be careful, you must be sure that all sites will work properly with the same configuration.</p><p>We recommend that you set the configuration for each ingress resource, in other words, for each website. You can add a snippet through ingress annotation<a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/">²</a>.</p><p>The nginx’s directive to add headers is pretty simple<a href="http://nginx.org/en/docs/http/ngx_http_headers_module.html">³</a>:</p><pre>Syntax: <strong>add_header</strong> <em>name</em> <em>value</em> [always];<br>Default: —<br>Context: http, server, location, if in location</pre><p>For the grand finale, let’s set it up: all you have to do is add a new annotation to your ingress:</p><pre>nginx.ingress.kubernetes.io/configuration-snippet: |   <br>  add_header X-Frame-Options &quot;sameorigin&quot;;<br>  add_header X-Content-Type-Options nosniff;<br>  add_header Referrer-Policy &#39;same-origin&#39;;<br>  add_header Permissions-Policy &quot;accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()&quot;;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVRHh9xI3nDN6TeiBdOiZA.png" /><figcaption>ingress</figcaption></figure><p>It took me a quite long time to troubleshoot this issue so I decided to write down what I learned and share it here, so I hope somebody else might find some value in it. :D</p><h3>References</h3><p>¹ <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers</a></p><p>² <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/</a></p><p>³ <a href="http://nginx.org/en/docs/http/ngx_http_headers_module.html">http://nginx.org/en/docs/http/ngx_http_headers_module.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=369e8f3302cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/improving-your-website-security-with-http-headers-in-nginx-ingress-369e8f3302cc">Improving your website security with HTTP headers in nginx-ingress</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>