Files
sif/modules/recon/terraform-tfvars-exposure.yaml
T
TigahandGitHub cb65f868c3 feat(modules): add terraform tfvars, ansible vault and ci config exposure modules (#299)
* feat(modules): add tfvars, ansible-vault and ci config exposure

* chore(modules): trim redundant module header comments

drop the top-line comments on the new iac config exposure modules that
just restated the id/name fields already in the info block
2026-07-22 12:47:54 -07:00

65 lines
1.4 KiB
YAML

id: terraform-tfvars-exposure
info:
name: Terraform Tfvars Exposure
author: sif
severity: high
description: Detects an exposed terraform variable definitions file that commonly carries plaintext infrastructure credentials
tags: [terraform, iac, tfvars, secrets, exposure, recon]
type: http
http:
method: GET
paths:
- "{{BaseURL}}/terraform.tfvars"
- "{{BaseURL}}/.terraform.tfvars"
- "{{BaseURL}}/secret.auto.tfvars"
matchers:
- type: status
status:
- 200
- type: regex
part: body
regex:
- '(?m)^[A-Za-z_][A-Za-z0-9_-]*[ \t]*=[ \t]*"[^"\n]*"[ \t]*\r?\n[A-Za-z_][A-Za-z0-9_-]*[ \t]*=[ \t]*"[^"\n]*"[ \t]*$'
- type: word
part: body
condition: or
words:
- "region"
- "instance_type"
- "vpc"
- "subnet"
- "cidr"
- "access_key"
- "secret_key"
- "api_key"
- "password"
- "db_"
- "ami"
- "zone"
- "project_id"
- type: word
part: body
negative: true
condition: or
words:
- "<!DOCTYPE"
- "<!doctype"
- "<html"
- "<HTML"
- "<head>"
- "<title>"
extractors:
- type: regex
name: tfvars_first_key
part: body
regex:
- '(?m)^([A-Za-z_][A-Za-z0-9_-]*)[ \t]*=[ \t]*"[^"\n]*"'
group: 1