Zudoku
Unikraft Cloud Network Shield Plugin API

AddressConflict

An address two policies on one port have resolved under two handlers.
port
​integer · uint16 · required

The port.

policies
​string[] · required

The two policies.

addresses
​string[] · required

The addresses both hold.

AddressSets

The address sets the policy set needs, against the kernel's table.
needed
​integer · uint32 · required
max
​integer · uint32 · required

BandwidthLimit

A cap on what the shield sends to the sandboxes, in bits per second.
max_bits_per_second
​integer · uint64 · min: 8 · max: 100000000000 · required

The cap, a whole number of bytes per second: a multiple of 8.

Example: 10000000

ConnectionLimit

A cap on new connections, counted by the kernel, on any handler.
max_connections
​integer · uint32 · min: 1 · max: 1000000 · required

New connections allowed within the window. Over it they are reset.

window_seconds
​number · enum · required

The window: a second, a minute, an hour or a day.

Enum values:
1
60
3600
86400

ConnectionLimited

A connection limit, for one policy and port.
policy
​string · required

The policy.

port
​integer · uint16 · required

The destination port.

Direction

string · enum
Enum values:
outbound
inbound

Which way the connections a policy applies to go.

EmptyResponse

A response which carries no data of its own. `data` is `null`; the outcome of the request is the HTTP status code.
status
​string · enum · required

The status of the response.

Enum values:
success
error
partial_success
data
​required

The response data for this request.

op_time_us
​integer · uint64 · required

The operation time in microseconds.

message
​string

An optional message providing additional information about the status.

A list of errors which may have occurred during the request.

Enforcement

What the packet layer enforces, derived from the policy set.
ipset
​boolean · required

Whether the kernel matches address sets; no policy is enforced without.

bandwidth_limit
​integer | null · uint64 · required

The shield-wide bandwidth cap in bits per second, or null.

​Intercept[]

Redirects into the proxy, one per policy and port.

​Exemption[]

Exemptions from the proxy, one per policy, port and protocol.

​ConnectionLimited[]

Connection limits, one per policy and port.

​InboundPort[]

Sandbox ports opened by inbound policies.

​AddressConflict[]

Addresses claimed under two handlers on one port. Normally empty.

​SetNearCapacity[]

Address sets near capacity. Normally empty.

​object

The address sets needed, and the most the kernel holds.

error
​string

Present only when the fields above could not be worked out: why.

Exemption

An exemption from the proxy, for one policy, port and protocol.
policy
​string · required

The policy.

protocol
​string · enum · required

The protocol.

Enum values:
tcp
udp
port
​integer · uint16 · required

The destination port.

Handler

string · enum
Enum values:
http
https
passthrough

How the connections a policy matches are carried.

IcapGenerations

The snapshot generations, published and loaded by the proxy.
published
​integer | null · uint64 · required

The generation last published.

secrets
​integer | null · uint64 · required

The generation of secrets the proxy has loaded, or null.

limits
​integer | null · uint64 · required

The generation of request limits the proxy has loaded, or null.

InboundPort

A sandbox port an inbound policy opens.
policy
​string · required

The policy.

sandbox
​string · required

The sandbox's name as the policy gave it, or else its address or range.

address
​string · required

The sandbox's address, or the range of sandboxes.

​object · required

The ports opened, both ends included: one port is a range of one.

handler
​string · enum · required

How connections are carried.

Enum values:
http
https
passthrough
listener
​integer | null · uint16 · required

http only: the listener serving the policy, else null.

sources
​string[] · required

http only: the networks clients may connect from; empty is anyone.

InjectMethod

string · enum
Enum values:
http_header
ssh_identity
ssh_password

How a secret is substituted.

Intercept

A redirect into the proxy, for one policy and port.
policy
​string · required

The policy.

handler
​string · enum · required

The proxy listener it goes to.

Enum values:
http
https
port
​integer · uint16 · required

The destination port.

Limits

The limits on the shield as a whole, rather than on a policy.
bandwidth_limit
​object | null

(OPTIONAL) The bandwidth cap; absent or null for none.

LimitsResponse

The response carrying the limits, read back from the kernel.
status
​string · enum · required

The status of the response.

Enum values:
success
error
partial_success
​object · required

The response data for this request.

op_time_us
​integer · uint64 · required

The operation time in microseconds.

message
​string

An optional message providing additional information about the status.

A list of errors which may have occurred during the request.

LogCategory

string · enum
Enum values:
api
policy

What wrote a log entry.

LogEntry

One log entry.
timestamp
​string · date-time · required

When the event occurred, in UTC to the microsecond. No two entries share one, so it is also the entry's place in the log.

uptime_ms
​integer · uint64 · required

The control plane's uptime when the entry was written, in whole milliseconds. It drops when the control plane restarts.

category
​string · enum · required

What wrote it.

