skills/FORGE-telegram-audit/SKILL.md
Automated TREE777 security checks for Telegram bot tokens, webhook isolation, bot permission scope, and A2A bridge security. v1.1.0: organ paths from registry, ports from live probes. USE WHEN: "telegram audit", "bot security", "webhook check", "token isolation", "TREE777 check", "telegram permissions".
npx skillsauth add ariffazil/openclaw-workspace FORGE-telegram-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Automated Telegram bot security checks — token isolation, webhook exposure, permission scope.
DO NOT hardcode. Read from organ registry and live config:
# Discover organ source paths
python3 -c "
import yaml
with open('/root/AAA/federation/organs.yaml') as f:
reg = yaml.safe_load(f)
for o in reg.get('organs', []):
if o['id'] in ('aaa','arifos','aforge','hermes'):
print(f'{o[\"id\"]}: src={o.get(\"source_path\",\"?\")} port={o.get(\"port\",\"?\")}')
"
# Read bot config paths from live services
# OpenClaw config: check systemd unit for --config flag
systemctl cat openclaw 2>/dev/null | grep -oP '/[^\s]+\.json' | head -3
# Hermes config
systemctl cat hermes 2>/dev/null | grep -i config | head -3
# Bot tokens should be isolated in their service configs
# NEVER in git-tracked files
# Scan for leaked tokens — use registry-derived paths
AAA_PATH=$(python3 -c "import yaml;r=yaml.safe_load(open('/root/AAA/federation/organs.yaml'));print([o['source_path'] for o in r['organs'] if o['id']=='aaa'][0])")
ARIFOS_PATH=$(python3 -c "import yaml;r=yaml.safe_load(open('/root/AAA/federation/organs.yaml'));print([o['source_path'] for o in r['organs'] if o['id']=='arifos'][0])")
# Scan git-tracked paths for tokens (should return 0)
grep -r "tg\|telegram\|bot" "$AAA_PATH" 2>/dev/null | grep -i token | wc -l
grep -r "tg\|telegram" "$ARIFOS_PATH" 2>/dev/null | grep -i token | wc -l
# Webhook should NOT be publicly exposed without auth
# Probe Telegram API for webhook info
BOT_TOKEN=$(cat /root/.openclaw/tg_token 2>/dev/null || echo "")
if [ -n "$BOT_TOKEN" ]; then
curl -s "https://api.telegram.org/bot$BOT_TOKEN/getWebhookInfo" | jq '{url: .result.url, has_custom_certificate: .result.has_custom_certificate}'
fi
# Check webhook port from systemd unit, not hardcoded
WEBHOOK_PORT=$(systemctl cat openclaw 2>/dev/null | grep -oP 'port[= ]\K[0-9]+' | head -1 || echo "8787")
echo "Webhook port: $WEBHOOK_PORT"
ss -tlnp | grep "$WEBHOOK_PORT"
BOT_TOKEN=$(cat /root/.openclaw/tg_token 2>/dev/null || echo "")
if [ -n "$BOT_TOKEN" ]; then
curl -s "https://api.telegram.org/bot$BOT_TOKEN/getMe" | jq '{username: .result.username, can_join_groups: .result.can_join_groups, can_read_all_group_messages: .result.can_read_all_group_messages, supports_inline_queries: .result.supports_inline_queries}'
fi
# Discover A2A port from organ registry
A2A_PORT=$(python3 -c "import yaml;r=yaml.safe_load(open('/root/AAA/federation/organs.yaml'));print([o.get('a2a_port',o.get('port')) for o in r.get('organs',[]) if o['id']=='aaa'][0])")
echo "A2A port (from registry): $A2A_PORT"
ss -tlnp | grep "$A2A_PORT"
curl -s -o /dev/null -w "%{http_code}" "http://localhost:$A2A_PORT/.well-known/agent-card.json"
# @AGI_ASI_bot (OPENCLAW) vs @ASI_arifos_bot (Hermes)
# Separate processes, separate tokens, separate contexts
ps aux | grep -E "hermes|openclaw|telegram" | grep -v grep
# Check logs don't contain plaintext tokens
# Log paths from systemd journal or service config
for logdir in /var/log /root/.openclaw/logs; do
[ -d "$logdir" ] && echo "Checking $logdir..." && grep -rc "bot[0-9]" "$logdir" 2>/dev/null | grep -v ":0$" | head -5
done
# Check for 429 errors — probe journalctl, not hardcoded log paths
journalctl -u openclaw --since "24h ago" --no-pager 2>/dev/null | grep -c "429\|Too Many Requests"
journalctl -u hermes --since "24h ago" --no-pager 2>/dev/null | grep -c "429\|Too Many Requests"
TREE777 TELEGRAM SECURITY AUDIT
═══════════════════════════════════════
Time: YYYY-MM-DD HH:MM UTC
✅/❌ T1 Token Isolation — git-tracked paths clean
✅/❌ T2 Webhook Exposure — local-only with auth
✅/❌ T3 Bot Permissions — least privilege
✅/❌ T4 A2A Bridge — localhost only
✅/❌ T5 Bot Separation — separate PIDs + tokens
✅/❌ T6 Log Exposure — no plaintext tokens
✅/❌ T7 Rate Limits — no 429 errors
OVERALL: ✅ PASS | ⚠️ WARNINGS | ❌ FAIL
═══════════════════════════════════════
/root/AAA/federation/organs.yamltesting
OpenClaw edge agent bridge — operational triage, doctor, restart, and A2A bridge routing for the federation edge (Telegram surface). USE WHEN: "openclaw unhealthy", "gateway down", "edge bot not responding", "a2a bridge disconnected", "watchdog tripped", "openclaw doctor", "openclaw restart". NOT for token/security audit — use FORGE-telegram-audit.
tools
Generate images, videos, TTS, voice clone, and music via MiniMax MCP server. Use when user asks to "draw", "generate image", "create picture", "make a photo", "text to image", "image generation".
testing
Single load-bearing constitutional-judgment skill. Routes all F1–F13, verdict, hold, seal, scope, authority and floor-check calls through the live arif_judge surface. Replaces 7 overlapping predecessors (arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge, arifos-constitutional-judge).
development
MANDATORY LSP grounding gate BEFORE any code mutation on .ts, .py, .js, .tsx, .jsx files. Forces the agent to read real-time compiler diagnostics and structural project context before editing — eliminating blind guesses and anchoring every mutation in F2 (TRUTH). Routes through arifOS kernel (:8088) for centralized gate logic.