Overview

This page describes how to get started with the Unified Agent.

Prerequisites

Ensure you have one of the following Java versions on the computer on which you want to run the Unified Agent. 

Additionally, depending on your project type, ensure that the relevant package managers are installed:

Project Type

Package Manager

C#

  • NuGet + .Net

  • Paket

Elixir, Erlang

MIX

Go

  • Dep

  • Godep

  • Vndr

  • Gogradle

  • Govendor

  • Gopm

  • Glide

  • Vgo

  • Modules

  • Bazel

Haskell

Cabal

Java

  • Maven

  • Gradle

  • ANT

  • Bazel

JavaScript

  • Yarn - required only if the project is not built

  • NPM - required only if the project is not built (or the detection was set to use NPM)

  • Bower

Objective-C, Swift

CocoaPods - required only if the project is not built  

OCaml

Opam

PHP

Composer - required only if the project is not built

Python

  • PIP

  • Poetry

  • Pipenv

  • Conda

R

Packrat - if used

Ruby

Bundler

Rust

Cargo - required only if the project is not built

Scala

SBT

Unified Agent Usage Overview

Step #

Step Name

1

Download the latest version of the Unified Agent and verify its integrity.

2

Set up the Unified Agent.

3

Do one of the following:

(See execution examples on this page)

4

View the results in your WhiteSource organizational portal.

Downloading the Unified Agent

The Unified Agent latest version can be downloaded from Amazon S3 or GitHub.

Latest Unified Agent Version

File

Features

Release Date

MD5

Comments

21.10.2

wss-unified-agent.jar

Release Notes 21.10.2

14-11-2021

90A989C0D60A70FCC9A62AF2D54F5E9B

N/A

Previous Unified Agent Versions

Version

File

Features

Release Date

MD5

Comments

21.10.1

wss-unified-agent-21.10.1.jar

Release Notes 21.10.1

31-10-2021

74BB03F271E93CAB9FD3710FC6B786DB

N/A

21.9.1.1

wss-unified-agent-21.9.1.1.jar

Release Notes 21.9.1.1

25-10-2021

706694E349EA14CB04C4621B70D99A93

N/A

21.8.1.1

wss-unified-agent-21.8.1.1.jar

Release Notes 21.8.1.1

31-08-2021

239DAD256F1E8BFAF7361FDEECE3E2CE

N/A

21.8.1

wss-unified-agent-21.8.1.jar

Release Notes 21.8.1

29-08-2021

5E066881180AB1C1C24748145F784B32

N/A

21.7.2

wss-unified-agent-21.7.2.jar

Release Notes 21.7.2

15-08-2021

90BE9617B380EF507C5D5ABE0191FCFA

N/A

21.7.1

wss-unified-agent-21.7.1.jar

Release Notes 21.7.1

01-08-2021

B18E7F9CACB80993151F4518F852710B

N/A

21.6.3

wss-unified-agent-21.6.3.jar

Release Notes 21.6.3

18-07-2021

B897BADFEBA66A39963717899E327F86

N/A

21.6.2.2

wss-unified-agent-21.6.2.2.jar

Release Notes 21.6.2.2

06-07-2021

BAC44FB66BE88130ECA094A37B81F527

N/A

21.6.2

wss-unified-agent-21.6.2.jar

Release Notes 21.6.2

04-07-2021

5E7FE501C0B1BEF76F64EE683B917012

N/A

21.6.1

wss-unified-agent-21.6.1.jar

Release Notes 21.6.1

20-06-2021

F2EB843816A572904954052756EB66E7

N/A

21.5.2

wss-unified-agent-21.5.2.jar

Release Notes 21.5.2

06-06-2021

8E51FDC3C9EF7FCAE250737BD226C8F6

N/A

21.5.1

wss-unified-agent-21.5.1.jar

Release Notes 21.5.1

23-05-2021

B50664F3840004A868D34D608030005C

N/A

21.4.2

wss-unified-agent-21.4.2.jar

Release Notes 21.4.2

09-05-2021

19ADD8EB5637DBD6BE63B9553576DAF9

N/A

21.4.1

wss-unified-agent-21.4.1.jar

Release Notes 21.4.1

25-04-2021

AD4F3747F519F83A2DF8963FF36D61B4

N/A

21.3.2.1

wss-unified-agent-21.3.2.1.jar

Release Notes 21.3.2.1

13-04-2021

707B193FEB891C1B40DD98A0B433ECA8

N/A

21.3.2

wss-unified-agent-21.3.2.jar

Release Notes 21.3.2

11-04-2021

C3576952F70F574FE6745E754A16A0EE

N/A

21.3.1

wss-unified-agent-21.3.1.jar

Release Notes 21.3.1

04-04-2021

C5639E304DEC915F664CE2B391D5A9D7

N/A

21.2.2

wss-unified-agent-21.2.2.jar

Release Notes 21.2.2

14-03-2021

5118B3403C578EC3AD922901CF70EF85

N/A

21.2.1

wss-unified-agent-21.2.1.jar

Release Notes 21.2.1