Enum values:
api
policy
message
​string · required

What happened, sanitised and at most 2048 characters.

​object · required

Structured detail, which varies by category.

LogsData

A page of the log.
​LogEntry[] · required

The entries, in the order asked for.

next
​string | null · date-time · required

The from of the page after this one: a microsecond after the last entry's timestamp, or with order=desc a microsecond before it, and null with order=desc once the oldest entry is on the page. In ascending order it is set after the newest entry too, so that asking with it returns what has been written since, and an empty page answers with the from it was sent.

total
​integer · uint32 · required

The entries from from on, before count cuts the page.

server_time
​string · date-time · required

The shield's time when it answered.

LogsResponse

The response carrying a page of the log.
status
​string · enum · required

The status of the response.

Enum values:
success
error
partial_success
​object · required

The response data for this request.

op_time_us
​integer · uint64 · required

The operation time in microseconds.

message
​string

An optional message providing additional information about the status.

A list of errors which may have occurred during the request.

PaginationOrder

string · enum
Enum values:
asc
desc

Pagination helpers.

PolicyListData

Policies: every one in force, or for an addition the ones added.
​PolicyRule[] · required

The policies, in the order they were written.

PolicyListResponse

The response carrying the policy set.
status
​string · enum · required

The status of the response.

Enum values:
success
error
partial_success
​object · required

The response data for this request.

op_time_us
​integer · uint64 · required

The operation time in microseconds.

message
​string

An optional message providing additional information about the status.

A list of errors which may have occurred during the request.

PolicyMatch

What a policy applies to.
hosts
​string[]

(OPTIONAL) Hostnames, each with at most a single leading *. wildcard, stored lowercased. Not addresses, which go in networks. Inbound: the sandbox's private name, exactly one.

networks
​string[]

(OPTIONAL) IPv4 networks in CIDR notation, given by their network address. Outbound: public ranges only. Inbound: the sandbox's address, which a name in hosts is resolved to when the policy is written, or on a passthrough policy a range of sandboxes. A policy names a host or a network.

ports
​integer[]

The ports to match. A policy names at least one port, here or in port_ranges. On an outbound policy 53 and 3128-3131 are reserved.

​PortRange[]

(OPTIONAL) Ranges of ports, both ends included. An inbound passthrough policy's only, for the platform's plugin range.

protocols
​Protocol[]

(OPTIONAL) The protocols to match; tcp when empty.

Enum values:
tcp
udp
sources
​string[]

(OPTIONAL) Inbound http only: the IPv4 networks clients may connect from, read from X-Forwarded-For. Empty admits anyone.

PolicyResponse

The response carrying one policy.
status
​string · enum · required

The status of the response.

Enum values:
success
error
partial_success
​object · required

The response data for this request.

op_time_us
​integer · uint64 · required

The operation time in microseconds.

message
​string

An optional message providing additional information about the status.

A list of errors which may have occurred during the request.

PolicyRule

A policy rule.
id
​string · required

The policy's id: 1 to 64 ASCII letters, digits, ., _ and -, but not . or .., unique among the policies.

Example: allow-github-https
direction
​string · enum · required

Which way the connections go.

Enum values:
outbound
inbound
handler
​string · enum · required

How matched connections are carried; inbound, http or passthrough.

Enum values:
http
https
passthrough
​object · required

What the policy applies to.

priority
​integer · int32

(OPTIONAL) Evaluation priority, highest first.

Default: 100
request_limit
​object | null

(OPTIONAL) A cap on requests. Not on passthrough, nor inbound.

connection_limit
​object | null

(OPTIONAL) A cap on new connections. Not inbound.

PortRange

An inclusive range of ports; one port is a range of one.
first
​integer · uint16 · required
last
​integer · uint16 · required

Protocol

string · enum
Enum values:
tcp
udp

A protocol a policy matches.

ReplacePolicyRequest

The request to replace one policy, which the path names.
direction
​string · enum · required

Which way the connections go.

Enum values:
outbound
inbound
handler
​string · enum · required

How matched connections are carried; inbound, http or passthrough.

Enum values:
http
https
passthrough
​object · required

What the policy applies to.

id
​string

(OPTIONAL) The policy's id. Given, it has to be the path's.

priority
​integer · int32

(OPTIONAL) Evaluation priority, highest first.

Default: 100
request_limit
​object | null

(OPTIONAL) A cap on requests. Not on passthrough, nor inbound.

connection_limit
​object | null

(OPTIONAL) A cap on new connections. Not inbound.

ReplaceSecretRequest

The request to replace one secret, which the path names.
​object · required

Where and how it is substituted.

hostname
​string[] · minItems: 1 · required

Exact hostnames the secret may be substituted for, at least one, at least one of them covered by an https policy the secret is bound to.

id
​string

(OPTIONAL) The secret's id. Given, it has to be the path's.

