# Offline Mode: Scan Air-Gapped Windows Hosts

## Introduction

Offline mode lets you run a Tutela vulnerability scan on a Windows host that cannot reach the Tutela cloud, then upload the results later from a machine that does have internet access.


:::info
**Windows only**

Offline mode is currently supported on the **Tutela Windows Agent**. A Linux offline workflow is available on request — contact CyberSift support if you need it.

:::

## When to use offline mode

Use offline mode when:

* The endpoint is air-gapped or blocked from outbound HTTPS
* You need a one-time inventory during a maintenance window
* Results must be reviewed or transferred before they reach Tutela

## What you need

* Tutela Windows Agent installed (or a portable `winAgent.exe`)
* Your Tutela API key
* A USB stick or other transfer method (if the scan host and upload host are different)


:::tip
**Get your API key**


1. Log in to Tutela
2. Go to **Settings → Agent API Keys and Settings**
3. Click **Add API Key** (or copy an existing key)

:::

Default install path:

```text
C:\Program Files (x86)\Tutela Windows Agent\winAgent.exe
```

## Step 1 — Run the offline scan

On the Windows host, open PowerShell and run:

```powershell
& "C:\Program Files (x86)\Tutela Windows Agent\winAgent.exe" -api_key INSERT_YOUR_API_KEY -offline-mode=true
```


:::warning
**Trial users**

If you are on the Tutela trial environment, include the trial API endpoint:

```powershell
& "C:\Program Files (x86)\Tutela Windows Agent\winAgent.exe" -api_key INSERT_YOUR_API_KEY -api_endpoint "https://trial-backend.tutela.cybersift.io" -offline-mode=true
```

:::

When the scan finishes, the agent writes a results file in the **current working directory**:

```text
offline_scan_results.json
```


:::tip
Run the command from a folder you control (for example `C:\TutelaOffline\`) so the JSON file is easy to find.

:::

### What offline mode does (and does not do)

| Included | Not included in offline mode |
|----------|------------------------------|
| Software / package vulnerability inventory | Patch management (PMAC)      |
| Local results file for later upload | Forensics checks             |
|          | Compliance checks            |
|          | Live schedule check with Tutela |

## Step 2 — Transfer the results (if needed)

Copy `offline_scan_results.json` to a workstation that can reach Tutela (USB, approved file transfer, etc.).

## Step 3 — Upload the results

From a connected machine, upload the JSON file to Tutela:

```powershell
$apiKey = "INSERT_YOUR_API_KEY"
$apiEndpoint = "https://cs-vas-backend.cybersift.io"   # trial: https://trial-backend.tutela.cybersift.io
$resultsFile = ".\offline_scan_results.json"

$headers = @{
    "X-Tutela-API" = $apiKey
    "Content-Type" = "application/json"
}

$body = Get-Content -Path $resultsFile -Raw -Encoding UTF8
Invoke-WebRequest -Uri "$apiEndpoint/hostScanSubmission" `
    -Method POST `
    -Headers $headers `
    -Body $body `
    -UseBasicParsing
```

A successful upload returns HTTP **200**. The host inventory then appears in Tutela like a normal host scan.

### All-in-one script (scan + upload)

Use this when the same Windows machine can briefly run the scan and later upload (or when you transfer the JSON into the same folder first):

```powershell
param(
    [Parameter(Mandatory = $true)]
    [string]$ApiKey,

    [string]$ApiEndpoint = "https://cs-vas-backend.cybersift.io",

    [string]$AgentPath = "C:\Program Files (x86)\Tutela Windows Agent\winAgent.exe",

    [string]$ResultsFile = ".\offline_scan_results.json"
)

$ErrorActionPreference = "Stop"

if (Test-Path $ResultsFile) {
    Remove-Item $ResultsFile -Force
}

Write-Host "Running offline scan..."
& $AgentPath -api_key $ApiKey -offline-mode=true
if ($LASTEXITCODE -ne 0) {
    throw "Agent exited with code $LASTEXITCODE"
}

if (-not (Test-Path $ResultsFile)) {
    throw "Results file not found: $ResultsFile"
}

Write-Host "Uploading results..."
$headers = @{
    "X-Tutela-API" = $ApiKey
    "Content-Type" = "application/json"
}
$body = Get-Content -Path $ResultsFile -Raw -Encoding UTF8
$response = Invoke-WebRequest -Uri "$ApiEndpoint/hostScanSubmission" `
    -Method POST `
    -Headers $headers `
    -Body $body `
    -UseBasicParsing

Write-Host "Done. Status: $($response.StatusCode)"
```

Example:

```powershell
.\offline-scan-upload.ps1 -ApiKey "INSERT_YOUR_API_KEY"
```

## Troubleshooting

| Problem | What to try |
|---------|-------------|
| No `offline_scan_results.json` | Confirm the folder you ran the command from; check that the agent completed without errors |
| Upload fails | Verify API key and endpoint; upload the file as raw JSON (do not edit or wrap it) |
| Expected patches / compliance results | Those modules are disabled in offline mode — run a normal online scan when the host can reach Tutela |
| Wrong / old host data in Tutela | Delete the previous JSON before scanning again so you do not re-upload stale results |



---


:::info
tags:

* Tutela
* Windows hosts
* offline mode
* air-gapped
* host scan
* vulnerability scan
* hostScanSubmission

:::

---

**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)