Skip to content

feat: introduce Go CLI health check, trust verification, and per-environment variants#63

Merged
l50 merged 8 commits into
mainfrom
feat/cli-additions
Apr 1, 2026
Merged

feat: introduce Go CLI health check, trust verification, and per-environment variants#63
l50 merged 8 commits into
mainfrom
feat/cli-additions

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented Apr 1, 2026

Key Changes:

  • Added health-check and verify-trusts commands to the Go CLI for lab validation
  • Introduced per-environment variant configuration and auto-generation in provisioning
  • Default environment changed to staging for safer operation
  • Deprecated Taskfile-based orchestration in favor of the Go CLI

Added:

  • Go CLI command health-check for automated instance and service validation across AD lab, verifying DCs, replication, trusts, DNS, membership, and critical services
  • Go CLI command verify-trusts for comprehensive domain trust verification, including cross-domain authentication checks
  • Per-environment variant settings (variant, variant_source, variant_target, variant_name) in CLI config, with auto-generation of variants on provision
  • Quick validation mode (--quick) for validate command to rapidly check critical vulnerabilities
  • Documentation on CLI configuration and per-environment variant support in docs/configuration.md

Changed:

  • Default environment is now staging (was dev) in CLI flags, config defaults, and config generation
  • Provisioning (provision command) now auto-generates a randomized GOAD variant if required by the active environment
  • CLI config file now includes an environments section for per-env overrides and variant control
  • validate command supports a --quick flag for fast checks of core vulnerabilities
  • All references and usage instructions in README.md now point to the Go CLI (dreadgoad) instead of Taskfile
  • CLI command-line flags and config logic use new per-environment structure and defaults

Removed:

  • Entire Taskfile.yaml and Taskfile-based orchestration, replaced by the Go CLI as the primary interface for provisioning, validation, and health checks

…ariants, and config docs

**Added:**

- Introduced `health-check` CLI command for SSM-based instance health and service verification (`cli/cmd/health_check.go`)
- Added `verify-trusts` CLI command to validate domain trust relationships and cross-domain queries (`cli/cmd/verify_trusts.go`)
- Documented configuration, per-environment settings, and variant support in `docs/configuration.md`
- Implemented `RunQuickChecks` method for fast validation of critical vulns in the validator

**Changed:**

- Updated default environment to `staging` across CLI flags, config, and defaults for safer operations
- Enhanced `dreadgoad provision` to auto-generate randomized GOAD variants if environment specifies `variant: true`
- Improved `variant generate` to use environment config as defaults if CLI flags are not set
- Extended config to support per-environment settings, including variant parameters (`cli/internal/config/config.go`)
- Modified `validate` command to support `--quick` flag for quick validation mode
- Refreshed README to document new CLI workflows, replacing Taskfile usage with `dreadgoad` commands and updated feature summary

**Removed:**

- Removed `Taskfile.yaml` and all Taskfile-based orchestration in favor of Go CLI commands for orchestration and validation
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added area/taskfiles Changes made to taskfiles area/readme Changes made to README.md file area/docs Changes made to documentation labels Apr 1, 2026
l50 added 5 commits April 1, 2026 15:01
build: add minimal Taskfile with remote include for pre-commit tasks


**Added:**

- Introduced a minimal Taskfile.yaml to support CI pre-commit tasks via remote
  include, delegating most operations to the Go CLI (dreadgoad)
**Added:**

- Introduced `nonEmptyEval` helper to generalize checks for non-empty output
- Added `replEval`, `dc01TrustsEval`, `forestTrustEval`, and `dcLocatorEval`
  functions to encapsulate specific health check evaluations

**Changed:**

- Refactored health check definitions to use new eval helpers instead of inline
  anonymous functions, improving readability and maintainability

**Removed:**

- Removed repetitive anonymous eval functions for domain controller, DNS,
  trust, and domain membership checks in favor of shared helpers
**Added:**

- Introduced `infra.go` providing `requireInfra`, which validates AWS credentials,
  discovers GOAD instances, and checks SSM agent status, returning a unified
  infrastructure context for commands.
- Added `preflight.go` in `internal/aws` implementing `VerifyCredentials` to
  validate AWS credentials and `CheckSSMStatus` to check SSM agent status for
  instances.

**Changed:**

- Refactored `health_check.go`, `validate.go`, and `verify_trusts.go` to use
  `requireInfra` for infrastructure validation and host discovery, removing
  duplicate logic and direct AWS client instantiation.
- Updated command output to reflect new infra context usage, including
  environment and region display.
- Modified AWS `Client` struct to include an STS client for credential
  verification.
- Updated `go.mod` to move `github.com/aws/aws-sdk-go-v2/service/sts` from
  indirect to direct dependency.

**Removed:**

- Eliminated redundant per-command code for AWS credential, region, and host
  discovery logic, consolidating these concerns into shared infra utilities.
**Changed:**

- Replaced fmt.Sprintf with direct string assignment for title formatting in
  health check and trust verification commands to streamline code and improve
  readability
**Added:**

- Appended logic to add a trailing newline to generated SVG files to prevent
  end-of-file fixer warnings or unnecessary changes

**Changed:**

- Updated `render_svg` in the diagram generation script to always write a
  trailing newline to the SVG output for consistent file formatting
- Ensured `architecture.svg` ends with a newline character for compliance with
  formatting tools and improved diff clarity
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added the area/pre-commit Changes made to pre-commit hooks label Apr 1, 2026
l50 added 2 commits April 1, 2026 16:20
chore: remove Taskfile to defer task management to Go CLI


**Removed:**

- Removed `Taskfile.yaml` to consolidate task management within the Go CLI
  (`dreadgoad`) and rely on it for operations previously handled by Taskfile
docs: update validation docs to focus on CLI usage, remove taskfile references


**Added:**

- Renamed `configuration.md` to `cli.md` to serve as the central reference for
  CLI usage and configuration
**Changed:**

- Rewrote validation instructions to use the `dreadgoad` CLI instead of Taskfile
  commands, simplifying usage examples and reflecting current best practices
- Updated troubleshooting, advanced usage, and CI/CD integration examples to use
  `dreadgoad` CLI flags and commands rather than shell scripts or Taskfile calls
- Replaced references to `taskfile.md` with `cli.md` in related documentation
  links to align with documentation renaming

**Removed:**

- Deleted Taskfile usage documentation (`docs/taskfile.md`) as CLI is now the
  preferred interface for managing and validating GOAD environments
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added the area/github Changes made to github actions label Apr 1, 2026
@l50 l50 merged commit 7948155 into main Apr 1, 2026
6 checks passed
@l50 l50 deleted the feat/cli-additions branch April 1, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Changes made to documentation area/github Changes made to github actions area/pre-commit Changes made to pre-commit hooks area/readme Changes made to README.md file area/taskfiles Changes made to taskfiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant