Skip to content

Slack

Create one Slack app for Team Server, then create scoped integrations for the teams and channels that should receive policy-violation alerts.

App and Integration Model

  • The Slack app holds permissions, the OAuth callback, Client ID, and Client Secret. Create it once per Team Server.
  • A Team Server integration selects a workspace, channels, notification options, pipelines, and deployments. Create one for each audience.

Several integrations can reuse the same app credentials and may target different Slack workspaces.

Prerequisites

  • Team Server available at the public HTTPS URL in settings.tenant.base_url
  • Operator or Administrator role in Team Server
  • Permission to create and install a Slack app
  • workers.mode configured in Team Server; BackgroundAsync is recommended
  • Outbound HTTPS from Team Server to slack.com:443
  • A pipeline or deployment reporting policy violations

Slack compares OAuth redirect URLs exactly. The callback is:

https://team-server.example.com/api/integrations/slack/callback

It is derived from settings.tenant.base_url. See Tenant.

Delivery Rules

Delivery is event-driven; there is no Slack scheduler job. Team Server groups all violations from one build or workload into one alert.

An integration posts only when:

  1. its app is installed;
  2. notifications are enabled;
  3. at least one channel is selected;
  4. the pipeline or deployment is in scope; and
  5. the outcome is enforced, or observed outcomes are enabled.

Each matching integration posts independently, so overlapping scopes produce multiple alerts.

Required Slack Permissions

Team Server generates an app definition with these bot scopes:

ScopePurpose
channels:readList public channels
groups:readList private channels that contain the app
chat:writePost to channels the app has joined
chat:write.publicPost to public channels without joining

channels:join is not required. Leave organization-wide deployment, Socket Mode, and token rotation disabled. Team Server sends messages but receives no Slack events, and it does not refresh rotating tokens.

Create and Install the App

1. Generate the App

  1. In Team Server, open Integrations, then Slack under Notify.
  2. Select Get Started or Create.
  3. Select Create app in Slack.
  4. Review the generated definition in Slack and select Create.

The app is named Endura Team Server and its bot user is Endura. If the app already exists, reuse its credentials.

2. Enter Credentials

In the Slack app’s Basic Information page, copy its Client ID and Client Secret. In Team Server:

  1. give the integration a unique audience-oriented name;
  2. enter the Client ID and Client Secret; and
  3. select Continue.

Slack credentials are stored per integration. They do not belong in production.yaml, and there are no SLACK_* environment variables.

3. Install into a Workspace

  1. Select Add to Slack.
  2. Choose the workspace.
  3. Review the requested permissions and select Allow.
  4. Confirm that Team Server shows the workspace and Active status.

If the workspace requires app approval, return and repeat Add to Slack after approval. Installing an existing integration into a different workspace clears its channel selections because Slack channel IDs are workspace-specific.

Configure Alerts

Select Channels

The channel selector lists public channels and private channels that include Endura. To use a private channel:

  1. run /invite @Endura in Slack;
  2. reload the Team Server integration page; and
  3. select the channel and save.

Removing the app from a private channel stops delivery there without changing the integration’s Active status.

An integration with no selected channels is intentionally muted.

Choose Outcomes and Mentions

OptionDefaultEffect
Post an alert when a violation is detectedOnMaster delivery switch
Also alert on observed violationsOffInclude observed outcomes in addition to prevented and terminated
Mention @here on every alertOffNotify online members in each target channel

Enable observed outcomes in a low-traffic channel while tuning an observe-mode policy. Disable them before routine enforcement alerts if the additional traffic is not useful. Reserve @here for an on-call channel.

Scope Pipelines and Deployments

Pipelines and deployments are scoped independently:

SelectionResult
All PipelinesCurrent and future pipeline build violations
Selected pipelinesOnly those pipeline build violations
No pipelines with All offNo build alerts
All DeploymentsCurrent and future workload violations
Selected deploymentsOnly those workload violations
No deployments with All offNo workload alerts

