Documentation
¶
Overview ¶
Package template provides functionality for loading and managing vulnerable target environment templates.
Index ¶
- Constants
- func GetDockerComposePath(templateID, repoPath string) (composePath string, workingDir string, err error)
- func ListTemplates(templates map[string]Template)
- func ListTemplatesWithFilter(templates map[string]Template, filterTag string)
- func LoadTemplates(repoPath string) (map[string]Template, error)
- func SyncTemplates(repoPath string) error
- type Cvss
- type Info
- type ProviderConfig
- type Template
Constants ¶
const TemplateRemoteRepository string = "https://github.com/HappyHackingSpace/vt-templates"
TemplateRemoteRepository is a constant for repo url.
Variables ¶
This section is empty.
Functions ¶
func GetDockerComposePath ¶ added in v0.0.2
func GetDockerComposePath(templateID, repoPath string) (composePath string, workingDir string, err error)
GetDockerComposePath finds and returns the docker-compose file path for a given template ID. It searches through all category directories in the templates repository to locate the template. Returns the absolute path to the compose file and the working directory.
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.