gcp-networking-observability
БесплатноБез исполняемых скриптовНе проверенInvestigate Google Cloud networking issues by analyzing VPC Flow Logs, firewall logs, Cloud NAT logs, threat logs, and networking metrics. Run Connectivity…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
GCP Networking Observability
Overview
Google Cloud emits multiple network telemetry streams: VPC Flow Logs (sampled IP traffic), firewall rule logs, Cloud NAT translation logs, Cloud Firewall Plus / Cloud IDS threat logs, and aggregated metrics in Cloud Monitoring. Connectivity Tests provide static path analysis for "why can't A reach B?" questions. The right source depends on the question — pick one and stop, do not chase verification across tools.
Instructions
Telemetry Streams
| Stream | Use it for |
|---|---|
| VPC Flow Logs | Top talkers, bytes/packets between IPs, traffic trends, egress analysis |
| Firewall Logs | DENY events, verifying ALLOW rules, audit of who hit which rule |
| Cloud NAT Logs | Port exhaustion, source NAT translation auditing |
| Threat Logs | Cloud Firewall Plus / Cloud IDS — malicious patterns from deep packet inspection |
| Networking Metrics | Time-series throughput, RTT, packet loss for performance dashboards |
| Connectivity Tests | Static reachability analysis between two endpoints |
Enabling VPC Flow Logs
# Enable flow logs on a subnet (5% sampling, full metadata)
gcloud compute networks subnets update prod-subnet \
--region=us-central1 \
--enable-flow-logs \
--logging-aggregation-interval=interval-5-sec \
--logging-flow-sampling=0.5 \
--logging-metadata=include-all
# Upgrade the log bucket to Log Analytics, then link it to BigQuery
# (one-time setup; the project's _Default bucket already receives these logs)
gcloud logging buckets update _Default --location=global --enable-analytics
gcloud logging links create network_logs_link \
--bucket=_Default --location=global
The link creates a BigQuery dataset in the same project containing a virtual view named _AllLogs that covers every log type in the bucket — no per-log-type sink or table management needed.
Top-Talker Analysis (BigQuery)
Always prefer BigQuery on the linked dataset's _AllLogs view for volume-based queries. Cloud Logging's Logs Explorer is for spot-checking, not aggregation. Log Analytics uses snake_case column names (json_payload, log_id, timestamp), not the camelCase field names shown in Logs Explorer.
-- Top 20 source→destination IP pairs by bytes (last 24 hours)
SELECT
json_payload.connection.src_ip AS src,
json_payload.connection.dest_ip AS dst,
json_payload.connection.dest_port AS dst_port,
SUM(CAST(json_payload.bytes_sent AS INT64)) AS total_bytes,
COUNT(*) AS flows
FROM `my-project.network_logs_link._AllLogs`
WHERE log_id = 'compute.googleapis.com/vpc_flows'
AND timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 24 HOUR)
GROUP BY src, dst, dst_port
ORDER BY total_bytes DESC
LIMIT 20;
-- Find external egress (to non-RFC1918) by VM
SELECT
json_payload.src_instance.vm_name AS vm,
json_payload.connection.dest_ip AS external_dst,
SUM(CAST(json_payload.bytes_sent AS INT64)) / POW(1024, 3) AS gb_sent
FROM `my-project.network_logs_link._AllLogs`
WHERE log_id = 'compute.googleapis.com/vpc_flows'
AND NOT NET.IP_IN_NET(json_payload.connection.dest_ip, '10.0.0.0/8')
AND NOT NET.IP_IN_NET(json_payload.connection.dest_ip, '172.16.0.0/12')
AND NOT NET.IP_IN_NET(json_payload.connection.dest_ip, '192.168.0.0/16')
AND DATE(timestamp) = CURRENT_DATE()
GROUP BY vm, external_dst
ORDER BY gb_sent DESC
LIMIT 50;
If the query returns NULL VM names, the subnet has EXCLUDE_ALL_METADATA set. Retry using json_payload.connection.src_ip as the join key.
Firewall DENY Analysis
-- Top denied connection attempts (firewall rule + source IP)
SELECT
json_payload.rule_details.reference AS rule,
json_payload.connection.src_ip AS src,
json_payload.connection.dest_port AS port,
COUNT(*) AS hits
FROM `my-project.network_logs_link._AllLogs`
WHERE log_id = 'compute.googleapis.com/firewall'
AND json_payload.disposition = 'DENIED'
AND timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR)
GROUP BY rule, src, port
ORDER BY hits DESC
LIMIT 25;
Connectivity Tests (Static Path Analysis)
# Test reachability between a VM and an external IP
gcloud network-management connectivity-tests create vm-to-api \
--source-instance=projects/my-project/zones/us-central1-a/instances/web-1 \
--destination-ip-address=203.0.113.10 \
--destination-port=443 \
--protocol=TCP
# Run and read the result
gcloud network-management connectivity-tests run vm-to-api
gcloud network-management connectivity-tests describe vm-to-api \
--format='value(reachabilityDetails.result,reachabilityDetails.traces)'
Connectivity Tests answer reachability questions deterministically — no log digging. If the result is REACHABLE, the path works; UNREACHABLE includes the failing hop and rule.
Cloud NAT Port Exhaustion
-- Find which VMs are saturating NAT ports
SELECT
json_payload.endpoint.vm_name AS vm,
COUNT(*) AS allocations,
COUNTIF(json_payloa
Установить gcp-networking-observability в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл gcp-networking-observability?
Investigate Google Cloud networking issues by analyzing VPC Flow Logs, firewall logs, Cloud NAT logs, threat logs, and networking metrics. Run Connectivity Tests for path diagnostics and use BigQuery linked datasets for high-volume traffic analysis. Use when troubleshooting connection failures, latency, packet loss, or top-talkers.
Как установить скилл gcp-networking-observability?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gcp-networking-observability запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic