Repository navigation
fix: restrict Slack approvals to allowlisted users and record who decided (#117) - #148
Merged
Merged
Conversation
…ided Any user who could see an approval message in Slack could approve a production change, and the approver was not recorded (#117). - SLACK_APPROVER_IDS (global, or per org via PUT /orgs/{org}/config, the org's value winning) lists the Slack user IDs that may approve. Anyone else gets an ephemeral "not an approver" reply and nothing runs. - Unset keeps today's behaviour (any channel member) and logs a warning. - Every approve, reject and refusal is stored as an incident log (approval-<ts>-<decision>.json) with Slack user ID, name and command; recording failures never block the decision. Confirmations now name the approver ("Approved by @alice"). Fixes #117 Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #117.
/slack/actionverified that a click came from Slack, but not who clicked. Any member who could see the approval message (guests, contractors, everyone in a public channel) could approve a rollback, a k8s apply, an nginx write or security updates, and nothing recorded who approved.Who can approve
SLACK_APPROVER_IDS=U012AB3CD,U045EF6GHlists the Slack user IDs allowed to approve.PUT /orgs/{org}/config(added toORG_CREDENTIAL_KEYS). The org's list overrides the global one, and orgs without their own fall back to the global list.replace_original: falseso the buttons stay for a real approver. Nothing is executed.Record of every decision
approval-<timestamp>-<decision>.jsonwith Slack user ID, name, org, incident and command, and logged with structlog.Out of scope (possible follow-ups): approval by Slack user group (needs a bot token and
usergroups.users.list), and two-person approval.Type of Change
Testing
tests/test_slack_approvers.py(10 tests):OrgConfig-llclean.Docs
.env.example,docs/API_REFERENCE.md(POST /slack/action: who can approve and decision records),SECURITY_GUARANTEES.md.🤖 Generated with Claude Code