<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Cloud Security | FirewallSync</title><link>https://firewallsync.com/tags/cloud-security/</link><description>Practical cybersecurity writing for engineering teams that ship fast.</description><language>en-us</language><image><url>https://firewallsync.com/icon-512.png</url><title>FirewallSync</title><link>https://firewallsync.com/</link></image><lastBuildDate>Fri, 06 Nov 2026 09:00:00 +0000</lastBuildDate><atom:link href="https://firewallsync.com/tags/cloud-security/index.xml" rel="self" type="application/rss+xml"/><item><title>What Is Workload Identity and Why Should You Stop Using Static Cloud Keys?</title><link>https://firewallsync.com/posts/what-is-workload-identity-and-why-should-you-stop-using-static-cloud-keys/</link><guid>https://firewallsync.com/posts/what-is-workload-identity-and-why-should-you-stop-using-static-cloud-keys/</guid><pubDate>Fri, 06 Nov 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>A static cloud key stored on a server is a credential that works until someone remembers to rotate it. Workload identity replaces that with a credential that's issued fresh, per request, and expires by design.</description><enclosure url="https://firewallsync.com/posts/what-is-workload-identity-and-why-should-you-stop-using-static-cloud-keys/cover_hu681824106042170752.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/what-is-workload-identity-and-why-should-you-stop-using-static-cloud-keys/cover_hu681824106042170752.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/what-is-workload-identity-and-why-should-you-stop-using-static-cloud-keys/cover_hu681824106042170752.jpg" alt="Close-up of server cooling fans in a data center" width="1200" height="630"></p><p>A static cloud credential — an access key downloaded once and placed in a configuration file, an environment variable, or a secrets manager — works exactly the same way for as long as it exists, whether it&rsquo;s being used by the legitimate service it was created for or by whoever else eventually gets hold of it. Workload identity replaces this model with credentials that are issued automatically, scoped narrowly, and expire on their own, removing the long-lived static secret from the equation entirely.</p>
<h2 id="the-core-idea">The core idea</h2>
<p>Workload identity lets a workload — a VM, a container, a Kubernetes pod, a CI/CD pipeline — prove its identity to a cloud provider using an identity mechanism native to the platform it&rsquo;s already running on, rather than a separately issued static credential it has to store and protect. The cloud provider verifies that identity (often via a signed token from the underlying platform) and, if the trust relationship allows it, issues short-lived, temporary credentials scoped to what that specific workload is allowed to do. No static key is generated, stored, or needs rotating, because the credential is requested fresh each time it&rsquo;s needed and expires shortly after.</p>
<p>This is the same underlying pattern as GitHub Actions OIDC for CI/CD, generalized to any workload: an ambient, platform-verified identity replacing a portable static secret.</p>
<h2 id="where-this-shows-up-across-major-platforms">Where this shows up across major platforms</h2>
<p><strong>AWS IAM roles for EC2 instances and ECS/EKS workloads</strong> let a compute resource assume a role automatically, without ever having an access key stored on the instance — the AWS SDK, when running on that instance, retrieves temporary credentials from the instance metadata service automatically, and those credentials rotate on their own throughout the instance&rsquo;s lifetime.</p>
<p><strong>Google Cloud&rsquo;s Workload Identity Federation</strong> extends this further, allowing workloads running outside Google Cloud entirely (in another cloud, or in an on-premises environment, or in GitHub Actions) to authenticate using their own platform&rsquo;s native identity, federated into GCP&rsquo;s IAM without any GCP-specific static credential ever being generated for that external workload.</p>
<p><strong>Azure Managed Identities</strong> provide the equivalent for Azure resources — a VM, a function, an App Service instance can have an identity automatically managed by Azure, with credentials retrieved and rotated transparently by the platform.</p>
<h2 id="why-the-static-key-model-is-worse-than-it-initially-appears">Why the static-key model is worse than it initially appears</h2>
<p>A static key&rsquo;s risk isn&rsquo;t just &ldquo;it might leak.&rdquo; It&rsquo;s that the key, once created, has no natural expiration and no built-in mechanism forcing anyone to verify it&rsquo;s still needed or still appropriately scoped — it persists exactly as originally configured until someone actively intervenes. Combined with the fact that static keys are portable (they can be copied, embedded in code, committed to a repository, or exfiltrated and used from anywhere), a leaked static key gives an attacker exactly the same access the legitimate workload has, usable from anywhere, for as long as the key remains valid — which in practice is often indefinitely, since key rotation discipline tends to be inconsistent in most organizations.</p>
<p>Workload identity credentials, by contrast, are typically scoped to be usable only from the specific platform context that requested them, are short-lived by default, and require no manual rotation process to maintain that short lifespan — the security property comes from the architecture itself, not from an operational discipline that has to be maintained correctly over time.</p>
<h2 id="migrating-from-static-keys-to-workload-identity">Migrating from static keys to workload identity</h2>
<p><strong>Start with the highest-risk static credentials first</strong> — keys with broad permissions, keys used in externally reachable services, keys that have existed longest without rotation — rather than attempting a full simultaneous migration, which is often impractical across a large existing environment.</p>
<p><strong>Confirm the workload&rsquo;s actual runtime platform supports the corresponding identity mechanism</strong> before planning the migration — a workload running on a platform without native workload identity support (some older on-premises or hybrid setups) may need an intermediate solution, like a secrets manager with automated rotation, as a partial improvement rather than the full architectural change.</p>
<p><strong>Update IAM policies to trust the workload identity mechanism specifically</strong>, scoped as narrowly as the static key&rsquo;s replacement role should be — this is also a natural opportunity to right-size permissions that may have accumulated excess over the static key&rsquo;s lifetime, rather than simply replicating the old key&rsquo;s exact permission set under the new mechanism.</p>
<p><strong>Decommission the static key only after confirming the workload identity path is fully functional</strong>, running both in parallel briefly if needed to avoid an availability gap, then removing the static credential entirely rather than leaving it as an unused, still-valid fallback.</p>
<h2 id="a-practical-checklist">A practical checklist</h2>
<ul>
<li>Identify workloads still using static cloud credentials, prioritized by permission scope and exposure</li>
<li>Confirm the platform-native workload identity mechanism available for each workload&rsquo;s actual runtime environment</li>
<li>Configure IAM trust relationships scoped narrowly to the specific workload identity, not broadly</li>
<li>Migrate and verify functionality before decommissioning the static credential</li>
<li>Treat any remaining static credential, after this process, as requiring active justification for why workload identity wasn&rsquo;t a viable replacement</li>
</ul>
<p>The shift from static keys to workload identity isn&rsquo;t primarily about convenience, even though it does remove manual rotation overhead. It&rsquo;s about changing the credential&rsquo;s fundamental risk profile — from a portable secret that persists until someone acts, to an ephemeral one that expires by default.</p>
]]></content:encoded></item><item><title>Non-Human Identities: The Security Problem Behind Service Accounts and AI Agents</title><link>https://firewallsync.com/posts/non-human-identities-the-security-problem-behind-service-accounts-and-ai-agents/</link><guid>https://firewallsync.com/posts/non-human-identities-the-security-problem-behind-service-accounts-and-ai-agents/</guid><pubDate>Thu, 05 Nov 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Identity &amp; Access</category><description>Most identity security programs were designed around human users logging in. Service accounts, API keys, and now AI agents don't fit that model, and it shows in how little oversight they typically get.</description><enclosure url="https://firewallsync.com/posts/non-human-identities-the-security-problem-behind-service-accounts-and-ai-agents/cover_hu5579159601805468162.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/non-human-identities-the-security-problem-behind-service-accounts-and-ai-agents/cover_hu5579159601805468162.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/non-human-identities-the-security-problem-behind-service-accounts-and-ai-agents/cover_hu5579159601805468162.jpg" alt="Small robot standing on a table" width="1200" height="630"></p><p>Most identity security programs — MFA policies, access reviews, onboarding and offboarding workflows — were designed around a mental model of a human user logging in. Service accounts, API keys, workload identities, and now AI agents acting autonomously don&rsquo;t fit that model cleanly, and in most organizations, they receive a small fraction of the governance attention human identities do, despite frequently outnumbering human users by a wide margin in any modern cloud environment.</p>
<h2 id="why-non-human-identities-are-structurally-under-governed">Why non-human identities are structurally under-governed</h2>
<p><strong>There&rsquo;s no natural offboarding trigger.</strong> A human employee leaving triggers an HR process that (ideally) disables their access. A service account has no equivalent event — it keeps functioning until someone specifically remembers it exists and decides to remove it, which, as covered in identity audits generally, tends to happen rarely and inconsistently.</p>
<p><strong>Permissions get granted broadly because there&rsquo;s no individual accountability pressure.</strong> Nobody feels personally exposed by over-provisioning a service account&rsquo;s permissions the way they might hesitate to request excessive personal access — the account is abstract, its permissions feel like an infrastructure detail rather than a decision with a name attached to it.</p>
<p><strong>They&rsquo;re numerous enough that manual review doesn&rsquo;t scale.</strong> A mid-sized cloud environment can easily have service accounts, API keys, and workload identities numbering in the thousands, dwarfing the human user count — manual, human-driven access review processes that work reasonably well for a few hundred employee accounts break down entirely at that scale.</p>
<h2 id="ai-agents-introduce-a-new-and-distinct-version-of-this-problem">AI agents introduce a new and distinct version of this problem</h2>
<p>An AI agent with tool access — the ability to call APIs, execute code, modify data, or take actions on a user&rsquo;s behalf — is a non-human identity with a property service accounts traditionally didn&rsquo;t have: its actions aren&rsquo;t fully deterministic from a static configuration. A service account does exactly what its code tells it to do, every time, in a way that&rsquo;s auditable in advance. An AI agent&rsquo;s specific actions depend on its inputs and its reasoning at runtime, which means the risk isn&rsquo;t just &ldquo;does this identity have too much permission&rdquo; (the traditional over-provisioning question) but also &ldquo;can this identity be manipulated, through its inputs, into using its legitimate permissions in unintended ways&rdquo; — a genuinely new dimension that traditional service-account governance wasn&rsquo;t built to address.</p>
<h2 id="excessive-agency-as-the-specific-failure-mode-to-watch-for">Excessive agency as the specific failure mode to watch for</h2>
<p>The OWASP Top 10 for LLM Applications identifies excessive agency — granting an AI system more autonomy, tool access, or permission than the task actually requires — as a distinct risk category. It manifests in the same pattern as traditional over-provisioning (an agent given broad database write access when it only needs to read a specific table) but with an added risk surface: if that agent can be manipulated through its inputs (a classic prompt injection scenario) into taking actions using its own legitimate, unrevoked permissions, the excessive scope of those permissions determines how much damage a successful manipulation can cause. Scoping an agent&rsquo;s tool access as narrowly as the task requires isn&rsquo;t just good practice — it&rsquo;s the primary control limiting what a successful manipulation of that agent can actually accomplish.</p>
<h2 id="what-actually-needs-to-change-in-practice">What actually needs to change in practice</h2>
<p><strong>Treat non-human identity inventory as seriously as human identity inventory</strong>, with the same expectation of knowing who or what owns each one, why it exists, and what it&rsquo;s actually used for — an unowned service account is a governance gap in exactly the way an unowned human account would be treated as one.</p>
<p><strong>Apply least privilege more aggressively to non-human identities than the current default</strong>, precisely because the absence of individual accountability pressure means the default outcome, without deliberate counter-effort, is over-provisioning.</p>
<p><strong>Build offboarding triggers for non-human identities explicitly</strong>, rather than relying on someone remembering — tying service account lifecycle to the lifecycle of the project or integration it supports, so decommissioning the project has a corresponding, enforced step for its associated identities.</p>
<p><strong>For AI agents specifically, scope tool access to the minimum the task requires</strong>, and treat any tool or API access an agent has as something that could be invoked through unintended input, not only through intended use — which means the permission scope itself, not just the intended behavior, needs to be defensible.</p>
<p><strong>Extend credential hygiene practices — short-lived tokens over static keys, rotation, monitoring for anomalous usage — to non-human identities with the same rigor applied to human credentials</strong>, rather than treating a service account&rsquo;s static, long-lived API key as an acceptable default simply because it&rsquo;s not a human logging in.</p>
<h2 id="the-scale-of-the-shift">The scale of the shift</h2>
<p>As AI agents become more common in production systems — not just answering questions but taking actions, calling tools, and operating with standing permissions — the non-human identity population in most organizations is set to grow substantially further, and faster than most identity governance processes are currently equipped to track. Treating this as a known, generalizable identity problem (apply the same governance discipline, adapted for scale and for the new manipulation risk agents introduce) is a more tractable path than waiting for the population of ungoverned non-human identities to become large enough that a comprehensive retrofit is required under incident pressure.</p>
]]></content:encoded></item><item><title>How to Audit Unused Cloud Accounts, Roles, and Service Identities</title><link>https://firewallsync.com/posts/how-to-audit-unused-cloud-accounts-roles-and-service-identities/</link><guid>https://firewallsync.com/posts/how-to-audit-unused-cloud-accounts-roles-and-service-identities/</guid><pubDate>Wed, 04 Nov 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>An unused identity with live credentials is functionally identical to a vulnerability sitting unpatched — nobody's using it, but it still works exactly as well for whoever finds it.</description><enclosure url="https://firewallsync.com/posts/how-to-audit-unused-cloud-accounts-roles-and-service-identities/cover_hu15633663302747140923.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/how-to-audit-unused-cloud-accounts-roles-and-service-identities/cover_hu15633663302747140923.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/how-to-audit-unused-cloud-accounts-roles-and-service-identities/cover_hu15633663302747140923.jpg" alt="Rack of equipment in a dark server room" width="1200" height="630"></p><p>An unused cloud identity — an IAM user nobody logs into anymore, a service account for a decommissioned integration, a role created for a migration that finished a year ago — is functionally identical to an unpatched vulnerability. It doesn&rsquo;t matter that nobody on your team is using it. What matters is that its credentials still work, exactly as well, for anyone who happens to find them.</p>
<h2 id="why-unused-identities-accumulate">Why unused identities accumulate</h2>
<p>Identities get created deliberately and removed by nobody&rsquo;s default responsibility. Offboarding processes, when they exist, usually focus on disabling a departed employee&rsquo;s primary login — they less consistently catch the service accounts that person set up, the API keys they generated for a one-off script, or the IAM role created specifically for a project that&rsquo;s since been shelved. Each of these represents a valid credential that continues to function indefinitely unless something explicitly removes it, and nothing about normal operations naturally surfaces &ldquo;this hasn&rsquo;t been used in months&rdquo; as a signal anyone acts on.</p>
<h2 id="finding-unused-identities-with-activity-data-not-assumption">Finding unused identities with activity data, not assumption</h2>
<p><strong>AWS IAM Access Analyzer&rsquo;s unused access findings</strong> directly surface unused IAM roles, unused access keys on IAM users, and unused passwords, based on actual observed activity rather than requiring manual review of every identity. This turns &ldquo;which of our hundreds of IAM users and roles are stale&rdquo; from a guessing exercise into a query against real usage data.</p>
<p><strong>Cloud provider &ldquo;last accessed&rdquo; and &ldquo;last used&rdquo; metadata</strong> exists across most major providers for service accounts, API keys, and roles — checking this directly, even without a dedicated unused-access tool, gives a concrete date rather than relying on institutional memory about whether something is still needed.</p>
<p><strong>Cross-referencing identity lists against current employee and vendor rosters</strong> catches accounts that should have been disabled during offboarding but weren&rsquo;t — this requires connecting your identity provider&rsquo;s audit data to your HR or vendor management system, which isn&rsquo;t automatic in most setups but is one of the highest-value manual checks available.</p>
<h2 id="service-identities-deserve-more-scrutiny-than-human-ones-not-less">Service identities deserve more scrutiny than human ones, not less</h2>
<p>Service accounts and machine identities often get created with broader permissions than strictly necessary, because there&rsquo;s no individual human whose access needs feel personally accountable — nobody wants to be the reason a batch job fails from insufficient permissions, so the path of least resistance is granting broadly. Combined with the fact that service accounts don&rsquo;t have an obvious &ldquo;this person left the company&rdquo; trigger to prompt review, they tend to accumulate both excess permission and staleness at a higher rate than human accounts, while receiving less routine attention.</p>
<h2 id="what-to-do-once-youve-found-unused-identities">What to do once you&rsquo;ve found unused identities</h2>
<p><strong>Don&rsquo;t delete immediately — deactivate first, and observe.</strong> An identity that appears unused in your analysis window might back an infrequent process (a quarterly compliance export, an annual data migration script) that simply hasn&rsquo;t run recently. Deactivating (disabling the credential without deleting the identity) and monitoring for any access failures over a follow-up period is safer than immediate deletion, and still closes the exposure during the observation window.</p>
<p><strong>Extend your observation window for anything ambiguous.</strong> Thirty days of &ldquo;unused&rdquo; data is a reasonable default for continuously-running services, but insufficient for anything tied to quarterly, annual, or on-demand processes — check with the team that would own the process before treating a longer-cycle identity as confirmed unused.</p>
<p><strong>Prioritize by permission scope, not just by staleness.</strong> An unused identity with narrow, low-impact permissions is a lower-priority cleanup than an unused identity holding broad administrative access — if you can only tackle a subset immediately, start with the ones that would matter most if found and used maliciously.</p>
<h2 id="building-this-into-an-ongoing-process-not-a-one-time-cleanup">Building this into an ongoing process, not a one-time cleanup</h2>
<p>A single cleanup pass reduces the current backlog but doesn&rsquo;t stop new unused identities from accumulating going forward, since the same organizational gaps that created the current backlog — no clear ownership of removing access when it&rsquo;s no longer needed — remain in place afterward. A recurring quarterly (at minimum) review, ideally automated through a tool that surfaces unused-access findings continuously rather than requiring someone to remember to run an audit, keeps the backlog from silently rebuilding.</p>
<h2 id="a-practical-checklist">A practical checklist</h2>
<ul>
<li>Run cloud-native unused access tooling (like AWS IAM Access Analyzer) as a recurring process, not a one-time audit</li>
<li>Cross-reference identity lists against current employee and vendor rosters to catch offboarding gaps</li>
<li>Apply extra scrutiny to service and machine identities specifically, since they accumulate excess more often and get reviewed less</li>
<li>Deactivate before deleting, with an observation period for anything not obviously safe to remove immediately</li>
<li>Prioritize cleanup by permission scope and blast radius, not purely by how long an identity has been idle</li>
<li>Establish a recurring cadence for this review, not a one-time project, since the conditions that create unused identities don&rsquo;t go away after a single cleanup</li>
</ul>
<p>The goal isn&rsquo;t a one-time reduction in identity count. It&rsquo;s closing the gap between &ldquo;how many valid credentials exist&rdquo; and &ldquo;how many are actually needed,&rdquo; on an ongoing basis, since that gap is where a meaningful share of real incidents originate.</p>
]]></content:encoded></item><item><title>Cloud IAM vs Network Security: Why Identity Has Become the New Perimeter</title><link>https://firewallsync.com/posts/cloud-iam-vs-network-security-why-identity-has-become-the-new-perimeter/</link><guid>https://firewallsync.com/posts/cloud-iam-vs-network-security-why-identity-has-become-the-new-perimeter/</guid><pubDate>Tue, 03 Nov 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>Network segmentation still matters, but in a cloud environment, the thing standing between an attacker and your data is increasingly a permission check, not a firewall rule.</description><enclosure url="https://firewallsync.com/posts/cloud-iam-vs-network-security-why-identity-has-become-the-new-perimeter/cover_hu2099996365430746022.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/cloud-iam-vs-network-security-why-identity-has-become-the-new-perimeter/cover_hu2099996365430746022.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/cloud-iam-vs-network-security-why-identity-has-become-the-new-perimeter/cover_hu2099996365430746022.jpg" alt="Close-up of network equipment with connected cables" width="1200" height="630"></p><p>Traditional network security assumed a defensible boundary: a corporate network with a firewall at the edge, internal traffic implicitly more trusted than external traffic, and access controlled largely by what network segment you could physically or logically reach. Cloud environments break this assumption structurally — most cloud resources are reachable over the public internet by design, and what actually stands between an attacker and your data is increasingly a permission check evaluated by an identity provider, not a network path blocked by a firewall.</p>
<h2 id="why-the-network-perimeter-stopped-being-the-primary-boundary">Why the network perimeter stopped being the primary boundary</h2>
<p>In a cloud environment, an S3 bucket, a database, or an API endpoint is often reachable from anywhere on the internet unless explicitly restricted — and even when network restrictions exist, they&rsquo;re frequently permissive by necessity, since legitimate access (from developers, from other cloud services, from users) also needs to traverse the same public internet. This means the network layer, while still worth hardening, isn&rsquo;t where most access decisions actually get enforced anymore. The enforcement point has moved to IAM: does this identity have permission to perform this action on this resource, evaluated per-request, regardless of what network path the request arrived on.</p>
<h2 id="what-this-changes-practically">What this changes practically</h2>
<p><strong>A compromised credential now matters more than a compromised network position.</strong> In a traditional perimeter model, gaining access to the internal network was often the hard part of an attack, after which lateral movement was comparatively easier. In a cloud environment, an attacker with a valid but overprivileged credential can often reach exactly what they need directly, without needing to compromise any network boundary at all — the credential itself is the boundary that mattered.</p>
<p><strong>Least privilege on identities does the work that network segmentation used to do.</strong> Where network segmentation limited blast radius by controlling what a compromised machine could reach on the network, IAM scoping limits blast radius by controlling what a compromised identity can do regardless of where it&rsquo;s calling from. A tightly scoped IAM role with no meaningful network restriction is often a stronger control than a broad IAM role sitting behind a well-segmented network, because the segmentation doesn&rsquo;t stop a legitimately-authenticated call from an already-compromised identity.</p>
<p><strong>Service-to-service authentication is now an identity problem, not just a network problem.</strong> Whether one internal service can call another used to be substantially a network question (can it reach the right port on the right host). It&rsquo;s increasingly an identity question — does this specific service&rsquo;s identity have a role or token that authorizes this specific call — which is why workload identity and service-to-service authentication design has become a first-class security concern rather than an implementation detail.</p>
<h2 id="where-network-controls-still-matter">Where network controls still matter</h2>
<p>This isn&rsquo;t an argument that network security has become irrelevant — it remains a meaningful additional layer, particularly for defense in depth and for reducing the attack surface an identity-layer compromise can reach. Network policies (in Kubernetes, in VPC security groups) that restrict which services can even attempt to communicate reduce the paths available to an attacker who has compromised one workload, even if IAM would separately block the attempt. The point isn&rsquo;t that network controls are obsolete — it&rsquo;s that they&rsquo;re no longer sufficient on their own, and organizations that invest heavily in network segmentation while leaving IAM broadly permissive are protecting the boundary that matters less while underinvesting in the one that matters more.</p>
<h2 id="where-teams-still-get-the-balance-wrong">Where teams still get the balance wrong</h2>
<p><strong>Treating &ldquo;inside the VPC&rdquo; as equivalent to &ldquo;trusted.&rdquo;</strong> A service reachable only from within a VPC still needs proper authentication and authorization for calls it receives — network placement isn&rsquo;t a substitute for verifying who&rsquo;s calling and what they&rsquo;re allowed to do, since anything else inside that VPC (including a compromised workload) can also reach it.</p>
<p><strong>Investing in network monitoring while IAM policies go unreviewed.</strong> Network traffic monitoring and intrusion detection get regular attention in many security programs, while IAM policy review — auditing for unused, overprivileged, or stale permissions — happens far less consistently, despite IAM misconfiguration being a more direct path to most cloud breaches than a network-layer compromise.</p>
<p><strong>Assuming a well-configured security group compensates for an overprivileged role.</strong> A database with a restrictive security group but a service account holding broad, unscoped permissions to it is still exposed to anything that compromises that service account — the network restriction only helps against threats arriving from an unexpected network path, which is a shrinking fraction of realistic cloud attack scenarios.</p>
<h2 id="the-practical-implication">The practical implication</h2>
<p>Security effort in cloud environments should be weighted toward identity: least-privilege IAM policies, short-lived credentials over static ones, strong authentication for service-to-service calls, and continuous auditing of what every identity can actually do. Network controls remain a legitimate and useful additional layer, but they&rsquo;re the secondary boundary now, not the primary one — and a security program still organized as if the network perimeter is the main line of defense is protecting against yesterday&rsquo;s most common attack path more than today&rsquo;s.</p>
]]></content:encoded></item><item><title>Kubernetes ValidatingAdmissionPolicy: CEL Rules for Registry Allowlists and Memory Limits, with a Warn-First Rollout</title><link>https://firewallsync.com/posts/kubernetes-validatingadmissionpolicy-cel-rules-for-registry-allowlists-and-memory-limits-with-a-warn-first-rollout/</link><guid>https://firewallsync.com/posts/kubernetes-validatingadmissionpolicy-cel-rules-for-registry-allowlists-and-memory-limits-with-a-warn-first-rollout/</guid><pubDate>Sat, 17 Oct 2026 06:05:00 +0000</pubDate><dc:creator>John Marshall</dc:creator><category>Cloud Security</category><description>ValidatingAdmissionPolicy lets the Kubernetes API server enforce custom rules written in CEL, with no webhook to run. This guide shows the policy, binding and parameter model, two worked rules that Pod Security Admission cannot express, and a rollout order that goes from Warn and Audit to Deny.</description><enclosure url="https://firewallsync.com/posts/kubernetes-validatingadmissionpolicy-cel-rules-for-registry-allowlists-and-memory-limits-with-a-warn-first-rollout/cover_hu6289360861179626159.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/kubernetes-validatingadmissionpolicy-cel-rules-for-registry-allowlists-and-memory-limits-with-a-warn-first-rollout/cover_hu6289360861179626159.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/kubernetes-validatingadmissionpolicy-cel-rules-for-registry-allowlists-and-memory-limits-with-a-warn-first-rollout/cover_hu6289360861179626159.jpg" alt="Large architectural floor-plan drawings printed on white paper and spread overlapping across a table" width="1200" height="630"></p><p>Kubernetes has a built-in way to reject a workload for breaking <em>your</em> rules, not just the generic ones: <strong>ValidatingAdmissionPolicy</strong> (VAP). You write a rule such as &ldquo;every container image must start with <code>registry.example.com/</code>&rdquo; in the Common Expression Language (CEL), and the API server evaluates it whenever a matching object is created or updated. There is no webhook server to run, patch or keep available. This guide explains the three resources involved, shows two worked rules, and gives a rollout order that does not break deployments on day one.</p>
<p><strong>Scope.</strong> This is research-based analysis of the Kubernetes documentation pages listed under Sources and verification, read on October 17, 2026 (the site&rsquo;s latest version is v1.37). We did not run a cluster. We did evaluate the CEL expressions below against sample Pod objects with the open-source <code>cel-go</code> library (version 0.32.0), which confirms the logic but is not the Kubernetes API server&rsquo;s own CEL environment. Treat the manifests as untested drafts and try them in a non-production cluster first.</p>
<h2 id="what-vap-is-and-where-it-sits">What VAP is, and where it sits</h2>
<p>The Kubernetes <a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/">Validating Admission Policy page</a> describes validating admission policies as &ldquo;a declarative, in-process alternative to validating admission webhooks&rdquo;, using CEL to declare validation rules. The page marks the feature &ldquo;Stable since Kubernetes v1.30&rdquo;. An <em>admission controller</em> is a component that intercepts API requests after authentication and authorization and before the object is stored; the <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/">admission controllers reference</a> lists <code>ValidatingAdmissionPolicy</code> among the plugins enabled by default in Kubernetes 1.37.</p>
<p>How it compares with the options you may already know:</p>
<table>
  <thead>
      <tr>
          <th></th>
          <th>Pod Security Admission</th>
          <th>ValidatingAdmissionPolicy</th>
          <th>Validating webhook</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Rules</td>
          <td>Three fixed levels</td>
          <td>Your own CEL expressions</td>
          <td>Your own code</td>
      </tr>
      <tr>
          <td>Runs</td>
          <td>In the API server</td>
          <td>In the API server</td>
          <td>In a separate service the API server calls over HTTP</td>
      </tr>
      <tr>
          <td>Can modify the object</td>
          <td>No</td>
          <td>No (validating only; mutation is a separate feature, MutatingAdmissionPolicy)</td>
          <td>No (mutating webhooks are a separate type)</td>
      </tr>
      <tr>
          <td>Best for</td>
          <td>Pod hardening baseline</td>
          <td>Field-level rules on any resource</td>
          <td>Logic CEL cannot express, or external lookups</td>
      </tr>
  </tbody>