value
​string

(OPTIONAL) The value substituted for the pattern. Left out, the stored one is kept. Never returned.

bound_to_policies
​string[]

(OPTIONAL) The https policies whose requests the secret is substituted into. Empty, it applies to every https policy covering its hostnames.

RequestLimit

A cap on requests, counted by the proxy, on `http` and `https` policies.
max_requests
​integer · uint32 · min: 1 · max: 1000000 · required

Requests allowed within the sliding window; over it, 429.

window_seconds
​integer · uint32 · min: 1 · max: 86400 · required

The length of the sliding window, in seconds.

ResponseError

The error response message for an API request.
status
​integer · uint64 · required

The HTTP status code of the error.

ResponseStatus

string · enum
Enum values:
success
error
partial_success

The response status of an API request.

Sealed

Why the shield sealed. Once set, it never clears.
reason
​string · required

What failed.

failures
​string[] · required

The operations that failed.

since
​string | null · date-time · required

When the shield sealed.

remedy
​string · required

What to do: replace the instance.

​object

Which of the shutdown steps took effect.

Secret

A secret, as written.
id
​string · required

The secret's id, on the same terms as a policy's.

Example: github-token
value
​string · required

The value substituted for the pattern. Never returned.

​object · required

Where and how it is substituted.

hostname
​string[] · minItems: 1 · required

Exact hostnames the secret may be substituted for, at least one, at least one of them covered by an https policy the secret is bound to.

bound_to_policies
​string[]

(OPTIONAL) The https policies whose requests the secret is substituted into. Empty, it applies to every https policy covering its hostnames.

SecretInject

Where and how a secret is substituted.
method
​string · enum · required

The substitution method.

Enum values:
http_header
ssh_identity
ssh_password
header_name
​string · required

The request header the pattern is replaced in. Only what HTTP allows in a header name: letters, digits, any of !#$%&'*+-.^_|~ and the backtick.

Example: Authorization
pattern
​string · required

The literal text replaced by the secret's value.

Example: {{GITHUB_TOKEN}}

SecretListData

Secrets: every one in force, or for an addition the ones added.
​SecretMetadata[] · required

The secrets, values excluded.

SecretListResponse

The response carrying every secret's metadata.
status
​string · enum · required

The status of the response.

Enum values:
success
error
partial_success
​object · required

The response data for this request.

op_time_us
​integer · uint64 · required

The operation time in microseconds.

message
​string

An optional message providing additional information about the status.

A list of errors which may have occurred during the request.

SecretMetadata

A secret as the API answers it: everything but the value.
id
​string · required

The secret's id.

​object · required

Where and how it is substituted.

hostname
​string[] · required

The hostnames it may be substituted for.

bound_to_policies
​string[] · required

The policies it is bound to.

SecretReplacement

A secret as a replace of every secret sends it.
id
​string · required

The secret's id, on the same terms as a policy's.

Example: github-token
​object · required

Where and how it is substituted.

hostname
​string[] · minItems: 1 · required

Exact hostnames the secret may be substituted for, at least one, at least one of them covered by an https policy the secret is bound to.

value
​string

(OPTIONAL) The value substituted for the pattern. Left out, the stored one is kept; a new secret needs it. Never returned.

bound_to_policies
​string[]

(OPTIONAL) The https policies whose requests the secret is substituted into. Empty, it applies to every https policy covering its hostnames.

SecretResponse

The response carrying one secret's metadata.
status
​string · enum · required

The status of the response.

Enum values:
success
error
partial_success
​object · required

The response data for this request.

op_time_us
​integer · uint64 · required

The operation time in microseconds.

message
​string

An optional message providing additional information about the status.

A list of errors which may have occurred during the request.

SetNearCapacity

An address set at 90% of its capacity or above.
policy
​string · required

The policy the set belongs to.

port
​integer · uint16 · required

The port the set belongs to.

entries
​integer · uint32 · required

The addresses in it.

maxelem
​integer · uint32 · required

The most it can hold.

full
​boolean · required

Whether it is full.

StatusData

The state of the shield.
uptime_ms
​integer · uint64 · required

Whole milliseconds since the control plane started.

policy_count
​integer · uint32 · required

The number of policies in force.

secret_count
​integer · uint32 · required

The number of secrets in force.

​object · required

What the packet layer enforces.

​object · required

The generations published and loaded.

failed
​object | null · required

null while the shield can say what it enforces. Set when applying a policy set failed: the shield denies all traffic and refuses every write.

StatusResponse

The response carrying the state of the shield.
status
​string · enum · required

The status of the response.

Enum values:
success
error
partial_success
​object · required

The response data for this request.

op_time_us
​integer · uint64 · required

The operation time in microseconds.

message
​string

An optional message providing additional information about the status.

A list of errors which may have occurred during the request.