Reference For: developers

API: firewall

Operations of the firewall tag of the native REST API.

Distributed firewall at the vNIC (docs/network/DFW-HOSTBRIDGE.md, ADR-011)

GET /v1/firewall/bypass

The emergency bypasses in force.

CLI
kyvernon firewall bypass list

Responses

StatusDescriptionSchema
200OKarray of BypassView

POST /v1/firewall/bypass

Opens every vNIC of a host for a limited time with an audited Emergency rule (a task; Kyvernon.Firewall.Bypass). Enabling it again extends it.

CLI
kyvernon firewall bypass --host <host> --reason <reason> --for <duration> [--wait]

Request body

application/json: BypassBody

NameTypeRequiredDescription
durationSecondsinteger (int64) or nullHow long, seconds (60 to 86,400; default 1,800).
hoststringyesHost id (host-N).
reasonstringyesWhy (kept in the policy and the events; 1 to 500 characters).

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
400Invalid argument; the error body names the fieldErrorBody

DELETE /v1/firewall/bypass/{id}

Ends a bypass before its time.

CLI
kyvernon firewall bypass remove <id> [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall bypass

Responses

StatusDescriptionSchema
204Done; no body
404Not found (or not visible to the caller)ErrorBody

GET /v1/firewall/groups

Firewall groups of a scope (a tenant user: its own and the shared provider groups, name only).

CLI
kyvernon firewall groups list [--tenant <tenant>]

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullTenant id (tenant-N); absent: the provider (a tenant user: its tenant).

Responses

StatusDescriptionSchema
200OKarray of GroupView

POST /v1/firewall/groups

Creates a group (Kyvernon.Firewall.ManageGroups; a shared provider group needs Kyvernon.Firewall.ManageProvider).

CLI
kyvernon firewall groups create --name <name> [--criterion <tags>] [--vm <vm>] [--prefix <prefix>] [--tenant <tenant>] [--wait]

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: GroupBody

NameTypeRequiredDescription
criteriaarray of array of TagViewTag criteria: a vNIC is a member when its VM carries every tag of one criterion.
descriptionstringDescription (tenants see it with the name for shared provider groups).
groupsarray of stringNested groups.
macsarray of stringEvery vNIC with one of these MAC addresses (00:50:56:aa:bb:cc).
namestringyesName (unique in its scope; sys: is reserved).
networksarray of stringEvery vNIC on these host-bridge networks.
prefixesarray of stringAddresses and prefixes (endpoints outside the platform).
sharedbooleanProvider groups only: tenants may use it as source or destination (name only).
vmsarray of stringEvery vNIC of these VMs.
vnicsarray of VnicViewThese vNICs.

Responses

StatusDescriptionSchema
201CreatedGroupView
400Invalid argument; the error body names the fieldErrorBody

GET /v1/firewall/groups/{id}

One group.

CLI
kyvernon firewall groups show <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall group

Responses

StatusDescriptionSchema
200OKGroupView
404Not found (or not visible to the caller)ErrorBody

PUT /v1/firewall/groups/{id}

Replaces a group.

CLI
kyvernon firewall groups update <id> [--name <name>] [--criterion <tags>] [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall group
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: GroupBody

NameTypeRequiredDescription
criteriaarray of array of TagViewTag criteria: a vNIC is a member when its VM carries every tag of one criterion.
descriptionstringDescription (tenants see it with the name for shared provider groups).
groupsarray of stringNested groups.
macsarray of stringEvery vNIC with one of these MAC addresses (00:50:56:aa:bb:cc).
namestringyesName (unique in its scope; sys: is reserved).
networksarray of stringEvery vNIC on these host-bridge networks.
prefixesarray of stringAddresses and prefixes (endpoints outside the platform).
sharedbooleanProvider groups only: tenants may use it as source or destination (name only).
vmsarray of stringEvery vNIC of these VMs.
vnicsarray of VnicViewThese vNICs.

Responses

StatusDescriptionSchema
200OKGroupView
409Conflict: the object exists, or expectedVersion is staleErrorBody

DELETE /v1/firewall/groups/{id}

Deletes a group (refused while it is referenced).

CLI
kyvernon firewall groups delete <id> [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall group
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody

GET /v1/firewall/groups/{id}/members

Resolved members of a group: vNICs and addresses.

CLI
kyvernon firewall groups members <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall group

Responses

StatusDescriptionSchema
200OKGroupMembersView

GET /v1/firewall/logs

Firewall log records of every host, newest first (kept in memory, bounded).

CLI
kyvernon firewall logs [--host <host>] [--rule <n>] [--limit <n>]

Parameters

NameInTypeRequiredDescription
limitqueryinteger or nullMost records (default 500, at most 5,000).
hostquerystring or nullHost id.
rulequeryinteger (int32) or nullRule number.

Responses

StatusDescriptionSchema
200OKarray of LogRecordView

GET /v1/firewall/policies

Policies with their rules, in evaluation order.

CLI
kyvernon firewall policies list [--tenant <tenant>]

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullTenant id (tenant-N); absent: the provider (a tenant user: its tenant).

Responses

StatusDescriptionSchema
200OKarray of PolicyView

POST /v1/firewall/policies

Creates a policy (Environment and Application: Kyvernon.Firewall.ManagePolicies; Emergency and Infrastructure: Kyvernon.Firewall.ManageProvider).

CLI
kyvernon firewall policies create --name <name> --category application [--tenant <tenant>] [--wait]

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: PolicyBody

NameTypeRequiredDescription
appliedToarray of stringGroups the policy applies to (empty: every vNIC; a tenant's: its own vNICs).
categoryCategoryViewyesCategory; tenants may use environment and application only.
descriptionstringDescription.
enabledbooleanEnabled (default true).
namestringyesName (unique in its scope; sys: is reserved).
rulesarray of RuleBody or nullRules in order.
sequenceinteger (int32) or nullOrder inside the category (lower first). Default: after the scope's last policy.
statefulbooleanReplies are allowed automatically (default true).

Responses

StatusDescriptionSchema
201CreatedPolicyView
400Invalid argument; the error body names the fieldErrorBody

GET /v1/firewall/policies/{id}

One policy with its rules.

CLI
kyvernon firewall policies show <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy

Responses

StatusDescriptionSchema
200OKPolicyView

PUT /v1/firewall/policies/{id}

Replaces a policy (with rules: its rules too; a rule with the id of an existing one keeps its number and counters).

CLI
kyvernon firewall policies update <id> [--sequence <n>] [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: PolicyBody

NameTypeRequiredDescription
appliedToarray of stringGroups the policy applies to (empty: every vNIC; a tenant's: its own vNICs).
categoryCategoryViewyesCategory; tenants may use environment and application only.
descriptionstringDescription.
enabledbooleanEnabled (default true).
namestringyesName (unique in its scope; sys: is reserved).
rulesarray of RuleBody or nullRules in order.
sequenceinteger (int32) or nullOrder inside the category (lower first). Default: after the scope's last policy.
statefulbooleanReplies are allowed automatically (default true).

Responses

StatusDescriptionSchema
200OKPolicyView
409Conflict: the object exists, or expectedVersion is staleErrorBody

DELETE /v1/firewall/policies/{id}

Deletes a policy and its rules.

CLI
kyvernon firewall policies delete <id> [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Responses

StatusDescriptionSchema
204Done; no body

GET /v1/firewall/policies/{id}/rules

The rules of a policy.

CLI
kyvernon firewall rules list --policy <policy>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy

Responses

StatusDescriptionSchema
200OKarray of RuleView

POST /v1/firewall/policies/{id}/rules

Adds a rule (?position=: default last); the control plane gives it its number.

CLI
kyvernon firewall rules add --policy <policy> --action allow [--service <service>] [--position <n>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: RuleBody

NameTypeRequiredDescription
actionActionViewyesAction.
appliedToarray of stringGroups the rule applies to (empty: the policy's).
destinationsarray of stringDestinations (empty: any).
destinationsNegatedbooleanMatch everything except the destinations.
directionDirectionViewDirection (default in-out).
enabledbooleanEnabled (default true).
idstring or nullId of an existing rule (policy PUT: keeps its number and counters); ignored when a rule is added.
ipVersionIpVersionViewIP families (default any).
loggedbooleanLog matches.
namestringDisplay name.
servicesarray of ServiceEntryViewServices (empty: any IP traffic).
sourcesarray of stringSources: group ids, addresses or prefixes (empty: any).
sourcesNegatedbooleanMatch everything except the sources.

Responses

StatusDescriptionSchema
201CreatedRuleView
400Invalid argument; the error body names the fieldErrorBody

GET /v1/firewall/policies/{id}/rules/{rid}

One rule (by id or number).

CLI
kyvernon firewall rules show <rule> --policy <policy>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy
ridpathstringyesId of the rule in the policy

Responses

StatusDescriptionSchema
200OKRuleView

PUT /v1/firewall/policies/{id}/rules/{rid}

Replaces a rule (keeps its number and position). If-Match is the policy's version.

CLI
kyvernon firewall rules update <rule> --policy <policy> [--action drop] [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy
ridpathstringyesId of the rule in the policy
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: RuleBody

NameTypeRequiredDescription
actionActionViewyesAction.
appliedToarray of stringGroups the rule applies to (empty: the policy's).
destinationsarray of stringDestinations (empty: any).
destinationsNegatedbooleanMatch everything except the destinations.
directionDirectionViewDirection (default in-out).
enabledbooleanEnabled (default true).
idstring or nullId of an existing rule (policy PUT: keeps its number and counters); ignored when a rule is added.
ipVersionIpVersionViewIP families (default any).
loggedbooleanLog matches.
namestringDisplay name.
servicesarray of ServiceEntryViewServices (empty: any IP traffic).
sourcesarray of stringSources: group ids, addresses or prefixes (empty: any).
sourcesNegatedbooleanMatch everything except the sources.

Responses

StatusDescriptionSchema
200OKRuleView

DELETE /v1/firewall/policies/{id}/rules/{rid}

Deletes a rule.

CLI
kyvernon firewall rules delete <rule> --policy <policy> [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy
ridpathstringyesId of the rule in the policy
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Responses

StatusDescriptionSchema
204Done; no body

POST /v1/firewall/policies/{id}/rules/{rid}/move

Moves a rule inside its policy.

CLI
kyvernon firewall rules move <rule> --policy <policy> --position <n> [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy
ridpathstringyesId of the rule in the policy
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: MoveRuleBody

NameTypeRequiredDescription
positioninteger (int32)yesNew position (0 first; beyond the end: last).

Responses

StatusDescriptionSchema
200OKRuleView

GET /v1/firewall/policies/{id}/stats

Hit counters of a policy's rules: packets, bytes, per host and total, last hit.

CLI
kyvernon firewall stats --policy <policy>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall policy

Responses

StatusDescriptionSchema
200OKPolicyStatsView

GET /v1/firewall/profiles

Default profiles (a tenant user: the selectable ones).

CLI
kyvernon firewall profiles list

Responses

StatusDescriptionSchema
200OKarray of ProfileView

POST /v1/firewall/profiles

Creates a provider profile.

CLI
kyvernon firewall profiles create --name <name> --inbound drop --outbound allow [--wait]

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: ProfileBody

NameTypeRequiredDescription
baselinestring or nullBaseline policy (a provider Application policy evaluated after every tenant rule).
inboundDefaultActionViewyesDefault for traffic arriving at the vNIC.
namestringyesName.
outboundDefaultActionViewyesDefault for traffic leaving the vNIC.
selectablebooleanTenants may choose it.

Responses

StatusDescriptionSchema
201CreatedProfileView

GET /v1/firewall/profiles/{id}

One profile.

CLI
kyvernon firewall profiles show <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall profile

Responses

StatusDescriptionSchema
200OKProfileView

PUT /v1/firewall/profiles/{id}

Replaces a profile (a built-in name stores a replacement of the built-in).

CLI
kyvernon firewall profiles set <id> [--inbound drop] [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall profile
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: ProfileBody

NameTypeRequiredDescription
baselinestring or nullBaseline policy (a provider Application policy evaluated after every tenant rule).
inboundDefaultActionViewyesDefault for traffic arriving at the vNIC.
namestringyesName.
outboundDefaultActionViewyesDefault for traffic leaving the vNIC.
selectablebooleanTenants may choose it.

Responses

StatusDescriptionSchema
200OKProfileView

DELETE /v1/firewall/profiles/{id}

Deletes a provider profile (a replaced built-in comes back).

CLI
kyvernon firewall profiles delete <id> [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall profile
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Responses

StatusDescriptionSchema
204Done; no body

GET /v1/firewall/realization

Realization per host: wanted and applied plan version, error, flows, preconditions.

CLI
kyvernon firewall realization [--host <host>]

Parameters

NameInTypeRequiredDescription
hostquerystring or nullHost id.

Responses

StatusDescriptionSchema
200OKarray of HostRealizationView

GET /v1/firewall/rules/{number}/stats

Hit counters of one rule by number.

CLI
kyvernon firewall stats --rule <n>

Parameters

NameInTypeRequiredDescription
numberpathinteger (int32)yesRule number, as the effective rules and the logs show it

Responses

StatusDescriptionSchema
200OKRuleStatsView

GET /v1/firewall/services

Named services (a tenant user: its own and the provider's).

CLI
kyvernon firewall services list [--tenant <tenant>]

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullTenant id (tenant-N); absent: the provider (a tenant user: its tenant).

Responses

StatusDescriptionSchema
200OKarray of ServiceView

POST /v1/firewall/services

Creates a named service.

CLI
kyvernon firewall services create --name <name> --entry <entry> [--tenant <tenant>] [--wait]

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: ServiceBody

NameTypeRequiredDescription
descriptionstringDescription.
entriesarray of ServiceEntryViewyesEntries (no named services inside).
namestringyesName.

Responses

StatusDescriptionSchema
201CreatedServiceView
400Invalid argument; the error body names the fieldErrorBody

GET /v1/firewall/services/{id}

One named service.

CLI
kyvernon firewall services show <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall service

Responses

StatusDescriptionSchema
200OKServiceView

PUT /v1/firewall/services/{id}

Replaces a named service.

CLI
kyvernon firewall services update <id> [--entry <entry>] [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall service
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: ServiceBody

NameTypeRequiredDescription
descriptionstringDescription.
entriesarray of ServiceEntryViewyesEntries (no named services inside).
namestringyesName.

Responses

StatusDescriptionSchema
200OKServiceView

DELETE /v1/firewall/services/{id}

Deletes a named service (refused while a rule uses it).

CLI
kyvernon firewall services delete <id> [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall service
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Responses

StatusDescriptionSchema
204Done; no body

GET /v1/firewall/settings

The firewall settings.

CLI
kyvernon firewall settings show

Responses

StatusDescriptionSchema
200OKSettingsView

PUT /v1/firewall/settings

Changes the firewall settings.

CLI
kyvernon firewall settings set [--log-rate-pps <n>] [--if-match <version>] [--wait]

Parameters

NameInTypeRequiredDescription
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: SettingsView

NameTypeRequiredDescription
ctLimitPerPortinteger (int32)yesConnection-tracking entries per vNIC.
enforceNewbooleanyesvNICs added to VMs from now on start in mode enforce (default false: mode off); existing vNICs are not changed.
flowLimitPerBridgeinteger (int32)yesFirewall flows per host bridge.
logRatePpsinteger (int32)yesLog rate per host (packets per second, meter kyv-fw-log).
monitorReportDaysinteger (int32)yesDays a monitor report covers.
rejectRatePpsinteger (int32)yesReject answers per second per bridge (meter kyv-fw-reject).
versioninteger (int64)Record version (ignored in requests).

Responses

StatusDescriptionSchema
200OKSettingsView

POST /v1/firewall/simulate

Verdict and deciding rule for a described packet at a vNIC (reference evaluator).

CLI
kyvernon firewall simulate --vm <vm> --in --proto tcp --port <n> --peer <peer>

Request body

application/json: SimulateBody

NameTypeRequiredDescription
directionstringyesin (to the vNIC) or out (from it).
icmpCodeinteger (int32) or nullICMP code.
icmpTypeinteger (int32) or nullICMP type.
localstring or nullThe vNIC's own address (default: its first address of the peer's family).
nicstring or nullNIC key (default: the VM's first host-bridge NIC).
peerstringyesThe other end's address.
portinteger (int32) or nullDestination port (TCP, UDP).
protocolstringyestcp, udp, icmp4, icmp6 or a protocol number.
statestring or nullConnection state: new (default), established.
vmstringyesVM id.

Responses

StatusDescriptionSchema
200OKSimulateView

GET /v1/firewall/tag-categories

Tag categories and whether they are provider-managed.

CLI
kyvernon firewall tag-categories list

Responses

StatusDescriptionSchema
200OKarray of TagCategoryView

PUT /v1/firewall/tag-categories/{id}

Marks a tag category provider-managed: only the provider attaches its tags, and only such categories count in provider groups' tag criteria.

CLI
kyvernon firewall tag-categories set <id> --provider-managed true [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the tag category
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: TagCategoryBody

NameTypeRequiredDescription
providerManagedbooleanyesProvider-managed.

Responses

StatusDescriptionSchema
200OKTagCategoryView

GET /v1/firewall/templates

The rule templates.

CLI
kyvernon firewall templates list

Responses

StatusDescriptionSchema
200OKarray of TemplateView

GET /v1/firewall/templates/{id}

One template.

CLI
kyvernon firewall templates show <template>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall template

Responses

StatusDescriptionSchema
200OKTemplateView
404Not found (or not visible to the caller)ErrorBody

PUT /v1/firewall/templates/{id}

Creates or replaces a provider template (built-in ids are refused with error.firewall.builtin).

CLI
kyvernon firewall templates set <template> --body-file <file>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall template
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: TemplateBody

NameTypeRequiredDescription
descriptionstringWhat it opens.
notestring or nullWhat to know before applying it.
rulesarray of TemplateRuleBodyyesThe rules (1 to 50).

Responses

StatusDescriptionSchema
200OKTemplateView
400Invalid argument; the error body names the fieldErrorBody

DELETE /v1/firewall/templates/{id}

Deletes a provider template.

CLI
kyvernon firewall templates delete <template>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall template
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Responses

StatusDescriptionSchema
204Done; no body
404Not found (or not visible to the caller)ErrorBody

POST /v1/firewall/templates/{id}/apply

Applies a template to a VM: its rules go into the VM's own policy (a task).

CLI
kyvernon firewall templates apply <template> <vm> [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the firewall template

Request body

application/json: ApplyTemplateBody

NameTypeRequiredDescription
vmstringyesVM id.

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody

GET /v1/vms/{id}/firewall

The firewall of every vNIC of a VM: mode, profile, protection, effective rules with counters, realization.

CLI
kyvernon firewall effective <vm>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Responses

StatusDescriptionSchema
200OKarray of VnicFirewallView

GET /v1/vms/{id}/firewall/logs

Firewall log records of a VM, newest first.

CLI
kyvernon firewall logs --vm <vm> [--limit <n>]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)
limitqueryinteger or nullMost records (default 500, at most 5,000).
hostquerystring or nullHost id.
rulequeryinteger (int32) or nullRule number.

Responses

StatusDescriptionSchema
200OKarray of LogRecordView

POST /v1/vms/{id}/firewall/mode

Switches the firewall mode of a VM's vNICs (a task; Kyvernon.Firewall.ManageProvider). With confirmWithin the previous mode comes back unless confirmed in time.

CLI
kyvernon firewall mode <vm> enforce [--confirm-within <duration>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Request body

application/json: ModeBody

NameTypeRequiredDescription
confirmWithininteger (int64) or nullSeconds until the previous mode comes back unless confirmed (30 to 86,400; absent: no timer).
modeModeViewyesThe new mode.
nicsarray of stringNIC keys (default: every host-bridge NIC of the VM).
reasonstring or nullWhy (kept in the event).

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
400Invalid argument; the error body names the fieldErrorBody

POST /v1/vms/{id}/firewall/mode/confirm

Confirms the mode switches of a VM that wait for confirmation.

CLI
kyvernon firewall mode confirm <vm>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Responses

StatusDescriptionSchema
200OKarray of VnicFirewallView
412Failed precondition; the error body says whichErrorBody

GET /v1/vms/{id}/firewall/monitor

What the vNICs' rules would have dropped in mode monitor, and a proposal.

CLI
kyvernon firewall monitor <vm>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)

Responses

StatusDescriptionSchema
200OKMonitorReportView

POST /v1/vms/{id}/firewall/open-port

Opens a port of a VM: an inbound allow rule in the VM's own policy vm-N (an equal rule that exists is returned).

CLI
kyvernon firewall open-port <vm> --tcp <ports> [--from <prefix>] [--wait]

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)
tenantquerystring or nullTenant id of a new object (create only).
waitquerystring or nullrealized: answer when the hosts concerned applied the change.
timeoutSecondsqueryinteger (int64) or nullLongest wait in seconds (default 30, at most 300).
positionqueryinteger (int32) or nullPosition of a new rule (default: last).

Request body

application/json: OpenPortBody

NameTypeRequiredDescription
fromarray of stringSources allowed (addresses or prefixes; empty: any).
ipVersionIpVersionViewIP families (default any).
namestring or nullRule name (default open <protocol> <ports>).
portsstringyesPort or range (443, 8000-8100).
protocolstringyestcp or udp.

Responses

StatusDescriptionSchema
201CreatedRuleView
400Invalid argument; the error body names the fieldErrorBody

GET /v1/vms/{id}/nics/{key}/firewall

The firewall of one vNIC.

CLI
kyvernon firewall effective <vm> --nic <key>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)
keypathstringyesDevice key of the network adapter (for example 4000)

Responses

StatusDescriptionSchema
200OKVnicFirewallView

PUT /v1/vms/{id}/nics/{key}/firewall

Sets the profile of a vNIC (null: the profile of its kind). A tenant user may choose a selectable profile only.

CLI
kyvernon firewall vnic-profile <vm> <key> --profile <profile>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the virtual machine (vm-N)
keypathstringyesDevice key of the network adapter (for example 4000)

Request body

application/json: NicProfileBody

NameTypeRequiredDescription
profilestring or nullProfile id; null: the profile of the NIC kind.

Responses

StatusDescriptionSchema
200OKVnicFirewallView
403Permission denied; args.privilege names the missing privilegeErrorBody

Version 0.1.