Skip to content

feat(network): honor HTTP_PROXY, HTTPS_PROXY and NO_PROXY for guarded requests, AWS SDK clients and OTLP export - #9851

Merged
waleedlatif1 merged 4 commits into
stagingfrom
feat/outbound-env-proxy
Nov 10, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
feat/outbound-env-proxy

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Requests through the SSRF guard (SSO OIDC discovery, HTTP block, tools, connectors, webhooks, MCP, model endpoints typed into a block) now honor HTTPS_PROXY / HTTP_PROXY / NO_PROXY with undici's EnvHttpProxyAgent rules. Previously they connected straight to the pinned IP, so proxy-only deployments could not save an OIDC provider
  • One change in the shared outbound transport covers secureFetchWithPinnedIP, the pinned fetch, and the DNS-guarded fetch. SSRF checks still run: every proxied request and redirect hop is resolved and judged first (honoring the caller's abort signal); the proxy gets the hostname so domain-allowlisting proxies work
  • AWS SDK clients (S3 storage, Bedrock, SES, Marketplace, AppConfig, CloudWatch metrics, and every AWS integration) and the OTLP exporters bring their own node:http stack, which Bun does not proxy. They now take a shared agent-base agent that picks the proxy per connection and honors NO_PROXY. Integration clients get it through a new awsClientConfig beside awsClientCredentials, so new AWS families inherit it
  • Nothing changes without a proxy variable: awsRequestHandler returns the caller's options and the SDK keeps its defaults (Bedrock keeps HTTP/2; with a proxy it uses HTTP/1.1, which Converse/ConverseStream support)
  • https tunnels via CONNECT, http uses absolute-form forwarding; http:// and https:// proxy URLs are supported and anything else fails closed. Proxy credentials come from the URL and never reach the origin. The HTTP block's per-request proxyUrl still wins; gateway-routed orgs are unchanged
  • SMTP stays direct on purpose: it is not HTTP, and tunnelling it through HTTPS_PROXY would silently reroute existing mail relays
  • New DOMAIN_VERIFICATION_NAMESERVERS lets the SSO domain TXT lookup use an internal resolver instead of 1.1.1.1/8.8.8.8
  • Self-hosting networking + env var docs updated, including NO_PROXY guidance for MinIO, VPC endpoints and in-cluster collectors

Type of Change

  • New feature

Testing

  • environment-proxy.server.test.ts against real local forward proxies (http and https) and a TLS origin: hostname tunneling + credential isolation for guarded fetches and an S3 client, pinned and DNS-guarded fetches, plain-http absolute-form, NO_PROXY bypass on both stacks, blocked destination and blocked redirect hop never reach the proxy, fail-closed on an unsupported proxy URL, env precedence table, and a probe under the real Bun runtime (guarded fetch + S3)
  • Red-checked: disabling the transport proxy branch fails 6/7 original cases; removing the SSRF check fails the 2 blocking tests; returning plain options from awsRequestHandler fails both AWS routing tests
  • Manual Bun probes against a local proxy: S3 and Bedrock reached AWS through the proxy, keep-alive reused the tunnel, and the OTLP exporter tunnelled
  • lib/internal, lib/selectors, lib/core/network, lib/core/security, providers/bedrock, uploads, email, marketplace, config, monitoring, credentials, SSO suites pass
  • /simplify and /cleanup passes applied; biome + check:test-patterns; type-check, audits and full suite in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 10, 2026 9:15pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The latest changes appear safe to merge, with no new actionable findings.

Summary

The PR adds environment-based proxy routing for guarded HTTP requests, AWS clients, and OTLP export.

  • Guarded HTTP requests can now use the deployment’s proxy settings.
  • AWS clients can now send requests through a configured HTTP proxy.
  • OTLP traces, metrics, and logs can now use the deployment’s proxy.
  • SSO domain checks can use DNS servers chosen for the deployment.

The previous cancellation finding is fixed: both fetch adapters pass the caller’s signal to the destination check. The forbidden environment-cleanup hook is also gone. waleedlatif1 retained the loopback transport tests because they use managed local servers and follow the existing gateway tests; Greptile withdrew its request to move them. No numbered previous comments were supplied.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Guarded HTTP request] --> B{Outbound route}
  B -->|Gateway| C[Organization gateway]
  B -->|Direct| D{Explicit request proxy?}
  D -->|Yes| E[Existing request proxy]
  D -->|No| F{Environment proxy applies?}
  F -->|No| G[Pinned direct connection]
  F -->|Yes| H[Check destination with caller signal]
  H -->|Allowed| I[Send hostname to proxy]
  H -->|Blocked| J[Reject request]
  K[AWS clients and OTLP exporters] --> L[Shared environment-aware agent]
  L --> M[Proxy or direct connection under NO_PROXY]
Loading

Reviews (4) · Last reviewed commit: "fix(network): record the proxy dependenc..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

Confidence score: 4/5

  • environment-proxy.server.ts handles valid wildcard entries differently from EnvHttpProxyAgent: * does not bypass all hosts, and *.example.com also bypasses the apex. Align the matcher’s per-entry wildcard behavior.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/core/network/environment-proxy.server.ts">

<violation number="1" location="apps/sim/lib/core/network/environment-proxy.server.ts:20">
P3: This matcher diverges from `EnvHttpProxyAgent` for valid wildcard entries: `none.invalid,*` does not bypass all hosts, while `*.example.com` incorrectly bypasses the apex. Handle `*` per entry and keep the `*.` form limited to subdomains so guarded and default fetches choose the same route.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner November 10, 2026 21:03
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@waleedlatif1 waleedlatif1 changed the title feat(network): honor HTTP_PROXY, HTTPS_PROXY and NO_PROXY for guarded outbound requests feat(network): honor HTTP_PROXY, HTTPS_PROXY and NO_PROXY for guarded requests, AWS SDK clients and OTLP export Nov 10, 2026
@cubic-dev-ai

cubic-dev-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 40 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/package.json Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 41 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant