<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ihechi Okere</title>
    <description>The latest articles on DEV Community by Ihechi Okere (@ihechi_okere).</description>
    <link>https://dev.to/ihechi_okere</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1606492%2F4e73d8db-70d8-44a9-859c-e14f6dcf7b8c.jpg</url>
      <title>DEV Community: Ihechi Okere</title>
      <link>https://dev.to/ihechi_okere</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ihechi_okere"/>
    <language>en</language>
    <item>
      <title>Troubleshooting Bicep Updates on Windows Self-Hosted Agents</title>
      <dc:creator>Ihechi Okere</dc:creator>
      <pubDate>Fri, 01 Aug 2025 00:26:54 +0000</pubDate>
      <link>https://dev.to/ihechi_okere/troubleshooting-bicep-updates-on-windows-self-hosted-agents-4h7g</link>
      <guid>https://dev.to/ihechi_okere/troubleshooting-bicep-updates-on-windows-self-hosted-agents-4h7g</guid>
      <description>&lt;h2&gt;
  
  
  🛠️ Resolving Bicep Update Issues in Self-Hosted CI/CD Agents
&lt;/h2&gt;

&lt;p&gt;This post is a follow-up to my previous article on updating &lt;a href="https://dev.to/ihechi_okere/secure-outputs-in-bicep-g4o"&gt;Bicep&lt;/a&gt; to leverage Microsoft's latest features. In our organization, we use Windows-based self-hosted agents for CI/CD pipelines. While updating Bicep might seem as simple as running a command and moving on, I recently encountered a subtle issue that proved otherwise.&lt;/p&gt;




&lt;h3&gt;
  
  
  ⚠️ The Problem
&lt;/h3&gt;

&lt;p&gt;After running the update command for Bicep, I expected the pipeline to use the latest version. However, it continued to execute using an older version. This was puzzling, especially since the update process had completed without errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initial Troubleshooting Approach
&lt;/h2&gt;

&lt;p&gt;Initially, I suspected a path conflict. Months ago, I had manually placed the Bicep executable in &lt;code&gt;Program Files&lt;/code&gt; to avoid copying it over with each update. To streamline future upgrades, I configured a system environment variable pointing to the auto-updated version located in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;C:\Users\&lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;\.azure\bin\bicep.exe&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Despite confirming that the system path was correctly set, the pipeline still defaulted to the outdated executable.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔍 Root Cause Discovery
&lt;/h3&gt;

&lt;p&gt;To investigate further, I added a &lt;code&gt;whoami&lt;/code&gt; command to the PowerShell script running in the pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;whoami&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Surprisingly, the job was being executed by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NT AUTHORITY\NETWORK SERVICE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was not the account I had assumed.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ The Solution
&lt;/h3&gt;

&lt;p&gt;This discovery led me to check the file permissions on the Bicep executable. Since the machine was domain-joined but the service account was local, I had to explicitly grant &lt;code&gt;NETWORK SERVICE&lt;/code&gt; the necessary permissions to read and execute the file.&lt;/p&gt;

&lt;p&gt;Here's what I did:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Right-clicked the &lt;code&gt;bicep.exe&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Opened &lt;strong&gt;Properties &amp;gt; Security&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Added &lt;code&gt;NETWORK SERVICE&lt;/code&gt; to the list of users&lt;/li&gt;
&lt;li&gt;Granted &lt;strong&gt;Read &amp;amp; Execute&lt;/strong&gt; permissions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once I updated the file's security settings, the pipeline successfully picked up the correct version of Bicep.&lt;/p&gt;




&lt;h3&gt;
  
  
  💡 Key Takeaways
&lt;/h3&gt;

&lt;p&gt;If you're using Windows self-hosted agents and encounter issues with updating Bicep—or any other tool—it's worth checking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Service Account Context&lt;/strong&gt;: Always verify which account is actually executing your pipeline processes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permission Management&lt;/strong&gt;: System-level path configurations are insufficient if the executing service account lacks proper file permissions
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local vs. Domain Accounts&lt;/strong&gt;: Consider the account type when troubleshooting permission-related issues&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This solution applies broadly to similar scenarios involving executable updates for any programs within Windows self-hosted agents, not just Bicep.&lt;/p&gt;




