fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
3.12k stars 431 forks source link

Add Slack as an automation destination #17889

Open tbcahill opened 7 months ago

tbcahill commented 7 months ago

Add Slack as an automation destination, in addition to Jira & Zendesk

Here is an example taken from a mac script that could used as a guide:

slackChannel="AABBCCDDEE" 
slackToken="Authorization: Bearer xoxb-112233445566778899"  
# Format the Slack message
slackMessage="content content content"
# Upload to Slack
curl -H "Content-type: application/json" \
--data '{"channel":"'"$slackChannel"'","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"'"$slackMessage"'"}}]}' \
-H "$slackToken" \
-X POST https://slack.com/api/chat.postMessage
noahtalerman commented 7 months ago

Thanks @tbcahill!

What would you want the Slack message's content to be? Would it get sent to a channel or an individual user?

tbcahill commented 7 months ago

Hi Noah,

We are hoping to use this as a notification that a device is failing a policy

It would be sent to a channel. Not much info needs to be included, the name of the Query / Policy & the name / Serial Number of the device.

noahtalerman commented 7 months ago

Thanks @tbcahill!

We decided not to draft this one in the upcoming design sprint (4.49).

It may be prioritized in a future design sprint.