项目文件夹

文件
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

1 行
7.2 KiB
JSON

{"content": "---\nname: google-cloud-networking-observability\ndescription: Investigates Google Cloud networking issues by analyzing logs, metrics, and diagnostics. Use when investigating VPC Flow Logs, NAT, firewall, or threat logs, querying latency and throughput metrics, or running Connectivity Tests for path diagnostics.\nsource: google/skills (Apache 2.0)\n---\n\n# Google Cloud Networking Observability Expert\n\n## Core Directive: Results First\n\n1. **Identify the Primary Source**: Quickly determine if the user needs\n firewall logs, threat logs, Cloud NAT, VPC Flow logs, or metrics.\n2. **Execute & Present**: Perform the minimum required query to get a direct\n answer.\n3. **Definitive Termination**: Once you identify the requested data, regardless\n of the value (including 0, null, or \"No traffic\"), present the finding and\n call the finish tool in the same turn. Do NOT attempt to find \"active\" or\n \"busier\" resources to provide a \"better\" answer unless specifically\n instructed to troubleshoot a resource that is expected to be busy.\n\n## Log & Telemetry Overview\n\n- **Threat Logs**: Specialized logs from Cloud Firewall Plus and Cloud IDS\n that identify malicious traffic patterns (for example, SQL injection or\n malware) using deep packet inspection.\n- **VPC Flow Logs**: Capture sample IP traffic to and from network interfaces.\n Use for traffic analysis, volume trends, and top talkers.\n- **Firewall Logs**: Record connection attempts matched by firewall rules. Use\n to identify \"DENY\" events or verify \"ALLOW\" rules.\n- **Cloud NAT Logs**: Audit NAT translations. Use to audit traffic going\n through NAT gateways or troubleshoot port exhaustion.\n- **Networking Metrics**: Aggregated time-series data for throughput, RTT\n (latency), and packet loss. Use for historical trends and performance\n monitoring.\n- **Connectivity Tests**: Static analysis tool for path diagnostics. Use to\n identify firewall or routing misconfigurations between endpoints.\n\n## Procedures\n\n### 0. Log Source Preference\n\n- **ALWAYS** check for BigQuery linked datasets (for example,\n `big_query_linked_dataset`, `_AllLogs`) before using Cloud Logging for\n high-volume analysis or aggregations. This is the preferred method for\n finding trends or top-blocking rules.\n- **Metadata Awareness (BigQuery)**: Subnetworks may be configured with\n `EXCLUDE_ALL_METADATA`, causing VM names to be NULL in VPC Flow Logs. If a\n query by VM name returns nothing, retry using the internal IP address\n (`jsonPayload.connection.src_ip`).\n\n### 1. Tool Selection & Discovery\n\n- **MCP Servers First**: Use\n [Cloud Monitoring MCP](references/mcp-usage.md#cloud-monitoring-mcp),\n [BigQuery MCP](references/mcp-usage.md#bigquery-mcp), or\n [Cloud Logging MCP](references/mcp-usage.md#cloud-logging-mcp).\n- **Resource Discovery**: If a user-specified resource (for example, NAT\n gateway, VPN tunnel) is not found in metrics/logs:\n 1. Use `run_shell_command` with `gcloud` to list resources in the project.\n 2. Search [Cloud Logging MCP](references/mcp-usage.md#cloud-logging-mcp)\n for the resource name to find correct labels.\n- **CLI Fallback**: Use `gcloud` or `bq` only if MCP servers are unavailable.\n DO NOT use gcloud monitoring; it is restricted. Immediately use the curl\n templates in [metrics-analysis.md](references/metrics-analysis.md).\n\n### 2. Schema Verification & Error Recovery\n\nIf a BigQuery query fails with an 'Unrecognized name' error or schema mismatch:\n1. **Validate Schema**: Run `bq show --schema --format=json\n{project_id}:{dataset_id}.{table_id}` to verify field names and casing (for\nexample, `jsonPayload` versus `json_payload`). 2. **Dry Run**: Before executing\na corrected query, use `bq query --use_legacy_sql=false --dry_run\n\"{query_text}\"` to verify field references without incurring cost or execution\ntime. 3. **Retry**: Apply identified fixes to the original query and execute.\n\n### 3. Analysis Guides (Read Only When Needed)\n\nFor detailed SQL patterns, field definitions, and advanced troubleshooting, read\nthe corresponding reference file:\n\n- **Threat Log Analysis**:\n [references/threat-analysis.md](references/threat-analysis.md)\n- **VPC Flow Analysis**:\n [references/vpc-flow-analysis.md](references/vpc-flow-analysis.md)\n- **Cloud NAT Analysis**:\n [references/cloud-nat-analysis.md](references/cloud-nat-analysis.md)\n- **Firewall Rule Analysis**:\n [references/firewall-analysis.md](references/firewall-analysis.md)\n- **Networking Metrics**:\n [references/metrics-analysis.md](references/metrics-analysis.md)\n- **Connectivity Test Analysis**:\n [references/connectivity-tests.md](references/connectivity-tests.md)\n\n## Boundaries (CRITICAL)\n\n- **ALWAYS** present the direct answer as soon as it is identified.\n- **NEVER** run more than 2 exploratory queries before showing results.\n- **NEVER** perform secondary verification (for example, don't check VPC flows\n after finding a firewall block) without explicit user permission.\n- **ALWAYS** print the generated SQL for review before execution.\n- **ALWAYS** include a link to the Flow Analyzer in the\n [Google Cloud Console](https://console.cloud.google.com/net-intelligence/flow-analyzer).\n- **NEVER** query a second data source (such as, BigQuery logs) if the primary\n source (for example, Cloud Monitoring metrics) has already provided a\n conclusive answer. **DO NOT** compare metrics and logs to \"verify\" accuracy\n unless the user specifically asks why they differ.\n- **NO DISCREPANCY LOOPS**: If Tool A provides a result (such as, 80,000\n counts) and Tool B provides a different result (for example, 1,000 counts),\n **DO NOT** initiate a deep dive to explain the difference. Present the\n result from the primary tool and STOP.\n- **ALWAYS** perform time-range calculations (such as, \"12 hours ago\") during\n the first turn to save steps.\n- **Conclusive Acceptance of Inactivity**: Treat a result of \"0\", \"0 traffic\",\n \"No data found\", or \"No records found\" as a conclusive finding for the\n requested timeframe and resource. You MUST report this as the definitive\n state and terminate immediately.\n- **Standardized Discovery Path**: For all \"Top-N\" or volume-based discovery\n tasks (for example, \"highest traffic,\" \"most hits,\" \"top talkers\"), you MUST\n use BigQuery aggregation on _AllLogs datasets. Manual aggregation of\n individual time-series points using the Monitoring API is forbidden due to\n step inefficiency.\n- **Ban on Auxiliary Scripting**: Execute all data retrieval and parsing logic\n as direct tool calls (bq, curl, gcloud). Do NOT write or execute local shell\n scripts (.sh) or python files, as these introduce avoidable environment and\n permission errors that lead to investigation timeouts.\n- **Discovery Efficiency**: For volume analysis (for example, \"how many\n connections\" or \"top IPs by bytes\"), BigQuery aggregation on VPC Flow logs\n (_AllLogs) is the **Primary Source of Truth**. If BigQuery data is\n available, it is conclusive. Do NOT query Monitoring API to \"double check\"\n BigQuery counts.\n"}