Elastic app for Slack

The Elastic app for Slack brings Elastic nightshift into your Slack workspace as the @Elastic bot. Your team can mention @Elastic to ask questions, automations can post investigation results to a channel, and alerts that other tools post in Slack can start investigations.

This page is for Slack admins, Elastic nightshift admins, and security reviewers. It explains what the app can access, the Slack permissions it requests, how it behaves in each kind of conversation, and what happens to your Slack data. To set it up, refer to Set up Slack. To use it, refer to Investigate in Slack.

Slack delivers all events for an app to a single URL, so Elastic hosts a service called the Slack relay between Slack and your project. The relay verifies that each event comes from Slack, finds the Elastic nightshift project that the channel is connected to, forwards the event, and posts the reply back to the thread. It also forwards messages from connected public channels, so that automations can start investigations from them.

Mermaid diagram
  • One app, many projects. One installation of the app serves the whole Slack workspace. Several Elastic projects, such as production and staging, can connect to the same workspace. Each channel connects to exactly one project.
  • Admins choose the channels. @Elastic answers only in channels that a Elastic nightshift admin has connected to a project in Kibana. Inviting @Elastic to a channel isn't enough.
  • Your project keeps the record. Conversations, investigations, and their findings are stored in your project. The relay doesn't keep message content. Refer to Where your Slack data goes.

Setting up the app takes the following roles:

Role What they do
Slack admin Approves the Elastic app, if your workspace requires approval, and chooses whether to allow private channel access.
Elastic nightshift admin Connects the Slack workspace to the project, then connects each channel. Needs nightshift: All and Manage engines. Connecting the workspace also needs the manage_security cluster privilege. Without Manage engines, Kibana shows the Slack settings but you can't change them. Refer to Grant access.
Channel member Invites @Elastic to the channel, for example with /invite @Elastic.

@Elastic doesn't act as the person who mentions it. Slack users aren't matched to Elastic users, and they don't need an Elastic account. Every answer in Slack comes from what the Elastic nightshift service accounts and the connectors in the space can reach. Refer to Privileges that Elastic nightshift runs with.

As a result, everyone in a connected channel can read what Elastic nightshift can read, including guests and people who were added to the channel later. Connect only the channels whose members should see that data. If only certain people should see some data, put that data in a separate project with its own Elastic nightshift setup.

When an admin connects Slack, Kibana creates a service account for the Slack connection, named nightshift-relay-agent-builder-<ID>. The relay uses the account for two calls to your project: passing each mention to the Elastic nightshift agent, and forwarding messages from connected public channels so that automations can match them. The agent runs as the nightshift_agent account, so the Slack connection doesn't change what an answer can read.

Only the relay can use the account. For every call, it exchanges the account ID for a token that expires after a few minutes, so no long-lived key is stored. When an admin with the manage_security cluster privilege disconnects the workspace, Kibana deletes the account. If the admin doesn't have it, the workspace still disconnects, but the account isn't deleted.

The Slack connection account is also capped by the privileges that the connecting admin had when they connected Slack. If that admin couldn't chat with the Elastic nightshift agent in Agent Builder, mentions in Slack are refused and @Elastic replies with an error instead of an answer. To fix it, have an admin with Agent Builder: All disconnect the workspace and connect it again.

The following table describes how @Elastic responds in each kind of channel or conversation:

Where What happens
A connected public channel A mention of @Elastic gets a threaded answer, with a View in Kibana link to the conversation. Follow-up mentions in the thread continue the same conversation. Top-level messages, such as alerts that other apps post, can start investigations through an automation with the New message in channel trigger.
A connected private channel A mention of @Elastic gets a threaded answer, as in a public channel. Messages in private channels can't trigger automations, and investigations can't read the channel's history. An admin must allow private channel access first. Refer to Private channels.
A channel that isn't connected When @Elastic joins, it posts the channel ID and asks you to have an Elastic admin connect the channel. It gives a similar reply to a mention instead of answering, at most once every 10 minutes per channel.
A direct message to @Elastic Not supported. @Elastic replies that direct messages aren't supported, at most once per hour per person.
A Slack Connect channel shared with another organization Not supported in Tech Preview. Kibana doesn't stop you from connecting one, but people in the other organization can then read @Elastic's answers. @Elastic ignores mentions from the other organization, leaves their messages out of the thread it reads, and investigations can't read a shared channel.

When a channel is connected, @Elastic posts a message there saying that the project is connected and ready.

While it works on an answer, @Elastic shows a plan in the thread titled Rolling up my sleeves, with a row for each step that it runs. The answer appears under the plan when it's done, and the plan's title changes to Finished N steps, or Done when no steps ran. If it can't answer, @Elastic posts the reason in the thread. Refer to Troubleshoot @Elastic responses.

