This PR implements the foundation for Template Profile Improvements as described in #5567.
Currently, template profiles require commenting out metadata fields. This PR enables ignoring extra fields gracefully.
type TemplateProfile struct {
// Metadata fields (ignored during processing)
Name string `yaml:"name,omitempty"`
Purpose string `yaml:"purpose,omitempty"`
Description string `yaml:"description,omitempty"`
ID string `yaml:"id,omitempty"`
// Targets
List string `yaml:"list,omitempty"`
// Template config
Type []string `yaml:"type,omitempty"`
ExcludeTags []string `yaml:"exclude-tags,omitempty"`
// Options
TemplateConcurrency int `yaml:"template-concurrency,omitempty"`
HostConcurrency int `yaml:"host-concurrency,omitempty"`
Stats bool `yaml:"stats,omitempty"`
Timeout int `yaml:"timeout,omitempty"`
// Secrets (embedded auth data)
Secrets SecretsConfig `yaml:"secrets,omitempty"`
}
name, purpose, description, id are recognized but ignored during processingname: projectdiscovery-scan
purpose: Config File for Scanning
description: Single config file for target-specific scanning
# targets list file
list: |
cve.projectdiscovery.io
chaos.projectdiscovery.io
# templates related config
type:
- http
- tcp
- javascript
exclude-tags:
- dos
- fuzz
# other options
template-concurrency: 5
host-concurrency: 100
stats: true
timeout: 30
# Secrets
secrets:
static:
- type: header
domains:
- api.projectdiscovery.io
headers:
- key: x-pdcp-key
value: <api-key-here>
This is Phase 1 of the implementation. Future phases will include:
Fixes: #5567 (Phase 1)
/claim #5567
EthanHan
@EthanHan
ProjectDiscovery
@projectdiscovery
starmovie12
@starmovie12