Slack - Send Message to Channel
  • 06 Feb 2025
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Slack - Send Message to Channel

  • Dark
    Light
  • PDF

Article summary

Slack - Send Message to Channel posts a message to a Slack channel for:

  • Assets returned by the selected query or assets selected on the relevant asset page.

See Creating Enforcement Sets to learn more about adding Enforcement Actions to Enforcement Sets.

Note:

Required Fields

These fields must be configured to run the Enforcement Set.

  • Action name - The name of this Enforcement Action. The system sets a default name. You can change the name.
  • Configure Dynamic Values - Toggle on to enter a Dynamic Value statement. See Creating Enforcement Action Dynamic Value Statements to learn more about Dynamic Value statement syntax.

  • Use stored credentials from Slack Adapter - Select this option to use credentials from the adapter connection. By default, the first connection is selected.

    • When you select this option, the Select Adapter Connection drop-down becomes available. Select the adapter connection to use for this Enforcement Action.
    Note:

    To use this option, you must successfully configure a Slack adapter connection.

  • Channel ID - The ID of the channel to which to send the messages.

  • Message Description - Specify a message description to be included in the Slack message.

  • Compute Node - The Axonius node to use when connecting to the specified host. For more details, see Connecting Additional Axonius Nodes.

Additional Fields

Connection and Credentials

When Use stored credentials from the adapter is toggled off, some of the connection fields below are required to create the connection, while other fields are optional.

  • Host Name or IP Address - The hostname or IP address of the Slack server.
  • Authentication Token - An Authentication Token associated with a user account that has the Required Permissions to perform this action. For instructions on generating the Authentication Token, see admin.users.list.
  • Account Sub Domain - The Slack server's sub domain (<sub_domain>.slack.com).
  • User Name and Password - The credentials for a user account that has the Required Permissions to perform this action.
  • MFA Secret - The MFA Secret Key configured for the Slack adapter.
  • Enterprise Grid Organization - Select this option if you are using the Slack Enterprise Grid Organization solution.
  • Verify SSL (optional) - Select whether to verify the SSL certificate of the server against the CA database inside of Axonius. For more details, see SSL Trust & CA Settings.
  • HTTPS Proxy (optional) - Connect the adapter to a proxy instead of directly connecting it to the domain.
  • Number of Assets to include in Message Body (max 100) - Set the top number of results to be displayed. The default value is 20. If this value is 0, the message will consist of just the specified text, and no asset details will be included.
  • Message Color (optional) - Enter the hex code for the color you want the message to appear in.
  • Prettify Entities -
    • Select this option to present in the Slack message, in an improved format, only the column view set in the Enforcement Action query.
    • Leave this option disabled (the default) to present the Slack message in JSON format.
  • Gateway Name - Select the Gateway through which to connect to perform the action.

API

Axonius uses the Slack Post Message API

Required Permissions

The stored credentials, or those provided in Connection and Credentials, must have have the following permissions:
Bot tokens: chat:write
User tokens: chat:write, chat: write:user, chat:write:bot, chat.write.public


For more details about other Enforcement Actions available, see Action Library.


Was this article helpful?