mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-06-11 05:34:55 +03:00
27c6414ca5
Complete skill folder anatomy across all cybersecurity skills: - scripts/agent.py: 80-150 line Python agents using real libraries (impacket, boto3, azure-mgmt-*, kubernetes, pefile, yara, scapy, shodan, stix2, etc.) - references/api-reference.md: real API documentation with method signatures - LICENSE: MIT license for all skill folders
2.3 KiB
2.3 KiB
API Reference: Implementing GCP VPC Firewall Rules
Libraries
google-cloud-compute
- Install:
pip install google-cloud-compute - Docs: https://cloud.google.com/python/docs/reference/compute/latest
Key Classes and Methods
| Class | Method | Description |
|---|---|---|
FirewallsClient |
list(project) |
List all firewall rules |
FirewallsClient |
get(project, firewall) |
Get rule details |
FirewallsClient |
insert(project, firewall_resource) |
Create rule |
FirewallsClient |
patch(project, firewall, firewall_resource) |
Update rule |
FirewallsClient |
delete(project, firewall) |
Delete rule |
NetworksClient |
list(project) |
List VPC networks |
Firewall Rule Object Fields
name-- Rule name (unique per project)network-- VPC network pathdirection--INGRESSorEGRESSpriority-- 0 (highest) to 65535 (lowest)allowed[]-- Protocol and port combinations to allowdenied[]-- Protocol and port combinations to denysource_ranges[]-- Source CIDR ranges for ingressdestination_ranges[]-- Destination CIDRs for egresstarget_tags[]-- Network tags to apply rule tosource_tags[]-- Source instance tagsdisabled-- Boolean to disable without deletinglog_config.enable-- Enable firewall rule logging
Priority Ranges (Best Practice)
- 0-999: Emergency/override rules
- 1000-9999: Organization policies
- 10000-49999: Application-specific rules
- 50000-64999: Default deny rules
- 65534: Implied allow egress (GCP default)
- 65535: Implied deny ingress (GCP default)
gcloud CLI Equivalents
gcloud compute firewall-rules listgcloud compute firewall-rules create NAME --allow tcp:22 --source-ranges 10.0.0.0/8gcloud compute firewall-rules delete NAMEgcloud compute firewall-rules update NAME --disabled
Hierarchical Firewall Policies
- Organization-level:
compute.firewallPolicies - Folder-level: Applied via
compute.firewallPolicies.addAssociation - Evaluation order: Organization > Folder > VPC rules
External References
- VPC Firewall Rules: https://cloud.google.com/vpc/docs/firewalls
- Firewall Policies: https://cloud.google.com/vpc/docs/firewall-policies
- VPC Flow Logs: https://cloud.google.com/vpc/docs/using-flow-logs
- Cloud Armor WAF: https://cloud.google.com/armor/docs