diff --git a/.gitignore b/.gitignore index 280b8b02..85b74265 100644 --- a/.gitignore +++ b/.gitignore @@ -16,8 +16,6 @@ __pycache__/ dreadgoad .dreadgoad/ coverage.out -ansible/roles/adcs_templates/files/ADCSTemplate.zip -ansible/roles/vulns_adcs_templates/files/ADCSTemplate.zip # Root environment inventories are local runtime state. /*-inventory diff --git a/ansible/roles/adcs_templates/README.md b/ansible/roles/adcs_templates/README.md index 2cb55266..b4ac617f 100644 --- a/ansible/roles/adcs_templates/README.md +++ b/ansible/roles/adcs_templates/README.md @@ -16,8 +16,7 @@ Deploy and configure ADCS certificate templates ### main.yml - **Refresh** (ansible.windows.win_command) -- **Copy ADCSTemplate zip to remote** (ansible.windows.win_copy) -- **Extract ADCSTemplate module** (ansible.windows.win_shell) +- **Copy ADCSTemplate module to remote** (ansible.windows.win_copy) - **Create a template directory** (ansible.windows.win_file) - **Copy templates json** (ansible.windows.win_copy) - **Install templates** (ansible.windows.win_shell) diff --git a/ansible/roles/adcs_templates/tasks/main.yml b/ansible/roles/adcs_templates/tasks/main.yml index 82c95abb..bdc5ec69 100644 --- a/ansible/roles/adcs_templates/tasks/main.yml +++ b/ansible/roles/adcs_templates/tasks/main.yml @@ -2,19 +2,10 @@ - name: Refresh ansible.windows.win_command: gpupdate /force -- name: Copy ADCSTemplate zip to remote +- name: Copy ADCSTemplate module to remote ansible.windows.win_copy: - src: files/ADCSTemplate.zip - dest: "C:\\Windows\\Temp\\ADCSTemplate.zip" - -- name: Extract ADCSTemplate module - ansible.windows.win_shell: | - $destPath = "C:\Program Files\WindowsPowerShell\Modules\ADCSTemplate" - if (Test-Path $destPath) { - Remove-Item -Path $destPath -Recurse -Force - } - Expand-Archive -Path "C:\Windows\Temp\ADCSTemplate.zip" -DestinationPath "C:\Program Files\WindowsPowerShell\Modules" -Force - Remove-Item -Path "C:\Windows\Temp\ADCSTemplate.zip" -Force + src: files/ADCSTemplate/ + dest: "C:\\Program Files\\WindowsPowerShell\\Modules\\ADCSTemplate\\" - name: Create a template directory ansible.windows.win_file: diff --git a/ansible/roles/vulns_adcs_templates/README.md b/ansible/roles/vulns_adcs_templates/README.md index 97ecd294..e11e8fdb 100644 --- a/ansible/roles/vulns_adcs_templates/README.md +++ b/ansible/roles/vulns_adcs_templates/README.md @@ -16,8 +16,7 @@ Deploy vulnerable ADCS certificate templates for attack simulation ### main.yml - **Refresh** (ansible.windows.win_command) -- **Copy ADCSTemplate zip to remote** (ansible.windows.win_copy) -- **Extract ADCSTemplate module** (ansible.windows.win_shell) +- **Copy ADCSTemplate module to remote** (ansible.windows.win_copy) - **Create a directory for templates** (ansible.windows.win_file) - **Install templates** (ansible.windows.win_shell) diff --git a/ansible/roles/vulns_adcs_templates/tasks/main.yml b/ansible/roles/vulns_adcs_templates/tasks/main.yml index 383463bd..aaa91d3e 100644 --- a/ansible/roles/vulns_adcs_templates/tasks/main.yml +++ b/ansible/roles/vulns_adcs_templates/tasks/main.yml @@ -2,19 +2,10 @@ - name: Refresh ansible.windows.win_command: gpupdate /force -- name: Copy ADCSTemplate zip to remote +- name: Copy ADCSTemplate module to remote ansible.windows.win_copy: - src: files/ADCSTemplate.zip - dest: "C:\\Windows\\Temp\\ADCSTemplate.zip" - -- name: Extract ADCSTemplate module - ansible.windows.win_shell: | - $destPath = "C:\Program Files\WindowsPowerShell\Modules\ADCSTemplate" - if (Test-Path $destPath) { - Remove-Item -Path $destPath -Recurse -Force - } - Expand-Archive -Path "C:\Windows\Temp\ADCSTemplate.zip" -DestinationPath "C:\Program Files\WindowsPowerShell\Modules" -Force - Remove-Item -Path "C:\Windows\Temp\ADCSTemplate.zip" -Force + src: files/ADCSTemplate/ + dest: "C:\\Program Files\\WindowsPowerShell\\Modules\\ADCSTemplate\\" - name: Create a directory for templates ansible.windows.win_file: diff --git a/cli/cmd/doctor.go b/cli/cmd/doctor.go index 4a747ae7..7a675b6d 100644 --- a/cli/cmd/doctor.go +++ b/cli/cmd/doctor.go @@ -13,7 +13,7 @@ var doctorCmd = &cobra.Command{ Short: "Run pre-flight system checks", Long: `Verifies that all required tools and configurations are in place. -Common checks: ansible-core version, Python, jq, zip, Ansible collections, inventory. +Common checks: ansible-core version, Python, jq, Ansible collections, inventory. Provider-specific: aws (default) AWS CLI, AWS credentials, Terragrunt, Terraform/Tofu diff --git a/cli/cmd/provision.go b/cli/cmd/provision.go index fe643a99..fafd7abd 100644 --- a/cli/cmd/provision.go +++ b/cli/cmd/provision.go @@ -148,9 +148,6 @@ func preflightChecks(ctx context.Context, cfg *config.Config) error { if err := ansible.BuildCollection(cfg.ProjectRoot); err != nil { return fmt.Errorf("collection build failed: %w", err) } - if err := ansible.PrepareADCSZips(cfg.ProjectRoot); err != nil { - slog.Warn("ADCS zip preparation failed", "error", err) - } if err := ensureVariant(cfg); err != nil { return err } diff --git a/cli/internal/ansible/prepare.go b/cli/internal/ansible/prepare.go index 8377d42f..c201ad01 100644 --- a/cli/internal/ansible/prepare.go +++ b/cli/internal/ansible/prepare.go @@ -88,33 +88,3 @@ func BuildCollection(projectRoot string) error { } return nil } - -// PrepareADCSZips creates the ADCSTemplate.zip files needed by ADCS roles. -func PrepareADCSZips(projectRoot string) error { - dirs := []string{ - filepath.Join(projectRoot, "ansible", "roles", "adcs_templates", "files"), - filepath.Join(projectRoot, "ansible", "roles", "vulns_adcs_templates", "files"), - } - - for _, dir := range dirs { - zipPath := filepath.Join(dir, "ADCSTemplate.zip") - templateDir := filepath.Join(dir, "ADCSTemplate") - - if _, err := os.Stat(zipPath); err == nil { - continue - } - - if _, err := os.Stat(templateDir); os.IsNotExist(err) { - continue - } - - slog.Info("creating ADCS template zip", "dir", dir) - cmd := exec.Command("zip", "-r", "ADCSTemplate.zip", "ADCSTemplate/") - cmd.Dir = dir - if output, err := cmd.CombinedOutput(); err != nil { - slog.Warn("failed to create ADCS zip", "dir", dir, "error", err, "output", string(output)) - return err - } - } - return nil -} diff --git a/cli/internal/doctor/checks.go b/cli/internal/doctor/checks.go index be2d56c8..5bf33baa 100644 --- a/cli/internal/doctor/checks.go +++ b/cli/internal/doctor/checks.go @@ -55,7 +55,6 @@ func RunChecks(opts Options) []CheckResult { results = append(results, checkAnsibleVersion(opts.Provider)) results = append(results, checkCommand("python3", "Python 3")) results = append(results, checkCommand("jq", "jq")) - results = append(results, checkCommand("zip", "zip")) results = append(results, checkInventoryFile(opts.InventoryPath, opts.Provider)) results = append(results, checkAnsibleCollections(opts.Provider)...) diff --git a/docs/mkdocs/docs/providers/ludus.md b/docs/mkdocs/docs/providers/ludus.md index ab2cd9b3..8bb90644 100644 --- a/docs/mkdocs/docs/providers/ludus.md +++ b/docs/mkdocs/docs/providers/ludus.md @@ -15,7 +15,6 @@ - A working Ludus v2 server: [https://docs.ludus.cloud/docs/quick-start/install-ludus/](https://docs.ludus.cloud/docs/quick-start/install-ludus/) - An **admin** user created with an API key -- `zip` package installed on the server (`apt-get install -y zip`) - Packer templates built in Ludus for the required VM images (see [Building Packer Templates](#building-packer-templates) below) !!! tip "Ludus CLI auto-install" @@ -336,20 +335,6 @@ ludus range status qm reset ``` -### ADCS template zip missing - -The ADCS role requires a `cert_templates.zip` file. If provisioning fails at the ADCS stage with a missing zip error: - -```bash -# Ensure zip is installed -apt-get install -y zip - -# Create the zip from the ADCS template files -cd /opt/DreadGOAD/ad/GOAD/providers/ludus -# The provision command handles this automatically, but if needed manually: -zip -r cert_templates.zip cert_templates/ -``` - ### "No running instances found" If health-check or verify-trusts reports no instances, make sure the VMs are powered on: