nuclei/v2/pkg/workflows/workflows.go

40 lines
1.3 KiB
Go
Raw Normal View History

2020-06-26 08:23:54 +00:00
package workflows
import "github.com/projectdiscovery/nuclei/v2/pkg/protocols"
2020-06-29 12:13:08 +00:00
// Workflow is a workflow to execute with chained requests, etc.
2020-06-26 08:23:54 +00:00
type Workflow struct {
// Workflows is a yaml based workflow declaration code.
Workflows []*WorkflowTemplate `yaml:"workflows,omitempty"`
2021-02-22 12:19:02 +00:00
2021-02-23 17:25:29 +00:00
Options *protocols.ExecuterOptions
}
// WorkflowTemplate is a template to be ran as part of a workflow
type WorkflowTemplate struct {
// Template is the template to run
Template string `yaml:"template"`
// Tags to perform filtering of supplied templates on
Tags []string `yaml:"tags"`
// Matchers perform name based matching to run subtemplates for a workflow.
Matchers []*Matcher `yaml:"matchers"`
// Subtemplates are ran if the template matches.
Subtemplates []*WorkflowTemplate `yaml:"subtemplates"`
2021-01-17 07:26:29 +00:00
// Executers perform the actual execution for the workflow template
Executers []*ProtocolExecuterPair
}
// ProtocolExecuterPair is a pair of protocol executer and its options
type ProtocolExecuterPair struct {
Executer protocols.Executer
2021-01-17 07:26:29 +00:00
Options *protocols.ExecuterOptions
}
// Matcher performs conditional matching on the workflow template results.
type Matcher struct {
// Name is the name of the item to match.
Name string `yaml:"name"`
// Subtemplates are ran if the name of matcher matches.
Subtemplates []*WorkflowTemplate `yaml:"subtemplates"`
}