cloud-firewall-and-gateway-ops

Diagnose and open cloud firewall ports on GCP and AWS, and restart hermes gateways safely.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill cloud-firewall-and-gateway-ops-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloud-firewall-and-gateway-ops
Source: https://github.com/CHENHUI-X/toolbox/tree/main/custom-skills/autonomous-ai-agents/cloud-firewall-and-gateway-ops
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill cloud-firewall-and-gateway-ops-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a service listens locally but is unreachable from the public internet, the cause is usually a missing cloud firewall rule rather than the application itself. This Skill provides a proven troubleshooting and remediation workflow for opening ports on GCP and AWS, plus a safe procedure for restarting hermes gateway processes that block self-restart commands. ## Core Features & Use Cases - Three-layer firewall diagnosis: Systematically checks service listening state (ss), host firewall (ufw), and cloud firewall rules, avoiding the hairpin misjudgment of self-testing a public IP from the same machine. - Cloud provider detection: Uses metadata endpoints to confirm whether an instance runs on GCP or AWS before touching any firewall configuration. - GCP port opening workflow: Detects the missing compute scope on the default service account via a metadata token probe, then hands the user a single-line gcloud firewall-rules command formatted to survive Telegram copy-paste and PowerShell quirks. - Safe gateway restart: Works around the gateway's self-protection block on restart commands by scheduling a script via at now + 1 minute, and explains why 'deactivating' is normal shutdown behavior. - Use Case: A new node port must be exposed publicly. The Skill verifies the process binds 0.0.0.0, confirms the cloud provider, produces evidence of the missing GCP firewall rule, and gives the user one copy-paste-safe gcloud command to run. ## Quick Start Ask the agent to check why a specific port is unreachable from the internet and open it in the cloud firewall.

Frequently Asked Questions about cloud-firewall-and-gateway-ops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I open a port in GCP firewall from the command line?

Use gcloud compute firewall-rules create with a rule name, --allow tcp:PORT, and --target-tags. If the VM's default service account lacks compute scope, run the command from a machine where gcloud is already authenticated, such as the user's local Windows terminal.

Why is my service reachable locally but not from the internet?

Check three layers in order: the process must listen on 0.0.0.0 (ss -tlnp), the host firewall must allow the port (ufw status), and the cloud firewall or security group must have a rule. Testing your own public IP from the same machine is unreliable due to hairpin routing.

How can I tell if a VM is running on GCP or AWS?

Query the metadata endpoints: GCP responds to metadata.google.internal with the Metadata-Flavor header, while AWS responds at 169.254.169.254. Confirming the provider first matters because the two platforms use entirely different firewall systems.

Why does restarting hermes gateway get blocked?

The gateway intercepts any command containing restart or stop wording issued from within its own process, including over ssh. The workaround is writing the restart command into a script file and scheduling it with at now + 1 minute so it runs outside the gateway process.

Why does the gateway stay in deactivating state after SIGTERM?

Deactivating is normal: the gateway waits for the current active turn to finish before exiting, which can take several minutes under memory pressure. Tell the user it completes after the current message and verify in the next turn instead of polling repeatedly.