@Elastic answers people. When another app posts a message that mentions @Elastic, it doesn't answer, but that message can start an automation.

Editing a message never changes an answer that @Elastic already gave. Edits and deletions in a connected public channel are still sent to your project, like any other message. Refer to What @Elastic reads from Slack.

A mention that opens a new conversation counts toward the Manual investigations daily limit and the All investigations daily limit. When either limit is reached, @Elastic replies that an admin can raise it. Follow-up mentions in the same thread aren't counted. Refer to Investigation limits.

The following table lists the messages that @Elastic posts when it can't answer your question, and what to do. If your project refuses a request for another reason and explains why, @Elastic posts that explanation. Otherwise it usually posts the "couldn't reach Elastic" message.

Where or when The message @Elastic posts What to do
You mention it in a channel that isn't connected "This channel isn't connected yet. Ask your Elastic admin to connect it in Kibana Settings using channel ID C0123456789, then mention me again." Send the channel ID to your admin. @Elastic posts this at most once every 10 minutes per channel, so later mentions in that window get no reply.
You open its Messages tab "Direct messages aren't supported yet. Mention me in a channel that's connected to Kibana instead." Mention it in a connected channel. @Elastic posts this at most once per hour per person.
You mention it while it's still answering in the same thread "Elastic is still answering an earlier message in this thread. Please ask again once that reply is posted." @Elastic waits up to two minutes for the earlier answer before it posts this. Ask again once the answer is posted.
Your project can't be reached, or refuses the request "Sorry, I couldn't reach Elastic right now. Please try again in a few minutes." If your project can't be reached or is overloaded, @Elastic retries for about two minutes before it posts this. If your project rejects the request without a reason, it posts this right away. Try again later. If it keeps happening, ask your admin to check the Slack connection. Refer to Who @Elastic acts as.
The Slack connection needs to be set up again "Your Elastic connection has expired. Please reconnect it in Kibana and try again." Ask your Elastic nightshift admin to disconnect and connect the workspace again.
A daily limit is reached "The daily limit of 5 for manual investigations has been reached. An admin can raise it in nightshift settings." The message names the limit that was reached, manual or all investigations, and its value when known. Ask your Elastic nightshift admin. Refer to Investigation limits.
The answer fails or stops Under a Stopped plan, "Elastic response failed.", "Elastic could not finish this turn.", or "Elastic stopped working on this request.", with a View in Kibana link Open the conversation in Kibana, or ask again.
The agent finishes without an answer "Elastic completed without a response." Open the conversation in Kibana, or ask again.
Slack rejects the answer "Couldn't post the answer here - Slack rejected the message. Open this conversation in Kibana to read it." Open the conversation in Kibana.
The agent needs more input "Elastic needs more information to continue. Open the conversation in Kibana to answer." Answer in Kibana.
The answer is longer than Slack allows "Response truncated. Open the conversation in Kibana for the full answer." Select View in Kibana.

When your project refuses your message, for example because the daily limit is reached, or @Elastic can't deliver it, @Elastic also adds a :warning: reaction to your message, so you can spot it in a busy channel. An answer that fails after it started gets no reaction.

When a daily limit skips an automation that posts to Slack, @Elastic posts a notice instead of the results, for example: "The automation Checkout alerts has reached its daily limit of 20 investigations. It resumes at 00:00 UTC, or an admin can raise the limit on the automation." If a deployment-wide limit was reached instead, the notice names that limit and points to the Elastic nightshift settings. Each notice is posted once per channel and limit each UTC day. Refer to What happens when a limit is reached.

Private channel access is optional. The person who connects Slack, or the Slack admin who approves the app, can allow or decline it. This choice applies to the whole Slack workspace and every Elastic project connected to it. @Elastic still sees only the private channels that someone invites it to. Allowing private channel access adds the optional groups:history and groups:read permissions. Refer to Slack permissions.

If you connected Slack without private channel access and want to turn it on, disconnect the workspace in Kibana, connect it again, and allow private channel access. Then connect your channels again. To connect a private channel, invite @Elastic to it in Slack, then enter its channel ID or link in Connect a channel. Private channels aren't listed in the Channel list.

To turn private channel access off, remove the app from the workspace in Slack, then reinstall it and decline private channel access. Slack doesn't remove permissions from an existing installation.

Slack shows these permissions when you install the app. @Elastic uses them only in channels that it has been invited to, and it can't read channels that it isn't a member of. Content from a channel reaches your project only when the channel is connected to it.

