Settings: internet access
Internet access
Egress is the allow-list of hosts and ports that task environments may connect to. Everything not on the list is refused, and the person sees a notice in the task, such as "Blocked network access to …: the network allow-list doesn't allow it." An empty list means environments can reach nothing outside. A fresh installation starts that way, and New task says so under the message box: "Tasks can't reach the internet: no sites are allowed yet." For an administrator it comes with Allow sites, which opens this page; members are told to ask an administrator to allow sites.
A change applies to each environment's next connection, including environments that are already running. A connection that is already open is not cut; it ends at its usual idle and lifetime bounds.
If the page says "Egress is turned off in the gateway configuration", the installation is set up so that environments
are internal-only. No rule applies, and the list cannot be changed on the page; this is a setting in gateway.toml.
Add, edit or delete a rule
To add a rule for any site, choose Add a site on the Custom card, under Ready-made lists. A link to this
page for one site (/settings/internet-access?host=api.example.com, with &port= for a port other than 443) opens
Add a site with it filled in, or its rule if it has one. The rules are listed under Allowed sites; each row has
Edit, and Delete… in its … menu, which asks first.
- Host: a host name or an address, such as
api.example.comor10.0.0.5. - Ports: 1 to 16 different ports from 1 to 65535, separated by commas, such as
443, 8443. - Delete: asks for confirmation. The next connection to that host from any environment is refused.
The list has a maximum size, which the page names when it is reached ("The allow-list is full …"). Delete a rule to add another.
Internal servers
A rule for a host name reaches only public addresses: a name that resolves to an address on your own network (such as
git.corp.example at 10.1.2.3) is refused, so a task can't be pointed at the inside of your network by a name. For a
server you mean tasks to reach there, mark its rule as an internal server: in Settings › Internet access, tick
Internal server when you add or edit its rule; internal = true on its [[egress.allow]] in gateway.toml; or
"internal": true in the rule through the API. It's off unless you set it, and only for one
exact host name, never for a wildcard or an address (a rule for an exact address already reaches it).
An internal rule reaches private addresses (the RFC 1918 ranges that start 10., 172.16 to 172.31 and 192.168., the
shared range that starts 100.64 to 100.127, and IPv6 fc00::/7) and still never this machine's own ground: loopback,
link-local addresses (cloud metadata), the container engine's networks and their gateways, the task environments'
network pool, the gateway's own addresses, and this machine's own addresses. Each connection looks the name up once
and goes only to the addresses it checked, so a name re-pointed between the check and the connection can't move it,
and one forbidden address in an answer refuses it all.
The gateway finds the container engine's networks itself. It can't see this machine's own addresses from inside its
container, so internal rules stay off until you name them in gateway.toml:
[egress]
internal_never = ["192.0.2.20", "192.0.2.0/24"]
Until then, such a rule refuses every connection, the task's notice says internal servers are off here, the API lists
the rule with internal_state internal_never_missing, Internet access shows "Not in use yet: name this machine's own
addresses in gateway.toml ([egress] internal_never)." under it, and tqa-gateway check names the setting. A gateway that runs in the host's network namespace
finds this machine's addresses itself and doesn't need the setting. If the gateway can't read the container engine's
networks for a few minutes, internal rules refuse until it can again. Internet access then says "Not in use for now: the gateway can't read the
container engine's networks. It tries again every minute." under each internal rule.
In Internet access an internal rule is marked Internal server in the list. The choice isn't offered for a wildcard or an address: "Only for one exact host name. A rule for an address already reaches it."
Ready-made lists
Ready-made lists add what tasks usually need in one step. Each card says what it allows and how many sites it holds, and whether it is On, Partly on or Off. Add puts its rules in the list, each marked with the list's name in the Source column; Remove takes them out again. A host that already had a rule keeps it as it was, and the page names such hosts. A list whose rules you have since edited or deleted says "Some of its sites were changed or removed." and offers Add again. Custom adds any other site (see above).
Open web: any website (ports 80 and 443) asks first ("Allow any website?"), because the agent can then send data to any public site.
The lists are built-in presets, and their rules are fixed in the gateway:
- Package registries (
package_registries): installing packages for Python, JavaScript, Rust and Go (pypi.org,files.pythonhosted.org,registry.npmjs.org,crates.io,static.crates.io,index.crates.io,proxy.golang.org,sum.golang.org), port 443. - Code hosting (
code_hosting):github.com,codeload.github.com,raw.githubusercontent.com,objects.githubusercontent.com,gitlab.com, port 443. - Open web (
open_web): any website on ports 80 and 443. It is not read-only: the agent can send data to any site. A name that resolves to a private or reserved address is still refused, as for every rule. This is the only way to allow any host; a typed rule can't.
The same through the API: GET /api/v1/admin/egress/presets lists them with how much of each is applied (none, partial, all).
POST /api/v1/admin/egress/presets/{id} adds the rules the list lacks, each marked with the preset, and keeps a host
that already has a rule as it is. DELETE /api/v1/admin/egress/presets/{id} removes the rules still marked; a rule you
edited since is yours and stays. Both take an Idempotency-Key and are audited per rule.
Recently refused
Under Allowed sites, Recently refused lists the sites the network proxy refused lately, so that a site a task
needed can be allowed without reading the task's notices or the log. Each row is one site, port and reason, the most
recent first: Site (host:port), Why in plain words, How often ("Once" or "12 times") and Action.
What is kept: the last 200 refused destinations (a host, a port and a reason count as one), with how often each was refused and when last. The record lives in the gateway's memory. A restarted gateway starts with an empty list, which reads "No site was refused since the gateway started."; the gateway's log keeps every refusal. A host is listed as the allow-list writes it (lower case, without a trailing dot). Only administrators see the list; if it can't be read, the page says "The recent refusals couldn't be read." and offers to try again.
The reasons, and what each means:
| Why | What it means |
|---|---|
| Not in the allow-list | No rule covers the host and port. A rule would open it, so the row offers Allow this site |
| A private or reserved address | The name resolves to a private or reserved address, which a rule for a name never reaches (see Internal servers) |
| Internet access is turned off | Egress is turned off in gateway.toml, so no rule applies |
| An internal server on an address that is never reached | An internal rule's name resolves to this machine's own ground: the gateway, its environments, the container engine or the machine itself |
| Internal servers aren't set up | An internal rule, while internal_never isn't named in gateway.toml yet |
| Internal servers can't be checked now | An internal rule, while the gateway can't read the container engine's networks; it tries again every minute |
| A key sent over plain HTTP | A task put a key's stand-in in a request over http://; a key goes only over HTTPS (see Shared keys for web services) |
Allow this site on a row opens Add a site with the host and port filled in; when the host already has a rule, it opens that rule with the port added to its ports. Save it as any rule: the same checks and the same audit entry as a rule you add by hand. The row then reads Allowed now in place of the button. Nothing waits for it: the task's connection was refused when it happened and the task moved on; its next connection to that site is decided by the list as it is then, so the task may need a message to try again. A row with any other reason has no Allow this site, because a rule wouldn't open it: an address the guard refuses stays refused whatever the list says. With egress turned off in the configuration no button is offered either, as the page can't change the list.
The same through the API: GET /api/v1/admin/egress/refusals (administrators) answers items, the most recent first,
each with host, port, reason (not_listed, private, disabled, internal_forbidden, internal_unconfigured,
internal_unverified or key_over_plain_http), count, last_at (RFC 3339), list (install), allowable
(whether a rule would open it) and allowed (whether the list as it is now lets it through); and limit, 200.
Allowing is the ordinary rule write, audited as every rule change.
Web search
There is no search tool. On the Workstation, the agent looks things up with what its environment already has:
- Facts come from Wikipedia's search first, with
curlonen.wikipedia.org. - The web is searched with
curlon DuckDuckGo's plain search page (html.duckduckgo.com), or with headless Chromium on the same page ifcurlis refused or finds nothing.
It then reads the pages it picks. It is told about each only when that site is allowed. A search site may answer a server's address with a page asking it to prove it's a person instead of results; the agent then says so and doesn't retry. DuckDuckGo does this often from a server, Wikipedia hasn't so far.
To let tasks look things up, allow en.wikipedia.org and html.duckduckgo.com on port 443 with Add a site (the
link /settings/internet-access?host=en.wikipedia.org opens it filled in, and the same with the other host), or turn on
the open web. With only these allowed, the agent can read a result's page only on a site that is allowed too; with
the open web it can read any. The pages it reads come into the task marked as outside content, which the agent treats as
data, never as instructions.