Nenhuma Descrição

send_to_shuffle_webhook.sh 923B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. SHUFFLE_WEBHOOK_URL="${SHUFFLE_WEBHOOK_URL:-}"
  4. INTEGRATOR_URL="${INTEGRATOR_URL:-http://localhost:8088}"
  5. INTERNAL_KEY="${INTERNAL_KEY:-}"
  6. if [[ -z "${SHUFFLE_WEBHOOK_URL}" ]]; then
  7. echo "error: SHUFFLE_WEBHOOK_URL is required"
  8. echo "example:"
  9. echo " SHUFFLE_WEBHOOK_URL='http://localhost:3001/api/v1/hooks/webhook_...' \\"
  10. echo " bash soc-integrator/examples/send_to_shuffle_webhook.sh"
  11. exit 1
  12. fi
  13. curl -sS -X POST "${SHUFFLE_WEBHOOK_URL}" \
  14. -H "Content-Type: application/json" \
  15. -d "{
  16. \"event_id\": \"soc-integrator-test-$(date +%s)\",
  17. \"source\": \"soc-integrator\",
  18. \"severity\": \"high\",
  19. \"title\": \"Suspicious VPN login outside Thailand\",
  20. \"description\": \"Detected by soc-integrator test script\",
  21. \"integrator_url\": \"${INTEGRATOR_URL}\",
  22. \"internal_key\": \"${INTERNAL_KEY}\"
  23. }"
  24. echo
  25. echo "sent webhook payload to Shuffle"