Documentation
¶
Index ¶
- Variables
- func IsHTTPBasedProtocolUsed(store *Store) bool
- type Config
- type ContentType
- type RemoteContent
- type Store
- func (store *Store) Load()
- func (store *Store) LoadTemplates(templatesList []string) []*templates.Template
- func (store *Store) LoadTemplatesOnlyMetadata() error
- func (store *Store) LoadTemplatesWithTags(templatesList, tags []string) []*templates.Template
- func (store *Store) LoadWorkflows(workflowsList []string) []*templates.Template
- func (store *Store) ReadTemplateFromURI(uri string, remote bool) ([]byte, error)
- func (store *Store) RegisterPreprocessor(preprocessor templates.Preprocessor)
- func (store *Store) Templates() []*templates.Template
- func (store *Store) ValidateTemplates() error
- func (store *Store) Workflows() []*templates.Template
Constants ¶
This section is empty.
Variables ¶
var (
TrustedTemplateDomains = []string{"cloud.projectdiscovery.io"}
)
Functions ¶
func IsHTTPBasedProtocolUsed ¶
IsHTTPBasedProtocolUsed returns true if http/headless protocol is being used for any templates.
Types ¶
type Config ¶
type Config struct {
Templates []string
TemplateURLs []string
Workflows []string
WorkflowURLs []string
ExcludeTemplates []string
IncludeTemplates []string
RemoteTemplateDomainList []string
Tags []string
ExcludeTags []string
Protocols templateTypes.ProtocolTypes
ExcludeProtocols templateTypes.ProtocolTypes
Authors []string
Severities severity.Severities
ExcludeSeverities severity.Severities
IncludeTags []string
IncludeIds []string
ExcludeIds []string
IncludeConditions []string
Catalog catalog.Catalog
ExecutorOptions protocols.ExecutorOptions
}
Config contains the configuration options for the loader
type ContentType ¶
type ContentType string
const ( Template ContentType = "Template" Workflow ContentType = "Workflow" )
type RemoteContent ¶
type RemoteContent struct {
Content []string
Type ContentType
Error error
}
type Store ¶
type Store struct {
// NotFoundCallback is called for each not found template
// This overrides error handling for not found templates
NotFoundCallback func(template string) bool
// contains filtered or unexported fields
}
Store is a storage for loaded nuclei templates
func (*Store) Load ¶
func (store *Store) Load()
Load loads all the templates from a store, performs filtering and returns the complete compiled templates for a nuclei execution configuration.
func (*Store) LoadTemplates ¶
LoadTemplates takes a list of templates and returns paths for them
func (*Store) LoadTemplatesOnlyMetadata ¶
LoadTemplatesOnlyMetadata loads only the metadata of the templates
func (*Store) LoadTemplatesWithTags ¶
LoadTemplatesWithTags takes a list of templates and extra tags returning templates that match.
func (*Store) LoadWorkflows ¶
LoadWorkflows takes a list of workflows and returns paths for them
func (*Store) ReadTemplateFromURI ¶
ReadTemplateFromURI should only be used for viewing templates and should not be used anywhere else like loading and executing templates there is no sandbox restriction here
func (*Store) RegisterPreprocessor ¶
func (store *Store) RegisterPreprocessor(preprocessor templates.Preprocessor)
RegisterPreprocessor allows a custom preprocessor to be passed to the store to run against templates
func (*Store) ValidateTemplates ¶
ValidateTemplates takes a list of templates and validates them erroring out on discovering any faulty templates.