Webhooks enable real-time communication between different systems or applications over the internet. They allow one application to send data to another application as soon as a specific event or a trigger occurs. Use webhooks to integrate Endor Labs with applications such as Slack, Microsoft Teams or more, and instantly get notified about projects when scans violate your configured policies. When events occur, Endor Labs sends HTTPS POST requests to URLs of your configured events, with all the information you need.Documentation Index
Fetch the complete documentation index at: https://docs.endorlabs.com/llms.txt
Use this file to discover all available pages before exploring further.
Configure a webhook integration
Set up a custom integration with Endor Labs webhooks.- Select User menu > Integrations from the sidebar.
- Navigate to Webhooks under Notifications and click Add.
- Click Add Notification Integration.
- Enter a name and description for this integration.
- Enter the URL endpoint for the webhooks.
- Enter the authentication method such as API Key, Basic, or None.
- Enter the details for the authentication method such as USERNAME, PASSWORD, or API KEY. Make sure the API Key has required permissions to post messages using webhook.
- To ensure integrity, de-select Disable HMAC Integration Check and enter the HMAC Shared Key. The Hash-Based Message Authentication Code (HMAC) ensures the authenticity of a message using a cryptographic hash function and a secret key. The HTTP request includes the HMAC signature as a header.
- Click Add Notification Integration.
Associate an action policy with the webhook
You can create action policies to trigger webhook notifications when a scan matches policy conditions. For example, send a webhook notification when there is a critical or high vulnerability. While creating an action policy, configure the following settings:- Select Choose an Action as Send Notification.
- From SELECT NOTIFICATION TARGETS, choose the webhook integration notification that you created.
-
Choose an Aggregation type for notifications.
- Choose None (Notify for each Finding) to trigger a separate notification for each finding.
- Choose Project to trigger a single notification for all findings.
- Choose Dependency to trigger a notification for every dependency.
- Choose Dependency per package version to trigger notifications for every unique combination of dependency and package version.
- From Assign Scope, include the project tags in INCLUSIONS to apply this policy to a project.
Endor Labs webhook payload
Endor Labs provides the following webhook payload, that you can customize for your needs.| Name | Description |
|---|---|
data.message | Brief message about the number of findings discovered for a project |
data.project_url | Link to the scanned project in the Endor Labs application |
data.policy.name | Name of the violated policy that triggered the notification |
data.policy.url | Link to the violated policy in the Endor Labs application |
data.findings | Complete list of findings |
data.findings[].uuid | Unique identifier of the finding |
data.findings[].description | Brief description of the finding |
data.findings[].severity | Severity of the finding |
data.findings[].dependency [CONDITIONAL] | Name of dependency that caused the policy violation. This field is only present for findings that have a dependency associated. For example, vulnerability findings |
data.findings[].package [CONDITIONAL] | The version of the package in the project that imported the dependency causing the policy violation. This field is only present for findings that have a package version associated with them. For example, vulnerability findings |
data.findings[].repositoryVersion [CONDITIONAL] | Repository version of the project that triggered the policy violation. This field is only present for findings that have a repository version associated with them. For example, secrets findings |
data.findings[].findingURL | Link to the finding in the Endor Labs application |
spec section in the API response to view all the information.
Example:
See the following example for a sample notification payload.
Use Endor Labs webhooks to integrate with Slack
If you use Slack as a collaborative tool, integrate Slack channels using webhooks in Endor Labs to publish notifications as messages in the respective channels.- Configure a webhook integration
- Endor Labs webhook payload
- Use Endor Labs webhooks to integrate with Slack
Create incoming webhooks in Slack
Create an incoming webhook to your Slack channel to enable Endor Labs to post notifications in the channel. The webhook provides a unique URL for integrating the channel in Endor Labs. To send messages into Slack using incoming webhooks, see Slack Integration If you have already created an incoming webhook in the channel, copy the unique URL and integrate the channel in Endor Labs.Customize webhook notification templates
Endor Labs provides you with a default template with standard information for the webhook message. You can use the default template or you can choose to edit and customize this template to fit your organization’s specific requirements. You can also create your own custom templates using Go Templates.- Select User menu > Integrations from the left sidebar
- Navigate to Slack under Notifications.
- Click Manage to view the list of configured notification integrations.
- Choose one and click the ellipsis on the right side, and click Edit Template.
- Make required changes to any of the following templates and click Save Template.
- Open - This template applies when Endor Labs raises new notifications.
- Update - This template applies when an existing notification updates, such as when findings change.
- Resolve - This template applies when all findings reported by the notification resolve.
- Click Restore to Default to revert the changes.
- Use the download icon on the top right corner to download this template.
- Use the copy icon to copy the information in the template.
Data model
To create custom templates for Webhook notifications, you must understand the data supplied to the template. See the protobuf specificationNotificationData message used for the templates.
To understand Project, Finding, PackageVersion and RepositoryVersion definitions used in this protobuf specification, see:
- Project resource kind
- Finding resource kind
- PackageVersion resource kind
- RepositoryVersion resource kind