# 2.0 Network Scans

# Introduction

A network scan in Tutela is a security assessment performed via a **Docker container** to identify vulnerabilities across your infrastructure by scanning specific subnets. It provides visibility into vulnerabilities present on network-accessible assets

```mermaidjs
graph LR
    A[<b>Tutela Network Scan</b>] --> B[<b>Tutela Container</b>]
    B -- "Scans via Network" --> C[<b>Target Subnets</b>]
    C -- "Maps Vulnerabilities and Network Assets" --> B
    B -- "Uploads Results" --> D[<b>Tutela Dashboard</b>]
```


[https://app.arcade.software/share/CxFbDwEHO6wD3tQvyrK4](https://app.arcade.software/share/CxFbDwEHO6wD3tQvyrK4)

## Requirements


:::tip
**Please ensure the below requirements are met beforehand:**

* Select an **internal server** to host docker and **make sure the selected server has network connectivity to all intended targets**. 


* Install Docker or Docker Desktop as outlined in Docker’s documentation and make sure it’s up and running. [[Download Docker](https://docs.docker.com/engine/install/)] 

:::

## **Installing and Running Tutela Image**


1. Make sure that docker is running by running `docker version` command in command prompt / terminal with elevated privileges.   ![](https://outline.cybersift.io/api/files.get?sig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1cGxvYWRzL2MwNWNhZDYzLTA0ZmEtNGFmZC04NjMwLTI3MjNjZDYwZWZkNS8zODBhY2NhYi0zM2E4LTQzZmEtYTEzMi1lNmUwYjdmZTFkZGMvaW1hZ2UucG5nIiwidHlwZSI6ImF0dGFjaG1lbnQiLCJpYXQiOjE3OTU0NDg3MDAsImV4cCI6MTc5NTUzNTEwMH0.ercIbyFhHIOMfPBVCmUcYAfB9OGn-qySNcbcyEGE71A " =572x322")



2. Run the following command `docker pull dvassallocs/tutela`. This should pull the latest image from Docker Hub. 



3. To verify correct operation, run the command `docker run dvassallocs/tutela`. It should give output similar to the below. ![](https://outline.cybersift.io/api/files.get?sig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1cGxvYWRzL2MwNWNhZDYzLTA0ZmEtNGFmZC04NjMwLTI3MjNjZDYwZWZkNS8zZjczNDUyMC1mYjg1LTQ3ZDYtOTE4YS0zYWRjMzI0YTVmMTYvaW1hZ2UucG5nIiwidHlwZSI6ImF0dGFjaG1lbnQiLCJpYXQiOjE3OTU0NDg3MDAsImV4cCI6MTc5NTUzNTEwMH0.b2S0dTpI4T3pyJE_lUMMmKRMNPjuit_dmbNZPjeodkw " =556x313")



4. Now, we need to generate our API Keys and configure the targets.

   
   1. Login to Tutela
   2. Go to `Settings` > `Agent API Keys and Setting` section. 
   3. Click `Add API Key`
   4. Once generated, click on **Add Agent Targets** next to your API key and add your desired network targets



5. Run your first Network Scan (*Please execute 1 of the below commands depending on your implementation*):

```powershell
docker run dvassallocs/tutela -api_key API_KEY 
```


:::warning
**Trial Users only**

```powershell
docker run dvassallocs/tutela -api_key API_KEY -api_endpoint "https://trial-backend.tutela.cybersift.io"
```

:::



6. After the scan is complete. login to Tutela to view your results!

## Automating Scans via Cron / Scheduled Tasks

Now that we got our network scanner to work, ideally, we want it to run on a weekly or a monthly basis to ensure our data is up to date.

To do this, we will be creating a cronjob or scheduled task on windows to run this command every week. 

+++++++
### Linux (Cronjob)

#### Creating Cron Job 


1. Edit your crontab:

```bash
crontab -e
```

 


2. Add the below line (replace `API_KEY` with your real key):

**Production Users:**

```bash
0 5 * * 0 docker run dvassallocs/tutela -api_key API_KEY 
```


:::warning
⚠️ **Trial Users**:

```bash
0 5 * * 0 docker run dvassallocs/tutela -api_key API_KEY -api_endpoint "https://trial-backend.tutela.cybersift.io"
```

:::


#### Permission Checklist

Make sure that the cron user can run Docker (`docker` group)

```bash
sudo usermod -aG docker your_user
```



:::success
#### You successfully created your Cron Job! 

*“0 5 \* \* 0” will run every Sunday at 5AM. Feel free to change this to your desired time* 

:::


+++++++
+++++++++
### Windows (Scheduled Task)

#### Creating a scheduled task 


1. Open Task Scheduler (Privileged) 
2. Click `Create Task` - *Not basic task*

   
   1. Select `Run whether user is logged in or not` (Depending on your machine)
3. Go to `Triggers` tab

   
   1. Press `New`
   2. Configure your desired schedule 
   3. Click `Ok`
4. Go to `Actions` tab

   
   1. Click `New` 
   2. Select **Start a Program** 
   3. Add the location where docker is installed (*"C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe"*) 
   4. Add the below arguments:

**Production Users:**

```powershell
run dvassallocs/tutela -api_key API_KEY 
```


:::warning
⚠️ **Trial Users**:

```bash
run dvassallocs/tutela -api_key API_KEY -api_endpoint "https://trial-backend.tutela.cybersift.io"
```

:::


5. Go to **Conditions & Settings** 

   
   1. Uncheck / Check any settings which might hinder this task from running.
   2. In the **settings** tab, make sure to allow the task to run on demand. 
6. Make sure to test it! 


:::success
**You successfully set up the scheduled task**

:::

+++++++++

---


:::info
tags:

* Setting up network scans
* Setting up docker
* Creating scheduled / cron job tasks
* Agent Targets 
* Network Scans targets

:::

---

**Documents**

- [1. Getting Started](https://outline.cybersift.io/s/tutela-docs/doc/1-getting-started-wi972eTn7N)
- [2. Vulnerability Scanning](https://outline.cybersift.io/s/tutela-docs/doc/2-vulnerability-scanning-giL9tJRfit)
- [3. Asset Management](https://outline.cybersift.io/s/tutela-docs/doc/3-asset-management-TVe3GfeqgX)
- [4. Online Presence Monitoring](https://outline.cybersift.io/s/tutela-docs/doc/4-online-presence-monitoring-7dAIDIi6OT)
- [5. Reporting](https://outline.cybersift.io/s/tutela-docs/doc/5-reporting-xCbDsqRFGR)
- [6. Tutela Integrations](https://outline.cybersift.io/s/tutela-docs/doc/6-tutela-integrations-GJJVFdWlTI)
- [7. Porta](https://outline.cybersift.io/s/tutela-docs/doc/7-porta-0KQ0fvqN3u)
- [FAQ](https://outline.cybersift.io/s/tutela-docs/doc/faq-IkXHcKeIFy)