feat(aws): add VPN-based local provisioning and existing VPC support#490
Open
nobody-Justheader wants to merge 2 commits intoOrange-Cyberdefense:mainfrom
Open
feat(aws): add VPN-based local provisioning and existing VPC support#490nobody-Justheader wants to merge 2 commits intoOrange-Cyberdefense:mainfrom
nobody-Justheader wants to merge 2 commits intoOrange-Cyberdefense:mainfrom
Conversation
- Add local provisioning mode to AWS provider (vpn_connect/vpn_disconnect) - Add VPN Terraform module templates (certificates, endpoint, OpenVPN config) - Support existing VPC via aws_vpc_id/aws_subnet_id/aws_security_group_id config - Skip jumpbox resources when using local provisioning - Add VPN client CIDR security group ingress rule for local mode - Add vpn_connect/vpn_disconnect CLI commands - Attempt VPN disconnect before destroy for local mode instances
Replace ami-03440f0d88fea1060 with ami-0a4c1700182f3bc09 (Windows_Server-2019-English-Full-Base-2025.11.12) across all labs and extensions. Fixes Orange-Cyberdefense#472
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AWS VPN-Based Local Provisioning
Motivation
The current AWS provider requires a jumpbox EC2 instance to run Ansible provisioning remotely over SSH. This has two significant pain points:
Cost — The jumpbox (
t2.medium) runs continuously alongside the lab VMs. Even when you're not actively provisioning or using the lab, you're paying for it. For labs that sit idle between pentest sessions, this adds up.Workflow friction — All Ansible execution happens on the jumpbox, which means syncing sources over SSH, managing tunnels, and debugging remotely. If you're already running Kali or another attack box locally (which most pentesters are), the jumpbox is redundant infrastructure that gets in the way.
AWS Client VPN solves both problems. It provides direct L3 connectivity into the VPC from your local machine, so Ansible runs locally — the same way it works with VirtualBox and VMware providers. The VPN endpoint is created on-demand with
vpn_connectand torn down withvpn_disconnect, so you only pay the ~$0.10/hr AWS Client VPN charge when you're actively connected.What this adds
localas the provisioning method to skip the jumpbox entirely and use VPN insteadvpn_connectandvpn_disconnectCLI commands manage the AWS Client VPN endpoint independently from lab VMsworkspace/<id>/vpn/with its own state file, so creating/destroying the VPN never touches running lab infrastructuretls_*resources with ACM upload — no manual PKI needed.ovpnconfig is generated as a Terraform output with embedded certsaws_vpc_id,aws_subnet_id, andaws_security_group_idingoad.inito deploy into pre-existing network infrastructuredestroycommand attemptsvpn_disconnectfirst when using local modeUsage
Existing VPC mode (optional)
Add to
~/.goad/goad.ini:Also fixes: #472 — Dynamic AMI resolution for all regions
Previously, Windows and Ubuntu AMI IDs were hardcoded for
eu-west-3, causingAuthFailureerrors when deploying in other regions. This PR addsdata "aws_ami"lookups that dynamically resolve the latest AMI for the configured region:data.aws_ami.windows_2016,windows_2019,windows_2022,windows_2025resolve by SKU vialocals.ami_lookup. Thewindows_skufield in each lab's config (e.g.2019-Datacenter) maps to the correct AMI automatically.data.aws_ami.ubuntu_22_04resolves the latest Ubuntu 22.04 AMI from Canonical.Hardcoded AMI IDs in lab files are retained as fallbacks but will never be used for standard SKUs. Also updated the stale
ami-03440f0d88fea1060references toami-0a4c1700182f3bc09as a safety net.Fixes #472
Files changed
goad/provider/terraform/aws.py— Local provisioner support, VPN methods, existing VPC configgoad/instance.py— Conditional jumpbox skipping, VPN folder generationgoad/goadpath.py— VPN path helpergoad/config.py— Optional VPC config fieldsgoad.py— VPN CLI commands, jumpbox skip, VPN disconnect on destroytemplate/provider/aws/vpn/*— New VPN Terraform templatestemplate/provider/aws/windows.tf— Dynamic Windows AMI lookup viadata "aws_ami"+locals.ami_lookuptemplate/provider/aws/jumpbox.tf— Dynamic Ubuntu AMI lookuptemplate/provider/aws/linux.tf— Dynamic Ubuntu AMI lookuptemplate/provider/aws/{network,outputs,variables}.tf— Conditional Jinja2 for existing VPC and local modead/*/providers/aws/windows.tf— Updated fallback AMI IDsextensions/*/providers/aws/windows.tf— Updated fallback AMI IDs