API: rules
GET /api/rules#
List Rules
Berechtigung policy.read (ansehen)
Antwort 200 RuleRead[]
23 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
POST /api/rules#
Create Rule
Berechtigung policy.write (vorbereiten)
Anfrage-Body RuleCreate
15 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action | "pass" | "block" | "reject" | default: "pass" |
description * | string | minLength 1, maxLength 255 |
destination_net | string | default: "any" · minLength 1, maxLength 128 |
destination_port | string | null | |
direction | "in" | "out" | default: "in" |
enabled | boolean | default: true |
interface * | string | minLength 1, maxLength 64 |
ipprotocol | "inet" | "inet6" | default: "inet" |
log | boolean | default: false |
placement | "end" | "top" | default: "end" |
protocol | string | default: "any" · minLength 1, maxLength 16 |
source_net | string | default: "any" · minLength 1, maxLength 128 |
source_port | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids | string (uuid)[] |
Antwort 201 RuleRead
23 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
PUT /api/rules/{rule_id}#
Edit Rule
Berechtigung policy.write (vorbereiten)
Parameter
rule_id * | path | string (uuid) |
Anfrage-Body RuleEdit
16 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action | "pass" | "block" | "reject" | default: "pass" |
description * | string | minLength 1, maxLength 255 |
destination_net | string | default: "any" · minLength 1, maxLength 128 |
destination_port | string | null | |
direction | "in" | "out" | default: "in" |
enabled | boolean | default: true |
expected_updated_at * | string (date-time) | |
interface * | string | minLength 1, maxLength 64 |
ipprotocol | "inet" | "inet6" | default: "inet" |
log | boolean | default: false |
placement | "end" | "top" | default: "end" |
protocol | string | default: "any" · minLength 1, maxLength 16 |
source_net | string | default: "any" · minLength 1, maxLength 128 |
source_port | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids | string (uuid)[] |
Antwort 200 RuleRead
23 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
DELETE /api/rules/{rule_id}#
Delete Rule
Berechtigung policy.deploy (ausrollen)
Parameter
rule_id * | path | string (uuid) | |
acknowledge_management_risk | query | boolean |
Antwort 204
POST /api/rules/{rule_id}/confirm#
Confirm
Berechtigung policy.write (vorbereiten)
Parameter
rule_id * | path | string (uuid) |
Antwort 200 RuleRead
23 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
POST /api/rules/{rule_id}/deploy#
Deploy
Berechtigung policy.deploy (ausrollen)
Parameter
rule_id * | path | string (uuid) |
Anfrage-Body DeployApproval | null
Antwort 200 RuleRead
23 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
POST /api/rules/{rule_id}/deployments/{host_id}/remove#
Remove Previous Target
Berechtigung policy.deploy (ausrollen)
Parameter
rule_id * | path | string (uuid) | |
host_id * | path | string (uuid) |
Anfrage-Body DeployApproval
3 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
acknowledge_management_risk | boolean | default: false |
comment | string | null | |
preview_token * | string | minLength 64, maxLength 64 |
Antwort 204
POST /api/rules/{rule_id}/deployments/{host_id}/retry-rollback#
Retry Rollback
Berechtigung policy.deploy (ausrollen)
Parameter
rule_id * | path | string (uuid) | |
host_id * | path | string (uuid) |
Anfrage-Body DeployApproval
3 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
acknowledge_management_risk | boolean | default: false |
comment | string | null | |
preview_token * | string | minLength 64, maxLength 64 |
Antwort 204
GET /api/rules/{rule_id}/management-check#
Rule Management Check
Read-only hint next to the preview (R11): would this rule block the way OPNexus or a management source reaches the firewall? The automatic revert needs that way. Reads the firewalls, writes nothing; a sure finding is what makes the deploy ask for an explicit acknowledgement.
Berechtigung policy.read (ansehen)
Parameter
rule_id * | path | string (uuid) | |
action | query | "deploy" | "remove" | "delete" | |
host_id | query | string (uuid) | null |
Antwort 200
GET /api/rules/{rule_id}/overlap#
Rule Overlap
Read-only hint next to the preview: would this rule be shadowed by (or duplicate) an earlier rule on its targets, and which later rules would it make pointless? Reads the firewalls (cached 60 s), writes nothing, never blocks.
Berechtigung policy.read (ansehen)
Parameter
rule_id * | path | string (uuid) |
Antwort 200
GET /api/rules/{rule_id}/preview#
Preview Rule
Berechtigung policy.read (ansehen)
Parameter
rule_id * | path | string (uuid) |
Antwort 200
GET /api/rules/{rule_id}/revisions#
List Revisions
Berechtigung policy.read (ansehen)
Parameter
rule_id * | path | string (uuid) |
Antwort 200
POST /api/rules/adopt#
Adopt Rule
Takes over a hand-made rule. Writes nothing to the firewall.
Berechtigung policy.write (vorbereiten)
Anfrage-Body AdoptRequest
4 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
host_id * | string (uuid) | |
interface_role | string | null | |
link_to | string (uuid) | null | |
rule_uuid * | string | minLength 1, maxLength 64 |
Antwort 201 RuleRead
23 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
POST /api/rules/bulk/confirm#
Bulk Confirm
"I still have access" for several rules at once - the same confirm as the single endpoint, per rule.
Berechtigung policy.write (vorbereiten)
Anfrage-Body BulkConfirmRequest
1 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
rule_ids * | string (uuid)[] |
Antwort 200 BulkConfirmResult
2 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
confirmed * | integer | |
results * | BulkRuleResult[] |
POST /api/rules/bulk/deploy#
Bulk Deploy
Deploys several rules one after the other, each through exactly the single-rule path (its own preview approval, consistency checks, pending window and auto-revert). One rule being refused does not stop the others; an unexpected error does, and the rest is reported as skipped. Declared before ``/{rule_id}/...`` so "bulk" is never read as an id.
Berechtigung policy.deploy (ausrollen)
Anfrage-Body BulkDeployRequest
2 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
comment | string | null | |
items * | BulkDeployItem[] |
Antwort 200 BulkDeployResult
5 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
attention * | integer | |
deployed * | integer | |
failed * | integer | |
results * | BulkRuleResult[] | |
skipped * | integer |
GET /api/rules/bulk/management-check#
Bulk Management Check
Read-only hint for the bulk dialog (R12): would these rules, deployed one after the other, block the way OPNexus or a management source reaches a firewall? Every rule can be harmless alone and still not be in combination. Reads the firewalls, writes nothing. Declared before ``/{rule_id}/...`` so "bulk" is never read as an id.
Berechtigung policy.read (ansehen)
Parameter
rule_id * | query | string (uuid)[] |
Antwort 200
GET /api/rules/unmanaged#
List Unmanaged Rules
Rules found on the host that OPNexus does not manage yet (live read).
Berechtigung policy.read (ansehen)
Parameter
host_id * | query | string (uuid) |
Antwort 200 UnmanagedRule[]
19 Felder anzeigen
| Feld | Typ | Hinweise |
|---|---|---|
action * | string | |
adoptable * | boolean | |
description * | string | |
destination_net * | string | |
destination_port * | string | |
direction * | string | |
enabled * | boolean | |
interface * | string | |
interface_label * | string | |
interface_roles | string[] | |
linkable | boolean | default: false |
log * | boolean | |
matches | LinkTarget[] | |
protocol * | string | |
reasons * | string[] | |
similar | LinkTarget[] | |
source_net * | string | |
source_port * | string | |
uuid * | string |
GET /api/rules/usage#
Rule Usage
When each central rule last matched something (stored pf counter observations, merged over its deployments). Declared before ``/{rule_id}/...`` so "usage" is never read as an id.
Berechtigung policy.read (ansehen)