28-02-2021

490F2217238889F0EC22A4D9352174B9

N/A

21.1.2.1

wss-unified-agent-21.1.2.1.jar

Release Notes 21.1.2.1

14-02-2021

9C6B4DE63AAC89EBB4E7411F792C0AA8

N/A

21.1.2

wss-unified-agent-21.1.2.jar

Release Notes 21.1.2

14-02-2021

15D50AB0EF4D43907393515BF19F6897

N/A

21.1.1

wss-unified-agent-21.1.1.jar

Release Notes 21.1.1

31-01-2021

FDC75043196E49882BCBE19CBCBBD81D

N/A

20.12.3

wss-unified-agent-20.12.3.jar

Release Notes 20.12.3

17-01-2021 

00198172C5724A389CCD6EACD41B8D96

N/A

20.12.2

wss-unified-agent-20.12.2.jar

Release Notes 20.12.2

03-01-2021

DA174CC191818A3763CC79934C2AEAE8

N/A

20.12.1

wss-unified-agent-20.12.1.jar

Release Notes 20.12.1

20-12-2020

70C387ECCA4FA7DCEA02C6C27FFE9247

N/A

20.11.2

wss-unified-agent-20.11.2.jar

Release Notes 20.11.2

06-12-2020

20FC4F59F3183F98D12E82882039531A

N/A

20.11.1

wss-unified-agent-20.11.1.jar

Release Notes 20.11.1

22-11-2020

75293725F596010982E7B831B6BC2F98

N/A

20.10.2

wss-unified-agent-20.10.2.jar

Release Notes 20.10.2

08-11-2020

AD6F30452BAB599BA13CFBE6CDC59AC1

N/A

20.10.1

wss-unified-agent-20.10.1.jar

Release Notes 20.10.1

25-10-2020

2D4624B239234177C851F7204ADB21F3

N/A

20.9.2.1

wss-unified-agent-20.9.2.1.jar

Release Notes 20.9.2.1

15-10-2020

673218A312EB4BF2EB4BB2122E66D2EC

N/A

20.9.1

wss-unified-agent-20.9.1.jar

Release Notes 20.9.1

04-10-2020

F375670B1F651330254AF5C65830CB10

N/A

20.8.2

wss-unified-agent-20.8.2.jar

Release Notes 20.8.2

13-09-2020

6CD6522EB3BFA9D5893505B618303C72

N/A

20.8.1.1

wss-unified-agent-20.8.1.1.jar

Release Notes 20.8.1.1

09-02-2020

E4D40C9C156BA1F284D23A09061FCAA9

N/A

20.8.1

wss-unified-agent-20.8.1.jar

Release Note 20.8.1

30-08-2020

2D4624B239234177C851F7204ADB21F3

N/A

20.7.3.1

wss-unified-agent-20.7.3.1.jar

Release Notes 20.7.3.1

24-08-2020

F15A81CA898EF48378C004F0C30DAC17

N/A

20.7.3

wss-unified-agent-20.7.3.jar

Release Notes 20.7.3

16-08-2020

088FE4495C2636DB12DDE290599D3487

N/A

20.7.2

wss-unified-agent-20.7.2.jar

Release Notes 20.7.2

02-08-2020

C4C1C03EAD650710F41BA06F934E6C8A

N/A

20.7.1

wss-unified-agent-20.7.1.jar

Release Notes 20.7.1

19-07-2020

B0E5171D9187DD5DCF0DC2E31065F210

N/A


Click here for earlier versions of the Unified Agent (previously called the File System Agent (FSA)).

Setting Up the Unified Agent

There are several methods for configuring the Unified Agent:

The configuration is applied in the following order of precedence:

  1. Command-line parameters

  2. Environment variables

  3. Configuration file

  4. Default values

For the full configuration parameters reference, refer to the Unified Agent Configuration Parameters page.

Setting the Minimum Required Configuration Parameters

Set the following configuration parameters, in any of the available methods, for the Unified Agent's execution:

Parameter Name

Environment Variable Name

Configuration File Parameter Name

Command Line Parameter Name 

Description

API Key

WS_APIKEY

apiKey

-apiKey

The identifier of the organization. This can be found on the Integrate page of the WhiteSource User Interface under the Organization section. Requires admin level access to see this page.

WhiteSource URL

WS_WSS_URL

wss.url

-wss.url

The Server URL with /agent added. This can also be found on the Integrate page of the WhiteSource User Interface under the Organization section. Requires admin level access to see this page.

For example: https://saas.whitesourcesoftware.com/agent

User Key

WS_USERKEY

userKey

-userKey

Required. See the following link for how to generate a user key.

Product Name

WS_PRODUCTNAME

productName

-product

The name of the product created after running a scan.

Project Name

WS_PROJECTNAME

projectName

-project

The name of the project created after running a scan

Scanning Best Practices

General Tips

Detection Methods

Dependency Resolution

During the detection, manifest files (such as, requirements.txt in python) are used to pinpoint a specific version of the package used.  

Binary and Source File Matching Overview

