Skip to content
Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.

Firewall API

Source: daemon/proto/hostcraft/v1/firewall.proto

FirewallService manages per-account nftables rules and country blocks. REST: /api/v1/firewall.

Method REST route Permission Streaming
ListRules GET /api/v1/firewall/rules FirewallRuleRead unary
CreateRule POST /api/v1/firewall/rules FirewallRuleCreate unary
GetRule GET /api/v1/firewall/rules/{id} FirewallRuleRead unary
UpdateRule PATCH /api/v1/firewall/rules/{id} FirewallRuleUpdate unary
DeleteRule DELETE /api/v1/firewall/rules/{id} FirewallRuleDelete unary
ListBlockedCountries GET /api/v1/firewall/countries/{account_id} FirewallCountryList unary
BlockCountry POST /api/v1/firewall/countries/{account_id} FirewallCountryBlock unary
UnblockCountry DELETE /api/v1/firewall/countries/{account_id}/{country_code} FirewallCountryUnblock unary
ListServerBlocks GET /api/v1/firewall/server-blocks FirewallRuleRead unary

/hostcraft.v1.FirewallService/ListRules

/hostcraft.v1.FirewallService/CreateRule

/hostcraft.v1.FirewallService/GetRule

/hostcraft.v1.FirewallService/UpdateRule

/hostcraft.v1.FirewallService/DeleteRule

/hostcraft.v1.FirewallService/ListBlockedCountries

/hostcraft.v1.FirewallService/BlockCountry

/hostcraft.v1.FirewallService/UnblockCountry

/hostcraft.v1.FirewallService/ListServerBlocks

Field Type Number Description
account_id string 1 -
country_code string 2 -
note string 3 -
Field Type Number Description
account_id string 1 -
country_code string 2 -
note string 3 -
blocked_at google.protobuf.Timestamp 4 -
Field Type Number Description
account_id string 1 -
kind string 2 -
source_kind string 3 -
source string 4 -
destination FirewallDestination 5 -
protocol string 6 -
priority int64 7 -
note string 8 -
Field Type Number Description
rule FirewallRule 1 -
workflow_id string 2 -
Field Type Number Description
id string 1 -

Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.

No fields.

Field Type Number Description
port int64 1 -
port_from int64 2 -
port_to int64 3 -
panel_target bool 4 -
Field Type Number Description
id string 1 -
account_id string 2 -
kind string 3 allow | deny
source_kind string 4 ip | cidr | country
source string 5 -
destination FirewallDestination 6 -
protocol string 7 tcp | udp | any
priority int64 8 -
enabled bool 9 -
note string 10 -
nft_handle int64 11 -
created_at google.protobuf.Timestamp 12 -
Field Type Number Description
id string 1 -
Field Type Number Description
account_id string 1 -
Field Type Number Description
countries repeated BlockedCountry 1 -
Field Type Number Description
account_id string 1 -
limit int64 2 -
offset int64 3 -
Field Type Number Description
rules repeated FirewallRule 1 -
Field Type Number Description
account_id string 1 -
Field Type Number Description
blocks repeated ServerBlock 1 -
Field Type Number Description
ip string 1 -
reason string 2 -
source string 3 -
created_at google.protobuf.Timestamp 4 -
expires_at google.protobuf.Timestamp 5 -
Field Type Number Description
account_id string 1 -
country_code string 2 -
Field Type Number Description
id string 1 -
enabled optional bool 2 -
priority optional int64 3 -
note optional string 4 -