&lt;p&gt;Hopefully, this helps someone avoid the same rabbit hole I went down! If you've run into similar issues or have other tips for managing self-hosted agents, feel free to share in the comments.&lt;/p&gt;

&lt;p&gt;Thanks for reading! 👋&lt;/p&gt;

</description>
      <category>bicep</category>
      <category>devops</category>
      <category>cicd</category>
      <category>azure</category>
    </item>
    <item>
      <title>Secure Outputs in Bicep</title>
      <dc:creator>Ihechi Okere</dc:creator>
      <pubDate>Sat, 05 Jul 2025 00:24:26 +0000</pubDate>
      <link>https://dev.to/ihechi_okere/secure-outputs-in-bicep-g4o</link>
      <guid>https://dev.to/ihechi_okere/secure-outputs-in-bicep-g4o</guid>
      <description>&lt;h1&gt;
  
  
  🔐 Securing Bicep Outputs: A Game-Changer for Logic App Deployments
&lt;/h1&gt;

&lt;p&gt;While developing a module to deploy a Logic App using Azure Bicep, I hit a frustrating snag: I couldn’t securely hide one of the outputs.. specifically, the storage account keys. The issue arose when I needed to call the storage account module from within the Logic App module. If a certain parameter was set to &lt;code&gt;true&lt;/code&gt;, it would create a new storage account. Simple enough, right?&lt;/p&gt;

&lt;p&gt;Well, not quite.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Exposed Secrets
&lt;/h2&gt;

&lt;p&gt;Every time I tried this setup, I ran into a Bicep linting error. More importantly, I was uneasy about the fact that the storage account key would always be exposed in the deployment output. Anyone with access to the deployment history could easily view it under:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resource Group → Settings → Deployments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s what that looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhvmxumqssplv0qpc5ua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhvmxumqssplv0qpc5ua.png" alt="Deployment Output Screenshot" width="411" height="616"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This meant that even sensitive values like storage keys were visible in plain text—an obvious security risk, especially in shared environments or production scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Temporary Solution: Separation of Concerns
&lt;/h2&gt;

&lt;p&gt;At the time, the only workaround was to separate the storage account module from the Logic App deployment entirely. It wasn’t elegant, but it avoided exposing secrets. I shelved the problem, hoping for a better solution down the line.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Comeback: Enter &lt;code&gt;@secure()&lt;/code&gt; for Outputs
&lt;/h2&gt;

&lt;p&gt;And then—plot twist! Microsoft dropped a powerful new feature in Bicep v0.35.1: the &lt;code&gt;@secure()&lt;/code&gt; decorator for outputs. 🎉&lt;/p&gt;

&lt;p&gt;Previously, &lt;code&gt;@secure()&lt;/code&gt; was only available for input parameters. Outputs, no matter how sensitive, were always exposed in plain text. But now, you can mark outputs as secure, and they’ll be hidden from the deployment logs.&lt;/p&gt;

&lt;p&gt;This is a huge win for anyone managing secrets or sensitive infrastructure details in Bicep.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Usage
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@secure()
output storageKey string = storageAccount.listKeys().keys[0].value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, the output will no longer appear in plain text in the deployment history. Instead, it’s masked—just like secure parameters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Still Seeing Linting Errors?
&lt;/h2&gt;

&lt;p&gt;If you’re still getting linting errors when using &lt;code&gt;@secure()&lt;/code&gt; on outputs, chances are you’re running an older version of Bicep.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔍 Check your version:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az bicep version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📦 Install a specific version:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az bicep &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--version&lt;/span&gt; v0.35.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ⬆️ Or upgrade to the latest:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az bicep upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Learn More:
&lt;/h2&gt;

&lt;p&gt;For full details, check out the official Microsoft documentation:&lt;br&gt;&lt;br&gt;
 &lt;a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/outputs?tabs=azure-powershell#secure-outputs" rel="noopener noreferrer"&gt;Secure Outputs in Bicep&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;This small but mighty feature makes Bicep even more production-ready. If you’ve ever hesitated to use outputs for sensitive data, now’s the time to revisit your templates.&lt;/p&gt;

