Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Geo-blocking and registry control

Besides checking each package, Shield can control where your machines connect to and where packages come from. On a centrally managed machine both are set in the dashboard, in the Geo blocking and Registries tabs of each configuration (see Managing Shield from the dashboard). On a locally configured machine, use the tray app's Policy tab or the commands below.

Both use the same three modes as the Black/White list:

Mode
Behaviour

Disabled

No control (default).

Allow by default (blocklist)

Everything is allowed except what is in the deny list.

Deny by default (allowlist)

Only what is in the allow list is allowed.

Geo-blocking

Geo-blocking controls connections by the country of the destination. It applies to every outbound connection from the machine, not only package downloads.

  • Countries are written as two-letter ISO codes: RU, CN, KP...

  • The unknown country setting decides what happens when the country of a destination cannot be determined: warn (allow and log it, the default), deny or allow.

  • The country database ships with Shield and is updated automatically, so geo-blocking also works offline.

What a blocked connection looks like:

  • Web requests through Shield get a 403 response that names the blocked country, and the block is recorded as an alert.

  • On Linux, other connections (any port or protocol) to a blocked country are dropped. System services and Shield's own connection to Xygeni are never cut.

  • On Windows, connections to a blocked country are refused by the Windows firewall, so the tool reports a connection error instead of a 403.

sudo xygeni-fw policy geo mode allow-default
sudo xygeni-fw policy geo deny add RU --reason "sanctioned"
sudo xygeni-fw policy geo deny add KP
sudo xygeni-fw policy geo unknown warn
xygeni-fw policy geo show
xygeni-fw geo lookup example.com      # which country, and would it be blocked?

Registry control

Registry control restricts the registries and URLs packages may be downloaded from. Use it to make sure packages only come from your approved registries, or to ban a specific mirror. Normal web browsing is never affected.

Each entry is:

  • a host (registry.npmjs.org, *.npmjs.org) or a pattern over the full URL (glob:https://repo.internal/*),

  • optionally an ecosystem, so the rule only applies to that ecosystem's downloads,

  • optionally a reason, shown in the block.

GitHub Actions are downloaded from codeload.github.com, not from github.com. List codeload.github.com to allow or block them.

With this policy, pip install from the public PyPI is blocked with a 403, while npm, GitHub Actions and the internal mirror keep working.

Last updated