# Model Scan

The AI Model scan option is added as part of the Adhoc scan. The ability to scan AI/ML Models published on HuggingFace using NBDefence and Garak tools is added as part of this scan option.

### To Access Model Scan&#x20;

* Click on **Scan Now** button at the top right corner of the screen.

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FrJIKrYmqJVFzsym10w2D%2Fscan%20now%20.png?alt=media&#x26;token=56c19f36-9c4c-4212-80d3-43a1d9853d03" alt=""><figcaption></figcaption></figure>

* In the screen that appears, select **Model Scan** from the left panel.

### To Add a Project&#x20;

* To add or update a new project with model scan configurations, for scanning, click **Add Project**.&#x20;

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FSl6iNUFYexmKxq9pzPOx%2Fimage.png?alt=media&#x26;token=f303c515-b77f-4901-a8a6-31f095d06bc8" alt=""><figcaption></figcaption></figure>

* The **Create Project** details page is displayed as shown below. Enter the details for the following fields:

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FAWkHmsbst7uiG1SWvYUu%2Fimage.png?alt=media&#x26;token=e73dc0b0-b49b-4268-837a-999d8bc363db" alt=""><figcaption></figcaption></figure>

* **Name** : Enter a name for the project.&#x20;
* **Team** : Select the team for which you want to create the project.&#x20;
* **Scan Type** : The default type is Source Scan.&#x20;
* **Platform** : Select the platform type, the platform where the code resides (Github, Gitlab Server, Bitbucket, Bitbucket Server, Azure, Azure Server) for the project.
* **Account** : Choose the needed account that has been integrated for the selected platform. If no account is available for the selected platform then click **Add Account**.
  * The integration page is displayed. You can add a new account.&#x20;
* **Organization / Workspace** : Choose the organization or workspace that the selected account has access to.&#x20;
* **Scan Level** : Select the scan level; either organization level or repository level that needs to be scanned.&#x20;
* **Configuration** : Set the configuration details, and schedule the auto scan time.
  * Repo /Project : Select the repo or project name for which the scan needs to be executed.&#x20;
  * Branch :  Select the branch name for which the scan needs to be executed.&#x20;
  * Branch Pattern : Select the branch pattern for which the scan needs to be executed.&#x20;
  * Scan Upto : Select the branch limit for which the scan needs to be executed. (number of branches to be scanned)
  * Schedule Auto Scan :  Select the time range during which the scan needs to be rerun automatically.&#x20;
* Click Save.&#x20;

The project gets added for scanning.

### To Upload a Project

* To upload a project from your local, for scanning, click **Upload Project**.

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FSrho2qCMltPWkkFkWoYn%2Funknown.png?alt=media&#x26;token=edf6b369-3667-485f-9c1f-832502ffad23" alt=""><figcaption></figcaption></figure>

* Click **Upload File** and select the json file that you want to add for scanning. &#x20;

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2Fs1SYK9DBJTycFVjjPPnz%2Fupload%201.png?alt=media&#x26;token=677b20dc-74bf-4b38-ae69-fcc5f1997dab" alt=""><figcaption></figcaption></figure>

* Click **Save**.&#x20;

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FCgSOHw0IFvm7QDtSrial%2Funknown.png?alt=media&#x26;token=97590f6e-8929-4ab7-adf6-8d8033456dcc" alt=""><figcaption></figcaption></figure>

The file gets added for scanning.

### To View and Interpret Scan Results&#x20;

Once the scan is complete, OpsMx generates the overall results and they are displayed as shown below: <br>

* Repos Registered
* Total Branches
* Total Scans
* Total Projects
* Auto Scan Enabled Repos

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FR1b9a9nYhnMHjLbUxOMb%2Frepo.png?alt=media&#x26;token=27728a00-70dc-4519-bc13-351b4242c2c7" alt=""><figcaption></figcaption></figure>

The panel at the bottom displays the project details. On expanding each project you can view the complete details of it.

{% hint style="info" %}
The current status of the scan (completed, pending or failed) is displayed to notify the status of the project.&#x20;
{% endhint %}

* To edit the configuration details of the project, click the **Edit Configuration** button.&#x20;
* Click the **View** option in the **Action** button, to view the SAST and SCA scan results of the project.&#x20;

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2F2woJrGVK5wSW3WdpopsS%2Fscan%20now%202%20.png?alt=media&#x26;token=3c4359b2-7b9b-490e-944d-348c79268225" alt=""><figcaption></figcaption></figure>

* The results page displays the complete data of the scan details.&#x20;
  * On clicking the **Download** button, the scan results are downloaded in .json or .csv format.
  * On clicking Report, the scan results are downloaded in a report format.&#x20;
  * On clicking Go to Artifact Page, you are redirected to the related artifact page.&#x20;

<figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FF7YQ6dr7WRDZwXO54bnh%2Fsource%20scan%20view.png?alt=media&#x26;token=3f6e4ad5-4af5-444d-a0fd-2bdadb67ba89" alt=""><figcaption></figcaption></figure>
