Egress
6 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.
Named sets of package-registry hosts for egress allow lists#
GET
Responses/v1/egress/presetsscope sandboxes:read200401403
curl -s -X GET https://api.kosa8.com/v1/egress/presets \ -H "Authorization: Bearer $KOSA8_API_KEY"
The egress policy the sandbox runs with#
GET
Parameters/v1/sandboxes/{id}/egressscope sandboxes:readidrequiredpath · stringSandbox id (sbx_…)
200401403404
curl -s -X GET https://api.kosa8.com/v1/sandboxes/$SBX/egress \ -H "Authorization: Bearer $KOSA8_API_KEY"
Change what the sandbox may reach, at once (a sleeping one when it wakes)#
PUT
/v1/sandboxes/{id}/egressscope sandboxes:writeInside the organization's policy when it enforces one (403 egress_not_allowed otherwise). Connections the new policy refuses stop at their next packet.
Parametersidrequiredpath · stringSandbox id (sbx_…)
internetbooleanfalse: nothing leaves but what allow and presets name. Default true when nothing is listed
allowarray of stringHostnames (exact), *.domain wildcards (any depth below, not the domain), IPv4 addresses or CIDRs
denyarray of stringRefused even where allow covers them. A name is refused at DNS; a CIDR for every packet
presetsarray of "common" | "npm" | "pypi" | "github" | "go" | "crates" | "rubygems" | "maven" …—
200400401403404409501502
curl -s -X PUT https://api.kosa8.com/v1/sandboxes/$SBX/egress \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
Back to the organization's default#
DELETE
Parameters/v1/sandboxes/{id}/egressscope sandboxes:writeidrequiredpath · stringSandbox id (sbx_…)
200401403404501502
curl -s -X DELETE https://api.kosa8.com/v1/sandboxes/$SBX/egress \ -H "Authorization: Bearer $KOSA8_API_KEY"
The organization's egress default and whether it is enforced#
GET
Responses/v1/org/egressscope sandboxes:read200401403
curl -s -X GET https://api.kosa8.com/v1/org/egress \ -H "Authorization: Bearer $KOSA8_API_KEY"
Set the organization's egress default (enforce: true makes it a ceiling); pushed to running and sleeping sandboxes#
PUT
JSON body/v1/org/egressscope admindefaultrequiredobject | null—
enforceboolean—
200400401403409
curl -s -X PUT https://api.kosa8.com/v1/org/egress \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json