Recipes

Allow a box to reach a host

Note
This page is generated from a mock CLI, and its numbers are placeholders.

Verified against vakna 0.0.0-mock on

Allow it with vakna net allow <host>, then run the command again. Every box starts in lockdown, so a host is out of reach until you allow it.

How do I let pip reach PyPI?

sh
vakna shell api -- pip install -r requirements.txtvakna net allow pypi.orgvakna shell api -- pip install -r requirements.txt
prints ERROR: Could not find a version that satisfies the requirement flask==3.0.3 (from versions: none) ERROR: No matching distribution found for flask==3.0.3 ran pip install -r requirements.txt · exit 1 2.40s vakna: lockdown blocked pypi.org hint: vakna net allow pypi.org # lockdown blocks it lockdown now lets pypi.org out · 3 hosts allowed 0.04s Successfully installed blinker-1.8.2 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0 jinja2-3.1.4 … ran pip install -r requirements.txt · exit 0 6.20s

The first install fails the way it would offline. Vakna then names the host it blocked and the command that allows it.

How does an agent detect a blocked host?

With --json the error is an object with "code":"egress_blocked". Branch on the code, not on the message.

sh
vakna shell api --json -- pip install -r requirements.txt
prints ERROR: Could not find a version that satisfies the requirement flask==3.0.3 (from versions: none) ERROR: No matching distribution found for flask==3.0.3 {"v":1,"event":"ran","box":"api","id":"sbx_eu1a_01JB7X9K3M4N5P6Q7R8S9T0V1W","command":"pip install -r requirements.txt","exit":1,"ms":2400,"mocked":true} {"v":1,"event":"error","code":"egress_blocked","message":"lockdown blocked pypi.org","hint":"vakna net allow pypi.org # lockdown blocks it","docs":"https://vakna.com/docs/errors/egress_blocked","mocked":true}

View as Markdown