Skip to main content
Version: 2.0.1-alpha.3

DigitalOcean

Provision a DigitalOcean Droplet that runs JS Recon against any URL. Upload results to DigitalOcean Spaces automatically.


View on Terraform Registry →



Quick start

module "js_recon" {
source = "js-recon/js-recon/digitalocean"
version = "~> 1.0"

url = "https://example.com"
spaces_access_id = var.spaces_access_id
spaces_secret_key = var.spaces_secret_key
}

Set your DigitalOcean token and apply:

export DIGITALOCEAN_TOKEN="dop_v1_..."
export TF_VAR_spaces_access_id="..."
export TF_VAR_spaces_secret_key="..."
terraform apply

The scan runs automatically when the Droplet starts. Destroy the Droplet after the scan completes:

terraform destroy

Inputs

NameRequiredDefaultDescription
urlYesTarget URL to scan
spaces_access_idYes*""Spaces access key ID (*required when create_spaces_bucket = true)
spaces_secret_keyYes*""Spaces secret access key
droplet_nameNojs-reconName prefix for all DigitalOcean resources
regionNonyc3DigitalOcean region (for example, nyc3, ams3, sgp1)
droplet_sizeNos-2vcpu-4gbDroplet size slug — minimum 4 GB RAM recommended
ssh_keysNo[]SSH key IDs or fingerprints for manual Droplet access
create_spaces_bucketNotrueWhether the module creates a Spaces bucket for artifacts
spaces_bucket_nameNo(auto-generated)Spaces bucket name (must be globally unique)
spaces_artifact_prefixNojs-recon-outputObject key prefix for uploaded artifacts
scheduleNo""Cron expression for recurring scans (for example, 0 8 * * *). Empty = run once at creation.
build_timeoutNo30Maximum scan duration in minutes
tagsNo[]Tags applied to the Droplet

See Common Reference — Common inputs for js_recon_version, break_on_map_files, break_on_vulnerabilities, vulnerability_severity, and output_dir.


Outputs

NameDescription
droplet_nameName of the Droplet
droplet_idID of the Droplet
droplet_ipPublic IPv4 address of the Droplet
spaces_bucket_nameName of the Spaces bucket
spaces_bucket_urnURN of the Spaces bucket
spaces_bucket_endpointHTTPS endpoint for the Spaces bucket

Output files

JS Recon writes the common output files and uploads them to DigitalOcean Spaces via the AWS CLI using the Spaces S3-compatible endpoint.


Break conditions

See Common Reference — Break conditions for how break_on_map_files and break_on_vulnerabilities/vulnerability_severity work.

Source maps

module "js_recon" {
source = "js-recon/js-recon/digitalocean"
url = "https://example.com"

break_on_map_files = true # default
}

Vulnerabilities

module "js_recon" {
source = "js-recon/js-recon/digitalocean"
url = "https://example.com"

break_on_vulnerabilities = true
vulnerability_severity = "medium"
}

Scheduled scans

module "js_recon" {
source = "js-recon/js-recon/digitalocean"
url = "https://example.com"

schedule = "0 8 * * *"
}

With a schedule the Droplet stays running and executes the scan via cron. Without a schedule the Droplet runs the scan once at creation.


Re-running a scan manually

# SSH into the Droplet and run the pre-installed wrapper
ssh root@<droplet_ip>
js-recon-scan

Scan logs are written to /var/log/js-recon.log on the Droplet.


Spaces access keys

Generate Spaces access keys at DigitalOcean → API → Spaces Keys, then pass them as variables:

export TF_VAR_spaces_access_id="..."
export TF_VAR_spaces_secret_key="..."

Pinning to a specific JS Recon version

module "js_recon" {
source = "js-recon/js-recon/digitalocean"
url = "https://example.com"

js_recon_version = "1.3.1"
}

See Common Reference — Pinning for details.