implementing-gcp-vpc-firewall-rules
하는 일
이 도구는 Google Cloud(GCP) 네트워크 방화벽 규칙을 설정하고 점검하도록 돕습니다. 허용된 트래픽만 네트워크에 들어오거나 나갈 수 있도록 하여 데이터를 안전하게 지킵니다.
사용하는 경우
- ✓GCP에서 새 네트워크를 설정할 때.
- ✓기존 보안 규칙을 검토할 때.
- ✓무단 접근에 대한 보안 경고에 대응해야 하는 경우.
스킬 링크
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-gcp-vpc-firewall-rules/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“'web-server' 태그가 붙은 서버에 특정 IP에서만 SSH 접근을 허용하는 규칙을 설정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 도구는 Google Cloud 명령(gcloud)을 사용해 방화벽 규칙을 조회하고, 만들고, 변경합니다. 어떤 트래픽을 허용하거나 거부할지, 어디서 오고 어디로 가는지 정의할 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Implementing GCP VPC Firewall Rules
When to Use
- When deploying new GCP workloads that require network-level access controls
- When auditing existing firewall configurations for overly permissive rules
- When implementing zero trust network segmentation within GCP VPC networks
- When responding to Security Command Center findings about open firewall rules
- When building hierarchical firewall policies across a GCP organization
Do not use for application-layer filtering (use Cloud Armor WAF), for DNS-based filtering (use Cloud DNS response policies), or for VPN/interconnect traffic filtering without understanding that VPC firewall rules apply to traffic within the VPC.
Prerequisites
- GCP project with Compute Engine API enabled
- IAM roles:
roles/compute.securityAdminfor firewall management,roles/compute.networkViewerfor auditing - Organization Admin role for hierarchical firewall policies
- gcloud CLI authenticated with appropriate permissions
- VPC Flow Logs enabled on target subnets for monitoring
Workflow
Step 1: Audit Existing Firewall Rules for Security Gaps
Enumerate all firewall rules and identify overly permissive configurations.
# List all firewall rules in the project
gcloud compute firewall-rules list \
--format="table(name, network, direction, priority, allowed[].map().firewall_rule().list():label=ALLOWED, sourceRanges, targetTags)"
# Find rules allowing all traffic from 0.0.0.0/0
gcloud compute firewall-rules list \
--filter="direction=INGRESS AND sourceRanges=0.0.0.0/0" \
--format="table(name, network, allowed, priority, targetTags)" \
--sort-by=priority
# Find rules allowing all protocols and ports
gcloud compute firewall-rules list \
--filter="direction=INGRESS AND allowed[].IPProtocol=all" \
--format="table(name, network, sourceRanges, targetTags)"
# Find rules with SSH (22) or RDP (3389) open to the internet
gcloud compute firewall-rules list \
--filter="direction=INGRESS AND sourceRanges=0.0.0.0/0 AND (allowed[].ports=22 OR allowed[].ports=3389)" \
--format="table(name, network, allowed, sourceRanges)"
# Check for disabled rules
gcloud compute firewall-rules list \
--filter="disabled=true" \
--format="table(name, network, direction)"
Step 2: Create Restrictive Ingress Firewall Rules
Implement least-privilege ingress rules using network tags and service accounts for targeting.
# Create rule allowing HTTPS from the internet to web servers only
gcloud compute firewall-rules create allow-https-web \
--network=production-vpc \
--direction=INGRESS \
--action=ALLOW \
--rules=tcp:443 \
--source-ranges=0.0.0.0/0 \
--target-tags=web-server \
--priority=1000 \
--description="Allow HTTPS to web servers from internet"
# Create rule allowing SSH only from bastion host subnet
gcloud compute firewall-rules create allow-ssh-bastion \
--network=production-vpc \
--direction=INGRESS \
--action=ALLOW \
--rules=tcp:22 \
--source-ranges=10.0.1.0/24 \
--target-tags=ssh-allowed \
--priority=1000 \
--description="Allow SSH only from bastion subnet"
# Create rule allowing internal communication between app tiers
gcloud compute firewall-rules create allow-app-to-db \
--network=production-vpc \
--direction=INGRESS \
--action=ALLOW \
--rules=tcp:5432 \
--source-tags=app-server \
--target-tags=db-server \
--priority=1000 \
--description="Allow PostgreSQL from app tier to database tier"
# Create service-account-based rule (more secure than tags)
gcloud compute firewall-rules create allow-api-internal \
--network=production-vpc \
--direction=INGRESS \
--action=ALLOW \
--rules=tcp:8080 \
--source-service-accounts=api-client@project.iam.gserviceaccount.com \
--target-service-accounts=api-server@project.iam.gserviceaccount.com \
--priority=1000
Step 3: Implement Egress Restrictions
Configure egress firewall rules to control outbound traffic and prevent data exfiltration.
# Deny all egress by default (low priority)
gcloud compute firewall-rules create deny-all-egress \
--network=production-vpc \
--direction=EGRESS \
--action=DENY \
--rules=all \
--destination-ranges=0.0.0.0/0 \
--priority=65534 \
--description="Default deny all egress traffic"
# Allow egress to Google APIs via restricted VIP
gcloud compute firewall-rules create allow-google-apis \
--network=production-vpc \
--direction=EGRESS \
--action=ALLOW \
--rules=tcp:443 \
…
자주 묻는 질문
방화벽 규칙이란 무엇인가요?
설정한 규칙에 따라 클라우드의 가상 네트워크에 누가 들어오고 나갈 수 있는지 통제하는 디지털 문지기와 같습니다.
‘인그레스’와 ‘이그레스’는 무엇을 의미하나요?
‘인그레스’는 네트워크로 들어오는 트래픽이고, ‘이그레스’는 네트워크에서 나가는 트래픽입니다.
이것으로 특정 웹사이트를 차단할 수 있나요?
직접적으로는 안 됩니다. 이 도구는 네트워크 규칙에 초점을 맞춥니다. 웹사이트를 차단하려면 Cloud Armor나 DNS 같은 다른 도구가 필요합니다.
상세 정보
작성자의 원본 설명
Implements and audits GCP VPC firewall rules using gcloud, covering auditing overly permissive rules, creating restrictive ingress/egress rules, hierarchical firewall policies, and monitoring rule effectiveness with VPC Flow Logs. Use when deploying GCP workloads needing network access controls, auditing firewall configs, or responding to Security Command Center findings; not for Cloud Armor or DN
인기도
- GitHub 스타
- 35k
- 순위
- #8044
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 8. 31.
댓글
- …
이 저장소의 다른 스킬
abusing-dpapi-for-credential-access
35kAI 에이전트에게 특정 작업을 위한 준비된 지침을 제공해, 더 잘하고 더 빠르게 처리하도록 합니다.
abusing-shadow-credentials-for-privesc
35kAI 에이전트가 명확하고 잘 구성된 텍스트를 쓰도록 가르칩니다.
achieving-cmmc-level-2-compliance
35kCMMC Level 2 규정 준수를 위한 환경을 준비하도록 돕습니다. 보안 요구 사항을 구현하고 필요한 문서를 관리합니다.
acquiring-disk-image-with-dd-and-dcfldd
35k에이전트가 하드 드라이브의 정확한 복사본을 만들도록 돕습니다. 조사 중 정보가 손실되거나 변경되지 않도록 하는 데 유용합니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.