Runner
runner.sh는 스위트 디렉토리 내의 번호가 매겨진 모든 스크립트를 순서대로 실행하고, 출력을 캡처하며, 결과 메타데이터를 기록하는 스위트 오케스트레이터입니다. VM의 /opt/traffic-generator/suites/runner.sh에 설치됩니다.
사용법
섹션 제목: “사용법”runner.sh <suite-name> [--dry-run]인수:
| 인수 | 필수 여부 | 설명 |
|---|---|---|
suite-name | 예 | 스위트 디렉토리 이름 (예: web-app-attacks, api-attacks) |
--dry-run | 아니요 | 스크립트를 실행하지 않고 실행될 내용을 출력 |
예시:
# Run the web-app-attacks suite/opt/traffic-generator/suites/runner.sh web-app-attacks
# Dry-run to preview api-attacks scripts/opt/traffic-generator/suites/runner.sh api-attacks --dry-run
# Run bot simulation/opt/traffic-generator/suites/runner.sh bot-simulationconfig.env
섹션 제목: “config.env”러너는 /opt/traffic-generator/config.env에서 구성을 읽습니다:
# Required: target FQDN (F5 XC load balancer domain)TARGET_FQDN=demo.example.com
# Optional: direct origin IP for baseline testing (bypasses F5 XC)TARGET_ORIGIN_IP=이 파일은 Terraform 프로비저닝 중에 target_fqdn 및 target_origin_ip 변수로부터 자동으로 작성됩니다. 배포 후 대상을 변경하려면 VM에서 이 파일을 직접 편집하십시오.
환경 변수 재정의
섹션 제목: “환경 변수 재정의”config.env의 모든 변수는 스위트 실행 전에 내보내기(export)하여 재정의할 수 있습니다:
# Override target FQDN for a single runTARGET_FQDN=staging.example.com /opt/traffic-generator/suites/runner.sh web-app-attacks
# Override via exportexport TARGET_FQDN=staging.example.com/opt/traffic-generator/suites/runner.sh web-app-attacks구성 파일 경로 자체도 재정의할 수 있습니다:
CONFIG_FILE=/tmp/my-config.env /opt/traffic-generator/suites/runner.sh web-app-attacks드라이런 모드
섹션 제목: “드라이런 모드”--dry-run 플래그는 실행하지 않고 실행될 각 스크립트를 출력합니다:
/opt/traffic-generator/suites/runner.sh web-app-attacks --dry-run출력:
=== 01-sqli.sh ===[DRY-RUN] Would execute: /opt/traffic-generator/suites/web-app-attacks/01-sqli.sh demo.example.com=== 02-xss.sh ===[DRY-RUN] Would execute: /opt/traffic-generator/suites/web-app-attacks/02-xss.sh demo.example.com=== 03-command-injection.sh ===[DRY-RUN] Would execute: /opt/traffic-generator/suites/web-app-attacks/03-command-injection.sh demo.example.com=== 04-path-traversal.sh ===[DRY-RUN] Would execute: /opt/traffic-generator/suites/web-app-attacks/04-path-traversal.sh demo.example.com=== 05-nikto-scan.sh ===[DRY-RUN] Would execute: /opt/traffic-generator/suites/web-app-attacks/05-nikto-scan.sh demo.example.com=== 06-nuclei-scan.sh ===[DRY-RUN] Would execute: /opt/traffic-generator/suites/web-app-attacks/06-nuclei-scan.sh demo.example.com=== Suite Complete ===Passed: 0 | Failed: 0 | Skipped: 6Results: /opt/traffic-generator/results/20260425-143000-web-app-attacks드라이런을 사용하여 배포 후 또는 새 대상에 대해 스위트를 실행하기 전에 스위트 구조를 확인하십시오.
결과 디렉토리
섹션 제목: “결과 디렉토리”각 스위트 실행은 타임스탬프가 있는 결과 디렉토리를 생성합니다:
/opt/traffic-generator/results/<YYYYMMDD-HHMMSS>-<suite-name>/구조:
/opt/traffic-generator/results/20260425-143000-web-app-attacks/ meta.json 01-sqli.sh.log 02-xss.sh.log 03-command-injection.sh.log 04-path-traversal.sh.log 05-nikto-scan.sh.log 06-nuclei-scan.sh.log각 스크립트의 stdout 및 stderr은 스크립트 이름을 딴 .log 파일에 캡처됩니다.
meta.json 형식
섹션 제목: “meta.json 형식”meta.json 파일은 스위트 실행 메타데이터를 기록합니다:
{ "suite": "web-app-attacks", "target": "demo.example.com", "started": "2026-04-25T14:30:00Z", "completed": "2026-04-25T14:45:23Z", "status": "completed", "passed": 5, "failed": 1, "skipped": 0}| 필드 | 설명 |
|---|---|
suite | 스위트 이름 |
target | 실행에 사용된 대상 FQDN |
started | 스위트가 시작된 UTC 타임스탬프 |
completed | 스위트가 완료된 UTC 타임스탬프 |
status | 실행 중에는 running, 완료 시 completed |
passed | 종료 코드 0으로 종료된 스크립트 수 |
failed | 0이 아닌 코드로 종료된 스크립트 수 |
skipped | 건너뛴 스크립트 수 (실행 불가능하거나 드라이런) |
개별 스크립트 실행
섹션 제목: “개별 스크립트 실행”각 스크립트는 러너 없이 독립적으로 실행할 수 있습니다:
# Run a single script directly/opt/traffic-generator/suites/web-app-attacks/01-sqli.sh demo.example.com
# Run a specific API attack/opt/traffic-generator/suites/api-attacks/01-vampi-owasp-top10.sh demo.example.com스크립트는 첫 번째 위치 인수로 대상 FQDN을 받습니다. 스크립트는 config.env를 직접 읽지 않으며, 러너만 이를 수행합니다. 독립적으로 실행할 때는 FQDN을 명시적으로 전달해야 합니다.
모든 스위트를 순서대로 실행
섹션 제목: “모든 스위트를 순서대로 실행”모든 스위트를 연속으로 실행하려면:
for suite in web-app-attacks api-attacks bot-simulation reconnaissance ssl-scanning javascript-exploits traffic-generation; do echo "=========================================" echo "Starting suite: ${suite}" echo "=========================================" /opt/traffic-generator/suites/runner.sh "$suite" echo ""done이렇게 하면 모든 F5 XC 보안 기능에 걸쳐 포괄적인 트래픽이 생성됩니다. 대상의 응답 시간에 따라 전체 실행에 45~80분이 소요될 수 있습니다.
SSH를 통한 원격 실행
섹션 제목: “SSH를 통한 원격 실행”SSH 세션을 유지하지 않고 로컬 머신에서 스위트를 실행합니다:
TGEN_IP=$(terraform output -raw public_ip)
# Run a single suitessh azureuser@${TGEN_IP} '/opt/traffic-generator/suites/runner.sh web-app-attacks'
# Run a suite with target overridessh azureuser@${TGEN_IP} 'TARGET_FQDN=staging.example.com /opt/traffic-generator/suites/runner.sh api-attacks'
# Run in background (disconnection-safe)ssh azureuser@${TGEN_IP} 'nohup /opt/traffic-generator/suites/runner.sh web-app-attacks > /tmp/web-app-attacks.log 2>&1 &'
# Check results laterssh azureuser@${TGEN_IP} 'ls -la /opt/traffic-generator/results/ | tail -5'ssh azureuser@${TGEN_IP} 'cat /opt/traffic-generator/results/$(ls -t /opt/traffic-generator/results/ | head -1)/meta.json'장시간 실행되는 스위트의 경우, SSH 연결이 끊겨 프로세스가 종료되지 않도록 nohup 또는 tmux를 사용하십시오:
ssh azureuser@${TGEN_IP} 'tmux new-session -d -s traffic "/opt/traffic-generator/suites/runner.sh reconnaissance"'
# Reattach later to watch progressssh -t azureuser@${TGEN_IP} 'tmux attach-session -t traffic'실행 흐름
섹션 제목: “실행 흐름”-
구성 로드 — 러너가
config.env(또는CONFIG_FILE재정의)를 읽은 후, 환경에서TARGET_FQDN을 확인합니다. -
스위트 유효성 검사 — 명명된 스위트 디렉토리가 스위트 디렉토리 아래에 존재하는지 확인합니다. 찾을 수 없는 경우 사용 가능한 스위트를 나열합니다.
-
결과 디렉토리 생성 —
/opt/traffic-generator/results/<timestamp>-<suite>/를 생성하고status: running으로 초기meta.json을 작성합니다. -
스크립트 실행 — 스위트 디렉토리에서
[0-9]*와 일치하는 파일을 이름순으로 정렬하여 순회합니다. 실행 불가능한 파일은 건너뜁니다.TARGET_FQDN을 첫 번째 인수로 전달합니다. 출력을<script-name>.log에 캡처합니다. -
결과 기록 — 완료 타임스탬프 및 통과/실패/건너뜀 수로
meta.json을 업데이트합니다.