- 18 Sep 2024
- 5 Minutes to read
- Print
- DarkLight
- PDF
Microsoft Teams - Send Direct Message to Assets
- Updated on 18 Sep 2024
- 5 Minutes to read
- Print
- DarkLight
- PDF
Microsoft Teams - Send Direct Message to Assets sends a direct message in Microsoft Teams to assets that match the results of the selected saved query, and match the Enforcement Action Conditions, if defined, or assets selected on the relevant Asset page.
- Not all asset categories are supported for all Enforcement Actions.
- See Actions supported for Activity Logs, Adapters Fetch History, and Asset Investigation modules.
- See Actions supported for Vulnerabilities.
- See Actions supported for Software.
General Settings
- 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 adapter connection - Select this option to use the first connected Microsoft Entra ID (Azure AD) adapter credentials.
To use this option, you must successfully configure an Microsoft Entra ID (Azure AD) adapter connection. Each asset is run using the the connection that fetched the asset.
Required Fields
These fields must be configured to run the Enforcement Set.
- Custom message - The text of the Microsoft Teams direct message.
Additional Fields
- Create list of predefined responses - This field is only available in an action that is added to a Workflow. Enter a list of response buttons to be shown in the Microsoft Teams message in the order that they are added into this field. Click Add to add each possible response to the list. When a response button is clicked in a Microsoft Teams message that is sent, the workflow continues based on that button.
Connection Parameters
If Use adapter connection is not enabled, these fields need to be configured. To access the values for these fields, see the Microsoft Entra ID (Azure AD) adapter configuration page.
- Azure Client ID - The Application ID of the Axonius application.
- Azure Client Secret - Specify a non-expired key generated from the new client secret.
- Azure Tenant ID - Microsoft Entra ID (Azure AD) ID.
- Verify SSL - 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.
- Account Sub Domain - The Microsoft account's sub domain (<sub_domain>.onmicrosoft.com).
- Username and Password - The credentials for a user account that has the permissions needed to fetch SaaS data.
- 2FA Secret Key - The secret generated in Microsoft Entra ID (Azure AD) for setting up 2-factor authentication for the Microsoft user.
- SSO Provider - If your organization uses Microsoft Entra ID (Azure AD) for SSO, you can select this check box.
For more information, see Connecting your SSO Solution Provider Adapter.
- Send asset details in message - Select this option to include asset details in the direct message sent by Teams.
- Send to manager - Select this option to also send the direct message to the relevant manager for that asset.
API
Axonius uses the Azure AI Bot Service API.
Required Permissions
The following Microsoft Graph permissions are required for the action to work:
- AppCatalog.Read.All
- TeamsAppInstallation.ReadWriteForUser.All
Required Ports
Axonius must be able to communicate with Microsoft Teams via TCP port 443.
Set Up the EC Action
To set up this EC Action, you need to first configure a new designated bot in Microsoft Teams and then create a new application in Microsoft Teams.
Configure the Bot
- Navigate to https://dev.botframework.com/bots/new and create a new bot.
- Fill the following fields:
- Display name - Any name you want for this bot.
- Bot handle - The Client ID of the Azure application.
- Messaging endpoint - Copy the "Webhook URL" from the Axonius configuration (Global settings - Workflows Events - Microsoft Teams). This is only necessary if you are using "Create list of predefined responses" configuration in the action.
- App type - The tenancy type for the Azure app.
- Paste your app ID below to continue - The Client ID of the Azure application.
- App Tenant ID - The Azure Tenant ID (if single tenancy mode is selected).
- Click Register.
Set Up the App with the Developer Portal
In Microsoft Teams, from the side panel, click Apps.
Using the search bar, search for "developer portal".
From Microsoft Corporation, click Developer Portal.
Click Add (or Open).
In Developer Portal, click Apps.
Click New app.
Enter a name for the app and click Add.
On the Basic information page, fill the following fields:
- Short description
- Long description
- Developer or company name
- Website
- Privacy policy
- Terms of use
Click Save.
Click App features.
Click Bot.
Select Select an existing bot, and choose the bot you created earlier.
Under "Select the scopes in which people can use this command", select Personal, Team, and Group Chat.
Click Save.
In Developer Portal, from the top toolbar, click Tools.
Click Bot management.
Click the bot you've created.
Click Channels.
Make sure Microsoft Teams is checked.
Click Save.
Install the New App in Teams Through the Admin Center
After you set up the app there are two potential ways for installing the app. If this process for installing the app through the Teams portal doesn't work, see the next process for installing the app using a downloaded zip file.
- In Developer Portal, from the top toolbar, click Apps.
- Select the app you created.
- On the top-right of the screen, click Publish.
- Select Publish to your org.
- Click Publish your app
- Navigate to Teams App Management.
- Search for your app and click on it.
- Click Publish.
- When prompted, confirm in the pop up.
Install the New App in Teams Through the Developer Portal
- In Developer Portal, from the top toolbar, click Apps.
- Select the app you created.
- On the top-right of the screen, click Publish.
- Select Download the app package to download a zip file containing the application.
- Navigate to Teams App Management.
- On the top right, click Actions.
- Click Upload new app.
- Click Upload.
- Choose the file you downloaded.
For more details about other Enforcement Actions available, see Action Library.