# ローカルでOWASP VulnerableAppを起動する手順
# ※ 必ずローカル・プライベートネットワーク環境でのみ実行してください

# 1. リポジトリのクローン
git clone https://github.com/SasanLabs/VulnerableApp.git
cd VulnerableApp

# 2. Dockerイメージの取得と起動
docker-compose pull && docker-compose up -d

# 3. 起動確認（数十秒〜数分かかる場合があります）
docker-compose ps

# 4. ブラウザでアクセス
# モダンUI: http://localhost
# レガシーUI: http://localhost:9090/VulnerableApp

# 5. ベンチマークAPIのテスト（アプリ起動後）
curl -s -X POST http://localhost:9090/VulnerableApp/scanner/benchmark \
  -H "Content-Type: application/json" \
  -d '{"tool": "test-scanner", "scanType": "DAST", "findings": [{"url": "http://localhost:9090/VulnerableApp/user", "type": "SQL_INJECTION", "cwe": "89"}]}' \
  | python3 -m json.tool

# 6. 終了
docker-compose down
