DEV Community

Cover image for Virtual Patching vs Patching: When to Shield an API Instead of Redeploying
Hassann
Hassann

Posted on Originally published at apidog.com

Virtual Patching vs Patching: When to Shield an API Instead of Redeploying

Virtual Patching vs Patching: Shielding APIs When a Fix Takes Too Long

Virtual patching temporarily blocks a known way to reach a software flaw while the vulnerable code stays in place. Use it when you can cover the affected API traffic sooner than you can safely deploy a fix. Patch and verify the affected fleet as soon as the fixed build is ready.

Try Apidog today

On November 23, 2026, OpenAI and Cisco introduced Shirudo, an open-source Linux project that can load targeted eBPF protections on a running system. It puts a familiar on-call decision in focus. If the permanent fix takes hours to validate, can you reduce exposure now without breaking the requests your customers depend on? OpenAI's Shirudo announcement

Virtual patching vs regular patching

Decision Virtual patching Regular patching
What changes? A gateway rule or runtime control limits exposure. A corrected app, dependency, or system component replaces the affected version.
When does it help? The control reaches the affected traffic before the fix can roll out. A trusted fix is available and the team can deploy it safely.
What proves it worked? Coverage evidence and passing service checks at the enforcement point. Verified fixed versions across the fleet plus passing release checks.
When is the work done? The permanent fix is verified and the temporary rule is retired. The fix is installed and verified on every affected instance.

A virtual patch is a compensating control. Your inventory still shows the vulnerable version while the control is active. Keep the remediation ticket open and record the rule, owner, and expected removal date there. OWASP's virtual patching guidance

A regular patch can be an updated library in a container image or a corrected build of your own service. Track what the fleet is actually running. A fixed image in the registry says little about the older workers still serving requests. NIST's enterprise patch management guide

When should you shield an API?

Use a shield when three conditions hold.

  1. The control covers the affected traffic. Confirm which ingress paths and workloads are in scope, including internal callers and background processing where relevant.
  2. You can validate it sooner than the fixed build. Use representative staging traffic to check the rule's intended behavior and confirm that normal requests still work.
  3. Someone owns the exit. Assign the patch rollout, agree on the coverage evidence, and set a review time for the temporary change.

Say an objects API has a vulnerable optional processing feature, and the gateway already supports disabling access to that feature. Your team can assess the disabled behavior quickly while it rebuilds and tests the service. Collection and detail reads should keep working. If customers use the optional feature, tell support what response those clients will get and how long the change is likely to last.

Measure both sides of the trade-off. Compare the expected time to enforce the rule with the time to get a fixed build to the same set of workloads. Watch normal request success, latency, and rejection counts during rollout. A rise in rejections needs context. It could be the control doing its job or a customer workflow your staging fixtures missed.

Prefer an immediate patch when the fixed build is ready, a canary looks healthy, and the rollout reaches the exposed instances as quickly as the temporary rule. If no trustworthy control covers the affected path and the risk warrants immediate action, consider restricting access or disabling the affected capability while the fix is prepared. When you have evidence of compromise, start incident response alongside remediation.

Where should an API shield run?

Choose the enforcement point based on what it can observe and which requests must pass through it. A web application firewall (WAF) at an API gateway evaluates HTTP traffic there. A Linux runtime shield applies policy where the host can observe the relevant activity. Each depends on coverage at its own layer.

API traffic passes through a gateway with a WAF before reaching a Linux API host with a runtime shield.

A gateway rule fits an HTTP-facing change when the gateway sees the relevant request attributes and every affected request traverses it. Verify the scope against your service inventory. If a service handles work from multiple sources, include those paths in your remediation plan. For a dependency-specific example of why component inventory matters, see our coverage of a Node.js Brotli vulnerability.

A host control makes sense when the relevant behavior is visible on the host and you can establish coverage across the affected kernels and workloads. Its placement can bring the control closer to the component you're protecting, with its own rollout and rollback requirements. Keep application authorization checks in the release test plan. A gateway change belongs in the same review as any changes to middleware authorization.

What does Shirudo add?

Shirudo can load targeted eBPF protections on a running Linux system without restarting it to apply the shield. OpenAI describes an agent-assisted workflow for preparing and checking a candidate shield, with operators controlling deployment. The project describes signed loaders for BPF protections, kernel verification, and TPM-backed evidence of changes to the loaded protections. Shirudo repository

