Documentation ¶
Index ¶
- Constants
- Variables
- func Copy(src string, dst string) error
- func CopyDir(src string, dest string) error
- func Escape(val string) string
- func IsAlive(target string) (bool, error)
- type AssertFail
- type BucketResults
- type Coverage
- type HubTest
- type HubTestItem
- type HubTestItemConfig
- type NucleiConfig
- type ParserAssert
- func (p *ParserAssert) AssertFile(testFile string) error
- func (p *ParserAssert) AutoGenFromFile(filename string) (string, error)
- func (p *ParserAssert) AutoGenParserAssert() string
- func (p *ParserAssert) EvalExpression(expression string) (string, error)
- func (p *ParserAssert) LoadTest(filename string) error
- func (p *ParserAssert) Run(assert string) (bool, error)
- func (p *ParserAssert) RunExpression(expression string) (interface{}, error)
- type ScenarioAssert
- func (s *ScenarioAssert) AssertFile(testFile string) error
- func (s *ScenarioAssert) AutoGenFromFile(filename string) (string, error)
- func (s *ScenarioAssert) AutoGenScenarioAssert() string
- func (s *ScenarioAssert) EvalExpression(expression string) (string, error)
- func (s *ScenarioAssert) LoadTest(filename string, bucketpour string) error
- func (s *ScenarioAssert) Run(assert string) (bool, error)
- func (s *ScenarioAssert) RunExpression(expression string) (interface{}, error)
Constants ¶
View Source
const ( ParserAssertFileName = "parser.assert" ParserResultFileName = "parser-dump.yaml" ScenarioAssertFileName = "scenario.assert" ScenarioResultFileName = "bucket-dump.yaml" BucketPourResultFileName = "bucketpour-dump.yaml" TestBouncerApiKey = "this_is_a_bad_password" DefaultNucleiTarget = "http://127.0.0.1:7822/" DefaultAppsecHost = "127.0.0.1:4241" )
View Source
const (
TemplateNucleiFile = `` /* 429-byte string literal not displayed */
)
Variables ¶
View Source
var ErrNucleiTemplateFail = errors.New("nuclei template failed")
Functions ¶
Types ¶
type AssertFail ¶
type BucketResults ¶
func LoadScenarioDump ¶
func LoadScenarioDump(filepath string) (*BucketResults, error)
func (BucketResults) Len ¶
func (b BucketResults) Len() int
func (BucketResults) Less ¶
func (b BucketResults) Less(i, j int) bool
func (BucketResults) Swap ¶
func (b BucketResults) Swap(i, j int)
type HubTest ¶
type HubTest struct { CrowdSecPath string CscliPath string HubPath string HubTestPath string //generic parser/scenario tests .tests HubAppsecTestPath string //dir specific to appsec tests .appsec-tests HubIndexFile string TemplateConfigPath string TemplateProfilePath string TemplateSimulationPath string TemplateAcquisPath string TemplateAppsecProfilePath string NucleiTargetHost string AppSecHost string HubIndex *cwhub.Hub Tests []*HubTestItem }
func NewHubTest ¶
func (*HubTest) GetAppsecCoverage ¶ added in v1.6.0
func (*HubTest) GetParsersCoverage ¶
func (*HubTest) GetScenariosCoverage ¶
func (*HubTest) LoadAllTests ¶
func (*HubTest) LoadTestItem ¶
func (h *HubTest) LoadTestItem(name string) (*HubTestItem, error)
type HubTestItem ¶
type HubTestItem struct { Name string Path string CrowdSecPath string CscliPath string RuntimePath string RuntimeHubPath string RuntimeDataPath string RuntimePatternsPath string RuntimeConfigFilePath string RuntimeProfileFilePath string RuntimeSimulationFilePath string RuntimeAcquisFilePath string RuntimeHubConfig *csconfig.LocalHubCfg ResultsPath string ParserResultFile string ScenarioResultFile string BucketPourResultFile string HubPath string HubTestPath string HubIndexFile string TemplateConfigPath string TemplateProfilePath string TemplateSimulationPath string TemplateAcquisPath string TemplateAppsecProfilePath string HubIndex *cwhub.Hub Config *HubTestItemConfig Success bool ErrorsList []string AutoGen bool ParserAssert *ParserAssert ScenarioAssert *ScenarioAssert CustomItemsLocation []string NucleiTargetHost string AppSecHost string }
func (*HubTestItem) Clean ¶
func (t *HubTestItem) Clean() error
func (*HubTestItem) InstallHub ¶
func (t *HubTestItem) InstallHub() error
func (*HubTestItem) Run ¶
func (t *HubTestItem) Run() error
func (*HubTestItem) RunWithLogFile ¶ added in v1.6.0
func (t *HubTestItem) RunWithLogFile() error
func (*HubTestItem) RunWithNucleiTemplate ¶ added in v1.6.0
func (t *HubTestItem) RunWithNucleiTemplate() error
type HubTestItemConfig ¶
type HubTestItemConfig struct { Parsers []string `yaml:"parsers,omitempty"` Scenarios []string `yaml:"scenarios,omitempty"` PostOverflows []string `yaml:"postoverflows,omitempty"` AppsecRules []string `yaml:"appsec-rules,omitempty"` NucleiTemplate string `yaml:"nuclei_template,omitempty"` ExpectedNucleiFailure bool `yaml:"expect_failure,omitempty"` LogFile string `yaml:"log_file,omitempty"` LogType string `yaml:"log_type,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` IgnoreParsers bool `yaml:"ignore_parsers,omitempty"` // if we test a scenario, we don't want to assert on Parser OverrideStatics []parser.ExtraField `yaml:"override_statics,omitempty"` //Allow to override statics. Executed before s00 }
type NucleiConfig ¶ added in v1.6.0
type NucleiConfig struct { Path string `yaml:"nuclei_path"` OutputDir string `yaml:"output_dir"` CmdLineOptions []string `yaml:"cmdline_options"` }
func (*NucleiConfig) RunNucleiTemplate ¶ added in v1.6.0
func (nc *NucleiConfig) RunNucleiTemplate(testName string, templatePath string, target string) error
type ParserAssert ¶
type ParserAssert struct { File string AutoGenAssert bool AutoGenAssertData string NbAssert int Fails []AssertFail Success bool TestData *dumps.ParserResults }
func NewParserAssert ¶
func NewParserAssert(file string) *ParserAssert
func (*ParserAssert) AssertFile ¶
func (p *ParserAssert) AssertFile(testFile string) error
func (*ParserAssert) AutoGenFromFile ¶
func (p *ParserAssert) AutoGenFromFile(filename string) (string, error)
func (*ParserAssert) AutoGenParserAssert ¶
func (p *ParserAssert) AutoGenParserAssert() string
func (*ParserAssert) EvalExpression ¶
func (p *ParserAssert) EvalExpression(expression string) (string, error)
func (*ParserAssert) LoadTest ¶
func (p *ParserAssert) LoadTest(filename string) error
func (*ParserAssert) RunExpression ¶
func (p *ParserAssert) RunExpression(expression string) (interface{}, error)
type ScenarioAssert ¶
type ScenarioAssert struct { File string AutoGenAssert bool AutoGenAssertData string NbAssert int Fails []AssertFail Success bool TestData *BucketResults PourData *dumps.BucketPourInfo }
func NewScenarioAssert ¶
func NewScenarioAssert(file string) *ScenarioAssert
func (*ScenarioAssert) AssertFile ¶
func (s *ScenarioAssert) AssertFile(testFile string) error
func (*ScenarioAssert) AutoGenFromFile ¶
func (s *ScenarioAssert) AutoGenFromFile(filename string) (string, error)
func (*ScenarioAssert) AutoGenScenarioAssert ¶
func (s *ScenarioAssert) AutoGenScenarioAssert() string
func (*ScenarioAssert) EvalExpression ¶
func (s *ScenarioAssert) EvalExpression(expression string) (string, error)
func (*ScenarioAssert) LoadTest ¶
func (s *ScenarioAssert) LoadTest(filename string, bucketpour string) error
func (*ScenarioAssert) RunExpression ¶
func (s *ScenarioAssert) RunExpression(expression string) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.