|
| 1 | +--- |
| 2 | +title: ModelScan Step Configuration |
| 3 | +description: Scan machine learning models with ModelScan. |
| 4 | +sidebar_label: ModelScan Step Configuration |
| 5 | +sidebar_position: 240 |
| 6 | +--- |
| 7 | + |
| 8 | +<DocsTag text="Code repo scanners" backgroundColor="#cbe2f9" textColor="#0b5cad" link="/docs/security-testing-orchestration/whats-supported/scanners?view-by=target-type#code-repo-scanners" /> |
| 9 | +<DocsTag text="Orchestration" backgroundColor="#e3cbf9" textColor="#5c0bad" link="/docs/security-testing-orchestration/get-started/key-concepts/run-an-orchestrated-scan-in-sto" /> |
| 10 | +<DocsTag text="Ingestion" backgroundColor="#e3cbf9" textColor="#5c0bad" link="/docs/security-testing-orchestration/get-started/key-concepts/ingest-scan-results-into-an-sto-pipeline" /> |
| 11 | +<br/> |
| 12 | +<br/> |
| 13 | + |
| 14 | +The **ModelScan** step in Harness STO uses the open-source scanner [ModelScan](https://github.com/protectai/modelscan) to scan your machine learning (ML) models for security vulnerabilities. You can perform **ModelScan** scans in both **[Orchestration](#scan-mode)** and **[Ingestion](#scan-mode)** modes. This document will guide you through configuring the **ModelScan** step in your STO pipeline. |
| 15 | + |
| 16 | +:::info |
| 17 | +- To run scans as a non-root user, you can use custom STO scan images and pipelines. See [Configure your pipeline to use STO images from private registry](/docs/security-testing-orchestration/use-sto/set-up-sto-pipelines/configure-pipeline-to-use-sto-images-from-private-registry). |
| 18 | +- STO supports multiple workflows for loading self-signed certificates. See [Run STO scans with custom SSL certificates](/docs/security-testing-orchestration/use-sto/secure-sto-pipelines/ssl-setup-in-sto/#supported-workflows-for-adding-custom-ssl-certificates). |
| 19 | +::: |
| 20 | + |
| 21 | +### Supported ML Libraries and Formats |
| 22 | + |
| 23 | +The following table lists the ML libraries and serialization formats, along with their support status in the **ModelScan** step. |
| 24 | + |
| 25 | +| ML Library | Serialization Format | Support Status | |
| 26 | +| :------------------------------------------- | :----------------------------------- | :--------------- | |
| 27 | +| Pytorch | Pickle | ✅ Supported | |
| 28 | +| Keras | HD5 (Hierarchical Data Format) | ✅ Supported | |
| 29 | +| Classic ML Libraries (Sklearn, XGBoost, etc.) | Pickle, Cloudpickle, Dill, Joblib | ✅ Supported | |
| 30 | +| TensorFlow | Protocol Buffer | ❌ Not Supported | |
| 31 | +| Keras | Keras V3 (Hierarchical Data Format) | ❌ Not Supported | |
| 32 | + |
| 33 | +Scanning ML models in **binary files** is not supported. Your models must be in one of the supported formats listed above. |
| 34 | + |
| 35 | +## ModelScan step settings |
| 36 | + |
| 37 | +The recommended workflow is to add a **ModelScan** step to a **Security** or **Build** stage and then configure it as described below. |
| 38 | + |
| 39 | +### Scan Mode |
| 40 | + |
| 41 | +- **Orchestration mode**: In this mode, the step executes the scan, then processes the results by normalizing and deduplicating them. |
| 42 | +- **Ingestion mode**: In this mode, the **ModelScan** step ingests scan results from a specified file. The scan results file must be in JSON format. |
| 43 | + |
| 44 | +### Scan Configuration |
| 45 | + |
| 46 | +import StoSettingProductConfigName from './shared/step-palette/scan/config-name.md'; |
| 47 | + |
| 48 | +<StoSettingProductConfigName /> |
| 49 | + |
| 50 | +### Target |
| 51 | + |
| 52 | +#### Type |
| 53 | + |
| 54 | +import StoSettingScanTypeRepo from './shared/step-palette/target/type/repo.md'; |
| 55 | + |
| 56 | +<StoSettingScanTypeRepo /> |
| 57 | + |
| 58 | +You can also scan models stored in **Hugging Face** repositories by using the [Harness GitHub connector](/docs/platform/connectors/code-repositories/connect-to-code-repo), configured to connect to your Hugging Face account. |
| 59 | + |
| 60 | +#### Target and variant detection |
| 61 | + |
| 62 | +import StoSettingScanTypeAutodetectRepo from './shared/step-palette/target/auto-detect/code-repo.md'; |
| 63 | +import StoSettingScanTypeAutodetectNote from './shared/step-palette/target/auto-detect/note.md'; |
| 64 | + |
| 65 | +<StoSettingScanTypeAutodetectRepo/> |
| 66 | +<StoSettingScanTypeAutodetectNote/> |
| 67 | + |
| 68 | +#### Name |
| 69 | + |
| 70 | +import StoSettingTargetName from './shared/step-palette/target/name.md'; |
| 71 | + |
| 72 | +<StoSettingTargetName /> |
| 73 | + |
| 74 | +#### Variant |
| 75 | + |
| 76 | +import StoSettingTargetVariant from './shared/step-palette/target/variant.md'; |
| 77 | + |
| 78 | +<StoSettingTargetVariant /> |
| 79 | + |
| 80 | +#### Workspace |
| 81 | + |
| 82 | +import StoSettingTargetWorkspace from './shared/step-palette/target/workspace.md'; |
| 83 | + |
| 84 | +<StoSettingTargetWorkspace /> |
| 85 | + |
| 86 | +### Ingestion File |
| 87 | + |
| 88 | +import StoSettingIngestionFile from './shared/step-palette/ingest/file.md'; |
| 89 | + |
| 90 | +<StoSettingIngestionFile /> |
| 91 | + |
| 92 | +The ingestion file must be in `JSON` format. |
| 93 | + |
| 94 | +### Log Level |
| 95 | + |
| 96 | +import StoSettingLogLevel from './shared/step-palette/all/log-level.md'; |
| 97 | + |
| 98 | +<StoSettingLogLevel /> |
| 99 | + |
| 100 | +### Fail on Severity |
| 101 | + |
| 102 | +import StoSettingFailOnSeverity from './shared/step-palette/all/fail-on-severity.md'; |
| 103 | + |
| 104 | +<StoSettingFailOnSeverity /> |
| 105 | + |
| 106 | +### Additional Configuration |
| 107 | + |
| 108 | +import ScannerRefAdditionalConfigs from './shared/additional-config.md'; |
| 109 | + |
| 110 | +<ScannerRefAdditionalConfigs /> |
| 111 | + |
| 112 | +### Advanced settings |
| 113 | + |
| 114 | +import ScannerRefAdvancedSettings from './shared/advanced-settings.md'; |
| 115 | + |
| 116 | +<ScannerRefAdvancedSettings /> |
| 117 | + |
| 118 | +## Proxy settings |
| 119 | +import ProxySettings from './shared/proxy-settings.md'; |
| 120 | + |
| 121 | +<ProxySettings /> |
0 commit comments