Documentation
¶
Overview ¶
Package template provides functionality for loading and managing vulnerable target environment templates.
Index ¶
Constants ¶
const TemplateRemoteRepository string = "https://github.com/HappyHackingSpace/vt-templates"
TemplateRemoteRepository is a constant for repo url.
Variables ¶
This section is empty.
Functions ¶
func ListTemplates ¶
ListTemplates displays all available templates in a table format.
func ListTemplatesWithFilter ¶
ListTemplatesWithFilter displays templates in a table format, optionally filtered by tag.
func LoadTemplates ¶
LoadTemplates loads all templates from the given repository path. If the repository doesn't exist, it clones it first. Returns a map of templates indexed by their ID.
func SyncTemplates ¶
SyncTemplates downloads or updates all templates from the remote repository.
Types ¶
type Info ¶
type Info struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Author string `yaml:"author"`
Targets []string `yaml:"targets"`
Type string `yaml:"type"`
AffectedVersions []string `yaml:"affected_versions"`
FixedVersion string `yaml:"fixed_version"`
Cwe string `yaml:"cwe"`
Cvss Cvss `yaml:"cvss"`
Tags []string `yaml:"tags"`
References []string `yaml:"references"`
}
Info contains metadata about a template.
type ProviderConfig ¶
type ProviderConfig struct {
Path string `yaml:"path"`
}
ProviderConfig contains configuration for a specific provider.
func (ProviderConfig) Validate ¶
func (pc ProviderConfig) Validate(templateID, name string) error
Validate validates the provider configuration structure and content.
type Template ¶
type Template struct {
ID string `yaml:"id"`
Info Info `yaml:"info"`
ProofOfConcept map[string][]string `yaml:"poc"`
Remediation []string `yaml:"remediation"`
Providers map[string]ProviderConfig `yaml:"providers"`
PostInstall []string `yaml:"post-install"`
}
Template represents a vulnerable target environment configuration.
func LoadTemplate ¶
LoadTemplate loads a template from the specified filepath by reading the index.yaml file.