Slack
Get approval and bypass requests in a Slack channel, approve from the message as yourself, and what Wardn does when Slack is down.
Connect a Slack workspace and Wardn posts a message to a channel when a snapshot needs approvals, someone asks for a bypass, a release is raised or changes state, or someone restores past the guardrails during an incident. The message has an Approve button (or Grant bypass) and an Open in Wardn link.
A click on Approve is you approving, never a bot. Wardn finds you by the email address on your Slack profile, runs the same approval as the Approve button on the web, in your name, with the same check of whether you hold the approval duty at that deployment, and records it in Activity under your name with the note "From Slack". If you may not approve, Slack tells you why and nothing is recorded.
Connect it
You need integration:manage (Owners and Admins), and the person who runs Wardn must have set WARDN_SECRET_MASTER_KEY, because Wardn keeps the two secrets below in its secret store.
- Create a Slack app for your workspace with the bot scopes
chat:write,users:read.emailandim:write, and install it.im:writelets Wardn open a direct message with a person who chose Slack in their notification settings; without it, their notices say Slack was not delivered. Copy the Bot User OAuth Token (xoxb-…). - Under Interactivity & Shortcuts, turn interactivity on and set the request URL to
https://<your Wardn API>/api/v1/webhooks/slack/actions. - Copy the app's Signing Secret from Basic Information. Invite the bot to the channel and copy the channel's id.
- Connect:
curl -fsS -X PUT "$WARDN_API_URL/api/v1/integrations/slack/connection" \
-H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' \
-d '{"botToken":"xoxb-…","signingSecret":"…","channel":"C0123ABCD"}'Wardn checks the token with Slack before it keeps anything. The token and signing secret are never shown again, listed or logged. A workspace belongs to one Wardn organization; connecting one that another organization holds is a conflict. Pause (POST /integrations/slack/pause) stops messages and clicks without removing anything, and Disconnect (DELETE /integrations/slack/connection) removes the connection and both secrets.
Choose where messages go
By default everything goes to the channel you connected. Routes send events to other channels by what they are about. Each route has a name, a channel and any of:
- events:
approval.requested,bypass.requested,approval.decided,approval.superseded,release.raised,release.status_changed,restore.break_glass; - environments: an environment's name or its class (
production,staging); - teams: the ids of teams that own the apps the deployment runs (
GET /teamslists them); - the least severity:
info,warningorcritical. An approval request is warning, a bypass request, a failed release and a break-glass restore are critical, a release that is paused or held is warning, and everything else is info.
Every route that matches an event posts it, once per channel, so one event can reach a team's channel and the on-call channel. An event no route matches still goes to the connected channel, so an approval request never vanishes; but once a route matches, the connected channel gets the event only if a route names it, so add a route for it if you want it to keep hearing everything. A release is placed by the first deployment in it. A route that names teams skips an event that belongs to none.
curl -fsS -X PUT "$WARDN_API_URL/api/v1/integrations/slack/routes" \
-H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' \
-d '{"items":[
{"name":"Production approvals","channel":"C0PROD","events":["approval.requested"],"environments":["production"],"teams":[],"minSeverity":"warning"},
{"name":"Failed releases","channel":"C0ONCALL","events":["release.status_changed"],"environments":[],"teams":[],"minSeverity":"critical"}]}'A break-glass restore is written to say that a restore went past the restore guardrails, with the incident, who did it and their reason, and an Open in Wardn link to the deployment, and a route can select it. It is not posted yet, though: the Slack worker does not subscribe to restore.break_glass in this version of the server, so a route for it has nothing to carry until it does. The restore itself is in Activity. GET on the same path reads them, and PUT replaces all of them (up to 50 routes; a channel is named by its id, not #name). The Slack page on Integrations lists the routes under Connection.
Who can approve from Slack
Anyone whose Slack profile email is the verified email of a member of your organization, and who holds the approval duty where the snapshot is going. Everyone else gets a private reply saying why, for example that the person who raised the request cannot approve it. People whose Slack profile has no email, or whose address is not a member's, are told Wardn cannot tell who they are and nothing happens.
Once a request is decided, or a newer snapshot replaces the one it was for, Wardn edits the message so it no longer offers a button. A bypass granted on the web leaves the message as it was; clicking it then says the request already has a decision.
What keeps a click honest
- Signed. Every click is a request from Slack signed with your signing secret. A request with a wrong or missing signature, a body changed after signing, a timestamp more than five minutes from now (old or ahead), or from a workspace Wardn does not know gets the same 401, so a refusal tells a forger nothing.
- Once. Wardn remembers the signature of each accepted click for ten minutes, so a captured request sent again does nothing.
- Escaped. Names and reasons in a message are escaped, so a request titled
<!channel>does not mention the channel.
When Slack is down
Messages are sent from the outbox: the request is stored in the same transaction as the approval request itself, and a worker posts it. If Slack is down, slow or rate limiting, the worker retries with backoff, so the message arrives late and does not get lost, and each event is posted once however often it is retried. A call waits at most five seconds; after five failures in a row Wardn stops calling Slack for 30 seconds and retries later. A refusal that waiting cannot fix, such as a revoked token or a channel the bot is not in, is not retried: the event is dead-lettered where the Integrations page can show it.
Approving from Slack is a convenience and never the only way: the Open in Wardn link and the approvals inbox always work.