-
Notifications
You must be signed in to change notification settings - Fork 9
Architecture
Recep Gunes edited this page May 17, 2026
·
2 revisions
The VT ecosystem is split across four repositories that work together.
| Repo | Role |
|---|---|
| vt | Go CLI tool — the main user-facing binary |
| vt-templates | YAML template definitions + Docker Compose files |
| vt-site | Static website at vulnerabletarget.com |
| vt.wiki | This documentation |
┌──────────────────────────────────────────────────────────┐
│ vt-templates │
│ labs/ · cves/ · benchmarks/ · http/ · playbooks/ │
│ index.yaml + docker-compose.yaml per template │
└────────────────────┬─────────────────────────────────────┘
│ git clone / git pull
▼
┌──────────────────────────────────────────────────────────┐
│ vt CLI │
│ - Loads templates from ~/vt-templates/ │
│ - Manages state in ~/.vt-cli/ │
│ - Delegates deployments to providers │
└───────────┬────────────────────────┬─────────────────────┘
│ docker compose up/down │ queries Docker API
▼ ▼
┌────────────────────┐ ┌──────────────────────────────┐
│ Docker containers │ │ vt ps / vt inspect │
│ (labeled with │ │ (reads vt.template-id label)│
│ vt.template-id) │ └──────────────────────────────┘
└────────────────────┘
GitHub Actions
│ generate templates.json
▼
┌──────────────────────────────────────────────────────────┐
│ vt-site │
│ vulnerabletarget.com — searchable catalog │
└──────────────────────────────────────────────────────────┘
vt/
├── cmd/vt/
│ └── main.go # Entry point, wires App and CLI
├── internal/
│ ├── app/ # App struct (templates, playbooks, providers, config)
│ ├── cli/ # Cobra command handlers
│ ├── banner/ # ASCII art banner with reticle pattern (Print + PrintAnimated)
│ ├── logger/ # zerolog wrapper
│ └── file/ # File path utilities
└── pkg/
├── template/ # Template & playbook loading, parsing, validation
│ ├── template.go
│ ├── playbook.go
│ ├── parser.go
│ ├── loader.go # Recursively walks vt-templates dir
│ ├── downloader.go # git clone / pull via go-git
│ └── validator.go
└── provider/
├── provider.go # Provider interface: Start, Stop, Status, List
├── registry/ # Returns map of registered providers
└── dockercompose/ # Docker Compose v2 implementation
App container (internal/app)
Holds all runtime state:
Templates map[string]template.TemplatePlaybooks map[string]template.PlaybookProviders map[string]provider.Provider-
Config *Config(template path, storage path, log level)
Provider interface (pkg/provider)
type Provider interface {
Name() string
Start(template *tmpl.Template) error
Stop(template *tmpl.Template) error
Status(template *tmpl.Template) (string, error)
List() ([]ListDeployment, error)
}Currently only docker-compose is implemented. The interface makes it straightforward to add Kubernetes or cloud providers later.
Template loader (pkg/template/loader.go)
- Clones
vt-templateson first run if the local directory doesn't exist. - Scans top-level category dirs (
labs/,cves/, etc.), then recursively walks each withfilepath.WalkDirlooking for directories that contain anindex.yaml. - Playbooks are loaded from the
playbooks/dir as a special case; all other top-level dirs are treated as template categories. - Enforces that a template's
idfield must match its directory name; duplicate IDs cause a load error.
Docker Compose provider (pkg/provider/dockercompose)
- Uses
docker/composev2 Go library directly (no shell-out). - Injects
vt.template-id(plus standardcom.docker.compose.*) labels into every service at load time vialoadComposeProject. -
List()discovers running deployments by listing all Docker Compose stacks whose project name starts withvt-, then reads thevt.template-idlabel from containers to get the canonical template ID.
| Layer | Technology |
|---|---|
| Language | Go 1.25.6 (as declared in go.mod) |
| CLI framework | Cobra v1.10.2 |
| Logging | zerolog v1.34.0 |
| Table output | go-pretty v6.7.8 |
| YAML parsing | gopkg.in/yaml.v3 |
| Git operations | go-git v5.17.0 |
| Docker integration | docker/compose v2.40.3 |
| Testing | testify v1.11.1 |
| Path | Purpose |
|---|---|
~/vt-templates/ |
Local clone of the vt-templates repository |
~/.vt-cli/ |
CLI state and storage |
The main vt repo uses GitHub Actions for:
- Linting (
golangci-lint) - Tests (
go test ./...) - Build verification
The vt-templates repo uses GitHub Actions to:
- Generate
templates.json(consumed by vt-site) - Validate YAML against the schema
Pre-commit hooks enforce gofmt, yamllint, typos, and hadolint locally.
Vulnerable Target
Usage
Reference
Contributing