Egress Requirements Documentation
Overview
When deploying applications in firewall-restricted environments, you must identify and document all external endpoints your application requires. This guide shows you how.
Why Document Egress Requirements?
- Security Team Approval: Security teams need to know what to allow
- Firewall Configuration: Network teams need specific IPs/CIDRs and ports
- Compliance: Auditors need to see documented access patterns
- Troubleshooting: When things break, you know what should be accessible
- Change Management: New requirements can be reviewed and approved
What to Document
For each external endpoint, document:
- Purpose: Why does the application need this endpoint?
- Protocol: TCP, UDP, or both?
- Ports: Specific ports or port ranges
- Destination: IP address, CIDR block, or domain name
- Direction: Outbound only (egress)
- Frequency: How often is this accessed?
- Data: What data is transmitted?
- Alternatives: Can this be avoided or proxied?
Template
markdown
## Egress Requirements for [Application Name]
### Endpoint 1: [Name/Purpose]
- **Purpose**: [Why is this needed?]
- **Protocol**: TCP/UDP
- **Ports**: [Port numbers]
- **Destination**: [IP/CIDR or domain]
- **Frequency**: [How often?]
- **Data**: [What data is sent?]
- **Alternatives**: [Can this be avoided?]
### Endpoint 2: [Name/Purpose]
...Common Endpoints
Container Images
Docker Hub:
- Purpose: Pull container images
- Protocol: TCP
- Ports: 443 (HTTPS)
- Destination: registry-1.docker.io (IPs vary, use domain)
- Frequency: On pod startup
- Data: Image layers
- Alternatives: Use private registry (Artifact Registry)
Artifact Registry:
- Purpose: Pull container images
- Protocol: TCP
- Ports: 443
- Destination: [region]-docker.pkg.dev (GCP service)
- Frequency: On pod startup
- Data: Image layers
- Alternatives: None (if using GCP)
Package Managers
npm (Node.js):
- Purpose: Install npm packages
- Protocol: TCP
- Ports: 443
- Destination: registry.npmjs.org
- Frequency: During builds
- Data: Package metadata and tarballs
- Alternatives: Use private npm registry
PyPI (Python):
- Purpose: Install Python packages
- Protocol: TCP
- Ports: 443
- Destination: pypi.org, files.pythonhosted.org
- Frequency: During builds
- Data: Package metadata and wheels
- Alternatives: Use private PyPI mirror
Maven (Java):
- Purpose: Download dependencies
- Protocol: TCP
- Ports: 443
- Destination: repo1.maven.org, central.maven.org
- Frequency: During builds
- Data: JAR files and metadata
- Alternatives: Use private Maven repository
APIs and Services
GitHub:
- Purpose: Clone repositories, download releases
- Protocol: TCP
- Ports: 443, 22 (SSH)
- Destination: github.com, api.github.com
- Frequency: During CI/CD
- Data: Code, releases, API responses
- Alternatives: Use GitHub Enterprise or mirror
Cloud Provider APIs:
- Purpose: Access cloud services
- Protocol: TCP
- Ports: 443
- Destination: [cloud provider API endpoints]
- Frequency: Continuous
- Data: API requests/responses
- Alternatives: Use Private Google Access (GCP)
Monitoring and Logging
Monitoring Services:
- Purpose: Send metrics
- Protocol: TCP
- Ports: 443
- Destination: [monitoring service endpoints]
- Frequency: Continuous
- Data: Metrics, telemetry
- Alternatives: Use cloud-native monitoring
Logging Services:
- Purpose: Send logs
- Protocol: TCP
- Ports: 443
- Destination: [logging service endpoints]
- Frequency: Continuous
- Data: Application logs
- Alternatives: Use cloud-native logging
How to Identify Required Endpoints
Method 1: Application Documentation
Check your application's documentation for:
- External dependencies
- API endpoints
- Service integrations
- Third-party services
Method 2: Network Monitoring
Run the application and monitor network traffic:
bash
# On a test node
tcpdump -i any -n 'tcp and port 443'
# Or use VPC Flow Logs in GCP
gcloud logging read "resource.type=gce_instance" --limit 100Method 3: Application Logs
Check application logs for connection errors:
- DNS resolution failures
- Connection timeouts
- SSL/TLS errors
Method 4: Test in Restricted Environment
Deploy to a test environment with strict firewall:
- See what breaks
- Document what's needed
- Test fixes
Example: Argo Workflows Egress Requirements
markdown
## Egress Requirements for Argo Workflows
### Container Image Registry
- **Purpose**: Pull Argo Workflows container images
- **Protocol**: TCP
- **Ports**: 443
- **Destination**: quay.io (or Artifact Registry)
- **Frequency**: On pod startup
- **Data**: Container image layers
- **Alternatives**: Use private registry mirror
### Workflow Container Images
- **Purpose**: Pull images for workflow steps
- **Protocol**: TCP
- **Ports**: 443
- **Destination**: docker.io, quay.io, gcr.io (varies by workflow)
- **Frequency**: Per workflow execution
- **Data**: Container image layers
- **Alternatives**: Pre-pull images to private registry
### Artifact Storage
- **Purpose**: Store workflow artifacts
- **Protocol**: TCP
- **Ports**: 443
- **Destination**: [S3, GCS, or other storage]
- **Frequency**: Per workflow execution
- **Data**: Workflow artifacts
- **Alternatives**: Use internal storage
### External APIs (if workflows call them)
- **Purpose**: [Specific API purpose]
- **Protocol**: TCP
- **Ports**: 443
- **Destination**: [API endpoint]
- **Frequency**: [As needed by workflow]
- **Data**: [API requests/responses]
- **Alternatives**: [If any]Presenting to Security Teams
Format
- Executive Summary: High-level overview
- Detailed Requirements: Per-endpoint breakdown
- Risk Assessment: Security implications
- Mitigation Strategies: How risks are addressed
- Alternatives Considered: Why direct access is needed
Key Points to Emphasize
- Minimal Scope: Only what's absolutely necessary
- HTTPS Only: All traffic encrypted in transit
- Audit Trail: All access is logged
- Proxy Control: Traffic goes through controlled proxy
- Regular Review: Requirements reviewed periodically
Maintaining Documentation
Regular Reviews
- Quarterly: Review all endpoints
- After Changes: Update when application changes
- After Incidents: Document what was needed for troubleshooting
Version Control
- Keep documentation in version control
- Tag versions with application releases
- Track changes over time
Tools
Network Analysis
- tcpdump: Capture network traffic
- Wireshark: Analyze packets
- VPC Flow Logs: GCP network logs
- kubectl exec: Test from pods
Documentation
- Markdown: Easy to version control
- Spreadsheets: For tabular data
- Confluence/Wiki: For team collaboration