Permission Required What @Elastic uses it for
app_mentions:read Yes Receive messages that mention @Elastic.
assistant:write Yes Show its progress in the thread while it works on an answer.
channels:history Yes Read the thread that a mention is in, receive messages in connected public channels for automations, and let investigations read recent messages in a connected public channel.
channels:read Yes List the public channels it has been invited to, so admins can pick one in Kibana. Check that it's a member of a channel before an admin connects it.
chat:write Yes Post and update answers, investigation status, and results in threads.
im:history Yes Receive direct messages, only so that it can reply that they aren't supported.
reactions:write Yes Add a :warning: reaction when your project refuses a message or can't be reached.
users:read Yes Show people's display names instead of Slack user IDs in the context that it sends to your project. It doesn't read email addresses.
groups:history No In private channels that it's invited to, read the thread that a mention is in.
groups:read No Check that it's a member of a private channel before an admin connects it.

The app also subscribes to these Slack events: app_mention, message.channels, message.groups, message.im, member_joined_channel, app_home_opened, and app_uninstalled. Slack sends message.groups only when private channel access is allowed. The relay drops private channel messages that don't mention @Elastic.

When you mention @Elastic
Your message. In a thread, the relay also reads the thread's first message and up to four of the latest messages from people and other apps since @Elastic last posted there. In a long thread, it might read only the first message. Each message is capped at 2,000 characters. The relay reads the thread again for every mention and doesn't keep it.
In connected public channels
Every message event, so that automations with the New message in channel trigger can match them, for example alerts that another app posts. This includes edits and deletions, and a deletion can include the deleted text. Messages in which a person mentions @Elastic go to the agent instead, though edits of those messages are sent. @Elastic's own posts aren't sent. An automation that matches a message receives its text, up to 4,000 characters. Replies in an investigation's thread are added to that investigation, even without a mention. Refer to Discuss an investigation in its thread.
During an investigation
An investigation can read recent messages in a connected public channel that @Elastic is a member of. By default it reads the last two hours. It can read up to seven days at a time, or a whole thread. It can't read private channels, shared channels, direct messages, or channels that aren't connected to the project.
People's names
The display names of the people in the thread, so that answers and the investigation record show who said what. Names are held in memory for up to six hours and aren't written to disk.
What it doesn't read
Channels that @Elastic isn't a member of, and the content of files. It receives direct messages only to reply that they aren't supported, and never forwards or stores them.

The following table lists where Slack data is kept, what's kept there, and for how long:

Where What's kept How long
The Slack relay The workspace installation and its Slack bot token, which channels connect to which project, the channel names, the project's Kibana URL, and the ID of each project's Slack connection service account. The token and the account ID are encrypted. No message content. Until the channel or workspace is disconnected, or the app is removed from Slack.
The Slack relay, in transit Slack events that are waiting to be delivered to your project, encrypted. Deleted when your project accepts the event, or within an hour if it can't be delivered.
The Slack relay, per answer IDs and state for an answer in progress, such as which message to update, and IDs used to limit repeated notices. No message content. About an hour after the answer's last update.
Your project Conversations, investigations, and the Slack messages that they include, with the names of the people who wrote them. Until you delete them. Refer to Deleting data.
Your project, the .workflows-events data stream Every message event that the relay sends from a connected public channel, including edits and deletions, with its text, and including messages that no automation matches. Elastic nightshift itself doesn't keep them. Workflows logs them as trigger events. No retention period is set on the data stream.
Models through EIS The Slack messages in a thread are sent to the model along with the rest of the investigation. Refer to What it sends to models.
Slack The messages that @Elastic posts. Your Slack workspace's retention settings.

The relay runs in a single AWS region, us-east-1, during Tech Preview. Slack events for every project pass through it, regardless of the project's region. If your organization requires Slack data to stay in a specific region, check whether this meets your requirements before you connect Slack.

To learn how Elastic processes personal data, including the Data Processing Addendum and GDPR, refer to the Elastic Trust Center.

Disconnect a channel
On the Elastic nightshift Settings page, select Disconnect channel next to the channel. @Elastic stops answering there and replies that the channel isn't connected. It stays in the channel until you remove it in Slack. Automations that post to the channel stop posting.
Disconnect the workspace
On the Elastic nightshift Settings page, on the General tab, navigate to the Slack channels section, and select → Disconnect workspace. This disconnects every channel for this project. Other Elastic projects connected to the same workspace aren't affected. When the last project disconnects, the relay revokes the bot token and deletes the installation.
Remove the app from Slack
When a Slack admin removes the app from the workspace, the relay deletes the installation and every channel connection for every project connected to the workspace.

Disconnecting doesn't delete conversations or investigations from your project, or the messages that @Elastic already posted in Slack.