The WhiteSource Unified Agent also detects binaries and source files (such as, .py files in Python or a .jar file in Java) and matches them against the WhiteSource Index.

Running the Unified Agent

To run the Unified Agent from the command line, execute the following commands in a shell script task as part of your build pipeline or in the directory where your codebase is located: 

cd <your codebase directory>

Linux/macOS:

export WS_APIKEY=my-apiKey
export WS_USERKEY=my-userKey
export WS_PRODUCTNAME=my-product
export WS_PROJECTNAME=my-project
export WS_WSS_URL=https://saas.whitesourcesoftware.com/agent
java -jar wss-unified-agent.jar

Windows:

set WS_APIKEY=<your-api-key>
set WS_USERKEY=<your-user-key>
set WS_PRODUCTNAME=<your-product-name>
set WS_PROJECTNAME=<your-project-name>
set WS_WSS_URL=https://saas.whitesourcesoftware.com/agent
java -jar wss-unified-agent.jar

NOTES:

Viewing and Understanding the Scan Steps and Summary

The Unified Agent command-line interface enables you to view the steps that ran as part of a scan and understand how long each step took.

Start/End Indication

A start/end indication is displayed for each scan step. For example:

------------------------------------------------------------------------
-------------------- Start: Pre-Step & Resolve Dependencies ------------
------------------------------------------------------------------------
[INFO] [2019-03-07 13:58:02,775 +0200] - Trying to resolve MAVEN dependencies
[INFO] [2019-03-07 13:58:02,776 +0200] - topFolder = C:\Users\Me\Desktop\UAtests\GenerateScanReport\generateScanReport\Data
[INFO] [2019-03-07 13:58:07,105 +0200] - Start parsing pom files
[INFO] [2019-03-07 13:58:07,112 +0200] - End parsing pom files , found : search-engine,search-engine-client,search-engine-server
[INFO] [2019-03-07 13:58:07,191 +0200] - Trying to resolve HTML dependencies
[INFO] [2019-03-07 13:58:09,113 +0200] -
------------------------------------------------------------------------
-------------------- End: Pre-Step & Resolve Dependencies --------------
------------------------------------------------------------------------

Summary Table

A summary at the end of scan with all the relevant information on each step is also displayed. It Includes the following columns:

For example: 

Step                                 Completion Status                              Elapsed                              Comments
======================================================================================================================================================
Fetch Configuration                     COMPLETED                                 00:00:00.078                           --------
Scan Files Matching 'Includes' Pattern  COMPLETED                                 00:00:00.014                   1 source/binary files
Pre-Step & Resolve Dependencies         COMPLETED                                 00:00:06.378                   7 total dependencies (7 unique)
   MAVEN                                COMPLETED                                 00:00:04.416                   5 total dependencies (5 unique)
   HTML                                 COMPLETED                                 00:00:01.922                   2 total dependencies (2 unique)
Update Inventory                        COMPLETED                                 00:00:01.551                   2 updated projects

======================================================================================================================================================
Elapsed running time:                                                             00:00:08.021
======================================================================================================================================================
Process finished with exit code SUCCESS (0)

Execution Examples

The following are several syntax examples for various use cases of the Unified Agent execution.

Executing the Unified Agent with Inline environment variables:

export WS_APIKEY=my-apiKey
export WS_USERKEY=my-userKey
WS_PRODUCTNAME=my-product WS_PROJECTNAME=my-project java -jar ./wss-unified-agent.jar

Executing the Unified Agent with the config file:

java -jar ./wss-unified-agent.jar -c /path/to/config/file -d /directory/to/scan

Executing the Unified Agent on multiple folders or files:

export WS_APIKEY=my-apiKey
export WS_USERKEY=my-userKey
export WS_PRODUCTNAME=my-product
export WS_PROJECTNAME=my-project
java -jar ./wss-unified-agent.jar -d /directory/to/scan,/directory/to/scan2,/file/to/scan

Executing the Unified Agent with a policy check to return an error code in order to break a CI/CD pipeline:

export WS_APIKEY=my-apiKey
export WS_USERKEY=my-userKey
export WS_PRODUCTNAME=my-product
export WS_PROJECTNAME=my-project
export WS_CHECKPOLICIES=true
export WS_FORCECHECKALLDEPENDENCIES=true
export WS_FORCEUPDATE=true
export WS_FORCEUPDATE_FAILBUILDONPOLICYVIOLATION=true
java -jar ./wss-unified-agent.jar

Executing the Unified Agent with a proxy:

export WS_APIKEY=my-apiKey
export WS_USERKEY=my-userKey
export WS_PRODUCTNAME=my-product
export WS_PROJECTNAME=my-project
export WS_PROXY_HOST=my-proxy-host-name
export WS_PROXY_PORT=my-proxy-port-number
export WS_PROXY_USER=my-proxy-username
export WS_PROXY_PASS=my-proxy-password
java -jar ./wss-unified-agent.jar 

Additional examples for CI/CD pipelines and executing WhiteSource Prioritize can be found at https://github.com/whitesource-ft/ws-examples.