Skip to main content
Version: 2.0

Policies and webhooks

Added in v0.3.0

Policies

Policies automate responses to findings based on conditions.

Structure

A policy consists of:

  • Scope - application, group, or global
  • Event types - triggers that activate the policy
  • Conditions - filters (severity, scanner, risk score, etc.)
  • Actions - what to do when triggered
POST /api/policies
Content-Type: application/json

{
"name": "Auto-assign critical findings",
"scope_type": "global",
"event_types": ["finding.created"],
"conditions": [
{
"field": "severity",
"op": "in",
"value": ["critical", "high"]
}
],
"actions": [
{
"type": "assign_to",
"target": "1"
}
]
}

Conditions

OperatorDescription
inValue is in a list
not_inValue is not in a list
eqEquals
neqNot equals
gteGreater than or equal
lteLess than or equal
regexMatches regular expression

Available condition fields: severity, risk_score, scanner_type, status, cwe_id, file_path.

Available actions

ActionDescription
change_statusAutomatically transition finding status (target: open, confirmed, false_positive, fixed)
assign_toAssign finding to a user (target: user ID)
webhookFire a webhook with finding data

Webhooks

Webhooks send HTTP callbacks when events occur.

POST /api/applications/{id}/webhooks
Content-Type: application/json

{
"url": "https://hooks.example.com/security",
"events": "finding.created",
"secret": "optional-hmac-secret"
}

Supported events

EventDescription
finding.createdA new finding was ingested
finding.status_changedFinding status changed
finding.reassignedFinding reassigned
scan.completedA scan finished processing

Webhook payloads are signed with HMAC-SHA256 when a secret is configured (header: X-Servasec-Signature).