Skip to content
gcp-firewall logo

GCP Firewall Rules

gcp-firewall

GCP 방화벽 규칙 관리

SKILL.md

Full skill instructions

GCP Firewall Rules

VPC 방화벽 규칙을 조회, 생성, 관리합니다.

사용법

/​gcp-firewall                      # 규칙 목록 조회
/​gcp-firewall allow 8080           # TCP 8080 허용 규칙 생성
/​gcp-firewall allow 80,443         # 여러 포트 허용
/​gcp-firewall delete my-rule       # 규칙 삭제

Workflow

1. 방화벽 규칙 목록

PROJECT_ID=$(gcloud config get-value project)
gcloud compute firewall-rules list --project=$PROJECT_ID \
  --format="table(name,network.basename(),direction,priority,allowed[].map().firewall_rule().list():label=ALLOW,sourceRanges.list():label=SRC_RANGES,targetTags.list():label=TARGET_TAGS)"

2. 규칙 상세 조회

gcloud compute firewall-rules describe RULE_NAME

3. 규칙 생성

기본 HTTP/​HTTPS 허용
gcloud compute firewall-rules create allow-http \
  --direction=INGRESS \
  --priority=1000 \
  --network=default \
  --action=ALLOW \
  --rules=tcp:80 \
  --source-ranges=0.0.0.0/​0 \
  --target-tags=http-server
특정 포트 허용
gcloud compute firewall-rules create allow-custom-port \
  --direction=INGRESS \
  --priority=1000 \
  --network=default \
  --action=ALLOW \
  --rules=tcp:8080 \
  --source-ranges=0.0.0.0/​0 \
  --target-tags=custom-server
특정 IP만 SSH 허용
gcloud compute firewall-rules create allow-ssh-office \
  --direction=INGRESS \
  --priority=900 \
  --network=default \
  --action=ALLOW \
  --rules=tcp:22 \
  --source-ranges=1.2.3.4/​32 \
  --target-tags=ssh-allowed

4. VM에 태그 추가

gcloud compute instances add-tags VM_NAME \
  --zone=ZONE \
  --tags=http-server,custom-server

5. 규칙 삭제

gcloud compute firewall-rules delete RULE_NAME

자주 쓰는 규칙 템플릿

용도포트명령어
HTTP80--rules=tcp:80 --target-tags=http-server
HTTPS443--rules=tcp:443 --target-tags=https-server
SSH22--rules=tcp:22 --target-tags=ssh-allowed
MySQL3306--rules=tcp:3306 --target-tags=db-server
PostgreSQL5432--rules=tcp:5432 --target-tags=db-server
Redis6379--rules=tcp:6379 --target-tags=cache-server
Node.js3000--rules=tcp:3000 --target-tags=node-server
Flask/​Django5000,8000--rules=tcp:5000,tcp:8000

출력 형식

## 방화벽 규칙 목록

| 규칙 이름 | 방향 | 허용 | 소스 | 대상 태그 |
|-----------|------|------|------|-----------|
| default-allow-ssh | INGRESS | tcp:22 | 0.0.0.0/​0 | - |
| default-allow-http | INGRESS | tcp:80 | 0.0.0.0/​0 | http-server |
| allow-custom | INGRESS | tcp:8080 | 0.0.0.0/​0 | custom-server |

---
총 3개 규칙

보안 모범 사례

  1. 최소 권한 원칙: 필요한 포트만 열기
  2. 소스 IP 제한: 가능하면 0.0.0.0/​0 대신 특정 IP
  3. 태그 사용: 규칙을 특정 VM에만 적용
  4. 우선순위: 거부 규칙은 낮은 숫자 (높은 우선순위)
  5. 정기 감사: 미사용 규칙 정리

주의사항

  • 0.0.0.0/​0은 전체 인터넷에 노출
  • SSH(22)는 가능하면 IAP 터널 사용 권장
  • 규칙 삭제 시 연결 끊김 주의
  • 같은 우선순위면 거부가 우선

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
Any Summary logo
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View