nuclei/v2/pkg/workflows/workflows.go
2021-07-27 16:03:56 +05:30

52 lines
1.7 KiB
Go

package workflows
import "github.com/projectdiscovery/nuclei/v2/pkg/protocols"
// Workflow is a workflow to execute with chained requests, etc.
type Workflow struct {
// description: |
// Workflows is a list of workflows to execute for a template.
Workflows []*WorkflowTemplate `yaml:"workflows,omitempty"`
Options *protocols.ExecuterOptions
}
// WorkflowTemplate is a template to be ran as part of a workflow
type WorkflowTemplate struct {
// description: |
// Template is a single template or directory to execute as part of workflow.
// examples:
// - name: A single template
// value: "\"dns/worksites-detection.yaml\""
// - name: A template directory
// value: "\"misconfigurations/aem\""
Template string `yaml:"template"`
// description: |
// Tags to run templates based on.
Tags string `yaml:"tags"`
// description: |
// Matchers perform name based matching to run subtemplates for a workflow.
Matchers []*Matcher `yaml:"matchers"`
// description: |
// Subtemplates are ran if the `template` field Template matches.
Subtemplates []*WorkflowTemplate `yaml:"subtemplates"`
// 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
Options *protocols.ExecuterOptions
}
// Matcher performs conditional matching on the workflow template results.
type Matcher struct {
// description: |
// Name is the name of the item to match.
Name string `yaml:"name"`
// description: |
// Subtemplates are ran if the name of matcher matches.
Subtemplates []*WorkflowTemplate `yaml:"subtemplates"`
}