&lt;p&gt;Have you tried the new &lt;code&gt;@secure()&lt;/code&gt; decorator yet? I’d love to hear how it’s changed your workflow or if you’ve found other clever ways to manage secrets in Bicep.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>bicep</category>
      <category>iac</category>
    </item>
    <item>
      <title>A Safer Container Runtime</title>
      <dc:creator>Ihechi Okere</dc:creator>
      <pubDate>Tue, 01 Apr 2025 00:24:03 +0000</pubDate>
      <link>https://dev.to/ihechi_okere/a-safer-container-runtime-17of</link>
      <guid>https://dev.to/ihechi_okere/a-safer-container-runtime-17of</guid>
      <description>&lt;p&gt;Security experts within the container ecosystem have been sounding the alarm lately: Kubernetes, the darling of container orchestration, is likely to become the next major frontier for cyberattacks. As one prominent DevSecOps engineer recently put it, "We're sitting on a security time bomb with Kubernetes deployments. The complexity that makes K8s powerful also creates an expanding attack surface that most teams aren't prepared to defend."&lt;/p&gt;

&lt;p&gt;I couldn't agree more with this assessment. With the use of containerization technology not slowing down anytime soon, it's only a matter of time before threat actors focus their efforts on containers and container orchestration platforms and low hanging fruits will be the first to be grabbed. &lt;/p&gt;

&lt;p&gt;Rootless containers provide a way to run containers safely by running the container with a user other than the root user or running the container in privileged mode. By default, docker containers run with root privileges. This is because the Docker daemon is required to run containers and it has to run with root privileges in order to provide some powerful Docker features. You can run a container where the &lt;code&gt;/host&lt;/code&gt; directory is mounted on the &lt;code&gt;/&lt;/code&gt; directory of the host without restrictions. Such is the power afforded to users of the Docker daemon. However, this adds an added risk of compromise of the host which runs the daemon. But by leveraging rootless containers, your applications can be run in containers that are created, run, and managed by users without admin rights. It also adds a new layer of security by utilising identity management to prevent attackers from gaining root privileges on the host even if the container engine, runtime, or orchestrator is compromised.&lt;/p&gt;

&lt;p&gt;Below are ways we can safely run containers to minimise the risks associated with running containers as root or in privileged mode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set containers root filesystem as read-only&lt;/li&gt;
&lt;li&gt;Run as a non-root user&lt;/li&gt;
&lt;li&gt;Build rootless containers using supported tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running containers do not need changes to be made to the root filesystem. Attempted changes to the root filesystem often is an indication of compromise and is mostly attempted by malicious actors. The immutable nature of containers should be preserved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building Rootless Containers
&lt;/h2&gt;

&lt;p&gt;To build truly secure containers, you need to start with the build process itself. Traditional Docker builds run as root by default, but there are better alternatives:&lt;/p&gt;

&lt;h3&gt;
  
  
  Kaniko
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/GoogleContainerTools/kaniko" rel="noopener noreferrer"&gt;Kaniko&lt;/a&gt; is a tool from Google that builds container images from a Dockerfile inside a container or Kubernetes cluster without requiring privileged mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Example running kaniko in a Kubernetes pod&lt;/span&gt;
kubectl run kaniko &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gcr.io/kaniko-project/executor:latest &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--restart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Never &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--env&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"DOCKER_CONFIG=/kaniko/.docker"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--env&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"GOOGLE_APPLICATION_CREDENTIALS=/secret/kaniko-secret.json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--volumes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;kaniko-secret:/secret &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--dockerfile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Dockerfile &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gs://my-bucket/my-app &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--destination&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;my-registry/my-app:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kaniko executes each command within the Dockerfile completely in userspace, which makes it a safer alternative to Docker's build process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Buildah
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/containers/buildah" rel="noopener noreferrer"&gt;Buildah&lt;/a&gt; is another tool that can build OCI container images without requiring root privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install buildah&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;buildah

