Skip to main content

Supply Chain CLI

The Supply Chain CLI is a container image that can be downloaded and ran via Docker. For prerequisites, including licenses, see Prerequisites.

Download

Download the Supply Chain CLI file and transfer it to the system where it will be deployed.
Docker Command FailsWhen using Docker commands, like docker pull, if you get a permission denied message, try using sudo docker, like sudo docker pull.Alternatively, add the user to the appropriate Docker group for Docker daemon permissions.
  1. Authenticate using docker login.
    • The username is the Registry Username.
    • The password is the Model Scanner License ID.
    • For information about licenses, see Prerequisites.
  2. Pull the HiddenLayer image.
  3. Tag the image for your private registry.
  4. Push the air-gapped image to your private registry. Note: Make sure you are logged in to your private registry in order to push the image.
Notes
  • You will run the Supply Chain CLI after you deploy the AI Security Platform and create an API key.
  • The above may need to be repeated for each updated release of Supply Chain.

Running Supply Chain CLI

Select your deployment type.
  • Hybrid: Connecting a Self-Hosted Supply Chain to an Self-Hosted AI Security Platform.
  • Standalone: Self-Hosted Supply Chain without a Self-Hosted AI Security Platform.
  1. Export your HiddenLayer information (product license, API key, and API secret).
    • Replace %HIDDENLAYER_LICENSE% with your HiddenLayer License.
    • Replace %HL_API_KEY% and %HL_API_SECRET% with your HiddenLayer API client ID and client secret, generated in the Platform Console.
    • For HL_MODEL_SCANNER_PLATFORM_RESULTS_URL and HL_MODEL_SCANNER_TOKEN_URL, replace %HIDDENLAYER_PLATFORM_HOSTNAME% with the URL for your Console.
      • Example: http://server1.test.hiddenlayer.com.
    • For Windows, replace export with set.
    • For information about licenses and keys, see Prerequisites.
  2. Run the Supply Chain command.
    • Replace $(directory) with the path on the local machine where models to be scanned are located. Example: /Users/username/Downloads.
      • To scan a specific file in the folder, update --input /files-to-scan with the file name. Example: --input /files-to-scan/test_model.pkl.
    • Replace <location of supply chain cli in local registry> with the location of the Supply Chain image.
      • Example for Docker image:
    • Replace $model_name with either the name of an existing model from the inventory (to add a new scan version to the existing model) or a new, unique name (to create a new model entry in the inventory). Example: Test Scan.
    • Using --persist adds the scan results to an existing model in the AI Security Platform Console.
    • In the following example, jq is used to make the output more readable. Remove | jq if you do not want to use jq.
  1. The scan results display in the terminal or command prompt. You can also log in to the Platform Console to view the scan results.
  2. For more information about Supply Chain CLI command-line arguments, for input and output, see Command-Line Arguments
The following is an example output for a Supply Chain CLI scan using a terminal or command prompt.
Self-Signed Certificates Breaks Persist FlagWhen using a self-signed certificate for testing, using the --persist flag results in a failed scan. Scan results never display in the Platform Console.The container does not trust the internal certificate. To fix this, you must fetch the certificate and mount it into the container.To fetch the certificate:
Add these flags to the Docker run command: