INNER CODE UNIT · Go

mixedSeverityFindings

vmfunc/sif · notify_test.go:41

func mixedSeverityFindings() []finding.Finding {
	return []finding.Finding{
		{Target: "https://t.test", Module: "headers", Severity: finding.SeverityInfo, Key: "headers:s", Title: "server"},
		{Target: "https://t.test", Module: "redirect", Severity: finding.SeverityLow, Key: "redirect:r", Title: "open redirect"},
		{Target: "https://t.test", Module: "sql", Severity: finding.SeverityMedium, Key: "sql:e", Title: "db error"},
		{Target: "https://t.test", Module: "cors", Severity: finding.SeverityHigh, Key: "cors:c", Title: "reflected origin"},
		{Target: "https://t.test", Module: "lfi", Severity: finding.SeverityCritical, Key: "lfi:l", Title: "path traversal"},
	}
}

func TestNotifyFindingsSeverityFilter(t *testing.T) {
	tests := []struct {
		name     string
		floor    string
		wantKeys []string
	}{
		{name: "medium drops info+low", floor: "medium", wantKeys: []string{"sql:e", "cors:c", "lfi:l"}},
		{name: "high drops everything below", floor: "high", wantKeys: []string{"cors:c", "lfi:l"}},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…