</table>
<p>PSA&rsquo;s own documentation points to third-party engines for rules such as registry allowlists; see our <a href="/posts/kubernetes-pod-security-admission-namespace-labels-modes-and-a-safe-rollout-from-warn-to-enforce/">Pod Security Admission guide</a>. VAP is the built-in route for many of those rules.</p>
<h2 id="the-three-resources">The three resources</h2>
<p>Per the docs, a policy generally has three parts:</p>
<ul>
<li><strong>ValidatingAdmissionPolicy</strong>: the abstract logic and the resource types it applies to (<code>matchConstraints</code>).</li>
<li><strong>ValidatingAdmissionPolicyBinding</strong>: links a policy to a scope and chooses what happens on failure (<code>validationActions</code>). &ldquo;At least a ValidatingAdmissionPolicy and a corresponding ValidatingAdmissionPolicyBinding must be defined for a policy to have an effect.&rdquo;</li>
<li><strong>A parameter resource</strong> (optional): a ConfigMap or custom resource that supplies concrete values. The docs&rsquo; example is a <code>ReplicaLimit</code> resource with <code>maxReplicas: 3</code> for test namespaces and another with <code>maxReplicas: 100</code> for the rest, both used by the same policy through two bindings.</li>
</ul>
<p>If you use no parameters, leave <code>spec.paramKind</code> unset.</p>
<h2 id="worked-rule-1-image-registry-allowlist-for-pods">Worked rule 1: image registry allowlist for Pods</h2>
<p><strong>Goal.</strong> Reject Pods in which any container or init container uses an image outside <code>registry.example.com/</code>. The registry name is a placeholder.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">apiVersion</span>: <span style="color:#ae81ff">admissionregistration.k8s.io/v1</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">kind</span>: <span style="color:#ae81ff">ValidatingAdmissionPolicy</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">metadata</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">name</span>: <span style="color:#ae81ff">allowed-registry.example.com</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">spec</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">failurePolicy</span>: <span style="color:#ae81ff">Fail</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">matchConstraints</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">resourceRules</span>:
</span></span><span style="display:flex;"><span>    - <span style="color:#f92672">apiGroups</span>:   [<span style="color:#e6db74">&#34;&#34;</span>]
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">apiVersions</span>: [<span style="color:#e6db74">&#34;v1&#34;</span>]
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">operations</span>:  [<span style="color:#e6db74">&#34;CREATE&#34;</span>, <span style="color:#e6db74">&#34;UPDATE&#34;</span>]
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">resources</span>:   [<span style="color:#e6db74">&#34;pods&#34;</span>]
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">variables</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">allContainers</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">expression</span>: &gt;-<span style="color:#e6db74">
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">      object.spec.containers +
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">      (has(object.spec.initContainers) ? object.spec.initContainers : [])</span>      
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">validations</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">expression</span>: <span style="color:#e6db74">&#34;variables.allContainers.all(c, c.image.startsWith(&#39;registry.example.com/&#39;))&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">messageExpression</span>: &gt;-<span style="color:#e6db74">
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">      &#39;images not from registry.example.com: &#39; +
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">      variables.allContainers.filter(c, !c.image.startsWith(&#39;registry.example.com/&#39;))
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">        .map(c, c.image).join(&#39;, &#39;)</span>      
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">reason</span>: <span style="color:#ae81ff">Forbidden</span>
</span></span></code></pre></div><p>How to read it:</p>
<ul>
<li><code>variables</code> are named sub-expressions, evaluated lazily, that later expressions reference as <code>variables.&lt;name&gt;</code>. The docs recommend them when an expression gets complicated or is reused.</li>
<li><code>has(object.spec.initContainers)</code> guards the optional field. The docs explain that CEL&rsquo;s <code>has()</code> checks whether a field is present before the expression reads it.</li>
<li>The trailing <code>/</code> in the prefix matters. <code>registry.example.com.evil.net/app</code> does not start with <code>registry.example.com/</code>, so a look-alike hostname fails the check. We confirmed this case in our <code>cel-go</code> run.</li>
<li><code>messageExpression</code> builds the denial message from the offending images. Per the docs, if the message expression fails to evaluate, the static <code>message</code> is used instead, and a multi-line result is discarded.</li>
<li><code>reason: Forbidden</code> is one of the four documented values (<code>Unauthorized</code>, <code>Forbidden</code>, <code>Invalid</code>, <code>RequestEntityTooLarge</code>). It sets the machine-readable reason and HTTP status of the first failing validation.</li>
</ul>
<p><strong>Our <code>cel-go</code> results</strong> (sample Pods, expression result): a Pod with only registry-prefixed images, with and without init containers, evaluated <code>true</code>; a Pod using <code>docker.io/library/nginx:1</code> evaluated <code>false</code>; a Pod with a bad image only in an init container evaluated <code>false</code>; the look-alike hostname evaluated <code>false</code>.</p>
<p><strong>What this rule does not cover:</strong></p>
<ul>
<li><em>Ephemeral containers.</em> They are added through a different API subresource that <code>resources: [&quot;pods&quot;]</code> does not match. We did not test how the API server handles them.</li>
<li><em>Digest pinning and signatures.</em> A prefix does not stop someone pushing a malicious image to your own registry. For that, see <a href="/posts/verify-signed-container-images-in-kubernetes-sigstore-policy-controller-keyless-policy-and-rollout/">verifying signed images with policy-controller</a> and <a href="/posts/container-image-scanning-what-ci-pipelines-still-miss/">what image scanning misses</a>.</li>
<li><em>Existing Pods on UPDATE.</em> Because the policy matches <code>UPDATE</code> as well as <code>CREATE</code>, our reading (untested) is that editing an already-running Pod that violates the rule would also be evaluated. Drop <code>UPDATE</code> if you only want to gate new Pods.</li>
</ul>
<h2 id="worked-rule-2-every-container-needs-a-memory-limit">Worked rule 2: every container needs a memory limit</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">apiVersion</span>: <span style="color:#ae81ff">admissionregistration.k8s.io/v1</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">kind</span>: <span style="color:#ae81ff">ValidatingAdmissionPolicy</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">metadata</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">name</span>: <span style="color:#ae81ff">require-memory-limit.example.com</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">spec</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">failurePolicy</span>: <span style="color:#ae81ff">Fail</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">matchConstraints</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">resourceRules</span>:
</span></span><span style="display:flex;"><span>    - <span style="color:#f92672">apiGroups</span>:   [<span style="color:#e6db74">&#34;&#34;</span>]
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">apiVersions</span>: [<span style="color:#e6db74">&#34;v1&#34;</span>]
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">operations</span>:  [<span style="color:#e6db74">&#34;CREATE&#34;</span>]
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">resources</span>:   [<span style="color:#e6db74">&#34;pods&#34;</span>]
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">validations</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">expression</span>: &gt;-<span style="color:#e6db74">
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">      object.spec.containers.all(c,
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">        has(c.resources) &amp;&amp; has(c.resources.limits) &amp;&amp; &#39;memory&#39; in c.resources.limits)</span>      
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">message</span>: <span style="color:#e6db74">&#34;every container must set resources.limits.memory&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">reason</span>: <span style="color:#ae81ff">Invalid</span>
</span></span></code></pre></div><p>The docs&rsquo; advice for maps is to use the <code>in</code> operator to test whether a key exists, which is what <code>'memory' in c.resources.limits</code> does. In our <code>cel-go</code> run, a container with a memory limit evaluated <code>true</code>; one with no <code>resources</code> block and one with only a CPU limit both evaluated <code>false</code>. This rule checks init containers only if you extend it the same way as rule 1. Be aware that a cluster may apply default limits through a LimitRange, in which case Pods may already carry limits by the time admission policies see them. We did not verify the ordering of those two mechanisms, so test this in your own cluster.</p>
<h2 id="bindings-scope-and-actions">Bindings: scope and actions</h2>
<p>A binding says where the policy applies and what a failure does. This one excludes the <code>kube-system</code> namespace and starts in observation mode:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">apiVersion</span>: <span style="color:#ae81ff">admissionregistration.k8s.io/v1</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">kind</span>: <span style="color:#ae81ff">ValidatingAdmissionPolicyBinding</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">metadata</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">name</span>: <span style="color:#ae81ff">allowed-registry-binding.example.com</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">spec</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">policyName</span>: <span style="color:#ae81ff">allowed-registry.example.com</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">validationActions</span>: [<span style="color:#ae81ff">Warn, Audit]</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">matchResources</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">namespaceSelector</span>:
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">matchExpressions</span>:
</span></span><span style="display:flex;"><span>      - <span style="color:#f92672">key</span>: <span style="color:#ae81ff">kubernetes.io/metadata.name</span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">operator</span>: <span style="color:#ae81ff">NotIn</span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">values</span>: [<span style="color:#e6db74">&#34;kube-system&#34;</span>]
</span></span></code></pre></div><p>The Kubernetes <a href="https://kubernetes.io/docs/reference/labels-annotations-taints/">well-known labels page</a> says the API server sets <code>kubernetes.io/metadata.name</code> on all namespaces, with the namespace&rsquo;s name as the value, and that it cannot be changed. That makes it a dependable selector. Whether <code>kube-system</code> should be excluded at all is your call; system components may use images from other registries.</p>
<p>The three actions, per the docs:</p>
<table>
  <thead>
      <tr>
          <th>Action</th>
          <th>What a failure does</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>Deny</code></td>
          <td>The request is rejected</td>
      </tr>
      <tr>
          <td><code>Warn</code></td>
          <td>The request is allowed and the client receives a warning</td>
      </tr>
      <tr>
          <td><code>Audit</code></td>
          <td>The request is allowed and the failure is recorded in the audit event for the request</td>
      </tr>
  </tbody>
</table>
<p>Deny and Warn &ldquo;may not be used together&rdquo;. Deny with Audit is therefore the production end state, and Warn with Audit is the observation state.</p>
<h2 id="what-happens-when-several-policies-or-bindings-apply">What happens when several policies or bindings apply</h2>
<p>For each request, the API server evaluates every matching (policy, binding, parameter) combination, and the request is admitted only if all of them pass. The docs state that a policy may be evaluated several times if multiple bindings match, and that overlapping bindings are allowed. The practical effect: adding a second, stricter binding never loosens an existing one.</p>
<h2 id="failurepolicy-the-setting-that-can-silently-disable-a-rule"><code>failurePolicy</code>: the setting that can silently disable a rule</h2>
<p><code>failurePolicy</code> is set on the policy and governs errors in the policy itself, such as a misconfiguration or a CEL expression that errors at runtime. <code>Fail</code> (the default) rejects the request; <code>Ignore</code> lets it continue. Two consequences:</p>
<ul>
<li>Under <code>Ignore</code>, a broken expression enforces nothing and nobody is told. If you choose <code>Ignore</code> to avoid blocking deployments, watch for errors another way.</li>
<li>Under <code>Fail</code>, a policy that errors on a field you did not guard with <code>has()</code> can block every matching request. This is why the Warn-first rollout below matters.</li>
</ul>
<p>The docs also say a validation that simply evaluates to false is always enforced according to the binding&rsquo;s actions, whatever <code>failurePolicy</code> says.</p>
<h2 id="catch-mistakes-before-they-run">Catch mistakes before they run</h2>
<ul>
<li><strong>Type checking.</strong> When a policy is created or updated, expressions are parsed and syntax errors cause rejection. Referenced fields are then type-checked against the matched resource types, with results in <code>status.typeChecking</code>. Per the docs, type checking does not affect behavior, does not apply to custom resources, skips wildcard matches, and covers at most 10 matched types. Inspect it with <code>kubectl get validatingadmissionpolicy &lt;name&gt; -o yaml</code> after creation.</li>
<li><strong>Cost limits.</strong> The <a href="https://kubernetes.io/docs/reference/using-api/cel/">CEL in Kubernetes page</a> says all expressions run under a runtime cost budget, and that the API server may reject expressions whose worst-case estimated cost is too high when they are written. Deeply nested <code>all</code>/<code>filter</code> loops over large lists are where you would run into this.</li>
<li><strong><code>matchConditions</code></strong> filter requests with CEL before the policy runs. Per the docs, <code>namespaceObject</code> is null in match conditions, so use a <code>namespaceSelector</code> to select by namespace labels. If any match condition is false, the policy is skipped; if a match condition errors and none is false, <code>failurePolicy</code> decides.</li>
</ul>
<h2 id="a-rollout-order">A rollout order</h2>
<p>Our suggested order, built on the documented actions. We have not run it on a cluster.</p>
<ol>
<li><strong>Write the policy and a binding with <code>[Warn, Audit]</code></strong>, scoped to one non-production namespace.</li>
<li><strong>Check <code>status.typeChecking</code></strong> for the policy and fix any warnings.</li>
<li><strong>Apply a known-good and a known-bad manifest</strong> in that namespace and confirm the client sees a warning for the bad one only. Look in the API server audit log for the validation-failure annotation (see the docs&rsquo; <a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/#audit-annotations">audit annotations</a> section). Audit-log availability depends on your cluster&rsquo;s audit policy.</li>
<li><strong>Widen the namespace selector</strong> and let real deployments generate warnings for a period you choose. Fix or exempt what shows up.</li>
<li><strong>Switch the binding to <code>[Deny, Audit]</code></strong>, one namespace group at a time.</li>
<li><strong>Keep the policy in version control.</strong> The docs warn that &ldquo;Validating Admission Policy is part of the cluster control-plane. You should write and deploy them with great caution.&rdquo;</li>
</ol>
<p>One more documented limit: policies created through the REST API cannot intercept ValidatingAdmissionPolicy or binding objects themselves, nor TokenReview-style authentication and authorization review kinds, which are exempt to avoid lock-out. So a user who can edit bindings can switch a policy off; guard that with RBAC.</p>
<h2 id="limits-of-this-article">Limits of this article</h2>
<p>We did not run a Kubernetes cluster. The <code>cel-go</code> check uses generic dynamic types, not Kubernetes&rsquo; typed objects or its CEL environment, so a policy can pass our check and still draw a type-checking warning in a real cluster. We did not test how LimitRange defaults, ephemeral containers or <code>UPDATE</code> operations interact with these rules. Behavior may differ by Kubernetes version and by managed-service provider; the documented feature state is for v1.30 and later.</p>
<h2 id="sources-and-verification">Sources and verification</h2>
<p>Documentation read October 17, 2026. The Validating Admission Policy page shows &ldquo;Last modified September 28, 2026&rdquo;; the CEL page shows August 13, 2026.</p>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>VAP is a declarative, in-process alternative to validating webhooks using CEL; stable since v1.30</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/">Validating Admission Policy</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Policy plus binding required; optional parameter resources; example <code>ReplicaLimit</code> bindings</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/">Validating Admission Policy</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Actions Deny, Warn, Audit; Deny and Warn cannot be combined</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/#validation-actions">Validating Admission Policy: validation actions</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td><code>failurePolicy</code> values Fail (default) and Ignore; failing validations always follow binding actions</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/#failure-policy">Validating Admission Policy: failure policy</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>All matching policy/binding/parameter combinations must pass</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/#parameter-resources">Validating Admission Policy: parameter resources</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td><code>has()</code>, <code>in</code> for map keys; variables; messageExpression behavior; reason values</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/">Validating Admission Policy</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>matchConditions semantics; <code>namespaceObject</code> null in match conditions</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/#matching-requests-matchconditions">Validating Admission Policy: matchConditions</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Type-checking behavior and limits</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/#type-checking">Validating Admission Policy: type checking</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Exempt kinds for REST-created policies</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/#api-kinds-exempt-from-admission-validation">Validating Admission Policy: exempt kinds</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>ValidatingAdmissionPolicy is in the default-enabled plugin list for Kubernetes 1.37</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/">Admission Controllers reference</a></td>
          <td>Qualified: the same page&rsquo;s per-plugin text still mentions v1alpha1 prerequisites; we rely on the default list</td>
      </tr>
      <tr>
          <td>API server sets immutable <code>kubernetes.io/metadata.name</code> label on all namespaces</td>
          <td><a href="https://kubernetes.io/docs/reference/labels-annotations-taints/">Well-Known Labels, Annotations and Taints</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Runtime cost budget; estimated-cost rejection at write time</td>
          <td><a href="https://kubernetes.io/docs/reference/using-api/cel/">CEL in Kubernetes</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>The two example expressions give the stated true/false results on sample Pods</td>
          <td>Our run of <code>cel-go</code> v0.32.0, October 17, 2026</td>
          <td>Qualified: not the Kubernetes CEL environment; not run on a cluster</td>
      </tr>
      <tr>
          <td>Ephemeral containers, LimitRange ordering and UPDATE effects</td>
          <td>Our inference</td>
          <td>Qualified: not tested</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>Kubernetes Pod Security Admission: Namespace Labels, Modes and a Safe Rollout from Warn to Enforce</title><link>https://firewallsync.com/posts/kubernetes-pod-security-admission-namespace-labels-modes-and-a-safe-rollout-from-warn-to-enforce/</link><guid>https://firewallsync.com/posts/kubernetes-pod-security-admission-namespace-labels-modes-and-a-safe-rollout-from-warn-to-enforce/</guid><pubDate>Thu, 15 Oct 2026 06:06:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>Pod Security Admission is the Kubernetes built-in that blocks risky pod settings per namespace. This guide explains the three levels, the three modes, the labels that control them, what it does not cover, and a rollout order that does not break running workloads.</description><enclosure url="https://firewallsync.com/posts/kubernetes-pod-security-admission-namespace-labels-modes-and-a-safe-rollout-from-warn-to-enforce/cover_hu8938934897327753420.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/kubernetes-pod-security-admission-namespace-labels-modes-and-a-safe-rollout-from-warn-to-enforce/cover_hu8938934897327753420.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/kubernetes-pod-security-admission-namespace-labels-modes-and-a-safe-rollout-from-warn-to-enforce/cover_hu8938934897327753420.jpg" alt="A silver combination padlock with a rusty shackle hanging on a black chain-link fence, with a blurred pale background" width="1200" height="630"></p><p>Many Kubernetes clusters run workloads that could mount the host filesystem, share the host network or run as root, simply because nothing told the API server not to allow it. <strong>Pod Security Admission</strong> (PSA) is the built-in answer: a check that runs when a pod is created and compares its settings with a named standard. This guide explains how it works and gives an order of operations that avoids breaking deployments.</p>
<p><strong>Scope.</strong> This is research-based analysis of the official Kubernetes documentation as published for v1.37 on October 15, 2026 (the site&rsquo;s configured latest version). We did not run a cluster for this article; the manifests and commands below are taken from, or built from, the documentation and are untested by us. If you run an older Kubernetes version, read that version&rsquo;s docs: some controls carry version markers, such as host probes, which the docs tag &ldquo;v1.34+&rdquo;.</p>
<h2 id="what-psa-is-and-where-it-sits">What PSA is and where it sits</h2>
<p>The <a href="https://kubernetes.io/docs/concepts/security/pod-security-admission/">Pod Security Admission documentation</a> describes a built-in <em>admission controller</em>, a component that inspects API requests after authentication and authorization and before objects are stored, and enforces the <a href="https://kubernetes.io/docs/concepts/security/pod-security-standards/">Pod Security Standards</a>. Restrictions are applied at the <em>namespace</em> level when pods are created. The <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#podsecurity">admission controllers reference</a> lists it as a validating controller, meaning it can accept or reject a request but not modify it.</p>
<p>Two practical consequences follow:</p>
<ul>
<li>It looks only at the <strong>pod specification</strong>. It does not check which image is running, whether the image is signed (see our guide to <a href="/posts/verify-signed-container-images-in-kubernetes-sigstore-policy-controller-keyless-policy-and-rollout/">verifying signed images with policy-controller</a>), whether the image is vulnerable (<a href="/posts/container-image-scanning-what-ci-pipelines-still-miss/">what scanning misses</a>), or what network and RBAC permissions the pod has.</li>
<li>It offers <strong>three fixed levels and no custom rules</strong>. If you need, for instance, an allowlist of registries, the Kubernetes docs point to third-party tools such as Kubewarden, Kyverno and OPA Gatekeeper, and say that using any of them is better than doing nothing.</li>
</ul>
<h2 id="the-three-levels">The three levels</h2>
<p>The standards are cumulative, from permissive to restrictive:</p>
<table>
  <thead>
      <tr>
          <th>Level</th>
          <th>What the docs say it is for</th>
          <th>Practical meaning</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>privileged</code></td>
          <td>Unrestricted; &ldquo;purposely-open&rdquo;; aimed at system and infrastructure workloads run by privileged, trusted users</td>
          <td>Pods may bypass normal container isolation, for example use the node&rsquo;s host network</td>
      </tr>
      <tr>
          <td><code>baseline</code></td>
          <td>Minimally restrictive; prevents known privilege escalations; allows the default, minimally specified pod</td>
          <td>Blocks, for example, privileged containers, host namespaces (<code>hostNetwork</code>, <code>hostPID</code>, <code>hostIPC</code>), hostPath volumes and added capabilities outside a short allowed list</td>
      </tr>
      <tr>
          <td><code>restricted</code></td>
          <td>Heavily restricted; follows current pod hardening best practices</td>
          <td>Everything in baseline, plus the controls in the next section</td>
      </tr>
  </tbody>
</table>
<h3 id="what-restricted-adds-on-top-of-baseline">What <code>restricted</code> adds on top of baseline</h3>
<p>From the Pod Security Standards page for this version:</p>
<table>
  <thead>
      <tr>
          <th>Control</th>
          <th>Requirement</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Volume types</td>
          <td>Only <code>configMap</code>, <code>csi</code>, <code>downwardAPI</code>, <code>emptyDir</code>, <code>ephemeral</code>, <code>persistentVolumeClaim</code>, <code>projected</code> and <code>secret</code> volumes</td>
      </tr>
      <tr>
          <td>Privilege escalation</td>
          <td><code>allowPrivilegeEscalation</code> must be <code>false</code> (Linux pods only)</td>
      </tr>
      <tr>
          <td>Run as non-root</td>
          <td><code>runAsNonRoot</code> must be <code>true</code> (may be set at pod level)</td>
      </tr>
      <tr>
          <td>Non-root user</td>
          <td><code>runAsUser</code> must not be <code>0</code> (undefined is allowed)</td>
      </tr>
      <tr>
          <td>Seccomp</td>
          <td>Profile type must be set to <code>RuntimeDefault</code> or <code>Localhost</code>; unset and <code>Unconfined</code> are not allowed (Linux pods only)</td>
      </tr>
      <tr>
          <td>Capabilities</td>
          <td>Containers must drop <code>ALL</code>; only <code>NET_BIND_SERVICE</code> may be added back (Linux pods only)</td>
      </tr>
  </tbody>
</table>
<p>Baseline itself also restricts, among other things, <code>hostPort</code> (the built-in controller does not support the docs&rsquo; &ldquo;known list&rdquo; option, so effectively no host ports), the SELinux type and the AppArmor profile type. Read the <a href="https://kubernetes.io/docs/concepts/security/pod-security-standards/">full tables</a> before choosing a level for workloads such as node agents or ingress controllers, which often need exceptions.</p>
<h2 id="the-three-modes-and-the-labels-that-control-them">The three modes and the labels that control them</h2>
<p>A namespace opts in with labels. The <a href="https://kubernetes.io/docs/concepts/security/pod-security-admission/">docs</a> define the modes this way:</p>
<table>
  <thead>
      <tr>
          <th>Mode</th>
          <th>Effect on a violating pod</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>enforce</code></td>
          <td>The pod is rejected</td>
      </tr>
      <tr>
          <td><code>audit</code></td>
          <td>Allowed, but an annotation is added to the event in the <a href="https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/">audit log</a></td>
      </tr>
      <tr>
          <td><code>warn</code></td>
          <td>Allowed, but the user sees a warning</td>
      </tr>
  </tbody>
</table>
<p>For each mode there are two labels:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">pod-security.kubernetes.io/&lt;MODE&gt;</span>: <span style="color:#ae81ff">&lt;LEVEL&gt;         </span> <span style="color:#75715e"># privileged | baseline | restricted</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">pod-security.kubernetes.io/&lt;MODE&gt;-version</span>: <span style="color:#ae81ff">&lt;VERSION&gt;</span> <span style="color:#75715e"># a Kubernetes minor version such as v1.37, or latest</span>
</span></span></code></pre></div><p>A namespace may set any or all modes, at different levels. The version label pins the rules to those that shipped with a given Kubernetes minor version. The docs&rsquo; own example pins to the current version, v1.37. Pinning avoids a surprise when a cluster upgrade tightens a level, while <code>latest</code> always tracks the running version. The docs suggest a useful pattern: keep <code>enforce</code> pinned and set <code>audit</code> and <code>warn</code> to the same level at <code>latest</code>, which surfaces settings that older rules allowed but current best practice does not.</p>
<p>Here is the docs&rsquo; example, which blocks pods failing <code>baseline</code> and warns about, and audits, anything failing <code>restricted</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">apiVersion</span>: <span style="color:#ae81ff">v1</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">kind</span>: <span style="color:#ae81ff">Namespace</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">metadata</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">name</span>: <span style="color:#ae81ff">my-baseline-namespace</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">labels</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">pod-security.kubernetes.io/enforce</span>: <span style="color:#ae81ff">baseline</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">pod-security.kubernetes.io/enforce-version</span>: <span style="color:#ae81ff">v1.37</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">pod-security.kubernetes.io/audit</span>: <span style="color:#ae81ff">restricted</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">pod-security.kubernetes.io/audit-version</span>: <span style="color:#ae81ff">v1.37</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">pod-security.kubernetes.io/warn</span>: <span style="color:#ae81ff">restricted</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">pod-security.kubernetes.io/warn-version</span>: <span style="color:#ae81ff">v1.37</span>
</span></span></code></pre></div><h3 id="unlabeled-namespaces-default-to-privileged">Unlabeled namespaces default to privileged</h3>
<p>This is the most common misunderstanding. The <a href="https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-admission-controller/">admission controller configuration page</a> shows cluster-wide defaults applied &ldquo;when a mode label is not set,&rdquo; and lists <code>privileged</code> as the default level for each mode and <code>latest</code> as the default version. So a namespace with no labels is, by default, unrestricted, unless an administrator changed it. The &ldquo;Enforcing Pod Security Standards&rdquo; page calls namespaces lacking any configuration &ldquo;significant gaps in your cluster security model&rdquo; and suggests treating them as &ldquo;yet to be evaluated.&rdquo;</p>
<p>Cluster defaults and exemptions are set through an <code>AdmissionConfiguration</code> file passed to the API server with <code>--admission-control-config-file</code>. On managed Kubernetes services you may not control API server flags; we did not check any provider&rsquo;s options.</p>
<h2 id="pods-versus-deployments-where-enforcement-happens">Pods versus Deployments: where enforcement happens</h2>
<p>Pods are usually created indirectly, by a controller acting on a Deployment or Job template. The docs state that audit and warn modes apply to those workload resources too, &ldquo;to help catch violations early,&rdquo; but that <strong>enforce mode is not applied to workload resources, only to the resulting pod objects</strong>.</p>
<p>Our reading, which we have not tested: a Deployment that violates an enforced level can be accepted by the API server while its pods are then refused, so the failure appears as missing pods rather than a rejected <code>kubectl apply</code>. If you see a Deployment with zero ready replicas after labeling a namespace, look at the events on its ReplicaSet. Having <code>warn</code> set at the same level gives the person applying the manifest an immediate message.</p>
<h2 id="exemptions-and-the-one-that-backfires">Exemptions, and the one that backfires</h2>
<p>PSA can skip checks by exempting usernames, runtime class names or entire namespaces. Exempted requests are ignored entirely, with all three modes skipped. The documentation adds a caution: most pods are created by controllers, so exempting an end user exempts them only when creating pods directly, not when creating workload resources; and controller service accounts such as <code>system:serviceaccount:kube-system:replicaset-controller</code> &ldquo;should generally not be exempted,&rdquo; because that would implicitly exempt anyone who can create the corresponding workload.</p>
<p>Separately, updates that change only certain fields are not rechecked, so an already-running violating pod can still receive those updates: metadata changes (except seccomp or AppArmor annotations), valid updates to <code>.spec.activeDeadlineSeconds</code>, and valid updates to <code>.spec.tolerations</code>.</p>
<h2 id="a-rollout-that-follows-the-kubernetes-guidance">A rollout that follows the Kubernetes guidance</h2>
<p>Apply this order, adapted from the <a href="https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-namespace-labels/">namespace labels task</a> and the <a href="https://kubernetes.io/docs/setup/best-practices/enforcing-pod-security-standards/">enforcement best practices</a>:</p>
<ol>
<li><strong>Inventory.</strong> Find namespaces with no <code>enforce</code> label (the docs&rsquo; command):
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>kubectl get namespaces --selector<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;!pod-security.kubernetes.io/enforce&#39;</span>
</span></span></code></pre></div></li>
<li><strong>Turn on visibility, not blocking.</strong> The docs&rsquo; suggested first step for all namespaces:
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>kubectl label --overwrite ns --all <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>  pod-security.kubernetes.io/audit<span style="color:#f92672">=</span>baseline <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>  pod-security.kubernetes.io/warn<span style="color:#f92672">=</span>baseline
</span></span></code></pre></div>The docs deliberately leave <code>enforce</code> unset so that unevaluated namespaces remain distinguishable. Collect the warnings and audit annotations, then set the target level per namespace. In the docs&rsquo; words: &ldquo;set to the desired level and version you would eventually like to enforce.&rdquo;</li>
<li><strong>Dry-run the enforce label.</strong> The docs&rsquo; server-side dry run shows how the new level would treat existing pods without changing anything:
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>kubectl label --dry-run<span style="color:#f92672">=</span>server --overwrite ns --all <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>  pod-security.kubernetes.io/enforce<span style="color:#f92672">=</span>baseline
</span></span></code></pre></div>The docs note that when an enforce label is added or changed, the admission plugin tests every pod in the namespace and returns violations as warnings.</li>
<li><strong>Enforce namespace by namespace</strong>, pinned to a version:
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>kubectl label --overwrite ns my-existing-namespace <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>  pod-security.kubernetes.io/enforce<span style="color:#f92672">=</span>restricted <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>  pod-security.kubernetes.io/enforce-version<span style="color:#f92672">=</span>v1.37
</span></span></code></pre></div></li>
<li><strong>Keep <code>warn</code> and <code>audit</code> on</strong> at the same level as enforce so authors get feedback.</li>
<li><strong>Put privileged workloads in their own namespaces</strong> and document why, as the docs advise: namespaces allowing <code>privileged</code> workloads &ldquo;should establish and enforce appropriate access controls.&rdquo;</li>
</ol>
<p>Also consider monitoring. The kube-apiserver exposes <code>pod_security_evaluations_total</code>, <code>pod_security_exemptions_total</code> and <code>pod_security_errors_total</code>. The docs warn that non-fatal evaluation errors &ldquo;may result in the latest restricted profile being used for enforcement,&rdquo; so a rise in errors is worth an alert.</p>
<h2 id="an-example-pod-that-should-satisfy-restricted">An example pod that should satisfy <code>restricted</code></h2>
<p>We built this from the controls above; we have not run it against a cluster. The image name is a placeholder, and your image must really be able to run as a non-root user, otherwise the container will start and then fail.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">apiVersion</span>: <span style="color:#ae81ff">v1</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">kind</span>: <span style="color:#ae81ff">Pod</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">metadata</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">name</span>: <span style="color:#ae81ff">restricted-example</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">spec</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">securityContext</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">runAsNonRoot</span>: <span style="color:#66d9ef">true</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">seccompProfile</span>:
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">type</span>: <span style="color:#ae81ff">RuntimeDefault</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">containers</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">app</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">image</span>: <span style="color:#ae81ff">registry.example.com/team/app:1.0.0  </span> <span style="color:#75715e"># placeholder</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">securityContext</span>:
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">allowPrivilegeEscalation</span>: <span style="color:#66d9ef">false</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">capabilities</span>:
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">drop</span>: [<span style="color:#e6db74">&#34;ALL&#34;</span>]
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">volumeMounts</span>:
</span></span><span style="display:flex;"><span>    - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">tmp</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">mountPath</span>: <span style="color:#ae81ff">/tmp</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">volumes</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">name</span>: <span style="color:#ae81ff">tmp</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">emptyDir</span>: {}
</span></span></code></pre></div><p>Check against the table: <code>emptyDir</code> is an allowed volume type; <code>allowPrivilegeEscalation</code> is <code>false</code>; <code>runAsNonRoot</code> is <code>true</code> at pod level, which the docs permit in place of per-container values; seccomp is <code>RuntimeDefault</code> at pod level; <code>ALL</code> capabilities are dropped and none are added. The usual failure causes when you move an existing workload to <code>restricted</code> are a missing seccomp profile, a missing <code>drop: [&quot;ALL&quot;]</code>, an image whose default user is root, and a volume type outside the allowed list such as <code>hostPath</code>.</p>
<h2 id="where-psa-is-not-enough">Where PSA is not enough</h2>
<ul>
<li><strong>Windows pods.</strong> Several restricted controls (privilege escalation, seccomp, Linux capabilities) apply only when <code>spec.os.name</code> is not <code>windows</code>, and the docs warn that clusters containing nodes older than v1.24 should pin restricted policies to a version before v1.25.</li>
<li><strong>Policy beyond pod fields.</strong> Registry allowlists, required labels, resource limits and image signatures need another policy engine.</li>
<li><strong>Pods that need privilege.</strong> Node-level agents and some storage or networking components legitimately need <code>privileged</code>; isolate them rather than weakening everything.</li>
<li><strong>Detection.</strong> PSA reduces what can be created; it does not tell you what already runs. Pair it with the practices in our <a href="/posts/cloud-misconfiguration-checklists-dont-work-heres-what-does/">cloud misconfiguration guide</a> and identity hygiene from <a href="/posts/least-privilege-access-controls-that-dont-slow-teams-down/">least privilege without slowing teams</a>.</li>
</ul>
<h2 id="limits-of-this-article">Limits of this article</h2>
<p>We did not run any of the commands or manifests. We read the Kubernetes documentation source for the v1.37 site on October 15, 2026; older and newer versions may differ, and we did not check any managed Kubernetes provider&rsquo;s behavior. The statement about where enforce failures surface for Deployments is our inference from the documented scope of enforce mode.</p>
<h2 id="sources-and-verification">Sources and verification</h2>
<p>Checked on October 15, 2026, against the Kubernetes documentation source (kubernetes/website, main branch; site latest version v1.37).</p>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>PSA enforces Pod Security Standards per namespace at pod creation; stable v1.25; levels; modes and labels; version label; workload-resource behavior; exemptions and caution; field-update exemptions; metrics</td>
          <td><a href="https://kubernetes.io/docs/concepts/security/pod-security-admission/">Pod Security Admission</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Level definitions; baseline and restricted controls; Windows/OS-specific controls; alternatives (Kubewarden, Kyverno, OPA Gatekeeper)</td>
          <td><a href="https://kubernetes.io/docs/concepts/security/pod-security-standards/">Pod Security Standards</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Example labels, <code>kubectl</code> commands, enforce-label warning behavior, dry run</td>
          <td><a href="https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-namespace-labels/">Enforce Pod Security Standards with Namespace Labels</a></td>
          <td>Verified; commands not run by us</td>
      </tr>
      <tr>
          <td>Default level privileged and version latest; AdmissionConfiguration; <code>--admission-control-config-file</code>; beta in v1.23, GA from v1.25</td>
          <td><a href="https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-admission-controller/">Enforce Pod Security Standards by Configuring the Built-in Admission Controller</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Unlabeled namespaces as gaps; multi-mode strategy; least privilege; intent to replace PodSecurityPolicies</td>
          <td><a href="https://kubernetes.io/docs/setup/best-practices/enforcing-pod-security-standards/">Enforcing Pod Security Standards</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>PSA is a validating admission controller</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#podsecurity">Admission Controllers reference</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Existing running pods are not terminated by an enforce label</td>
          <td>Inferred from &ldquo;applied when pods are created&rdquo; and the warning behavior</td>
          <td>Qualified: not tested</td>
      </tr>
      <tr>
          <td>Failure for Deployments shows as missing pods / ReplicaSet events</td>
          <td>Our inference from documented enforce scope</td>
          <td>Qualified: not tested</td>
      </tr>
      <tr>
          <td>Example restricted pod compliance</td>
          <td>Our check against the restricted control table</td>
          <td>Qualified: not run on a cluster</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>Verify Signed Container Images in Kubernetes with Sigstore policy-controller: Keyless Policy and Safe Rollout</title><link>https://firewallsync.com/posts/verify-signed-container-images-in-kubernetes-sigstore-policy-controller-keyless-policy-and-rollout/</link><guid>https://firewallsync.com/posts/verify-signed-container-images-in-kubernetes-sigstore-policy-controller-keyless-policy-and-rollout/</guid><pubDate>Wed, 14 Oct 2026 06:08:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>Signing images only helps if something refuses the unsigned ones. This guide covers Sigstore's policy-controller admission webhook: opting namespaces in, writing a ClusterImagePolicy that pins a GitHub Actions workflow identity, rolling out in warn mode, and the failure-policy trade-off the Helm chart defaults create.</description><enclosure url="https://firewallsync.com/posts/verify-signed-container-images-in-kubernetes-sigstore-policy-controller-keyless-policy-and-rollout/cover_hu540727492569119796.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/verify-signed-container-images-in-kubernetes-sigstore-policy-controller-keyless-policy-and-rollout/cover_hu540727492569119796.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/verify-signed-container-images-in-kubernetes-sigstore-policy-controller-keyless-policy-and-rollout/cover_hu540727492569119796.jpg" alt="A row of gray metal fare gates with orange tops and green lights at a station entrance, with a blue sign in Chinese characters and an arrow, a wall monitor, and glass barriers to the right" width="1200" height="630"></p><p>If your CI pipeline signs container images but your cluster will pull anything, the signatures protect nothing. The enforcement step is an admission controller that checks each image before Kubernetes starts it. <strong>Sigstore policy-controller</strong> is one such controller, built to verify signatures and attestations created with cosign (Sigstore&rsquo;s signing tool). This guide explains how it decides, how to write a keyless policy pinned to a specific GitHub Actions workflow, and how to roll it out without locking yourself out of your own cluster.</p>
<p>This is a follow-up to our article on <a href="/posts/cosign-container-image-signing-keyless-signing-in-ci-and-why-verification-must-pin-an-identity/">signing images with cosign and why verification must pin an identity</a>. We read the Sigstore policy-controller documentation, its README and Helm chart files, Sigstore&rsquo;s CI quickstart, GitHub&rsquo;s OIDC documentation and Kubernetes&rsquo; admission webhook documentation on October 14, 2026. We did not install policy-controller or run any manifest below, so this is research-based explanation, not tested configuration. Placeholders in angle brackets are for you to fill in.</p>
<h2 id="the-short-answer">The short answer</h2>
<p>Install policy-controller, label the namespaces you want checked, and create a <code>ClusterImagePolicy</code> that names the image patterns to check and the identities allowed to have signed them. Start in <code>warn</code> mode, decide what happens to images that match no policy, and give the webhook more than one replica before you switch any production namespace to enforcement, because the chart&rsquo;s default failure policy rejects requests when the webhook is unreachable.</p>
<h2 id="what-an-admission-controller-does-here">What an admission controller does here</h2>
<p>A Kubernetes admission webhook is an HTTPS service the API server calls when matching requests arrive, such as creating or updating a Deployment. A validating webhook can reject the request. Policy-controller&rsquo;s overview describes it as an admission controller that enforces policy using verifiable supply-chain metadata from cosign, and says it can validate signatures and attestations on container images and apply policies written in CUE or Rego against attestations. The same page notes the component is &ldquo;still actively under development.&rdquo;</p>
<p>Two details from the documentation shape everything else:</p>
<ul>
<li><strong>It matches by digest.</strong> Image patterns are matched against image digests, and the controller resolves tags to digests so the running image matches what was admitted. A tag like <code>:1.4</code> can move; a digest cannot.</li>
<li><strong>It is opt-in per namespace.</strong> Out of the box, only namespaces labelled <code>policy.sigstore.dev/include: &quot;true&quot;</code> are validated.</li>
</ul>
<h2 id="install-and-opt-in">Install and opt in</h2>
<p>The installation page lists these steps, with Helm v3 and a cluster you can reach with <code>kubectl</code> as prerequisites:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>helm repo add sigstore https://sigstore.github.io/helm-charts
</span></span><span style="display:flex;"><span>helm repo update
</span></span><span style="display:flex;"><span>kubectl create namespace cosign-system
</span></span><span style="display:flex;"><span>helm install policy-controller -n cosign-system sigstore/policy-controller
</span></span><span style="display:flex;"><span>kubectl get pods -n cosign-system
</span></span></code></pre></div><p>Then opt a namespace in, using the example command from the overview page:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>kubectl label namespace &lt;my-namespace&gt; policy.sigstore.dev/include<span style="color:#f92672">=</span>true
</span></span></code></pre></div><p>The documentation does not give a minimum Kubernetes version. Pin the chart and image versions you deploy rather than relying on a floating install. When we read the chart&rsquo;s <code>Chart.yaml</code> on its main branch, it listed chart version 0.10.8 with <code>appVersion</code> 0.13.1, while the project&rsquo;s releases page listed v0.15.1 as the latest release and described v0.15.0 as upgrading cosign from v2 to v3. The release page shows dates without a year, so we do not date those releases. The practical point: check which controller version a chart install actually gives you, and read the release notes for cosign-version changes before you upgrade.</p>
<h2 id="write-a-keyless-policy-pinned-to-one-workflow">Write a keyless policy pinned to one workflow</h2>
<p>Policy-controller&rsquo;s documented structure is:</p>
<ul>
<li><code>spec.images</code>: a list of <code>glob</code> patterns for the images the policy covers. Hosts default to <code>index.docker.io</code> and single-name images to <code>library</code>.</li>
<li><code>spec.authorities</code>: ways an image can pass. An authority is a <code>key</code> (public key, secret reference or KMS URI), a <code>keyless</code> block with Fulcio details and <code>identities</code>, or <code>static</code>, which passes or fails without checking a signature.</li>
<li><code>spec.mode</code>: set to <code>warn</code> to admit non-compliant images with a warning.</li>
<li><code>spec.match</code>: optionally limits the policy to resource kinds such as <code>deployments</code> or <code>jobs</code>.</li>
</ul>
<p>For images signed by a GitHub Actions workflow with cosign keyless signing, the identity to pin has two parts. The issuer is the OIDC (OpenID Connect) token issuer, <code>https://token.actions.githubusercontent.com</code>, which GitHub&rsquo;s documentation lists. The subject is the signer identity in the certificate; Sigstore&rsquo;s CI quickstart shows it as <code>https://github.com/USERNAME/REPOSITORY_NAME/.github/workflows/WORKFLOW_NAME@refs/heads/BRANCH_NAME</code>.</p>
<p>A policy for images from your organization, accepting only the release workflow on version tags, would look like this, built from the documented fields:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#f92672">apiVersion</span>: <span style="color:#ae81ff">policy.sigstore.dev/v1beta1</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">kind</span>: <span style="color:#ae81ff">ClusterImagePolicy</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">metadata</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">name</span>: <span style="color:#ae81ff">require-release-workflow-signature</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">spec</span>:
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">mode</span>: <span style="color:#ae81ff">warn</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">images</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">glob</span>: <span style="color:#e6db74">&#34;ghcr.io/&lt;org&gt;/**&#34;</span>
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">authorities</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">keyless</span>:
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">identities</span>:
</span></span><span style="display:flex;"><span>      - <span style="color:#f92672">issuer</span>: <span style="color:#ae81ff">https://token.actions.githubusercontent.com</span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">subjectRegExp</span>: <span style="color:#ae81ff">https://github\.com/&lt;org&gt;/[^/]+/\.github/workflows/release\.yml@refs/tags/v.+</span>
</span></span></code></pre></div><p>We have not applied this manifest. Before relying on it, test it with the project&rsquo;s <code>policy-tester</code> tool, which the README describes as checking a ClusterImagePolicy against an image. We also did not confirm whether the controller anchors regular expressions to the whole string or what Fulcio URL it uses when <code>url</code> is omitted, so check both for your version.</p>
<h3 id="a-caution-about-the-documentations-own-regular-expression-example">A caution about the documentation&rsquo;s own regular-expression example</h3>
<p>The overview page&rsquo;s GitHub Actions example uses this value for <code>subjectRegExp</code>:</p>
<pre tabindex="0"><code>https://github.com/mycompany/*/.github/workflows/*@*
</code></pre><p>Read as a regular expression, <code>*</code> repeats the preceding character instead of acting as a wildcard, and an unescaped <code>.</code> matches any character. We tested that string with Python&rsquo;s <code>re</code> module (the meanings of <code>.</code> and <code>*</code> are the same in Go&rsquo;s regular-expression syntax, but we did not run policy-controller itself). It did not match <code>https://github.com/mycompany/app/.github/workflows/build.yml@refs/heads/main</code>, and it did match the odd string <code>https://github.com/mycompany/.github/workflows@</code>. The example is probably shorthand, but copying it literally would either match nothing you intended or match things you did not. Write the expression the way the policy above does: escape dots, use <code>[^/]+</code> for one path segment, and name the workflow file and ref pattern you actually trust. We verified our own expression against three strings in Python: it matched a <code>release.yml</code> tag-ref identity under <code>mycompany/app</code>, and rejected both a branch-ref identity and a look-alike owner <code>mycompanyx</code>.</p>
<h2 id="how-policies-combine-and-the-traps">How policies combine, and the traps</h2>
<p>The overview says: every matching <code>ClusterImagePolicy</code> must pass, and within one policy any passing authority is enough.</p>
<ul>
<li><strong>Adding a second authority loosens a policy.</strong> If one authority pins your release workflow and another accepts any signature from a public issuer, the second one wins. Keep authorities that mean the same trust level together and put different trust levels in different policies.</li>
<li><strong><code>static</code> authorities skip verification.</strong> <code>action: pass</code> passes images with no signature check at all. Use only deliberately.</li>
<li><strong>Overlapping globs stack.</strong> An image matching two policies must satisfy both.</li>
</ul>
<h3 id="decide-the-no-match-behavior-first">Decide the no-match behavior first</h3>
<p>Per the overview, an image that matches no policy is rejected unless the <code>config-policy-controller</code> ConfigMap in the release namespace sets <code>no-match-policy</code> to <code>warn</code>, <code>allow</code> or <code>deny</code>. With only your own registry covered by a policy, every third-party image, such as a sidecar or a base-image-derived job, in an opted-in namespace is a &ldquo;no match&rdquo;. Choose between listing those registries in policies (with their own authorities), or setting <code>no-match-policy</code> explicitly. Release v0.15.0 notes say image references are now logged when no-match-policy is <code>warn</code> or <code>deny</code>, which helps you find what you forgot.</p>
<h2 id="rolling-out-without-an-outage">Rolling out without an outage</h2>
<ol>
<li><strong>Run <code>policy-tester</code> against your real images</strong> from CI, before touching the cluster.</li>
<li><strong>Label one non-critical namespace</strong> and set <code>mode: warn</code>. Deploy normally and collect the warnings.</li>
<li><strong>Set <code>no-match-policy: warn</code></strong> for the pilot so third-party images surface as warnings, not failures.</li>
<li><strong>Fix identities you did not expect.</strong> A warning on an image you thought was signed usually means the signing workflow or ref differs from your pattern.</li>
<li><strong>Switch the policy to enforce</strong> (remove <code>mode: warn</code>, since by default an unsatisfied policy blocks admission) for that namespace only, then widen.</li>
</ol>
<h3 id="the-webhook-is-now-in-your-deployment-path">The webhook is now in your deployment path</h3>
<p>The Kubernetes documentation says <code>failurePolicy</code> controls what happens when calling the webhook fails: <code>Fail</code> means an error calling the webhook causes admission to fail and the request is rejected, <code>Ignore</code> lets the request continue; <code>Fail</code> is the default. Network errors, timeouts and bad responses are among the errors it covers. The timeout can be set between 1 and 30 seconds.</p>
<p>The policy-controller Helm chart&rsquo;s <code>values.yaml</code> on its main branch, which we read on October 14, 2026, sets <code>webhook.failurePolicy: Fail</code> and <code>webhook.replicaCount: 1</code>. We did not check which of the chart&rsquo;s webhook configurations that value feeds. Put together, and as our analysis rather than a tested result: a single webhook pod that is rescheduled, OOM-killed or unreachable could cause creates and updates in opted-in namespaces to be rejected until it returns. The opt-in label limits the blast radius to those namespaces, which is a reason to start small and to keep critical namespaces out until you have run the failure case in a test cluster: scale the webhook to zero and see what breaks. Raising the replica count is a chart value; whether you prefer fail-closed (safer against unsigned images, riskier for availability) or fail-open (the reverse) is a decision for your threat model, not a default to accept unread.</p>
<h2 id="what-this-does-not-prove">What this does not prove</h2>
<ul>
<li><strong>A signature is not a vulnerability assessment.</strong> It shows which identity produced an image, not that the image is free of flaws. See our article on <a href="/posts/container-image-scanning-what-ci-pipelines-still-miss/">what scanning still misses</a>.</li>
<li><strong>It checks requests, not running pods.</strong> We found nothing in the documentation about re-verifying workloads that are already running.</li>
<li><strong>Identity pins are only as good as your CI.</strong> If an attacker can get a malicious change into the pinned workflow on the pinned ref, the signature will be valid. Pair this with locked-down workflow permissions and provenance checks from <a href="/posts/slsa-build-levels-and-provenance-attestations-what-they-prove-and-what-they-dont/">SLSA attestations</a>.</li>
<li><strong>Documentation gaps remain.</strong> The installation page does not describe webhook failure behavior, and the overview describes the project as under active development; check the release notes of the version you run.</li>
</ul>
<h2 id="sources-and-verification">Sources and verification</h2>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>policy-controller validates cosign signatures and attestations; opt-in label policy.sigstore.dev/include; every matching policy must pass and any authority within one suffices; no-match-policy values and default rejection; ClusterImagePolicy fields; warn mode; tag-to-digest resolution; &ldquo;still actively under development&rdquo;</td>
          <td><a href="https://docs.sigstore.dev/policy-controller/overview/">Sigstore: Policy Controller overview</a></td>
          <td>Verified: read October 14, 2026; project under active development</td>
      </tr>
      <tr>
          <td>Helm install commands; prerequisites; no minimum Kubernetes version stated; webhook failure behavior not described</td>
          <td><a href="https://docs.sigstore.dev/policy-controller/installation/">Sigstore: policy-controller installation</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>policy-tester tool description</td>
          <td><a href="https://github.com/sigstore/policy-controller/blob/main/README.md">policy-controller README</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>v0.15.0 upgraded cosign v2 to v3 and logs image references under warn or deny no-match-policy; v0.15.1 latest listed</td>
          <td><a href="https://github.com/sigstore/policy-controller/releases">policy-controller releases</a></td>
          <td>Qualified: page lists dates without a year; read October 14, 2026</td>
      </tr>
      <tr>
          <td>Chart main branch: chart 0.10.8, appVersion 0.13.1; webhook.failurePolicy Fail; replicaCount 1</td>
          <td><a href="https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/Chart.yaml">Chart.yaml</a> and <a href="https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/values.yaml">values.yaml</a></td>
          <td>Qualified: main branch at time of reading; which webhook the value feeds not checked</td>
      </tr>
      <tr>
          <td>failurePolicy semantics, Fail as default, timeout 1 to 30 seconds</td>
          <td><a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/">Kubernetes: dynamic admission control</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>GitHub Actions OIDC issuer URL</td>
          <td><a href="https://docs.github.com/en/actions/reference/security/oidc">GitHub Docs: OIDC reference</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>GitHub workflow signer identity format and verify flags</td>
          <td><a href="https://docs.sigstore.dev/quickstart/quickstart-ci/">Sigstore: CI quickstart</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Docs example subjectRegExp does not match a typical repository path when read as a regular expression</td>
          <td>Our test in Python&rsquo;s re module</td>
          <td>Qualified: not run in policy-controller; Go regexp syntax for these characters is the same</td>
      </tr>
      <tr>
          <td>Example policy and rollout order</td>
          <td>Our analysis</td>
          <td>Qualified: untested; editorial judgment</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>How to Find Overprivileged AWS IAM Users and Roles</title><link>https://firewallsync.com/posts/how-to-find-overprivileged-aws-iam-users-and-roles/</link><guid>https://firewallsync.com/posts/how-to-find-overprivileged-aws-iam-users-and-roles/</guid><pubDate>Sat, 10 Oct 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>Overprivileged IAM identities aren't usually the result of one bad decision. They're the accumulated residue of a hundred small, reasonable-seeming ones. Here's how to actually find them.</description><enclosure url="https://firewallsync.com/posts/how-to-find-overprivileged-aws-iam-users-and-roles/cover_hu18280299811781223229.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/how-to-find-overprivileged-aws-iam-users-and-roles/cover_hu18280299811781223229.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/how-to-find-overprivileged-aws-iam-users-and-roles/cover_hu18280299811781223229.jpg" alt="Rows of server racks in a data center" width="1200" height="630"></p><p>Overprivileged IAM identities rarely come from one obviously bad decision. They come from a hundred individually reasonable ones — a broad policy attached during setup, a permission added to unblock a deploy, a role copied from a template that itself was never trimmed. The result is an environment where almost every identity has more access than it uses, and nobody can say with confidence which ones without checking.</p>
<h2 id="start-with-whats-provably-unused-not-what-looks-risky">Start with what&rsquo;s provably unused, not what looks risky</h2>
<p>Guessing which roles are overprivileged by reading policy documents doesn&rsquo;t scale and misses the point — a policy can look reasonable on paper and still grant access nothing has touched in a year. IAM Access Analyzer&rsquo;s unused access findings are built for exactly this: it surfaces unused roles, unused access keys, unused passwords, and — most usefully — the specific unused services and actions within an otherwise-active identity&rsquo;s policy, based on real activity data rather than a manual read of the JSON.</p>
<p>This reframes the question from &ldquo;does this policy look too broad&rdquo; to &ldquo;what has this identity actually never used,&rdquo; which is both more concrete and harder to argue with when you bring findings to a team that owns the resource.</p>
<h2 id="cross-reference-with-cloudtrail-for-the-identities-access-analyzer-wont-fully-cover">Cross-reference with CloudTrail for the identities Access Analyzer won&rsquo;t fully cover</h2>
<p>Access Analyzer&rsquo;s unused-access findings are strong for standing IAM users and roles but won&rsquo;t capture every nuance of activity, especially for identities used inconsistently or through cross-account access patterns. For those, CloudTrail&rsquo;s event history lets you query what a specific principal has actually called over a given window — filtering by user identity ARN and looking at the distinct set of API actions invoked is a direct way to compare &ldquo;granted&rdquo; against &ldquo;used&rdquo; for any identity you&rsquo;re specifically concerned about.</p>
<h2 id="compare-against-role-purpose-not-just-activity">Compare against role purpose, not just activity</h2>
<p>An identity can be actively using every permission it has and still be overprivileged, if the permissions it&rsquo;s using go beyond what its actual job requires. This shows up most often in service roles: a Lambda function that only needs to read from one S3 bucket but was granted broad <code>s3:*</code> access because it was faster to configure. Activity-based tooling won&rsquo;t flag this, because the access is being used — just more broadly than necessary. This requires pairing the automated findings with a manual pass asking &ldquo;does this identity&rsquo;s actual function justify this scope,&rdquo; particularly for any role with wildcard resources or actions.</p>
<h2 id="prioritize-by-blast-radius-not-by-count">Prioritize by blast radius, not by count</h2>
<p>Once you have a list of overprivileged identities, tackling them in the order you found them wastes effort on low-stakes fixes while high-risk ones wait. Rank by what the identity could do if compromised, not by how many unused permissions it has — a role with three unused but highly sensitive permissions (like <code>iam:CreateUser</code> or <code>kms:Decrypt</code> on a broad key set) deserves attention before a role with twenty unused but low-impact ones.</p>
<h2 id="a-practical-checklist">A practical checklist</h2>
<ul>
<li>Run IAM Access Analyzer&rsquo;s unused access analysis across every account, not just production</li>
<li>Query CloudTrail directly for any identity Access Analyzer&rsquo;s findings don&rsquo;t fully cover</li>
<li>Cross-check active-but-broad permissions against the identity&rsquo;s actual functional purpose, not just usage data</li>
<li>Rank remediation by potential blast radius, not by finding volume</li>
<li>Treat any identity with wildcard actions or resources as a priority review, regardless of what usage data shows</li>
</ul>
<p>Finding overprivileged identities is a data problem before it&rsquo;s a policy-writing problem. The tooling to answer &ldquo;what&rsquo;s actually being used&rdquo; already exists in most AWS accounts — the gap is usually that nobody&rsquo;s running it on a recurring basis, not that the answer is hard to get.</p>
]]></content:encoded></item><item><title>AWS IAM Least Privilege: A Practical Guide to Finding Excess Permissions</title><link>https://firewallsync.com/posts/aws-iam-least-privilege-a-practical-guide-to-finding-excess-permissions/</link><guid>https://firewallsync.com/posts/aws-iam-least-privilege-a-practical-guide-to-finding-excess-permissions/</guid><pubDate>Fri, 09 Oct 2026 05:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>Least privilege fails in practice because most teams have no visibility into which granted permissions are actually used. Here's how to find the gap and close it without breaking production.</description><enclosure url="https://firewallsync.com/posts/aws-iam-least-privilege-a-practical-guide-to-finding-excess-permissions/cover_hu925019013742310432.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/aws-iam-least-privilege-a-practical-guide-to-finding-excess-permissions/cover_hu925019013742310432.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/aws-iam-least-privilege-a-practical-guide-to-finding-excess-permissions/cover_hu925019013742310432.jpg" alt="Server racks behind mesh doors with orange and teal network cables and green status lights" width="1200" height="630"></p><p>Least privilege fails in practice for a simple reason: granting permissions is a one-time decision made under uncertainty, and revoking them requires confidence that nothing will break. Most teams grant broadly upfront because they don&rsquo;t know exactly what a role will need, and then never revisit it, because finding out what&rsquo;s actually being used requires visibility that doesn&rsquo;t exist by default.</p>
<h2 id="why-permissions-accumulate">Why permissions accumulate</h2>
<p>Roles and users rarely lose permissions once granted. Common patterns:</p>
<ul>
<li>A role gets <code>AdministratorAccess</code> or a broad managed policy during initial setup &ldquo;to unblock things,&rdquo; with a plan to tighten it later that never happens</li>
<li>A permission was needed for a one-time migration or debugging session and was never removed afterward</li>
<li>A service&rsquo;s responsibilities changed, but its IAM policy was never updated to match — it still holds access relevant to what it used to do</li>
<li>Permissions get copied from an existing role as a starting template, inheriting whatever excess that role had accumulated</li>
</ul>
<p>None of these are unusual mistakes. They&rsquo;re the predictable result of granting being cheap and auditing being expensive, unless you have tooling that makes the audit cheap too.</p>
<h2 id="finding-unused-access-with-iam-access-analyzer">Finding unused access with IAM Access Analyzer</h2>
<p>AWS IAM Access Analyzer&rsquo;s unused access analysis is built specifically for this problem. Once enabled, it continuously analyzes accounts and surfaces:</p>
<ul>
<li>Unused IAM roles</li>
<li>Unused access keys on IAM users</li>
<li>Unused passwords on IAM users</li>
<li>For active roles and users, specific unused services and actions within their attached policies</li>
</ul>
<p>This last category is the one that matters most for least privilege work — it doesn&rsquo;t just tell you a role exists and might be over-permissioned in theory, it tells you which specific granted permissions haven&rsquo;t actually been exercised, based on real access activity. Findings consolidate into a centralized dashboard, so security teams can prioritize accounts by finding volume instead of manually reviewing every policy by hand.</p>
<p>Two details from AWS&rsquo;s documentation that change how you plan this work. First, the unused access analyzer has a configurable tracking period of 1 to 365 days, and it only evaluates entities that have existed for the whole period (<a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-create-unused.html">AWS docs: create an unused access analyzer</a>). Second, unused access analysis is a paid feature billed per IAM role or user analyzed per month, unlike external access findings, which are free (<a href="https://aws.amazon.com/iam/access-analyzer/pricing">AWS pricing page</a>). Check the pricing page for the current rate in your region.</p>
<h2 id="turning-findings-into-safe-policy-changes">Turning findings into safe policy changes</h2>
<p>Finding unused permissions is the easy part. Removing them without breaking something is where teams get cautious, and reasonably so — an unused-in-the-analysis-window permission isn&rsquo;t necessarily an unused-forever permission if it backs an infrequent process like a quarterly batch job or an annual compliance export.</p>
<p>A safer sequence:</p>
<ol>
<li><strong>Extend the observation window</strong> before acting on any single finding — a permission unused in a 30-day window might still be legitimate for something that runs monthly or quarterly</li>
<li><strong>Cross-reference against known infrequent processes</strong> — check with the team that owns the role about anything that runs on a schedule longer than your analysis window before removing access tied to it</li>
<li><strong>Use policy generation, not just manual editing</strong> — Access Analyzer policy generation builds a policy template from the actions an entity performed in your CloudTrail logs over a period of up to 90 days, which is a better starting point than hand-editing an existing broad policy. It has limits: it needs a CloudTrail trail, it does not identify action-level activity for data events such as S3 object reads, it does not include <code>iam:PassRole</code> (CloudTrail does not track it), and it counts denied actions as activity. Review the generated template rather than attaching it as-is (<a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-generation.html">AWS docs: policy generation</a>)</li>
<li><strong>Apply changes in a way that&rsquo;s reversible</strong> — deploy the tightened policy, monitor for access denials over a follow-up period, and keep the prior policy version available to roll back quickly if something legitimate breaks</li>
</ol>
<h2 id="where-least-privilege-breaks-down-structurally">Where least privilege breaks down structurally</h2>
<p>Two patterns undermine least privilege even with good tooling:</p>
<p><strong>Wildcard actions and resources.</strong> A policy using <code>&quot;Action&quot;: &quot;s3:*&quot;</code> or <code>&quot;Resource&quot;: &quot;*&quot;</code> defeats granular analysis because it&rsquo;s technically &ldquo;using&rdquo; a category of permission broadly enough that unused-access tooling has less to work with. Scoping policies to specific actions and specific resource ARNs, rather than wildcards, is what makes the analysis actually useful later.</p>
<p><strong>Shared roles across multiple purposes.</strong> A single role used by several different services or functions accumulates the union of everything any of them needs, and removing anything requires confirming none of the other consumers depend on it. Splitting roles by function, even when it means more roles to manage, keeps each one&rsquo;s actual permission needs legible.</p>
<h2 id="a-practical-checklist">A practical checklist</h2>
<ul>
<li>Enable IAM Access Analyzer&rsquo;s unused access analysis across your accounts, not just external access analysis</li>
<li>Prioritize review by finding volume, starting with roles holding the broadest permissions</li>
<li>Extend your observation window before removing access tied to infrequent processes</li>
<li>Replace wildcard actions and resources with specific ARNs and actions where feasible</li>
<li>Split multi-purpose shared roles so permission needs stay attributable to a single function</li>
<li>Treat policy tightening as a monitored, reversible change, not a one-way cutover</li>
</ul>
<p>Least privilege isn&rsquo;t a policy you write once. It&rsquo;s a permissions posture that decays by default unless something is actively pulling it back toward minimal, which is what continuous unused-access analysis is actually for.</p>
]]></content:encoded></item><item><title>S3 Block Public Access: What the Four Settings Do and How to Enforce Them</title><link>https://firewallsync.com/posts/s3-block-public-access-what-the-four-settings-do-and-how-to-enforce-them/</link><guid>https://firewallsync.com/posts/s3-block-public-access-what-the-four-settings-do-and-how-to-enforce-them/</guid><pubDate>Thu, 08 Oct 2026 08:20:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>New S3 buckets have blocked public access by default since April 2023, but older buckets, account settings and new accounts can still be open. Here is what each setting does and how to enforce all four across an account or an AWS organization.</description><enclosure url="https://firewallsync.com/posts/s3-block-public-access-what-the-four-settings-do-and-how-to-enforce-them/cover_hu11756217249689777234.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/s3-block-public-access-what-the-four-settings-do-and-how-to-enforce-them/cover_hu11756217249689777234.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/s3-block-public-access-what-the-four-settings-do-and-how-to-enforce-them/cover_hu11756217249689777234.jpg" alt="Rows of white archive boxes on wooden shelves" width="1200" height="630"></p><p>Turn on all four S3 Block Public Access settings at the account level in every AWS account, or, if you use AWS Organizations, enforce them with an organization policy so no account can switch them off. Then look for buckets created before April 2023, because AWS&rsquo;s private-by-default change only applied to new buckets. The rest of this article explains what each setting does, because the names are similar and the differences matter when something stops working.</p>
<h2 id="the-four-settings">The four settings</h2>
<p>AWS describes four independent settings. Two act when someone tries to make something public; two act on what is already public.</p>
<table>
  <thead>
      <tr>
          <th>Setting</th>
          <th>What it does</th>
          <th>Acts on</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>BlockPublicAcls</code></td>
          <td>Makes calls that set a public ACL fail: <code>PutBucketAcl</code>, <code>PutObjectAcl</code>, and <code>PutObject</code> requests that include a public ACL</td>
          <td>New ACLs</td>
      </tr>
      <tr>
          <td><code>IgnorePublicAcls</code></td>
          <td>Makes S3 ignore all public ACLs on the bucket and its objects. Uploads that include a public ACL still succeed, but the ACL has no effect</td>
          <td>Existing and new ACLs</td>
      </tr>
      <tr>
          <td><code>BlockPublicPolicy</code></td>
          <td>Makes S3 reject a <code>PutBucketPolicy</code> call if the policy allows public access, and does the same for the bucket&rsquo;s same-account access point policies</td>
          <td>New policies</td>
      </tr>
      <tr>
          <td><code>RestrictPublicBuckets</code></td>
          <td>Limits a bucket or access point that has a public policy to AWS service principals and authorized users in the owner&rsquo;s account, blocking all other cross-account access</td>
          <td>Existing policies</td>
      </tr>
  </tbody>
</table>
<p>An ACL (access control list) is the older per-bucket and per-object permission mechanism in S3; a bucket policy is the JSON resource policy attached to a bucket.</p>
<p>The pairs matter. <code>BlockPublicPolicy</code> alone stops a new public policy but leaves an existing one working. <code>RestrictPublicBuckets</code> alone neutralizes an existing public policy but lets someone attach a new one. AWS recommends turning on all four.</p>
<p>One warning from AWS&rsquo;s documentation is worth repeating: &ldquo;Block public access settings don&rsquo;t alter existing policies or ACLs. Therefore, removing a block public access setting causes a bucket or object with a public policy or ACL to again be publicly accessible.&rdquo; The settings are a shield over your policies, not a cleanup of them.</p>
<h2 id="what-s3-counts-as-public">What S3 counts as &ldquo;public&rdquo;</h2>
<p>S3 uses its own definition, and it is stricter than &ldquo;allows everyone&rdquo;.</p>
<ul>
<li><strong>ACLs.</strong> An ACL is public if it grants any permission to the <code>AllUsers</code> or <code>AuthenticatedUsers</code> groups. <code>AuthenticatedUsers</code> means any AWS account holder, not users in your account.</li>
<li><strong>Bucket policies.</strong> S3 starts by assuming a policy is public, then checks whether it qualifies as non-public. To be non-public, a policy must grant access only to fixed values, with no wildcard and no IAM policy variable, for things such as specific AWS principals, <code>aws:SourceIp</code> address ranges, or conditions like <code>aws:SourceVpc</code>, <code>aws:SourceArn</code> and <code>aws:SourceAccount</code>.</li>
</ul>
<p>AWS&rsquo;s documentation gives an example: a policy granting <code>&quot;Principal&quot;: &quot;*&quot;</code> with the condition <code>&quot;StringEquals&quot;: {&quot;aws:SourceVpc&quot;: &quot;vpc-91237329&quot;}</code> is non-public, because the VPC ID is fixed. The same policy using <code>StringLike</code> with a wildcard VPC value is public.</p>
<h2 id="where-the-settings-apply-and-which-wins">Where the settings apply, and which wins</h2>
<p>You can set Block Public Access on an access point, a bucket, an AWS account, and, since November 2025, across an organization. AWS&rsquo;s rule for overlapping settings is simple: S3 &ldquo;applies the most restrictive combination&rdquo;. If the account blocks public policies, no bucket in that account can be made public through a policy, whatever the bucket&rsquo;s own setting says.</p>
<p>This is why the account level is where to start. One command covers every existing and future bucket in the account:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>aws s3control put-public-access-block <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>    --account-id <span style="color:#ae81ff">123456789012</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>    --public-access-block-configuration <span style="color:#e6db74">&#39;{&#34;BlockPublicAcls&#34;: true, &#34;IgnorePublicAcls&#34;: true, &#34;BlockPublicPolicy&#34;: true, &#34;RestrictPublicBuckets&#34;: true}&#39;</span>
</span></span></code></pre></div><p>The command needs the <code>s3:PutAccountPublicAccessBlock</code> permission. AWS&rsquo;s CLI reference notes that it can return an access-denied error when the account is governed by an organization-level policy, because that policy takes over account-level settings.</p>
<p>To check a single bucket&rsquo;s own settings:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>aws s3api get-public-access-block --bucket amzn-s3-demo-bucket
</span></span></code></pre></div><p>AWS&rsquo;s API reference cautions that this returns the bucket-level configuration only; the effective behavior also depends on the account and organization settings.</p>
<h3 id="access-points-behave-differently">Access points behave differently</h3>
<p>AWS notes two details for S3 access points. Their Block Public Access settings can only be set when the access point is created and cannot be changed afterward. And an access point whose network origin is a VPC is always treated as non-public, whatever its policy says.</p>
<h2 id="enforcing-it-across-an-organization">Enforcing it across an organization</h2>
<p>On November 26, 2025, AWS announced organization-level enforcement for S3 Block Public Access. You attach an AWS Organizations S3 policy at the root, at an organizational unit or to specific accounts, and new member accounts inherit it. AWS states there is no additional charge. AWS&rsquo;s policy syntax documentation shows the whole policy:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&#34;s3_attributes&#34;</span>: {
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&#34;public_access_block_configuration&#34;</span>: {
</span></span><span style="display:flex;"><span>            <span style="color:#f92672">&#34;@@assign&#34;</span>: <span style="color:#e6db74">&#34;all&#34;</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>The value is <code>&quot;all&quot;</code> or <code>&quot;none&quot;</code>. The organization level is all or nothing: it turns the four settings on or off together. AWS&rsquo;s documentation adds that if you want to manage the settings per account, you should disable the S3 policy type at the organization level.</p>
<p>For a multi-account estate, this is the strongest form of the control, because an administrator inside a member account cannot turn it off. That is our reading of the design rather than an AWS claim. Before attaching it, find any account that legitimately serves public content from S3 and move that content behind CloudFront first.</p>
<h2 id="the-april-2023-default-and-what-it-did-not-change">The April 2023 default, and what it did not change</h2>
<p>In December 2022, AWS announced two changes that took effect from April 2023: newly created buckets would have Block Public Access enabled, and ACLs disabled through the &ldquo;bucket owner enforced&rdquo; Object Ownership setting. AWS said the console already used both defaults, and the change extended them to buckets created through the S3 API, CLI, SDKs and CloudFormation. An update dated April 27, 2023 says the settings then applied to all new buckets in all AWS Regions.</p>
<p>The announcement describes newly created buckets only. A bucket created in 2021 with a public policy keeps it until someone acts. The places to look first:</p>
<ul>
<li>AWS accounts older than 2023, especially ones nobody owns any more.</li>
<li>Buckets created by older infrastructure-as-code modules that set the bucket ACL or policy explicitly.</li>
<li>Accounts where someone turned the account-level setting off to make one website work.</li>
</ul>
<h2 id="auditing-an-account">Auditing an account</h2>
<p>AWS Security Hub has four controls that cover this, if you use it:</p>
<table>
  <thead>
      <tr>
          <th>Control</th>
          <th>What it checks</th>
          <th>Severity</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>S3.1</td>
          <td>All four settings enabled at the account level</td>
          <td>Medium</td>
      </tr>
      <tr>
          <td>S3.8</td>
          <td>All four settings enabled at the bucket level</td>
          <td>High</td>
      </tr>
      <tr>
          <td>S3.2</td>
          <td>Bucket permits public read access, considering settings, policy and ACL</td>
          <td>Critical</td>
      </tr>
      <tr>
          <td>S3.3</td>
          <td>Bucket permits public write access, considering settings, policy and ACL</td>
          <td>Critical</td>
      </tr>
  </tbody>
</table>
<p>IAM Access Analyzer for S3 also reports buckets that grant access to anyone on the internet or to other AWS accounts. AWS notes that in rare cases Access Analyzer and the Block Public Access evaluation can disagree on whether a bucket is public.</p>
<p>If you do not use either service, this Python script with boto3 reports the gaps in one account. It only reads configuration. It is illustrative: we tested its logic with botocore&rsquo;s Stubber against simulated responses, not against a live AWS account.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#e6db74">&#34;&#34;&#34;Report S3 Block Public Access gaps in one AWS account (read-only).&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> boto3
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> botocore.exceptions <span style="color:#f92672">import</span> ClientError
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>SETTINGS <span style="color:#f92672">=</span> (<span style="color:#e6db74">&#34;BlockPublicAcls&#34;</span>, <span style="color:#e6db74">&#34;IgnorePublicAcls&#34;</span>, <span style="color:#e6db74">&#34;BlockPublicPolicy&#34;</span>, <span style="color:#e6db74">&#34;RestrictPublicBuckets&#34;</span>)
</span></span><span style="display:flex;"><span>MISSING <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;NoSuchPublicAccessBlockConfiguration&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">block_config</span>(fetch) <span style="color:#f92672">-&gt;</span> dict:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Return the four settings, treating &#39;not configured&#39; as all False.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">try</span>:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> fetch()[<span style="color:#e6db74">&#34;PublicAccessBlockConfiguration&#34;</span>]
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">except</span> ClientError <span style="color:#66d9ef">as</span> e:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> e<span style="color:#f92672">.</span>response[<span style="color:#e6db74">&#34;Error&#34;</span>][<span style="color:#e6db74">&#34;Code&#34;</span>] <span style="color:#f92672">==</span> MISSING:
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">return</span> {k: <span style="color:#66d9ef">False</span> <span style="color:#66d9ef">for</span> k <span style="color:#f92672">in</span> SETTINGS}
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">raise</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">audit</span>(session<span style="color:#f92672">=</span><span style="color:#66d9ef">None</span>) <span style="color:#f92672">-&gt;</span> list[str]:
</span></span><span style="display:flex;"><span>    session <span style="color:#f92672">=</span> session <span style="color:#f92672">or</span> boto3<span style="color:#f92672">.</span>Session()
</span></span><span style="display:flex;"><span>    account_id <span style="color:#f92672">=</span> session<span style="color:#f92672">.</span>client(<span style="color:#e6db74">&#34;sts&#34;</span>)<span style="color:#f92672">.</span>get_caller_identity()[<span style="color:#e6db74">&#34;Account&#34;</span>]
</span></span><span style="display:flex;"><span>    s3control <span style="color:#f92672">=</span> session<span style="color:#f92672">.</span>client(<span style="color:#e6db74">&#34;s3control&#34;</span>)
</span></span><span style="display:flex;"><span>    s3 <span style="color:#f92672">=</span> session<span style="color:#f92672">.</span>client(<span style="color:#e6db74">&#34;s3&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    findings <span style="color:#f92672">=</span> []
</span></span><span style="display:flex;"><span>    account <span style="color:#f92672">=</span> block_config(<span style="color:#66d9ef">lambda</span>: s3control<span style="color:#f92672">.</span>get_public_access_block(AccountId<span style="color:#f92672">=</span>account_id))
</span></span><span style="display:flex;"><span>    off <span style="color:#f92672">=</span> [k <span style="color:#66d9ef">for</span> k <span style="color:#f92672">in</span> SETTINGS <span style="color:#66d9ef">if</span> <span style="color:#f92672">not</span> account<span style="color:#f92672">.</span>get(k)]
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> off:
</span></span><span style="display:flex;"><span>        findings<span style="color:#f92672">.</span>append(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;account </span><span style="color:#e6db74">{</span>account_id<span style="color:#e6db74">}</span><span style="color:#e6db74">: off at account level: </span><span style="color:#e6db74">{</span><span style="color:#e6db74">&#39;, &#39;</span><span style="color:#f92672">.</span>join(off)<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">for</span> bucket <span style="color:#f92672">in</span> s3<span style="color:#f92672">.</span>list_buckets()[<span style="color:#e6db74">&#34;Buckets&#34;</span>]:
</span></span><span style="display:flex;"><span>        name <span style="color:#f92672">=</span> bucket[<span style="color:#e6db74">&#34;Name&#34;</span>]
</span></span><span style="display:flex;"><span>        cfg <span style="color:#f92672">=</span> block_config(<span style="color:#66d9ef">lambda</span>: s3<span style="color:#f92672">.</span>get_public_access_block(Bucket<span style="color:#f92672">=</span>name))
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># Effective setting is the most restrictive of account and bucket.</span>
</span></span><span style="display:flex;"><span>        effective_off <span style="color:#f92672">=</span> [k <span style="color:#66d9ef">for</span> k <span style="color:#f92672">in</span> SETTINGS <span style="color:#66d9ef">if</span> <span style="color:#f92672">not</span> (cfg<span style="color:#f92672">.</span>get(k) <span style="color:#f92672">or</span> account<span style="color:#f92672">.</span>get(k))]
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">try</span>:
</span></span><span style="display:flex;"><span>            is_public <span style="color:#f92672">=</span> s3<span style="color:#f92672">.</span>get_bucket_policy_status(Bucket<span style="color:#f92672">=</span>name)[<span style="color:#e6db74">&#34;PolicyStatus&#34;</span>][<span style="color:#e6db74">&#34;IsPublic&#34;</span>]
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">except</span> ClientError <span style="color:#66d9ef">as</span> e:
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">if</span> e<span style="color:#f92672">.</span>response[<span style="color:#e6db74">&#34;Error&#34;</span>][<span style="color:#e6db74">&#34;Code&#34;</span>] <span style="color:#f92672">!=</span> <span style="color:#e6db74">&#34;NoSuchBucketPolicy&#34;</span>:
</span></span><span style="display:flex;"><span>                <span style="color:#66d9ef">raise</span>
</span></span><span style="display:flex;"><span>            is_public <span style="color:#f92672">=</span> <span style="color:#66d9ef">False</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> is_public <span style="color:#f92672">or</span> effective_off:
</span></span><span style="display:flex;"><span>            findings<span style="color:#f92672">.</span>append(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;bucket </span><span style="color:#e6db74">{</span>name<span style="color:#e6db74">}</span><span style="color:#e6db74">: policy public=</span><span style="color:#e6db74">{</span>is_public<span style="color:#e6db74">}</span><span style="color:#e6db74">; &#34;</span>
</span></span><span style="display:flex;"><span>                            <span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;effectively off: </span><span style="color:#e6db74">{</span><span style="color:#e6db74">&#39;, &#39;</span><span style="color:#f92672">.</span>join(effective_off) <span style="color:#f92672">or</span> <span style="color:#e6db74">&#39;none&#39;</span><span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> findings
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">if</span> __name__ <span style="color:#f92672">==</span> <span style="color:#e6db74">&#34;__main__&#34;</span>:
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">for</span> line <span style="color:#f92672">in</span> audit():
</span></span><span style="display:flex;"><span>        print(line)
</span></span></code></pre></div><p><code>GetBucketPolicyStatus</code> returns <code>IsPublic: true</code> when S3 considers the bucket&rsquo;s policy public. Known limits of the script:</p>
<ul>
<li>It does not read organization-level policies, so an account protected only by an organization policy may be reported as &ldquo;off&rdquo;.</li>
<li>It does not paginate the bucket list or handle buckets in Regions that need a regional client, which matters for large accounts.</li>
<li>The missing-configuration error code is taken from the AWS SDK&rsquo;s model for the account-level API; we did not confirm the bucket-level code against a live account.</li>
<li>It checks policies and settings, not ACLs on individual objects.</li>
</ul>
<h2 id="if-you-need-public-content">If you need public content</h2>
<p>Serving a website straight from a public bucket is the main reason people switch these settings off. AWS&rsquo;s recommended alternative is CloudFront with origin access control (OAC): the bucket stays private and a bucket policy grants read access only to your CloudFront distribution. AWS recommends OAC over the older origin access identity (OAI), citing support for all Regions including those launched after December 2022, for SSE-KMS encryption, and for PUT and DELETE requests. The bucket policy looks like this, with your own bucket name, account ID and distribution ID:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;Version&#34;</span>: <span style="color:#e6db74">&#34;2012-10-17&#34;</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;Statement&#34;</span>: [
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;Sid&#34;</span>: <span style="color:#e6db74">&#34;AllowCloudFrontServicePrincipalReadOnly&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;Effect&#34;</span>: <span style="color:#e6db74">&#34;Allow&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;Principal&#34;</span>: {<span style="color:#f92672">&#34;Service&#34;</span>: <span style="color:#e6db74">&#34;cloudfront.amazonaws.com&#34;</span>},
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;Action&#34;</span>: <span style="color:#e6db74">&#34;s3:GetObject&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;Resource&#34;</span>: <span style="color:#e6db74">&#34;arn:aws:s3:::amzn-s3-demo-bucket/*&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;Condition&#34;</span>: {
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&#34;StringEquals&#34;</span>: {
</span></span><span style="display:flex;"><span>          <span style="color:#f92672">&#34;AWS:SourceArn&#34;</span>: <span style="color:#e6db74">&#34;arn:aws:cloudfront::111122223333:distribution/EDFDVBD6EXAMPLE&#34;</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>      }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>  ]
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>Because the condition uses a fixed <code>AWS:SourceArn</code> value, S3 treats this policy as non-public under the definition above, so it works with all four settings on.</p>
<p>Block Public Access does not cover everything. AWS&rsquo;s documentation advises also checking identity-based policies on IAM roles and resource-based policies on related resources such as KMS keys. For why per-bucket checklists rarely keep up across many accounts, see <a href="/posts/cloud-misconfiguration-checklists-dont-work-heres-what-does/">why cloud misconfiguration checklists don&rsquo;t work</a>.</p>
<h2 id="sources-and-verification">Sources and verification</h2>
<p>Checked on October 8, 2026. We did not run the CLI commands or the audit script against a live AWS account.</p>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Behavior of the four settings; settings do not alter existing policies or ACLs; most restrictive combination applies; definition of public for ACLs and policies; access point rules; recommendation to enable all four; check identity and KMS policies too; Access Analyzer can disagree</td>
          <td><a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html">AWS, Blocking public access to your Amazon S3 storage</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Account-level CLI command, required permission, access denied under organization policy</td>
          <td><a href="https://docs.aws.amazon.com/cli/latest/reference/s3control/put-public-access-block.html">AWS CLI reference, s3control put-public-access-block</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Bucket-level GET returns bucket configuration only</td>
          <td><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html">AWS API reference, GetPublicAccessBlock</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td><code>IsPublic</code> meaning</td>
          <td><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html">AWS API reference, GetBucketPolicyStatus</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Organization-level enforcement announced November 26, 2025; inheritance; no additional charge</td>
          <td><a href="https://aws.amazon.com/about-aws/whats-new/2025/11/amazon-s3-block-public-access-organization-level-enforcement/">AWS What&rsquo;s New, November 26, 2025</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Organization policy JSON; &ldquo;all&rdquo; and &ldquo;none&rdquo;; disable the policy type to manage per account</td>
          <td><a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3_syntax.html">AWS Organizations, S3 policy syntax</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>April 2023 defaults for new buckets; creation methods covered; April 27, 2023 update</td>
          <td><a href="https://aws.amazon.com/blogs/aws/heads-up-amazon-s3-security-changes-are-coming-in-april-of-2023/">AWS News Blog, December 13, 2022</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Older buckets keep their settings</td>
          <td>Same post describes only newly created buckets</td>
          <td>Qualified: inferred from the announcement&rsquo;s scope</td>
      </tr>
      <tr>
          <td>Security Hub controls S3.1, S3.8, S3.2, S3.3 and severities</td>
          <td><a href="https://docs.aws.amazon.com/securityhub/latest/userguide/s3-controls.html">AWS Security Hub, Amazon S3 controls</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>OAC recommended over OAI and reasons; example bucket policy</td>
          <td><a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html">Amazon CloudFront, Restrict access to an Amazon S3 origin</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Audit script logic</td>
          <td>Tested with botocore Stubber, boto3 1.43, Python 3.13</td>
          <td>Qualified: not run against a live account</td>
      </tr>
      <tr>
          <td>Missing-configuration error code</td>
          <td>AWS SDK model for the s3control API</td>
          <td>Qualified: bucket-level code not confirmed</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>Cloud Misconfiguration Checklists Don't Work — Here's What Does</title><link>https://firewallsync.com/posts/cloud-misconfiguration-checklists-dont-work-heres-what-does/</link><guid>https://firewallsync.com/posts/cloud-misconfiguration-checklists-dont-work-heres-what-does/</guid><pubDate>Sat, 03 Oct 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Cloud Security</category><description>Checklist-based cloud security reviews catch what's on the list and miss everything that changed since it was written. Drift detection closes the gap a checklist can't.</description><enclosure url="https://firewallsync.com/posts/cloud-misconfiguration-checklists-dont-work-heres-what-does/cover_hu6633924292829235487.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/cloud-misconfiguration-checklists-dont-work-heres-what-does/cover_hu6633924292829235487.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/cloud-misconfiguration-checklists-dont-work-heres-what-does/cover_hu6633924292829235487.jpg" alt="Person writing a list in a notebook" width="1200" height="630"></p><p>Cloud misconfiguration remains one of the most common root causes behind cloud breaches, which is strange given how many teams run a security checklist against their environment. The problem isn&rsquo;t that the checklists are wrong — it&rsquo;s that a checklist is a snapshot, and cloud environments change constantly between the review that passed and the incident that didn&rsquo;t.</p>
<h2 id="point-in-time-review-versus-continuous-drift-detection">Point-in-time review versus continuous drift detection</h2>
<p>A checklist run quarterly catches whatever was misconfigured on review day. It says nothing about the storage bucket permissions someone loosened for a debugging session last Tuesday and forgot to revert, or the security group rule a new engineer added without realizing its blast radius. Continuous configuration monitoring — tools that diff your actual cloud state against a defined baseline in near-real-time — catches drift the moment it happens instead of up to three months later.</p>
<h2 id="checklists-dont-scale-with-account-sprawl">Checklists don&rsquo;t scale with account sprawl</h2>
<p>A single-account checklist reviewed by hand doesn&rsquo;t scale once you&rsquo;re running dozens of accounts or projects across teams, which is most orgs past a certain size. Policy-as-code (applying the same rule set programmatically across every account) is what actually makes &ldquo;we check for public S3 buckets&rdquo; mean something at scale — a manual checklist run against 40 accounts either takes weeks or, more realistically, only gets applied to the few accounts someone remembers to check.</p>
<h2 id="default-deny-beats-detect-and-fix">Default-deny beats detect-and-fix</h2>
<p>The highest-leverage move isn&rsquo;t catching misconfigurations faster — it&rsquo;s making the insecure state harder to create in the first place. Guardrails enforced at the account or organization level (blocking public bucket creation outright, restricting which regions resources can be created in, requiring encryption by default) remove entire categories of misconfiguration from the checklist because they&rsquo;re no longer possible to create accidentally. Spend the review time you&rsquo;d have spent checking for these on building the guardrail instead — it only has to be built once.</p>
]]></content:encoded></item><item><title>SSRF Explained: How Server-Side Request Forgery Works and How to Prevent It</title><link>https://firewallsync.com/posts/ssrf-explained-how-server-side-request-forgery-works-and-how-to-prevent-it/</link><guid>https://firewallsync.com/posts/ssrf-explained-how-server-side-request-forgery-works-and-how-to-prevent-it/</guid><pubDate>Sat, 03 Oct 2026 08:05:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>AppSec &amp; APIs</category><description>Any feature that fetches a URL on a user's behalf lets that user borrow your server's network position. Here is how SSRF works, why URL filters keep failing, and the layered controls that hold.</description><enclosure url="https://firewallsync.com/posts/ssrf-explained-how-server-side-request-forgery-works-and-how-to-prevent-it/cover_hu8386556676597346944.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/ssrf-explained-how-server-side-request-forgery-works-and-how-to-prevent-it/cover_hu8386556676597346944.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/ssrf-explained-how-server-side-request-forgery-works-and-how-to-prevent-it/cover_hu8386556676597346944.jpg" alt="A rack of servers with network cables attached" width="1200" height="630"></p><p>Server-side request forgery (SSRF) is what happens when your application fetches a destination an attacker chose. The attacker cannot reach your internal network or your cloud credentials directly, but your server can, and a feature that fetches URLs on request will do the reaching for them.</p>
<p>The fix is not a cleverer URL filter. It is a set of layers: avoid taking raw URLs where you can, validate the address you actually connect to, refuse redirects, restrict what the fetching component can reach at the network level, and harden the most valuable target. The rest of this article explains why each layer exists.</p>
<h2 id="what-ssrf-is">What SSRF is</h2>
<p>MITRE&rsquo;s definition for <a href="https://cwe.mitre.org/data/definitions/918.html">CWE-918</a> is precise: &ldquo;The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.&rdquo;</p>
<p>The vulnerable feature is usually one somebody asked for on purpose:</p>
<ul>
<li>Webhooks, where a customer registers a URL for you to call</li>
<li>Link previews and URL unfurling</li>
<li>&ldquo;Import from URL&rdquo; for images, documents or feeds</li>
<li>HTML-to-PDF and screenshot services that load remote resources</li>
<li>Server-side integrations that build a backend URL from request parameters</li>
</ul>
<p>In each case the request originates inside your infrastructure. It passes any firewall that trusts your server, and it may carry whatever ambient identity the server has. CWE-918 lists the consequences as reading application data, executing unauthorized code or commands, and bypassing protection mechanisms such as firewalls.</p>
<p>Two variants matter for testing. In the basic form the response is returned to the attacker, who can read internal pages directly. In blind SSRF nothing is returned, but the attacker can still trigger state-changing requests or infer what exists from timing and error differences.</p>
<h2 id="where-it-sits-in-the-owasp-top-10">Where it sits in the OWASP Top 10</h2>
<p>SSRF became its own category, A10, in the <a href="https://top10.owasp.org/2021/A10_2021-Server-Side_Request_Forgery_(SSRF)/">OWASP Top 10 2021</a>, added from the community survey rather than from incidence data. In the 2025 edition it no longer has a separate entry: the <a href="https://top10.owasp.org/2025/0x00_2025-Introduction/">2025 introduction</a> states that &ldquo;Server-Side Request Forgery (SSRF) has been rolled into&rdquo; A01 Broken Access Control.</p>
<p>That reclassification is a useful way to think about the bug. SSRF is an access control failure: the server is authorized to reach something, and the application lets an unauthorized party direct that access. If you already review authorization as a class of bug, SSRF belongs in the same reviews.</p>
<h2 id="why-cloud-metadata-makes-it-serious">Why cloud metadata makes it serious</h2>
<p>Every major cloud gives a virtual machine a local HTTP endpoint that describes the instance and, critically, can hand out temporary credentials for the identity attached to it. On AWS, Google Cloud and Azure the IPv4 address is the same link-local address, <code>169.254.169.254</code>.</p>
<p>An SSRF bug that can reach that address may be able to retrieve credentials and use them from outside your network. How easy that is depends on the provider&rsquo;s protections:</p>
<table>
  <thead>
      <tr>
          <th>Provider</th>
          <th>Endpoint</th>
          <th>Protection against a naive SSRF request</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>AWS, IMDSv1</td>
          <td><code>169.254.169.254</code></td>
          <td>None: a plain GET request returns metadata</td>
      </tr>
      <tr>
          <td>AWS, IMDSv2</td>
          <td><code>169.254.169.254</code>, and <code>fd00:ec2::254</code> on Nitro instances in IPv6 subnets</td>
          <td>Requires a session token obtained with a PUT request, then sent in the <code>X-aws-ec2-metadata-token</code> header. Default response hop limit is 1</td>
      </tr>
      <tr>
          <td>Google Cloud</td>
          <td><code>169.254.169.254</code>, <code>metadata.google.internal</code></td>
          <td>Requires the <code>Metadata-Flavor: Google</code> header. Requests carrying <code>X-Forwarded-For</code> are rejected</td>
      </tr>
      <tr>
          <td>Azure</td>
          <td><code>169.254.169.254</code></td>
          <td>Requires the <code>Metadata: true</code> header. Requests carrying <code>X-Forwarded-For</code> are rejected</td>
      </tr>
  </tbody>
</table>
<p>IMDS stands for Instance Metadata Service. The header requirements matter because many SSRF bugs give the attacker control of the URL only, not the HTTP method or headers. They stop helping when the vulnerable feature lets the attacker set headers too, which some webhook and integration features do by design.</p>
<p>On AWS, both versions are accepted by default according to the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html">EC2 documentation</a>, so IMDSv1 stays reachable until you require IMDSv2. The commands for that are in the hardening section below.</p>
<p>Metadata is the best-known target, not the only one. The same bug reaches internal admin panels, unauthenticated services bound to localhost, databases with HTTP interfaces, and other tenants&rsquo; callbacks.</p>
<h2 id="why-url-filtering-keeps-failing">Why URL filtering keeps failing</h2>
<p>The intuitive defense is to inspect the URL and reject internal addresses. OWASP&rsquo;s guidance on that is blunt: &ldquo;Do not mitigate SSRF via the use of a deny list or regular expression. Attackers have payload lists, tools, and skills to bypass deny lists.&rdquo;</p>
<p>The underlying problem is that the string you inspect and the address you connect to are different things. Four gaps account for most bypasses:</p>
<ol>
<li><strong>Redirects.</strong> The URL points to a public host that passes your check. That host answers with a redirect to <code>http://169.254.169.254/</code>, and your HTTP client follows it.</li>
<li><strong>DNS that changes between check and use.</strong> Your code resolves the hostname, sees a public address and approves it. The HTTP client then resolves the name again and gets an internal address. This is DNS rebinding, a time-of-check to time-of-use race.</li>
<li><strong>Alternate notations.</strong> <code>127.0.0.1</code> can be written as the decimal integer <code>2130706433</code>, in hexadecimal, or as the IPv4-mapped IPv6 address <code>::ffff:127.0.0.1</code>. A string comparison against &ldquo;127.0.0.1&rdquo; misses all of them, while many resolvers accept them.</li>
<li><strong>Parser disagreement.</strong> The library that validates the URL and the library that fetches it may split the same string differently, for example around <code>@</code>, <code>#</code> or backslashes. The <a href="https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html">OWASP SSRF Prevention Cheat Sheet</a> recommends treating parser disagreement as a rejection.</li>
</ol>
<h2 id="how-to-prevent-ssrf">How to prevent SSRF</h2>
<p>OWASP&rsquo;s cheat sheet separates two situations, and the right control depends on which one you are in.</p>
<h3 id="case-1-the-destinations-are-known">Case 1: the destinations are known</h3>
<p>If the feature only ever needs to call a fixed set of services, do not accept a URL at all. Accept an identifier, map it to a destination on the server, and build the request yourself. Where a hostname must be supplied, compare it against an allow list with exact matching.</p>
<p>This is the strong position: there is nothing to bypass because the user never controls the destination.</p>
<h3 id="case-2-the-destination-can-be-anywhere">Case 2: the destination can be anywhere</h3>
<p>Webhooks and link previews cannot use an allow list, because the whole point is to reach arbitrary external hosts. Here OWASP&rsquo;s cheat sheet accepts that a block list is the available tool, while warning that deny lists are bypass-prone. That is consistent with the Top 10 advice quoted above: a block list is acceptable as one layer when applied to the resolved IP address and backed by network controls. It is not acceptable as a string filter standing alone.</p>
<p>The application-layer checks, in order:</p>
<ol>
<li>Allow only the schemes and ports you need, typically <code>https</code> on port 443.</li>
<li>Reject URLs containing embedded credentials.</li>
<li>Resolve the hostname and reject the request if any returned address is not publicly routable.</li>
<li>Connect to the address you validated, not to the hostname again.</li>
<li>Disable redirect following, or re-run every check on each redirect target.</li>
<li>Do not return the raw upstream response to the caller.</li>
</ol>
<p>The following Python function implements steps 1 to 3. It is illustrative, assumes Python 3.9 or later, and uses only the standard library.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> ipaddress
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> socket
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> urllib.parse <span style="color:#f92672">import</span> urlsplit
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>ALLOWED_SCHEMES <span style="color:#f92672">=</span> {<span style="color:#e6db74">&#34;https&#34;</span>}
</span></span><span style="display:flex;"><span>ALLOWED_PORTS <span style="color:#f92672">=</span> {<span style="color:#ae81ff">443</span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">vet_url</span>(url: str) <span style="color:#f92672">-&gt;</span> list[str]:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Return the public IPs a URL resolves to, or raise ValueError.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    parts <span style="color:#f92672">=</span> urlsplit(url)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> parts<span style="color:#f92672">.</span>scheme <span style="color:#f92672">not</span> <span style="color:#f92672">in</span> ALLOWED_SCHEMES:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">raise</span> <span style="color:#a6e22e">ValueError</span>(<span style="color:#e6db74">&#34;scheme not allowed&#34;</span>)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> parts<span style="color:#f92672">.</span>username <span style="color:#f92672">or</span> parts<span style="color:#f92672">.</span>password:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">raise</span> <span style="color:#a6e22e">ValueError</span>(<span style="color:#e6db74">&#34;credentials in URL not allowed&#34;</span>)
</span></span><span style="display:flex;"><span>    host <span style="color:#f92672">=</span> parts<span style="color:#f92672">.</span>hostname
</span></span><span style="display:flex;"><span>    port <span style="color:#f92672">=</span> parts<span style="color:#f92672">.</span>port <span style="color:#f92672">or</span> <span style="color:#ae81ff">443</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> <span style="color:#f92672">not</span> host <span style="color:#f92672">or</span> port <span style="color:#f92672">not</span> <span style="color:#f92672">in</span> ALLOWED_PORTS:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">raise</span> <span style="color:#a6e22e">ValueError</span>(<span style="color:#e6db74">&#34;host or port not allowed&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    infos <span style="color:#f92672">=</span> socket<span style="color:#f92672">.</span>getaddrinfo(host, port, type<span style="color:#f92672">=</span>socket<span style="color:#f92672">.</span>SOCK_STREAM)
</span></span><span style="display:flex;"><span>    addresses <span style="color:#f92672">=</span> {info[<span style="color:#ae81ff">4</span>][<span style="color:#ae81ff">0</span>] <span style="color:#66d9ef">for</span> info <span style="color:#f92672">in</span> infos}
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">for</span> raw <span style="color:#f92672">in</span> addresses:
</span></span><span style="display:flex;"><span>        ip <span style="color:#f92672">=</span> ipaddress<span style="color:#f92672">.</span>ip_address(raw)
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> ip<span style="color:#f92672">.</span>version <span style="color:#f92672">==</span> <span style="color:#ae81ff">6</span> <span style="color:#f92672">and</span> ip<span style="color:#f92672">.</span>ipv4_mapped:
</span></span><span style="display:flex;"><span>            ip <span style="color:#f92672">=</span> ip<span style="color:#f92672">.</span>ipv4_mapped
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> <span style="color:#f92672">not</span> ip<span style="color:#f92672">.</span>is_global:
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">raise</span> <span style="color:#a6e22e">ValueError</span>(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">{</span>host<span style="color:#e6db74">}</span><span style="color:#e6db74"> resolves to non-public address </span><span style="color:#e6db74">{</span>ip<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> sorted(addresses)
</span></span></code></pre></div><p>Three design choices are worth noting:</p>
<ul>
<li><strong>It tests for &ldquo;public&rdquo;, not for &ldquo;private&rdquo;.</strong> Python&rsquo;s <a href="https://docs.python.org/3/library/ipaddress.html"><code>ipaddress</code></a> documentation notes that <code>is_private</code> is <code>False</code> for the shared address space <code>100.64.0.0/10</code>, and so is <code>is_global</code>. Checking <code>not ip.is_global</code> rejects that range, loopback, link-local (including <code>169.254.169.254</code>) and private ranges in one condition. Checking <code>is_private</code> alone would let <code>100.64.0.0/10</code> through.</li>
<li><strong>It validates what the resolver returns, not the string.</strong> Decimal and hexadecimal notations are normalized by resolution before the check runs, which closes the alternate-notation gap without a list of patterns.</li>
<li><strong>It rejects if any returned address is non-public</strong>, not only the first.</li>
</ul>
<p>What it does not do is equally important. It does not close the DNS rebinding gap on its own: if you call <code>vet_url()</code> and then hand the original hostname to an HTTP client, the client resolves again. To close that gap, connect to one of the returned IP addresses while still sending the original hostname for TLS verification and the <code>Host</code> header, or route outbound fetches through a proxy that enforces the same address rules at connection time. When you make the request, turn off redirect following, for example <code>allow_redirects=False</code> in the Python <code>requests</code> library.</p>
<h3 id="network-layer-controls">Network-layer controls</h3>
<p>Application checks fail open when someone adds a second fetch path and forgets them. Network controls do not. OWASP&rsquo;s 2021 guidance lists segmenting remote resource access into separate networks, enforcing deny-by-default firewall policy for all but essential intranet traffic, and logging both accepted and blocked flows.</p>
<p>In practice that means running URL-fetching code in a component with its own egress rules: no route to internal subnets, no route to the metadata address, and outbound access only to the public internet. A dedicated fetch service or egress proxy also gives you one place to log every outbound destination, which is the evidence you will want when you investigate a suspected SSRF. Our article on <a href="/posts/logging-for-incidents-not-for-dashboards/">logging for incidents rather than dashboards</a> covers what to keep.</p>
<h3 id="harden-the-metadata-service">Harden the metadata service</h3>
<p>On AWS, require IMDSv2 so that a plain GET no longer returns anything. For an existing instance:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>aws ec2 modify-instance-metadata-options <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>    --instance-id i-1234567890abcdef0 <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>    --http-tokens required <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>    --http-endpoint enabled
</span></span></code></pre></div><p>To make it the default for new instances launched in a Region, set the account-level default, which AWS documents per Region:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>aws ec2 modify-instance-metadata-defaults <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>    --region us-east-1 <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>    --http-tokens required
</span></span></code></pre></div><p>Replace the instance ID and Region with your own. AWS documents that account-level defaults &ldquo;do not affect existing instances&rdquo;, and that settings given at launch take precedence over them, so you need both commands to cover a running fleet.</p>
<p>Two cautions. First, check for software still using IMDSv1 before enforcing, because those calls will start failing with HTTP 401. AWS provides the <code>MetadataNoToken</code> CloudWatch metric for this: it counts IMDSv1 calls, and an instance is ready when it records none. Second, the default response hop limit of 1 keeps the token response on the instance itself. AWS notes that &ldquo;in a container environment, a hop limit of <code>1</code> can cause issues&rdquo; and its examples use 2 there. A higher limit also widens what can reach the service, so raise it only where a workload needs it.</p>
<p>AWS introduced IMDSv2 in a <a href="https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/">November 2019 announcement</a> titled &ldquo;Add defense in depth against open firewalls, reverse proxies, and SSRF vulnerabilities&rdquo;. Defense in depth is the accurate description. Requiring IMDSv2 removes the easiest path to credentials. It does not remove the SSRF bug or protect anything else the server can reach.</p>
<p>The credential an attacker obtains is only as powerful as the role attached to the instance, so scoping that role tightly limits the damage of any metadata exposure. The rollout approach in <a href="/posts/least-privilege-access-controls-that-dont-slow-teams-down/">least-privilege access controls that don&rsquo;t slow teams down</a> applies directly.</p>
<h2 id="common-mistakes">Common mistakes</h2>
<ul>
<li><strong>Validating once, fetching twice.</strong> The check and the request each resolve DNS. This is the rebinding gap described above.</li>
<li><strong>Leaving redirects on.</strong> Many HTTP clients follow redirects by default, including the Python <code>requests</code> library for GET requests.</li>
<li><strong>Blocking only <code>169.254.169.254</code> and <code>127.0.0.1</code>.</strong> This misses IPv6 loopback <code>::1</code>, the AWS IPv6 endpoint <code>fd00:ec2::254</code>, private ranges and internal hostnames.</li>
<li><strong>Trusting internal callers.</strong> A service that fetches URLs passed to it by another internal service inherits that service&rsquo;s SSRF exposure.</li>
<li><strong>Returning upstream errors verbatim.</strong> Detailed error messages turn blind SSRF into a port scanner.</li>
<li><strong>Relying on a web application firewall alone.</strong> A WAF sees the inbound request string. It does not see what your server resolves and connects to.</li>
</ul>
<h2 id="how-to-find-it-in-your-own-code">How to find it in your own code</h2>
<p>Search for every place the application makes an outbound request, then trace whether any part of the destination comes from user input, stored user data or another service&rsquo;s response. HTTP client calls are the obvious ones. Less obvious are image and document processors, PDF renderers, XML parsers that resolve external entities, and SDK calls that accept an endpoint parameter.</p>
<p>For each one, ask three questions: can the caller influence the host, can the caller influence the scheme or port, and does the caller see the response. A yes to the first is an SSRF candidate regardless of the other two.</p>
<p>In testing, use a destination you control and watch for the inbound connection. That confirms the fetch happens and shows which component makes it, without touching internal systems. Only test systems you are authorized to test.</p>
<h2 id="recommendations">Recommendations</h2>
<ol>
<li>Inventory outbound fetch features and remove user-controlled destinations where an identifier would do.</li>
<li>Where arbitrary destinations are required, validate the resolved address, connect to that address and disable redirects.</li>
<li>Put URL-fetching code behind egress rules that block internal ranges and the metadata address.</li>
<li>Require IMDSv2 on AWS, and scope instance roles to least privilege on every cloud.</li>
<li>Log outbound destinations from fetch components and alert on attempts to reach internal or link-local addresses.</li>
</ol>
<p>No single item on that list is sufficient. Each one covers a failure mode of the others, which is the point of layering them.</p>
<h2 id="sources-and-verification">Sources and verification</h2>
<p>Checked on October 3, 2026. Cloud provider behavior is as documented on that date and can change.</p>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Definition of SSRF and its consequences</td>
          <td><a href="https://cwe.mitre.org/data/definitions/918.html">MITRE CWE-918</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>SSRF was category A10 in the OWASP Top 10 2021, added from the community survey</td>
          <td><a href="https://top10.owasp.org/2021/A10_2021-Server-Side_Request_Forgery_(SSRF)/">OWASP Top 10 2021, A10</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>SSRF was rolled into A01 Broken Access Control in the 2025 edition</td>
          <td><a href="https://top10.owasp.org/2025/0x00_2025-Introduction/">OWASP Top 10 2025 introduction</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>OWASP advises against deny lists and regular expressions as the mitigation</td>
          <td><a href="https://top10.owasp.org/2021/A10_2021-Server-Side_Request_Forgery_(SSRF)/">OWASP Top 10 2021, A10</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Allow list where destinations are known; address validation, DNS checks and disabled redirects where they are not</td>
          <td><a href="https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html">OWASP SSRF Prevention Cheat Sheet</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>IMDSv2 requires a PUT-issued session token; default hop limit is 1; both versions accepted by default</td>
          <td><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html">AWS EC2 User Guide, instance metadata service</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Account-level IMDSv2 default is set per Region and does not affect existing instances</td>
          <td><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">AWS EC2 User Guide, instance metadata options</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td><code>MetadataNoToken</code> tracks IMDSv1 calls before enforcement</td>
          <td><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-existing-instances.html">AWS EC2 User Guide, existing instances</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Google Cloud requires <code>Metadata-Flavor: Google</code> and rejects <code>X-Forwarded-For</code></td>
          <td><a href="https://docs.cloud.google.com/compute/docs/metadata/querying-metadata">Google Cloud, querying VM metadata</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Azure requires <code>Metadata: true</code> and rejects <code>X-Forwarded-For</code></td>
          <td><a href="https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service">Azure Instance Metadata Service</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td><code>is_private</code> and <code>is_global</code> are both <code>False</code> for <code>100.64.0.0/10</code></td>
          <td><a href="https://docs.python.org/3/library/ipaddress.html">Python <code>ipaddress</code> documentation</a></td>
          <td>Verified</td>
      </tr>
  </tbody>
</table>
<p>The Python example is illustrative rather than production-ready. It reduces risk as one layer and does not guarantee protection on its own.</p>
]]></content:encoded></item><item><title>Container Image Scanning: What CI Pipelines Still Miss</title><link>https://firewallsync.com/posts/container-image-scanning-what-ci-pipelines-still-miss/</link><guid>https://firewallsync.com/posts/container-image-scanning-what-ci-pipelines-still-miss/</guid><pubDate>Mon, 28 Sep 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>AppSec &amp; APIs</category><description>Image scanning in CI catches known CVEs in base layers, but most pipelines still ship vulnerable configs and secrets that scanners aren't tuned to see.</description><enclosure url="https://firewallsync.com/posts/container-image-scanning-what-ci-pipelines-still-miss/cover_hu3539560511430577827.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/container-image-scanning-what-ci-pipelines-still-miss/cover_hu3539560511430577827.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/container-image-scanning-what-ci-pipelines-still-miss/cover_hu3539560511430577827.jpg" alt="Stacked orange shipping containers against a blue sky" width="1200" height="630"></p><p>Most teams that added container scanning to CI did it for one reason: catch known CVEs before a vulnerable base image ships to production. That part works well now — scanners are mature and fast. What they consistently miss is everything that isn&rsquo;t a CVE: misconfigurations, embedded secrets, and drift between what was scanned and what actually runs.</p>
<h2 id="scanning-the-image-isnt-scanning-the-runtime-config">Scanning the image isn&rsquo;t scanning the runtime config</h2>
<p>A clean scan on the image itself says nothing about the Kubernetes manifest or Helm chart that deploys it — a container with zero CVEs can still run as root, mount the host filesystem, or expose a debug port to the internet. If your pipeline only gates on image scan results, add a separate policy check on the deployment manifest (tools like Kubernetes admission controllers or policy-as-code frameworks catch this class of issue that image scanners structurally can&rsquo;t).</p>
<h2 id="secrets-baked-in-during-build-not-commit">Secrets baked in during build, not commit</h2>
<p>Scanners tuned to catch secrets in source code miss keys that get pulled in during the Docker build itself — a <code>COPY .env .</code> line, a build arg that ends up baked into a layer, or a credential fetched mid-build and never cleaned up. Audit your Dockerfiles specifically for this pattern; it&rsquo;s one of the more common ways a key ends up in a public registry months after anyone remembers it was there.</p>
<h2 id="the-scan-to-deploy-gap">The scan-to-deploy gap</h2>
<p>A pipeline that scans on merge but deploys hours or days later is scanning against a CVE database that&rsquo;s already stale by deploy time. If a critical CVE gets published for a package already baked into a pending release, nothing in the pipeline re-checks it. Add a scheduled re-scan of images already in your registry, not just at build time — this is the difference between catching a zero-day the week it&rsquo;s disclosed versus the next time someone happens to rebuild.</p>
]]></content:encoded></item></channel></rss>