@@ -300,23 +300,6 @@ func TestMergeConfigFiles(t *testing.T) {
300300 PriorityThreshold : parser .DefaultPriorityThreshold ,
301301 },
302302 },
303- {
304- name : "global and repo config without severity threshold" ,
305- globalConfig : & models.Configuration {
306- SeverityThreshold : "" ,
307- PriorityThreshold : "" ,
308- },
309- repoConfig : & models.Configuration {
310- SeverityThreshold : "" ,
311- PriorityThreshold : "" ,
312- },
313- expected : & models.Configuration {
314- EnablePullRequestReviews : models .Bool (true ),
315- EnableIssueDashboards : models .Bool (true ),
316- SeverityThreshold : parser .DefaultSeverityThreshold ,
317- PriorityThreshold : parser .DefaultPriorityThreshold ,
318- },
319- },
320303 {
321304 name : "global and repo config without severity threshold" ,
322305 globalConfig : & models.Configuration {
@@ -334,94 +317,6 @@ func TestMergeConfigFiles(t *testing.T) {
334317 PriorityThreshold : models .PriorityImportant ,
335318 },
336319 },
337- {
338- name : "only global config for attack surface monitoring" ,
339- globalConfig : & models.Configuration {
340- AttackSurface : & models.AttackSurface {
341- Enable : true ,
342- EnableDNSEnumeration : true ,
343- Hosts : []string {"example.com" , "prod.hosting.com" , "10.11.12.13" , "10.0.0.*" },
344- IncludeOnly : []models.AttackSurfaceScopingRule {
345- {
346- Hosts : []string {"live.prod.hosting.com" },
347- TransportProtocols : []string {"tcp" },
348- Ports : []string {"80" , "443" },
349- HTTP : & models.HTTPAttackSurfaceScopingRuleHTTP {
350- Methods : []string {"GET" , "POST" },
351- Paths : []string {"/main" , "/api/**/create" },
352- },
353- },
354- },
355- Ignore : []models.AttackSurfaceScopingRule {
356- {
357- HTTP : & models.HTTPAttackSurfaceScopingRuleHTTP {
358- Methods : []string {"DELETE" },
359- },
360- },
361- {
362- Hosts : []string {"jira.example.com" , "*.testing.example.com" },
363- },
364- {
365- Hosts : []string {"100.110.120.130" },
366- TransportProtocols : []string {"tcp" },
367- Ports : []string {"22" , "8080" , "9990-9999" },
368- },
369- {
370- Hosts : []string {"dev.*" , "staging.*" },
371- HTTP : & models.HTTPAttackSurfaceScopingRuleHTTP {
372- Paths : []string {"/auth" },
373- Methods : []string {"POST" },
374- },
375- },
376- },
377- },
378- },
379- repoConfig : nil ,
380- expected : & models.Configuration {
381- EnablePullRequestReviews : models .Bool (true ),
382- EnableIssueDashboards : models .Bool (true ),
383- SeverityThreshold : parser .DefaultSeverityThreshold ,
384- PriorityThreshold : parser .DefaultPriorityThreshold ,
385- AttackSurface : & models.AttackSurface {
386- Enable : true ,
387- EnableDNSEnumeration : true ,
388- Hosts : []string {"example.com" , "prod.hosting.com" , "10.11.12.13" , "10.0.0.*" },
389- IncludeOnly : []models.AttackSurfaceScopingRule {
390- {
391- Hosts : []string {"live.prod.hosting.com" },
392- TransportProtocols : []string {"tcp" },
393- Ports : []string {"80" , "443" },
394- HTTP : & models.HTTPAttackSurfaceScopingRuleHTTP {
395- Methods : []string {"GET" , "POST" },
396- Paths : []string {"/main" , "/api/**/create" },
397- },
398- },
399- },
400- Ignore : []models.AttackSurfaceScopingRule {
401- {
402- HTTP : & models.HTTPAttackSurfaceScopingRuleHTTP {
403- Methods : []string {"DELETE" },
404- },
405- },
406- {
407- Hosts : []string {"jira.example.com" , "*.testing.example.com" },
408- },
409- {
410- Hosts : []string {"100.110.120.130" },
411- TransportProtocols : []string {"tcp" },
412- Ports : []string {"22" , "8080" , "9990-9999" },
413- },
414- {
415- Hosts : []string {"dev.*" , "staging.*" },
416- HTTP : & models.HTTPAttackSurfaceScopingRuleHTTP {
417- Paths : []string {"/auth" },
418- Methods : []string {"POST" },
419- },
420- },
421- },
422- },
423- },
424- },
425320 } {
426321 t .Run (scenario .name , func (t * testing.T ) {
427322 config := MergeConfigFiles (parser .NewDefaultConfig (), scenario .globalConfig , scenario .repoConfig )
0 commit comments