VPN
Corporate tunnels the sandbox can hold open
On this page(4 sections)
What is configured, dialling and dropping one, and reading connections out of an exported client configuration. Link state is read back from the operating system, not from memory.
GET/vpnConfigured tunnels and which are up
Every stored VPN with its live link state, read back from the operating system rather than from memory, so a tunnel dropped from a shell and one dropped from a screen look the same here.
What you send
Nothing. Call it as it is.
What comes back
| Field | Type |
|---|---|
linksEvery configured tunnel with its live… | object[] |
idWhich tunnel | string |
providerWhat kind of tunnel it is | "wireguard" | "fortinet" | "ipsec" |
stateWhether it is up, dialling, resting,… | "connected" | "connecting" | "disconnected" | "unavailable" … (5) |
gatewayWhat it dials | string |
interfaceThe network interface carrying it, once… | string |
addressThe address the far end gave… | string |
routesWhat goes through it | string[] |
dnsName servers it pushed, when it… | string[] |
sinceWhen it came up, in milliseconds | number |
autoConnectWhether it dials itself when the… | boolean |
detailWhy it failed, or a note… | string |
curl "$SANDBOX/vpn" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.vpn.list();POST/vpn/{id}/connectDial a VPNstream
Brings a stored tunnel up, streaming the client's progress as it authenticates and then sets up routing. Streamed because a dial takes seconds and can fail with something you have to read: a wrong password, a gateway certificate nobody trusts, a code it wants. Connecting one that is already up simply says so.
What you send
| Field | Type | Where |
|---|---|---|
idrequiredWhich tunnel to dial | string | address |
otpA one-time code, where the gateway… | string | body |
What comes back
| Field | Type |
|---|---|
when event is "message" | shape |
data | object |
kind | string |
id | string |
retry | number |
when event is "done" | shape |
data | unknown |
id | string |
retry | number |
when event is "error" | shape |
data | unknown |
id | string |
retry | number |
curl -N -X POST "$SANDBOX/vpn/a1b2c3d4/connect" \
-H "x-intentic-control: $INTENTIC_TOKEN" \
-H "content-type: application/json" \
-d '{"otp":"…"}'import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.vpn.connect({
"id": "a1b2c3d4",
"otp": "…"
});POST/vpn/{id}/disconnectDrop a tunnel
Takes the tunnel down. One that was already down is fine: the promise is that it is not up afterwards.
What you send
| Field | Type | Where |
|---|---|---|
idrequiredWhich tunnel | string | address |
What comes back
| Field | Type |
|---|---|
okAlways true | true |
curl -X POST "$SANDBOX/vpn/a1b2c3d4/disconnect" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.vpn.disconnect({
"id": "a1b2c3d4"
});POST/vpn/import-forticlientRead connections out of an exported config
Turns an exported FortiClient configuration into a list of connections you can add, so somebody holding that file picks from a list instead of retyping a host and port for every tunnel.
What you send
| Field | Type | Where |
|---|---|---|
xmlrequiredThe exported configuration file, whole | string | body |
What comes back
| Field | Type |
|---|---|
connectionsThe connections found in the file,… | object[] |
idThe id it would be added… | string |
labelIts name as the file has… | string |
providerWhat kind of tunnel it is | "wireguard" | "fortinet" | "ipsec" |
serverWhere it dials | string |
portOn which port | number |
usernameThe username, but only when the… | string |
descriptionWhatever the file said about it | string |
localIdAn identity some tunnel types need,… | string |
aggressiveWhich negotiation mode it used | boolean |
pfsWhether it asked for forward secrecy | boolean |
dhGroupWhich key-exchange group it used | string |
needsWhat you still have to type… | string[] |
curl -X POST "$SANDBOX/vpn/import-forticlient" \
-H "x-intentic-control: $INTENTIC_TOKEN" \
-H "content-type: application/json" \
-d '{"xml":"…"}'import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.vpn.importForticlient({
"xml": "…"
});