Set up your your policies prior to creating the Watch. For more information, see Creating Xray Policies and Rules.
To create a Watch, you need to have the Manage Watches global permission configured on the user or group. |
In the Create New Watch page, set the general information on the watch and assign Watch recipients on the watch.
When selected, all the Watch recipients will receive email notifications if a policy set to notify recipient has detected a vulnerability.
Starting from Xray 3.27.2 and above with Artifactory version 7.21.3 and above, if you are using Projects, you can create a Global Watch for Projects.
You can only see resources in a Watch if they are indexed for scanning by Xray and you have "View" permission on the resource. You can only add resources to a Watch or remove them if they are indexed for scanning by Xray and you have "Manage" permission on the resource. |
The next step is to assign resources to a Watch. The Resources are the set of repositories and builds in the connected Artifactory services that the Watch monitors. If you are using Projects, you can select Projects as resource.
Managing resources for a Watch involves two steps:
To assign resources on a watch:
- All resources within the resource type: Set the Any Repository, Any Build, Any Bundle or Any Project checkboxes to monitor all those resources that have been specified for indexing by Xray.
Note that this setting will also apply to new repositories and builds that are created after the Watch is defined.
- Packages: Set according to the Repo Path Include and Repo Path Exclude patterns.
- Builds and Release Bundles: Select By Name or By Pattern.
- Projects: Select By Name or By Pattern (project keys).
From version 2.6, when scanning builds for supported package formats, external (transitive) dependencies that are not directly included in the build are also scanned and will trigger violations if the meet the criteria specified in a Watch. Currently, the supported package formats are: Maven, NuGet, npm and Gradle and scans external resources using SHA-256. |
The filters you define for a watch determine which artifacts in the repositories specified will generate violations and under what conditions. You can define any number of filters on each of the repositories specified for the watch, and it will only trigger a violation if an artifact meets the conditions of all of the filters defined for that resource.
You can define any number of filters for a resource, and only artifacts that pass through all of them will trigger a violation. |
The following content filters are available:
Name | Description | Example |
---|---|---|
Name | A Name filter uses a regular expression to specify the name of an artifact. The watch will only trigger a violation if an artifact's name matches the expression. | For example, the filter specifies that the watch should only trigger a violation for rpm files. |
Path | A Path filter uses a regular expression to specify the path of an artifact in the repository. The watch will only trigger a violation if an artifact's name matches the expression. Note that the filter does not consider the repository name to be a part of the path. | For example, the filter specifies that the watch should only trigger a violation for artifacts that have the expressions "jfrog" in their path |
Package Type | A Package Type filter specifies an artifact's package type. The watch will only trigger a violation if an artifact has the specified package type. | |
Mime Type | A Mime Type filter specifies an artifact's mime type. The watch will only trigger a violation if an artifact has the specified mime type. | For example, the filter specifies that the watch should trigger a violation for any artifact with an "application/json" mime type. |
Property | A Property filter specifies a property annotating an artifact and its value. The watch will only trigger a violation if the property has the specified value. | For example, the filter above specifies that the watch should trigger a violation if an artifact with a property named "performance" has the value "false". |
Click Save to assign the policies to the Watch.
Edits made to a policy will automatically be applied to all watches the policy is assigned to. This will take affect only for newly scanned artifacts. You can manually apply the watch on existing artifacts. |
To edit a Watch select it from the list of Watches and go to the Settings tab.
Once a Watch is created, it will scan artifacts in the specified resources when a scan-triggering event happens, and issue Violations accordingly. However, until a scan-triggering event happens, artifacts already existing in the system will not be scanned by the Watch. So, to make sure a Watch is immediately applied to the relevant artifacts, you can invoke it manually by hovering over it and selecting Apply on Existing Content.
You can only manually invoke a Watch on existing content if the Watch is defined on specific resources and not on All Repositories or All Builds |
Clicking the button pops up a dialog that lets you specify which of the resources assigned to the watch should be scanned, and a date range that defines when the artifact was last scanned by Xray.
For example, selecting "Last 7 days" will only scan artifacts that have been scanned in the last 7 days.
Starting from Xray version 3.31.x and above, you can filter the Watches list in the Watches page in Xray to narrow down and display only Watches that are relevant to you. Select the Filter button, in the top-right corner, and the filter appears. Use the filtering options to display the Watches or Watch data you want to see.