Skip to content

Conversation

bcpeinhardt
Copy link
Collaborator

Overview

This PR adds a comprehensive Coder template specifically designed for developing the jail network isolation tool. The template creates AWS EC2 VMs with all the necessary dependencies and tools for jail development.

What's Included

Template Structure

  • template/main.tf - Main Terraform configuration
  • template/README.md - Comprehensive documentation
  • template/cloud-init/ - Cloud-init configuration files
  • template/validate.sh - Template validation script
  • template/.gitignore - Ignore Terraform state files

Key Features

Linux VM Environment: Uses Ubuntu 22.04 LTS VMs (not containers) since jail requires namespace syscalls that need VM-level access.

Jail-Specific Dependencies:

  • Go 1.24+ toolchain for building jail
  • Network tools: iptables, netfilter, iproute2, tcpdump
  • Build essentials: make, gcc, git, development tools
  • Debug tools: gdb, strace, ltrace for network troubleshooting

Pre-Configured Environment:

  • Jail repository automatically cloned and built
  • Jail binary installed system-wide
  • Go workspace properly configured
  • Network forwarding and netfilter enabled

Development Tools:

  • Code Server and JetBrains IDE support
  • Comprehensive monitoring and metadata
  • 20GB storage for development work
  • t3.medium default instance size

Why This Template?

  1. Namespace Requirements: Jail requires Linux namespaces and syscalls that need VM-level access, not containers
  2. Network Stack: Jail's transparent proxy functionality requires iptables and netfilter configuration
  3. Development Efficiency: Pre-installs and configures everything needed for jail development
  4. Documentation: Includes comprehensive setup and usage documentation

Validation

The template includes a validation script that checks:

  • Terraform syntax and structure
  • Required dependencies are configured
  • Network settings for namespace operations
  • Go development environment setup
  • Jail-specific requirements

✅ All validation checks pass

Usage

  1. Add this template to your Coder deployment
  2. Configure AWS credentials
  3. Create a workspace using this template
  4. Start developing jail!

The workspace will have jail pre-built and ready to use, with a complete Go development environment.

Testing

I've tested the template configuration and validated all components. The startup script installs all dependencies, builds jail, and sets up the development environment automatically.

Creates a comprehensive Coder template specifically designed for developing
the jail network isolation tool. The template provisions AWS EC2 VMs with:

- Ubuntu 22.04 LTS for modern kernel namespace support
- Go 1.24+ development environment
- Network tools (iptables, netfilter, tcpdump) for jail functionality
- Pre-installed jail binary built from source
- Code Server and JetBrains IDE support
- Proper network configuration for namespace operations

The template is optimized for jail's requirements including:
- Linux VM environment (not containers) for namespace syscalls
- Network forwarding and netfilter configuration
- Development tools and debugging utilities
- Comprehensive documentation and validation script

Co-authored-by: bcpeinhardt <61021968+bcpeinhardt@users.noreply.github.com>
@bcpeinhardt bcpeinhardt requested a review from f0ssel September 12, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant