Skip to main content
The SafeDep JFrog Xray integration is available with the Threat Intel Feed add-on. To enable the add-on, see the pricing page.
The JFrog Xray integration runs as a daemon. It polls SafeDep for verified malicious packages and pushes them to JFrog Xray as Custom Issues. With a blocking policy in place, Xray blocks those packages for every developer on that instance.
To preview the feed without JFrog credentials, run it with --dry-run first.

Prerequisites

  • SafeDep CLI installed (install)
  • JFrog instance with Xray enabled
  • JFrog Xray scoped Access Token
  • Optional, for blocking malicious packages on developer machines or CIs
    • JFrog Xray Malware security policy and repository watch with a block action configured

How It Works

1

Authenticate with SafeDep

2

Start the integration daemon

The daemon polls SafeDep continuously (default: every 5 minutes) and pushes any newly verified malicious packages to Xray.On the first run the daemon starts from the current time and does not pull older reports. To seed history, pass --backfill with a duration: --backfill 168h covers the last 7 days. Later runs resume from the saved cursor, so --backfill is ignored after the first run.
Output
3

Verify Blocking via JFrog

Assumes a Malicious Package blocking policy and watch configured for the target repository (e.g. npm-remote).
jf npm install triggers Xray to index <Malicious Ingested Package>. Xray raises a policy violation and blocks the download.
Install Output

Limitations

Malicious Packages Blocking

npm and other package managers cache packages locally on developer machines. If a developer installs a package before SafeDep flags it, the cached copy remains accessible even after the integration pushes it to Xray. Running npm cache clean --force removes the cached copy, but it clears the entire local cache and forces a full re-download of all packages.

Configuration

CLI Flags

*Required unless the corresponding environment variable is set.

Environment Variables

For server deployments or CI pipelines, use environment variables to avoid passing secrets as CLI flags. When both are set, flags take precedence. Example: environment variable setup

Dry run

Use --dry-run to test the feed without a JFrog connection.
--dry-run previews the feed and prints each finding as a Would push: line, without sending to JFrog. It needs no JFrog credentials, so you can check the feed before you connect an instance.
A dry-run does everything a real run does, except the final step: it prints each finding instead of sending it to JFrog.
Dry-run advances the same saved cursor. Run cursor remove before the first real run, or that run skips what the preview consumed.

Manage the feed cursor

The run command saves a cursor so it resumes where it stopped. The cursor is per SafeDep profile, so a change affects only the profile you select with --profile.

Move the cursor

Set the cursor to an RFC3339 timestamp. The next run processes reports updated after this time.

Clear the cursor

Remove the saved cursor. The next run starts fresh from the current time, or from the --backfill window.