A verdict a pipeline has to poll for is a verdict that arrives late or not at all. Webhooks let a deployment gate, a chat channel or a ticket system react to what TRUSTIVAN observed, at the moment it observed it.

The eight events

The set is closed. An endpoint subscribes by naming types, and a name nobody can subscribe to is a delivery nobody receives. Four describe container and repository security, three describe non-human identity. One endpoint may subscribe to kinds from either product or both. The same signed envelope carries them all, so a receiver written for one works for the other without changes.

AppSec

NHI Security

Every NHI payload carries a severity from the same ladder as everything else (info, low, medium, high, critical), a one-line summary, and no credential material. An actor is named only as a kind, never as an identity.
NHI Security has not been deployed to production, and no connector has authenticated to a live provider: discovery and runtime decisions are verified against recorded fixtures. These three kinds are implemented and subscribable; they have not carried production traffic.
finding.state_changed is one delivery per finding, whoever moved it: the first scan of an image with 300 vulnerabilities sends 300, one per new finding. change names what happened (finding.created, finding.resolved, finding.reopened, finding.suppression_expired, finding.suppressed, …) and actor says who: scan, system for an expiry, or user / apikey. audit.recorded is the push half of the audit trail: GET /audit/export is a customer pulling the trail on demand; this is TRUSTIVAN pushing it, near real time, to a SIEM or log pipeline the customer configured. See that page for exactly what is, and is not, on the payload. scan.completed fires for failures too, on purpose. A receiver that only heard about successes could not tell “clean” from “never ran”, which is the difference between a green build and an unmonitored one. Two silences are also deliberate. A retried verdict request returns the existing decision and announces nothing: one decision happened once, so it is reported once. A retryable scan failure returns the scan to queued and stays silent, because announcing scan.completed while the scan waits for its next attempt would be a lie.

Register an endpoint

Requires webhooks:manage, which is not grantable to an API key. An endpoint is a destination every future event is copied to, so a credential that could add one could arrange for a tenant’s security findings to be streamed somewhere the tenant never chose: exfiltration with an audit trail that reads like configuration. This is a human action, from the dashboard or a session.
The response carries secret: a whsec_… value, returned once, by create and by rotate. There is no read path, not for an admin and not for support: a secret that can be fetched is one that ends up in a screenshot. Subscribe to what you will act on. An endpoint that received everything would be one whose owner cannot reason about what it will be sent. webhooks:read is grantable, because a machine checking whether delivery is working is a legitimate thing to do.

The envelope

The envelope is identical across event types, so a receiver can log, deduplicate and route a delivery without knowing anything about the event inside it. The contract is versioned by date, and payload types are written by hand rather than serialised from database models. The duplication is the feature: a model is an internal shape that changes whenever the schema does, while a payload is a published contract customers write code against. Serialising a model straight to the wire would make every migration a silent breaking change to somebody else’s pipeline. Fields may be added within a version; none is ever removed or repurposed. blocking is precomputed rather than left to the receiver, for the same reason it is precomputed in the verdict response: a gate should not reimplement TRUSTIVAN’s opinion about which results stop a deployment, because then TRUSTIVAN cannot change that opinion.

What never travels

No API keys, no signing secrets, no session tokens, no passwords, and no scanner-engine structures, only TRUSTIVAN domain contracts. And finding.state_changed, audit.recorded and nhi.finding.state_changed all name an actor kind (user, apikey/api_key, scan, system, workload, scim), never an identity. The audit trail records who acted and is read inside the tenant; a payload goes to a destination the customer chose, and “alice@example.com suppressed this” is not something to hand to an arbitrary URL. audit.recorded additionally withholds the row’s before/after/detail fields. See Audit trail for the full redaction rationale.

Delivery guarantees

Published from a transactional outbox. An event becomes a row before it becomes a request, written in the same transaction as the thing it describes. The delivery row and the fact it describes commit together or not at all, so a crash between committing a verdict and sending its webhook cannot lose the event, a failed POST is not the only record of what happened, and a receiver that takes thirty seconds to answer does not hold a database transaction open for thirty seconds. The three NHI kinds are reported to this backend over an authenticated endpoint rather than produced inside a transaction here, so for them the guarantee is one step narrower: the publisher’s own event_id makes a retry fan out exactly once, and the delivery row is still committed before any request is made. At-least-once. A uniqueness constraint collapses a retried publish and two racing workers onto one row, but a delivery can genuinely be sent twice when a response is lost.
Receivers must be idempotent. Deduplicate on X-TrustIvan-Delivery, which is the same value as the envelope’s id.
Exponential backoff, from 30 seconds to a 2-hour cap, over about a day and six attempts before a delivery is terminally failed. Fixed intervals turn a downed endpoint into a steady stream of pointless requests at a receiver that is already struggling, and an endpoint unreachable for hours is not rescued by attempt two hundred. Ten seconds per attempt, with the response body read up to 8 KB. A slow receiver must not be able to hold a delivery worker open: that is how one customer’s broken endpoint becomes every customer’s backlog. Acknowledge as soon as you have verified and durably recorded the delivery; do the work afterwards. An endpoint failing 20 times consecutively is disabled, with the reason recorded. Re-enabling clears the streak, so an operator who has fixed their receiver is not disabled again by the failures that preceded the fix. A terminal delivery is immutable. It is the evidence behind “we did notify you”.

Destination restrictions

A webhook is a request whose destination the customer chooses, made from inside TRUSTIVAN’s network: the definition of server-side request forgery, with the destination attacker-controlled by design. Loopback, private (RFC1918), carrier-grade NAT, link-local (including the cloud instance metadata service), unique-local IPv6, multicast, reserved and documentation ranges are refused, as is the IPv4-mapped IPv6 spelling of each. The URL is checked when the endpoint is configured, but that is the shallow half, present to give an actionable message early. The real control runs at connection time on every resolved address, after DNS and before connect, so DNS rebinding does not work and a name with several A records cannot smuggle one bad address past a check that only looked at the first. Redirects are not followed, and proxying is disabled. A public host that answers 302 to the metadata service is the classic bypass; a webhook has no legitimate reason to be redirected, so the class is removed rather than defended. For local development, WEBHOOK_ALLOW_PRIVATE_DESTINATIONS=true lifts the loopback and private-range refusal and logs a loud warning. Configuration refuses to start with it set outside development, and even with it set the metadata range stays blocked.

Rotating the signing secret

The previous secret keeps working for a 24-hour overlap, during which deliveries are signed with both, space-separated in the header. A receiver accepts a delivery if any signature verifies. Without the overlap, rotating would drop every delivery between the rotation and the receiver being reconfigured, which makes rotation an outage, and an outage is a thing people avoid doing.

Seeing what happened

Failure messages are sanitised: a raw transport error names the resolved IP, the port and sometimes the proxy, and these records are shown in the dashboard and read by support. The one exception is a blocked address, where the guard’s own message is relayed in full. There, the URL is the problem.

Bounds

  • At most 20 endpoints per organisation. Each event fans out to every subscriber, so this is the multiplier on delivery work a single scan can create.
  • A bulk operation publishes one event per finding. Five hundred suppressed findings genuinely are five hundred state changes, and collapsing them would leave a receiver unable to tell which findings moved. Bounded on both sides: 500 findings × 20 endpoints.

See also