Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions ansible/roles/adcs_templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 3 additions & 12 deletions ansible/roles/adcs_templates/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions ansible/roles/vulns_adcs_templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
15 changes: 3 additions & 12 deletions ansible/roles/vulns_adcs_templates/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions cli/cmd/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
30 changes: 0 additions & 30 deletions cli/internal/ansible/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 0 additions & 1 deletion cli/internal/doctor/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)...)

Expand Down
15 changes: 0 additions & 15 deletions docs/mkdocs/docs/providers/ludus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -336,20 +335,6 @@ ludus range status
qm reset <VMID>
```

### 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:
Expand Down
Loading