Both All options are enabled on a new integration. Narrow the scope before selecting high-traffic channels. See Access Scope for the pipeline/build and deployment/workload relationships.

Test and Verify

Test Channel Connectivity

Select one or more channels and click Test. The test uses the current form selections, including unsaved selections.

A successful test proves only that the bot token can post to those channels. It does not evaluate scope, outcome options, the notification switch, or background workers.

An authentication failure can mark the integration Inactive.

Test End-to-End Delivery

  1. Confirm Active status, notifications enabled, and at least one selected channel.
  2. Assign an observe or enforce policy to an in-scope pipeline.
  3. Enable observed outcomes when testing an observe-mode policy.
  4. Run a build that violates the policy.
  5. Confirm that Team Server records the violation and Slack receives one grouped alert.
  6. Follow the alert link back to the correct build or workload.

If Team Server records the violation but Slack is silent, use the checklist below.

Route Alerts to Teams

Create separate integrations for audiences that need different scopes:

IntegrationScopeChannels
Platform SecurityAll pipelines and deployments#security-alerts
Payments On-CallSelected payment pipelines, no deployments#payments-oncall
Production HostsNo pipelines, all deployments#sre-prod

Overlapping integrations both post. Reduce noise by narrowing scopes, channel selections, or observed outcomes.

Edit or Delete an Integration

You can edit the name, channels, notification options, and scope. The workspace and credentials are fixed after installation; create a replacement integration to change them.

Deleting an integration revokes its bot token and uninstalls the app from that workspace before removing the record. Record its channels and scope first.

A Workspace Uninstall Can Affect Other Integrations

If several integrations target the same workspace, test each remaining integration after deleting one. Reinstall any integration whose token was revoked.

Deleting a Team Server integration does not delete the Slack app definition or its Client ID and Client Secret.

Troubleshooting

Alerts Are Not Arriving

Check in this order:

  1. The integration is installed and Active.
  2. Notify is on and channels are selected.
  3. The affected pipeline or deployment is in scope.
  4. Observed outcomes are enabled when the policy is in observe mode.
  5. Endura is still a member of each private channel.
  6. Test succeeds for the target channel.
  7. workers.mode is configured.
  8. Team Server Application Logs show no Slack error.

If Team Server cannot reach slack.com:443, logs report slack unreachable instead of a Slack error code.

OAuth and Installation Errors

ErrorResolution
invalid_client_idRecopy the Client ID from Basic Information.
bad_client_secretRecopy the current Client Secret, then reinstall.
bad_redirect_uriRegister {base_url}/api/integrations/slack/callback exactly.
invalid_codeStart Add to Slack again; the code expired or was reused.
access_deniedRepeat installation and approve the consent request.
missing_scopeRecreate the app from Team Server’s definition or add the missing scope and reinstall.

Posting Errors

ErrorResolution
invalid_auth, token_revoked, token_expired, not_authedDisable token rotation, then replace and reinstall the integration.
account_inactiveReactivate the workspace or bot, then reinstall.
channel_not_foundReload and select a current channel in the installed workspace.
not_in_channelInvite Endura to the private channel, reload, and reselect it.
is_archivedUnarchive the channel or select another.
restricted_actionAdjust workspace or channel app policy.
ratelimitedTeam Server retries using Slack’s requested delay; reduce duplicate integrations if persistent.

Authentication errors mark an integration Inactive. Channel, policy, and rate-limit errors affect only that delivery attempt.

Integration Is Inactive

update_status periodically rechecks stored Slack credentials. A revoked or uninstalled token changes the integration to Inactive. There is no in-place reconnect for a dead token: record the settings, delete the integration, create a replacement, and reinstall it.

Team Server URL Changed

Existing tokens continue to post, but new installs fail until the Slack app’s redirect URL is changed to:

{new_base_url}/api/integrations/slack/callback

Links in previously sent alerts keep their original hostname. Update the Slack app before attempting a reinstall.