Slack
Connecting to Slack
Common Fate integrates with Slack to send notifications to Slack channels when access is requested and approved.
Common Fate integrates with your Slack workspace using a private application which you create and manage.
When Slack is connected, users will receive notifications when an incoming request needs approval.
When an approver clicks on the “Approve” or “Close Request” buttons, they will be redirected to the web application to confirm their decision. Users who make requests will also receive notifications when the status of their request changes.
Integration Walkthrough
To configure your deployment to use Slack notifications, you first need to create a private Slack app. You can use the app manifest file below to setup the app as required.
- Replace both instances of
<your app URL>
with your app URL in the JSON below:
-
Navigate to https://api.slack.com/apps
-
Select Create New App
-
Select From an app manifest
-
Select your workspace from the drop down
-
Paste the completed app manifest JSON
-
Select Next
-
Select Create
-
You will now need to save the client secret and client signing secret to SSM Parameter Store.
You can use the AWS CLI to create a secret in the region you are deploying to, you must use the following path
"/<namespace>/<stage>/<secret name>"
Retrieve the ARN
Create the resource in Common Fate Terraform Config
Add the following resource into your config using the commonfate
Terraform provider.
Apply the new resource with terraform apply
In Common Fate
-
Sign in to your Common Fate deployment and from the home screen, navigate to Settings.
-
On the Access Controls page, scroll down to the Integrations section. Locate the Slack connection and click on Connect. This initiates the OAuth flow to integrate Slack with your Common Fate account.
-
Enter your login details to sign in with Slack if needed, and you will be asked which Slack tenant you want to install into.
-
After logging in, you will be redirected back to the Common Fate Access Controls page, where you will notice that the Slack integration is now online.
-
To finalise the Slack integration you will need to configure which Slack channel or approvers the Common Fate bot will send messages into. This is done with the
commonfate
Terraform provider.
Here is a simple default workflow that will send notifications for approvals to the specified Slack channel.
- The
commonfate_slack_alert
resource can be configured to send messages to a specified channel using theslack_channel_id
field. - Alternatively you can configure it to send direct messages to all the approvers of the request with the
send_direct_message_to_approvers
field.
Here is a simple default workflow that will send notifications for approvals to the the approvers of the request.
Adding the client to multiple Slack workspaces
It is possible with the Common Fate / Slack integration to add it into multiple Slack workspaces. To do so you will need to enable Public Distribution in the Slack config and update some of Terraform config. Here is how you can do this.
In Slack
- Navigate to https://api.slack.com/apps
- Find your App by selecting it from the list
- Select Manage Distribution
- Under Share Your App with Other Workspaces make sure you have all the checks ticked and select Activate Public Distribution
- You will now be able to install it into other Slack Workspaces.
In Common Fate
Add another commonfate_slack_integration
resource into your Terraform config. Make sure to use the same client id and secret as your first integration, but give it a different name.
Using multiple Slack integrations
When using multiple slack integrations you will need to specify explicitly which integration a slack alert will go into.
To update this make sure you have a commonfate_slack_alert
for each integration you have added. For example:
Run through the setup flow the same way you did for the first integration.
Requiring approval inside the web console
By default, the Common Fate Slack integration will perform an approval inside of Slack when a user presses the ‘Approve’ button on a Slack message.
For more sensitive entitlements, you may prefer to disable this behaviour and require that approvals are performed inside the Common Fate web console, so that you can enforce SAML SSO on approval actions.
To require approval inside the web console, set use_web_console_for_approval_action
to true
in the commonfate_slack_alert
resource.
To apply your changes, re-run terraform apply
.
Support
If you need assistance with this integration, please contact support@commonfate.io, or join our Slack community here, we’re happy to help!