ServiceNow and Jira
Require an approved change ticket before a snapshot goes out, how Wardn keeps the ticket's state fresh, and what happens when ServiceNow or Jira is down.
A guardrail can require a ServiceNow change approved before promoting (or the Jira equivalent). Wardn holds the snapshot until the ticket attached to it is approved in your change system, then lets it through. Wardn only reads tickets: your change process stays where it is.
When Wardn cannot tell whether a ticket is approved, because ServiceNow or Jira is down, slow, refusing Wardn's account or has not been asked recently, the answer is unknown, and a guardrail never lets a snapshot through on unknown. A failure is never a pass.
Connect it
You need integration:manage (Owners and Admins) and a server with WARDN_SECRET_MASTER_KEY set, because Wardn keeps the account's password or token in its secret store.
# ServiceNow: a service account that can read change_request
curl -fsS -X PUT "$WARDN_API_URL/api/v1/change-systems/servicenow" \
-H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' \
-d '{"baseUrl":"https://acme.service-now.com","username":"wardn","secret":"…"}'
# Jira: the account's email and an API token; name the statuses that mean approved
curl -fsS -X PUT "$WARDN_API_URL/api/v1/change-systems/jira" \
-H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' \
-d '{"baseUrl":"https://acme.atlassian.net","username":"[email protected]","secret":"…","approvedStatuses":["Approved","Ready for prod"]}'Wardn checks the credentials against the system before it keeps anything. The password or token is never shown again. The address must be https:// and cannot be a private, loopback or link-local address; Wardn refuses to connect to one even when a name resolves to it.
What counts as approved. In ServiceNow, a change request whose Approval field is Approved and that has not been cancelled. In Jira, an issue whose status is one of approvedStatuses (by default Approved), compared without regard to case. A ticket the system does not have, or that Jira's account cannot see, is not approved.
The first connection also returns a push secret once, and a pushPath. Keep the secret: it is not shown again.
Attach a ticket to a snapshot
Anyone who may raise a release at the deployment attaches a ticket to the snapshot it is for:
curl -fsS -X POST "$WARDN_API_URL/api/v1/deployments/$DEPLOYMENT/change-tickets" \
-H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' \
-d '{"snapshotId":"…","system":"servicenow","ref":"CHG0030001"}'Wardn reads the ticket at once. A ticket the system says does not exist is refused; one it cannot be asked about now is attached and unknown until it can. A snapshot with several tickets needs all of them approved. A snapshot with none has a plain "no" and stays held.
How the state stays fresh
- On a schedule. Every minute Wardn reads again the tickets that were never read, whose last read failed, or whose last read is more than five minutes old.
- When the system pushes. Point a ServiceNow outbound message or a Jira webhook at
pushPathand send the push secret asX-Wardn-Token, or sign the body with it (X-Hub-Signature-256: sha256=…, which is Jira's own signing). A push only names a ticket: Wardn reads it from the system itself and never takes approval from the body, so a forged or replayed push can cost one lookup and cannot approve anything. Every push that is not believed gets the same 401. - What is believed. What a system said counts for 15 minutes, and only if the read that said it succeeded. After that, or after any failed read, the ticket is unknown until the next good read.
When a ticket becomes approved, the held snapshot is judged again as the person who attached the ticket and released if nothing else holds it. Activity records the change in state.
When the system is down
Each lookup waits at most five seconds. Five failures in a row open a breaker: for 30 seconds every ticket of that system reads unknown at once, without a request. The tickets keep the state they last had, so you can see it, but it is not believed. When the system answers again, the next read restores them.
GET /deployments/{id}/change-tickets shows each ticket's status (approved, not_approved or unknown), the system's own state, when Wardn last asked and, when a read failed, why.
Discord
Post approval requests, bypass requests, release updates and break-glass restores to Discord channels through channel webhooks, choose which channel gets what, and what Wardn does when Discord is down or a webhook is deleted.
PagerDuty
Mirror PagerDuty incidents as Wardn incidents, map services to deployments, let "Platform on-call" mean whoever PagerDuty has on call right now, and what happens when PagerDuty is down.