Check Artifact Download Status
Check whether JFrog Xray blocks an artifact download, and see which policy violations are responsible, from JFrog CLI.
The JFrog CLI jf xr status command shows whether JFrog Xray currently blocks download of an artifact, and which policy violations are responsible. Use it when a download is blocked, or before you retrieve an artifact, so you can see the block reason in the terminal instead of locating the artifact in the JFrog Platform UI. For a walkthrough of a blocked download, see Find Why an Artifact Download Is Blocked.
JFrog Xray computes the status from the current violation and scan data. The command doesn't download the artifact. The artifact must already exist in JFrog Artifactory, and you need the same read permission on the repository that a download requires.
Check the Download Status
To check artifact download status:
-
Run
jf xr statuswith the artifact you want to check. The alias isjf xr st.jf xr status <ARTIFACT>Where:
<ARTIFACT>: The artifact to check.<REPOSITORY>: The JFrog Artifactory repository key.<PATH>: The artifact path inside the repository.<HOST>: The JFrog Platform hostname, or an optional Docker registry host.<IMAGE>: The Docker image name.<TAG>: The Docker image tag.<DIGEST>: The Docker image digest.
Use one of these forms:
- Repository path:
<REPOSITORY>/<PATH> - Platform URL that includes
/artifactory/:https://<HOST>/artifactory/<REPOSITORY>/<PATH> - Docker image reference, with an optional registry host:
<REPOSITORY>/<IMAGE>:<TAG>,<HOST>/<REPOSITORY>/<IMAGE>:<TAG>,<REPOSITORY>/<IMAGE>@sha256:<DIGEST>, or<HOST>/<REPOSITORY>/<IMAGE>@sha256:<DIGEST>
For example, this prints the Artifact Download Status for
libs-release-local/com/acme/foo-1.2.jar:jf xr status libs-release-local/com/acme/foo-1.2.jarWhen the download is blocked, the Artifact Download Status looks like this.
Expected output:
Download Status: BLOCKED Reason: one or more matched policies are configured to block downloads Results: https://acme.jfrog.io/ui/scans-list/repositories/libs-release-local/...-
Check a platform URL. The URL must include
/artifactory/.jf xr status https://acme.jfrog.io/artifactory/libs-release-local/com/acme/foo-1.2.jar -
Check a Docker image. Use the same form as
docker pull. A registry host is optional. A digest reference uses@sha256:<DIGEST>.jf xr status my-docker-repo/nginx:1.25jf xr status acme.jfrog.io/my-docker-repo/my-image:3 -
Print the Artifact Download Status, reason, scan status, and violations as JSON.
jf xr status libs-release-local/com/acme/foo-1.2.jar --format=json
-
Review the Artifact Download Status and the violations table. The command prints the artifact path, the SHA256 checksum when one is available, the violation scan status, the Artifact Download Status, the reason, and a link to the artifact results in the JFrog Xray Scans List tab.
The command then prints a violations table. JFrog Xray sorts violations by blocking status, then by severity. Severity and the blocking indicator are color-coded.
The table columns are Blocking, Severity, Detail, State, Violation ID, Watch, Policy, and Rule. When your terminal supports clickable links, the last column opens that violation in the JFrog Platform.
Note
When
jf xr statusprints a violations table, terminals that support clickable links include a last column with a direct link to that violation in the JFrog Platform. Those terminals include iTerm2, Visual Studio Code, Windows Terminal, kitty, WezTerm, Hyper, Ghostty, Tabby, and Warp. Terminals that don't support clickable links, including Terminal.app on macOS, omit that column.
Command Options
The following options apply to jf xr status. The alias is jf xr st.
| Option | Required | Default | Description |
|---|---|---|---|
--server-id | No | Default connection | ID of your JFrog Platform connection, configured with jf c add. |
--format | No | table | Output format. Acceptable values are table and json. |
--project | No | None | JFrog project key. Scopes the JFrog Xray request to that project. |
--insecure-tls | No | false | Set to true to skip TLS certificate verification. |
--url | No | None | URL of your JFrog Platform. |
--user | No | None | User name for your JFrog Platform. |
--password | No | None | Password for your JFrog Platform. |
--access-token | No | None | Access token for your JFrog Platform. |
--xray-url | No | None | URL of your JFrog Xray endpoint. |
Command Argument
The jf xr status command takes the following argument.
| Argument | Description |
|---|---|
artifact | The artifact to check. A repository path (<REPOSITORY>/<PATH>), a platform URL (https://<HOST>/artifactory/<REPOSITORY>/<PATH>), or a Docker image reference. A Docker reference can include an optional registry host: <REPOSITORY>/<IMAGE>:<TAG>, <HOST>/<REPOSITORY>/<IMAGE>:<TAG>, <REPOSITORY>/<IMAGE>@sha256:<DIGEST>, or <HOST>/<REPOSITORY>/<IMAGE>@sha256:<DIGEST>. |
Artifact Download Status
The jf xr status command returns one of the following Artifact Download Status values.
| Artifact Download Status | Description |
|---|---|
BLOCKED | At least one matched policy that isn't ignored blocks downloads. The reason is one or more matched policies are configured to block downloads. |
ALLOWED | Violation scanning is complete and no matched policy blocks the download. |
UNKNOWN | Violation scanning hasn't finished, failed, or is partial, or the checksum indexed by JFrog Xray doesn't match the artifact. A watch that blocks unscanned artifacts can still block the download while the Artifact Download Status is UNKNOWN. |
Related Topics
Updated 9 days ago
