Skip to main content
Version: 1.4.1

Alibaba Cloud

Provision an Alibaba Cloud ECI container group that runs JS Recon against any URL. Upload results to OSS automatically.


View on Terraform Registry →



Quick start

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

url = "https://example.com"
region = "ap-southeast-1"
}

Set credentials and apply:

export ALICLOUD_ACCESS_KEY="..."
export ALICLOUD_SECRET_KEY="..."
terraform apply

Inputs

NameRequiredDefaultDescription
urlYesTarget URL to scan
regionYesAlibaba Cloud region (e.g. ap-southeast-1, cn-hangzhou)
name_prefixNojs-reconName prefix for all Alibaba Cloud resources
container_cpuNo2CPU units for the ECI container group
container_memory_gbNo4Memory in GB for the ECI container group
create_oss_bucketNotrueWhether the module creates an OSS bucket for artifacts
oss_bucket_nameNo(auto-generated)OSS bucket name (must be globally unique)
oss_artifact_prefixNojs-recon-outputOSS object key prefix for uploaded artifacts
build_timeoutNo1800Maximum scan duration in seconds
tagsNo{}Tags applied to all Alibaba Cloud resources

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


Outputs

NameDescription
container_group_nameName of the ECI container group
container_group_idID of the ECI container group
oss_bucket_nameName of the OSS bucket
ram_role_nameName of the RAM role assigned to the container
vpc_idID of the VPC
vswitch_idID of the VSwitch

Output files

JS Recon writes the common output files and uploads them to Alibaba Cloud OSS via ossutil with ECS RAM Role authentication.


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/alibaba"
url = "https://example.com"
region = "ap-southeast-1"

break_on_map_files = true # default
}

Vulnerabilities

module "js_recon" {
source = "js-recon/js-recon/alibaba"
url = "https://example.com"
region = "ap-southeast-1"

break_on_vulnerabilities = true
vulnerability_severity = "medium"
}

Scheduled scans

Create an EventBridge scheduled rule via the Alibaba Cloud console after terraform apply:

  1. Go to EventBridge → Event Sources → Create Event Source
  2. Select Scheduled Event and enter your cron expression. EventBridge uses a six-field format (Seconds Minutes Hours Day-of-month Month Day-of-week), so 08:00 daily is 0 0 8 * * *, not the five-field Unix 0 8 * * *. EventBridge runs cron expressions in UTC by default; set the trigger's timezone field explicitly if you want 0 0 8 * * * to mean 08:00 in a different timezone.
  3. Create an EventBridge rule targeting the ECI container group restart API

Triggering a scan manually

Restart the ECI container group to run another scan:

aliyun eci RestartContainerGroup \
--RegionId ap-southeast-1 \
--ContainerGroupId <container_group_id>

Pinning to a specific JS Recon version

module "js_recon" {
source = "js-recon/js-recon/alibaba"
url = "https://example.com"
region = "ap-southeast-1"

js_recon_version = "1.3.1"
}

See Common Reference — Pinning for details.