Anchore Enterprise Notifications
- An information packet generated by Anchore Enterprise service to indicate some activity.
- External tool capable of receiving messages such as Slack, GitHub, Jira, MS Teams, email or webhook.
- Endpoint Configuration
- Connection information of the endpoint used for sending messages.
- Criteria for selecting events to be notified.
Anchore Enterprise includes Notifications service to alert external endpoints about the system’s activity. Services that make up Anchore Enterprise generate events to record significant activity, such as an update, in the policy evaluation result or vulnerabilities for a tag, or an error analyzing an image. This service provides a mechanism to selectively notify events of interest to supported external endpoints. The actual notification itself depends on the endpoint - formatted message to Slack, email and MS Teams endpoints, tickets in GitHub and Jira endpoints, and JSON payload to webhook endpoint.
Enterprise Notifications Service
The service loads configuration from the
notifications section of the config.yaml. See the following snippet of the configuration:
... services: notifications: enabled: true require_auth: true endpoint_hostname: "<hostname>" listen: '0.0.0.0' port: 8228 cycle_timers: notifications: 30 # Set Anchore Enterprise UI base URL to receive UI links in notifications ui_url: "<enterprise-ui-url>" authorization_handler: external authorization_handler_config: endpoint: "<rbac-authorizer-endpoint>"
cycle_timers -> notifications controls how often the service checks for events in the system that need to be processed for notifications. Default is every 30 seconds.
ui_url is used for constructing links to Enterprise UI pages in the notifications. Configure this property to the Enterprise UI’s base URL. This URL should be accessible from the endpoint receiving the notification for the links to work correctly. If the value is not set, the notification message is still be sent to the endpoint, but it won’t contain a clickable link to the Enterprise UI.
Note: Any changes to the configuration requires a restart of the service for the updates to take effect.
In an Anchore Enterprise RBAC-enabled deployment, the table below lists the required actions and containing roles:
|List all the available notification endpoints and their status||listNotificationEndpoints||Read Only, Read Write|
|List all available configurations for an endpoint||listNotificationEndpointConfigurations||Read Only, Read Write|
|Get an endpoint configuration and associated selectors||getNotificationEndpointConfiguration||Read Only, Read Write|
|Create an endpoint configuration and associated selectors||createNotificationEndpointConfiguration||Read Write|
|Update an endpoint configuration and associated selectors||updateNotificationEndpointConfiguration||Read Write|
|Delete an endpoint configuration and associated selectors||deletetNotificationEndpointConfiguration||Read Write|
To send notifications to an external tool/endpoint, the service requires connection information to that endpoint. See the following for the required information for each endpoint:
All endpoints in the Notifications service can be toggled as Enabled or Disabled. The endpoint status reflects the eabled or disabled state. By default, the status for all endpoints is enabled by default. Setting the endpoint status to disabled stops all notifications from going out to any configurations of that specific endpoint. This is a system-wide setting that can only be updated by the admin account. It is read-only for remaining accounts.
The endpoint configuration is the connection information such as URL, user credentials, and so on for an endpoint. The service allows multiple configurations per endpoint. Endpoint configurations are scoped to the account.
The services provides a mechanism to selectively choose notifications and route them to a configured endpoint. This is achieved using a Selector, which is a collection of filtering criteria. Each event is processed against a Selector to determine whether it is a match or not. If the Selector matches the event, a notification is sent to the configured endpoint by the service.
For a quick list of useful notifications and associated Selector configurations, see Quick Selection.
A Selector encapsulates the following distinct filtering criteria: scope, level, type, and resource type. Some allow a limited set of values, and others wildcards. The value for each criteria has to be set for the matching to compute correctly.
Events are scoped to the account responsible for the event creation.
accountscope matches events associated with a user account.
globalscope matches events of any and all users.
globalscope is limited to admin account only. Non-admin account users can only specify
accountas the scope.
Events are associated with a level that indicates whether the underlying activity is informational or resulted in an error. -
info matches informational events such as policy evaluation or vulnerabilities update, image analysis completion and so on.
errormatches failures such as image analysis failure.
*will match all events.
Allowed values: strings with or without regular expressions
Event types have a structured format
* matches all types of events. Category is indicative of the origin of the event.
system.*matches all system events.
user.*matches events that are relevant to individual consumption.
- Omitting an asterisk will do an exact match. See the GET /event_types route definition in the external API for the list of event types.
In most cases, events are generated during an operation involving a resource. Resource type is metadata of that resource. For instance
image_tag is the resource type in a policy evaluation update event.
* matches all resource types if you are uncertain what resource type to use.
The following Selector configurations are for notifying a few interesting events.
|Policy evaluation and vulnerabilities updates||
|Everything user related||
|Everything system related||
|All for every account (admin account only)||
See it in action
To learn more about configuring Notifications service in the Enterprise UI, see Notifications.