Skip to main content
Step-by-step guide for running osmedeus cloud on Google Cloud Platform Compute Engine instances.

Prerequisites

  • A GCP account with a project
  • A service account with Compute Engine permissions
  • A service account key file (JSON)
  • An SSH key pair (local ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub)

Required IAM Permissions

The service account needs these roles (or use the Compute Admin role):
The simplest approach is to assign the Compute Admin (roles/compute.admin) role to your service account.

Create a Service Account and Key

  1. Go to IAM & Admin > Service Accounts > Create Service Account
  2. Name it osmedeus-cloud (or similar)
  3. Grant it the Compute Admin role
  4. Go to the service account > Keys > Add Key > Create new key > JSON
  5. Save the JSON file (e.g., ~/.gcp/osmedeus-sa.json)
Or via gcloud CLI:
You can also export the credentials file path as an environment variable:

Configuration

Minimal Setup

Machine Types

Preemptible Instances

Preemptible VMs cost up to 80% less than on-demand. They last at most 24 hours and can be reclaimed, but are ideal for security scanning workloads.

Regions and Zones

Pick a region close to your targets or with the lowest pricing:
Note: The zone must be within the selected region.

Custom Image Family

Use a custom image family with tools pre-installed for faster startup:

Cost Limits

Examples

Quick Domain Recon

Cost: ~$0.03 (1 x e2-medium x 1 hour)

Large-Scale Subdomain Enumeration

Cost: ~$0.48 (5 x n1-standard-2 x 1 hour)

Custom Nmap Scan

Distributed Nuclei Scanning

Cost: ~$0.34 (10 x e2-medium x 1 hour)

Preemptible Instance Pipeline

Cost: ~$0.019 (1 x n1-standard-2 preemptible x 1 hour)

Persistent Recon Campaign

Multi-Region Scanning

Troubleshooting

”Permission denied” or “403 Forbidden”

Your service account lacks required permissions. Assign the Compute Admin role:

“Credentials file not found”

Make sure the JSON key file path is correct and the file exists:

Instances Not Starting

”Compute Engine API has not been used” Error

Enable the Compute Engine API for your project:

SSH Connection Timeout

Preemptible Instance Terminated

Preemptible VMs are reclaimed after 24 hours or when GCP needs capacity. The scan will fail for that worker. Mitigation:
  • Use --auto-destroy to clean up
  • Re-run the failed targets
  • Use on-demand instances for critical or long-running scans

Cleaning Up

Cost Optimization

  1. Use preemptible instances for all non-critical scans (use_preemptible: true) — up to 80% savings
  2. Right-size machines: e2-medium is enough for most single-target scans
  3. Always use --auto-destroy to prevent forgotten instances
  4. Set cost limits to catch runaway spending
  5. Use custom images to reduce setup time (less instance-hours)
  6. Pick the cheapest region if target geo-location doesn’t matter (us-central1 is usually cheapest)
  7. GCP sustained-use discounts apply automatically for on-demand VMs running more than 25% of the month