&lt;span class="c"&gt;# Run buildah in rootless mode&lt;/span&gt;
buildah &lt;span class="nt"&gt;--userns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;keep-id build-using-dockerfile &lt;span class="nt"&gt;-t&lt;/span&gt; my-app:latest &lt;span class="nb"&gt;.&lt;/span&gt;

&lt;span class="c"&gt;# Push to a registry&lt;/span&gt;
buildah push my-app:latest docker://registry.example.com/my-app:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Buildah can be configured to run in a fully rootless mode, making it an excellent choice for CI/CD pipelines where security is a priority.&lt;/p&gt;

&lt;p&gt;When combined with tools like Podman for running containers, you can achieve a fully rootless container workflow from build to execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confidential Containers
&lt;/h2&gt;

&lt;p&gt;Confidential containers represent an emerging approach to container security. They utilize hardware-based Trusted Execution Environments (TEEs) to protect sensitive data and workloads even from privileged users on the host system. This technology creates a secure enclave where container workloads can run with enhanced privacy and integrity guarantees.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drop Capabilities
&lt;/h2&gt;

&lt;p&gt;Another important security measure is dropping unnecessary Linux capabilities. Docker containers, by default, run with a reduced set of capabilities compared to a normal root user, but you can further restrict these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--cap-drop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ALL &lt;span class="nt"&gt;--cap-add&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;NET_BIND_SERVICE your-image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes all capabilities and only adds back the specific ones your application needs, following the principle of least privilege.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Scanning
&lt;/h2&gt;

&lt;p&gt;Implement automated container image scanning in your CI/CD pipeline. Tools like Grype, Clair, and Anchore can detect vulnerabilities in your container images before they're deployed to production:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grype image your-image:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Use Container-Specific Operating Systems
&lt;/h2&gt;

&lt;p&gt;Minimal, purpose-built operating systems like Alpine Linux, Bottlerocket, or Google's Container-Optimized OS reduce the attack surface by eliminating unnecessary packages and services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secure Your Container Runtime
&lt;/h2&gt;

&lt;p&gt;Keep your container runtime up-to-date and properly configured. For example, if using containerd:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check for security-related configurations&lt;/span&gt;
containerd config default | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; security
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Network Policies
&lt;/h2&gt;

&lt;p&gt;Implement strict network policies to control the traffic between containers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default-deny&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example blocks all incoming and outgoing traffic for pods by default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Runtime Security Monitoring
&lt;/h2&gt;

&lt;p&gt;Deploy runtime security tools that can detect and respond to suspicious activities inside containers. Solutions like Falco can provide real-time alerts on container behavior:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Terminal shell in container&lt;/span&gt;
  &lt;span class="na"&gt;desc&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;A shell was used as the entrypoint/exec point into a container&lt;/span&gt;
  &lt;span class="na"&gt;condition&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;container and shell_procs and not container_entrypoint&lt;/span&gt;
  &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Shell running in a container (user=%user.name container_id=%container.id container_name=%container.name shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline)&lt;/span&gt;
  &lt;span class="na"&gt;priority&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;WARNING&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  OCI Runtime Security Profiles
&lt;/h2&gt;

&lt;p&gt;Leverage OCI runtime security profiles like seccomp and AppArmor to restrict what system calls and operations containers can perform:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--security-opt&lt;/span&gt; &lt;span class="nv"&gt;seccomp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/path/to/seccomp/profile.json your-image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Container security requires a multi-layered approach. By implementing rootless containers, read-only filesystems, runtime security controls, and proper monitoring, you can significantly reduce the risk of container-based attacks. As containerization continues to grow in popularity, investing in these security measures now will help prevent your organization from becoming an easy target for attackers looking to exploit container vulnerabilities.&lt;/p&gt;

&lt;p&gt;It is worth remembering that container security should be a continuous process, not just a one-time setup. Regular audits, updates, and staying informed about the latest security best practices and vulnerabilities are essential parts of maintaining a secure container environment.&lt;/p&gt;

</description>
      <category>containers</category>
      <category>security</category>
      <category>kubernetes</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
