
- Model Scanner CLI requires its input - the model(s) to be scanned - to be made available to the running Docker container through a mounted volume.
- Model Scanner CLI can optionally write scan results to a file within a mounted volume.
- All file paths provided in command-line argument to the container are with respect to the container’s file system, not the local file system.
- See the Docker documentation for more information.
Example
- Suppose that the models to be scanned are located on the local machine in
/home/user/models. - Model Scanner CLI’s scan results should be output to the local machine in
/home/user/results.
In this case, volume mounts could be specified as follows:
docker run --rm \
-e HL_LICENSE \
-v /home/user/models:/files-to-scan \
-v /home/user/results:/scan-results \
quay.io/hiddenlayer/distro-cli-modelscanner:latest \
--input /files-to-scan \
--output /scan-results/results.jsonThis example runs the latest Model Scanner CLI image. Change the Model Scanner CLI version if you want to pull a different Model Scanner version.
| Argument | Required | Example Usage | Description |
|---|---|---|---|
| yes |
| An absolute file or directory path to scan:
|
| yes |
| Set the environment variables.
|
--include-pattern | no | --include-pattern "*.h5" --include-pattern "*.rds" |
|
--exclude-pattern | no | --exclude-pattern "*test*" |
|
| no |
| Calculates MD5, SHA1, and SHA256 hashes. These are not calculated by default.
|
Some of the input arguments for the Model Scanner CLI allow the user to specify one or more globs to use for matching certain file path patterns. The following tokens can be used within globs to specify matching patterns:
*: matches any (possibly empty) sequence of non-special characters- Special characters are
*, ?,\\, and[
- Special characters are
?: matches any single non-special character
| Argument | Required | Example Usage | Description |
|---|---|---|---|
--output {{file}} | no | --output /scan-results/output.json |
|
--output-format {{v3|sarif|cyclonedx-json}} | no | --output-format sarif |
|
--log-file <file> | no | --log-file /mnt/volume/log.json |
|
| no |
| Specifies whether scan results should drive exit code.
|
| no |
| If provided, you can add the scan results to an existing model in the AISec Platform Console.
|
| no |
| If you are using
|
| no |
| If you are using
|