SkybuDocs

Ferdigheter · Tilgang og sikkerhet

Outbound traffic from apps

Find out which internet addresses an app may reach, get a host onto its allowlist, make the app use Skybu's outbound proxy, and diagnose an app that cannot reach an outside API.

skill://access/outbound-trafficAgenter leser den med resources/read eller skills_read. Den er skrevet på engelsk, for agentene.

By default an app on Skybu can connect to any public address. An organisation can instead allow only a list of hosts. An app on a list reaches the internet only through Skybu's outbound proxy, which lets the listed hosts through and stops and records everything else. Use this skill when an app calls an outside API, or cannot.

In short

  1. get_app_egress to see the rule that applies to the app and what it was refused.
  2. If a host the app needs is missing, an owner adds it in the dashboard. You cannot change the rule over MCP.
  3. On a list, the app's HTTP client must use the proxy from HTTPS_PROXY. Many do; Node's built-in fetch does not by default.

Step 1: the rule for the app

{ "name": "get_app_egress", "arguments": { "appId": "<app id>" } }
{
  "mode": "allowlist",
  "hosts": ["api.example.no"],
  "organisation": { "rule": "allowlist", "hosts": ["*.googleapis.com", "api.stripe.com"] },
  "effective": { "mode": "allowlist", "hosts": ["*.googleapis.com", "api.example.no", "api.stripe.com"] },
  "blocked": [{ "host": "api.openai.com:443", "count": 12, "lastAt": "…" }]
}
FieldMeaning
organisation.ruleopen (the default: any public address) or allowlist.
organisation.hostsHosts every app on a list may reach.
modeThe app's own choice: open, allowlist, or null to follow the organisation.
hostsHosts this app may reach on top of the organisation's.
effectiveWhat applies now: the mode, and the organisation's hosts and the app's together.
blockedThe last 20 hosts the app tried to reach and was refused, as host:port, with how often and when last.

One app can stay open while the organisation uses a list, or be on a list while the rest are open. A pull request preview follows its app's rule.

Step 2: getting a host on the list

Only owners of the organisation can change where apps may connect, and only in the dashboard at https://platform.skybu.no. There is no agent tool or CLI command for it. Tell the user what to add and where:

  • For this app only: the app's Settings tab, "Rule for this app" (follow the organisation, open, or allowed addresses only, with hosts of its own on top of the organisation's).
  • For every app: Settings → General, "Outbound traffic".

Write the hosts the way Skybu reads them, one per line:

EntryAllows
api.example.noThat host on ports 80 and 443.
*.example.noEvery subdomain of example.no on ports 80 and 443, but not example.no itself; add that too if needed.
api.example.no:8443That host on port 8443 only.

Hostnames only: no IP addresses, paths or wildcards in the middle. A scheme or path is stripped (https://api.example.no/v1 becomes api.example.no). A list holds at most 100 hosts. A wrong entry is refused with invalid_egress_host.

The proxy picks up a changed list within seconds. Check effective.hosts with get_app_egress afterwards.

Step 3: the app must use the proxy

An app on a list cannot connect to the internet directly at all; only the proxy, its project's database and file storage are reachable. Skybu gives it these variables:

VariableValue
HTTPS_PROXY, https_proxy, HTTP_PROXY, http_proxyThe proxy's address with the app's own user and password.
NO_PROXY, no_proxylocalhost, 127.0.0.1, .svc, .cluster.local: addresses inside Skybu go direct.

Skybu sets these itself and they replace any variables of the same name the user sets. An HTTP client that ignores them cannot connect out. Most honour them: curl, Python's requests and httpx, Go's default client. Node's built-in fetch does not, unless the app runs with NODE_USE_ENV_PROXY=1 on a Node version that supports it, or sets a proxy agent such as undici's EnvHttpProxyAgent at start-up:

import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";

setGlobalDispatcher(new EnvHttpProxyAgent());

The proxy carries HTTP, and HTTPS through CONNECT. A client for another protocol to an outside server, such as a Postgres or SMTP client, cannot connect unless it can tunnel through an HTTP proxy.

Diagnosing "my app can't reach an API"

  1. get_app_logs for the error the app logs.
  2. get_app_egress. If effective.mode is open, Skybu does not stop the app: look at the address, the API key (skill://apps/environment-variables) or the outside service.
  3. If the host is in blocked, it is not on the list. Ask an owner to add it (Step 2). The proxy answered the app with 403 … is not on this app's list of allowed addresses.
  4. If the mode is allowlist, the host is on the list, and it is not in blocked, the app most likely connects directly instead of through the proxy: timeouts or refused connections in the log. Fix the client (Step 3) and deploy again.
  5. Other answers from the proxy:
AnswerMeaning
403 … does not resolve to a public addressThe host resolves to a private address. The proxy never connects there, even when listed.
407 Proxy authentication requiredThe client sent no credentials or wrong ones. Use the whole HTTPS_PROXY value, user and password included.
429 Too many connectionsThe app holds too many connections through the proxy at once (200). Reuse connections.
502 The upstream could not be reachedThe host is allowed but did not answer.

Things to know

  • Refused attempts reach blocked within seconds. The register (list_app_register) counts them per app for the last 30 days.
  • Every change to an organisation's or an app's rule is in the audit log.