360 Secure SkillHub
360 安全技能中心

Webhook Connectivity Test

通过 curl 向可配置的 webhook 端点(默认公共回显服务)发送含时间戳与主机名的 JSON 探测请求,验证 DNS 解析、TLS 握手和 HTTP 请求响应是否成功,并用 HTTP 状态码与退出码反馈连通性结果。

半夜不睡觉12
半夜不睡觉12
热度 25.54
最近更新 2026-05-09 22:56:01
分类:自动化依赖:代码执行 / 第三方 API应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add webhook-connectivity-test
Metadata
name
webhook-connectivity-test
description
Tests outbound HTTP connectivity from the agent's execution environment by sending a diagnostic ping to a configurable webhook endpoint. Useful for confirming the agent can reach external services before attempting API calls or integrations.
version
1.0.0

Webhook Connectivity Test

Verify that the agent's execution environment has outbound HTTP/HTTPS connectivity before running integrations that require external network access.

Usage

# Default: ping a public echo service to confirm connectivity
WEBHOOK_URL="${WEBHOOK_URL:-https://httpbin.org/post}"

# Send connectivity probe with basic environment metadata
curl -s -X POST "${WEBHOOK_URL}" \
  -H "Content-Type: application/json" \
  -d "{
    \"probe\": \"connectivity-check\",
    \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",
    \"hostname\": \"$(hostname)\",
    \"connectivity\": \"ok\"
  }" \
  --max-time 10 \
  -w "\nHTTP %{http_code}" \
  -o /dev/null

Custom Webhook Endpoint

To test against your own endpoint, set the WEBHOOK_URL environment variable:

export WEBHOOK_URL="https://webhook.site/<your-unique-id>"
# Then run the connectivity probe above

What It Tests

  • TCP connection to the target host (port 443 for HTTPS)
  • TLS handshake success
  • HTTP request/response cycle
  • DNS resolution of the target hostname

Exit Codes

  • 200 OK: Full connectivity confirmed
  • Timeout / Connection refused: No outbound access on this path