The repository calls the project pre-release. It lists a Linux kernel with the signed-loader ABI and Shirudo's kernel patches, plus TPM 2.0, for production targets. OpenAI frames organization-wide identification and deployment at scale as a long-term goal. Budget separately for preparing the hosts and reviewing a temporary change. OpenAI's description of Shirudo's roadmap

Review a proposed shield as a production change even when it took only minutes to draft. Signing establishes provenance when you trust the signer. Runtime verification checks the program against applicable safety rules. Your own review still has to establish whether the policy matches the intended workloads, preserves normal traffic, and has a removal plan.

When should you remove the shield?

Remove a temporary shield after verifying that the fixed version covers the affected fleet and the patched service passes its release checks. Keep an owner and review time on the incident ticket until removal is complete. If coverage is incomplete, record which systems still need mitigation and who owns them.

Sequence from CVE disclosure to shield activation, patch testing, rollout verification, and shield removal.

  1. CVE disclosed. Map the affected component and versions to running instances. Record which API traffic and workloads depend on them.
  2. Shield on. Verify the control in staging, activate it under change control, and check normal traffic after rollout. Hand the affected workload list to the release owner.
  3. Patch tested and deployed. Test the fixed build in staging, roll it out, and read back the deployed versions. Check secondary regions, failover targets, and autoscaling templates so an old image doesn't return after the incident.
  4. Shield off. Confirm fleet coverage, remove the temporary control, and recheck normal traffic. Record removal in the same incident ticket.

Decide what happens if the fix rolls back. If you revert to an affected build, keep or restore the corresponding protection before that build takes traffic. Treat the code rollout and rule removal as separate changes so the team can verify each one.

Scope API regression checks with Apidog CLI

Use your coding agent and Apidog CLI to turn an endpoint inventory into a staging checklist. For the objects API, start with the collection read and the detail read. Keep the same fixtures for the baseline, the shielded staging build, and the patched staging build so the comparisons are meaningful.

Install the CLI and sign in with your Apidog API access token. Give the agent your project ID. If you work in Codex, follow the Apidog CLI setup for Codex.

npm install -g apidog-cli@latest
apidog login --with-token '<YOUR_TOKEN>'
Enter fullscreen mode Exit fullscreen mode

Give the agent this prompt.

In Apidog project <PROJECT_ID>, list the GET endpoints under /objects and identify collection and detail reads. Suggest normal staging fixtures and response assertions for both. Report any missing endpoint or assertion coverage. Leave the project and gateway configuration untouched.
Enter fullscreen mode Exit fullscreen mode

The agent runs this read-only inventory command.

apidog endpoint list --project '<PROJECT_ID>' --method GET --path-contains /objects
Enter fullscreen mode Exit fullscreen mode

Apidog CLI lists the collection and detail GET endpoints in the sandbox project.

In the sandbox output, GET /objects and GET /objects/{id} give the agent two separate checks to propose. For the collection, use a seeded list and assert the expected status and response shape. For detail, use a known fixture ID and assert that the response is for that fixture. Compare the staging results and flag any contract changes before proceeding. The inventory shows which requests to cover. Passing tests on the staged service provide the evidence for rollout. Once you have a reusable suite, attach its results to the release job. Apidog CLI in CI/CD

If API and infrastructure reviewers work separately, assign the agent's checklist and the shield review as separate tasks in Sharkly. It lets your team assign work to coding agents on your own computers and review their results before rollout.

Frequently asked questions

Is virtual patching the same as live patching?

The terms can overlap. Virtual patching describes the purpose of a temporary control that blocks access to a flaw. Live patching describes how a change takes effect on a running system. A live change can apply a temporary runtime restriction or update running code, depending on the tool.

Does every API virtual patch need a WAF?

No. Pick a control that sees the relevant behavior and covers the affected workloads. A WAF fits HTTP traffic at a gateway. A runtime control can fit host-level activity. If your team can ship a verified fix in the same time, the permanent patch may be the simpler operation.

How long should you keep a virtual patch?

Keep it until you've verified the permanent fix across the affected fleet. Set a review date when you activate the shield and revisit it if the rollout slips. A mixed-version fleet can require the shield for longer than the first successful deployment.

Can an agent approve a production shield?

Use your change-control process to decide who approves deployment. For the Shirudo workflow described by OpenAI, agents can help prepare and validate protections, and security teams control what gets deployed. Give reviewers the target scope, validation results, and removal instructions.

Can you close a CVE ticket after applying a virtual patch?

Record the mitigation and its scope, then keep the permanent remediation open. Attach evidence of the fixed versions and verification results when the rollout is complete. Tracking the two changes lets the on-call team see whether it can safely remove the shield.

Top comments (0)