Skip to content

Commit 5b3bac6

Browse files
add options to attack surface
1 parent f581a1e commit 5b3bac6

File tree

5 files changed

+30
-6
lines changed

5 files changed

+30
-6
lines changed

examples/nullify.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,7 @@ attack_surface:
115115
enable_dns_enumeration: false
116116
domain_names: [172.36.255.7,example.com]
117117
ignore_domain_names: []
118+
path_prefixes: [/vuln]
119+
ignore_methods: [POST,DELETE]
120+
ignore_ports: [8080]
121+
schemes: ["http","https"]

pkg/merger/merger_test.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,14 @@ func TestMergeConfigFiles(t *testing.T) {
338338
name: "only global config for attack surface monitoring",
339339
globalConfig: &models.Configuration{
340340
AttackSurface: &models.AttackSurface{
341-
Enable: true,
341+
Enable: true,
342342
EnableDNSEnumeration: true,
343-
DomainNames: []string{"example.com"},
344-
IgnoreDomainNames: []string{"example2.com"},
343+
DomainNames: []string{"example.com"},
344+
IgnoreDomainNames: []string{"example2.com"},
345+
PathPrefixes: []string{"/vuln"},
346+
IgnoreMethods: []string{"POST", "DELETE"},
347+
IgnorePorts: []int{8080},
348+
Schemes: []string{"http", "https"},
345349
},
346350
},
347351
repoConfig: nil,
@@ -351,10 +355,14 @@ func TestMergeConfigFiles(t *testing.T) {
351355
SeverityThreshold: parser.DefaultSeverityThreshold,
352356
PriorityThreshold: parser.DefaultPriorityThreshold,
353357
AttackSurface: &models.AttackSurface{
354-
Enable: true,
358+
Enable: true,
355359
EnableDNSEnumeration: true,
356-
DomainNames: []string{"example.com"},
357-
IgnoreDomainNames: []string{"example2.com"},
360+
DomainNames: []string{"example.com"},
361+
IgnoreDomainNames: []string{"example2.com"},
362+
PathPrefixes: []string{"/vuln"},
363+
IgnoreMethods: []string{"POST", "DELETE"},
364+
IgnorePorts: []int{8080},
365+
Schemes: []string{"http", "https"},
358366
},
359367
},
360368
},

pkg/models/attack_surface.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ type AttackSurface struct {
66
EnableDNSEnumeration bool `yaml:"enable_dns_enumeration"`
77
DomainNames []string `yaml:"domain_names,omitempty"`
88
IgnoreDomainNames []string `yaml:"ignore_domain_names,omitempty"`
9+
PathPrefixes []string `yaml:"path_prefixes,omitempty"`
10+
IgnoreMethods []string `yaml:"ignore_methods,omitempty"`
11+
IgnorePorts []int `yaml:"ignore_ports,omitempty"`
12+
Schemes []string `yaml:"schemes"`
913
}

tests/integration_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ func TestIntegration(t *testing.T) {
158158
EnableDNSEnumeration: true,
159159
DomainNames: []string{"172.36.255.7", "example.com"},
160160
IgnoreDomainNames: []string{"jira.example.com"},
161+
PathPrefixes: []string{"/vuln"},
162+
IgnoreMethods: []string{"POST", "DELETE"},
163+
IgnorePorts: []int{8080},
164+
Schemes: []string{"http", "https"},
161165
},
162166
}
163167

tests/nullify.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ attack_surface:
9999
enable_dns_enumeration: true
100100
domain_names: [172.36.255.7,example.com]
101101
ignore_domain_names: [jira.example.com]
102+
path_prefixes: [/vuln]
103+
ignore_methods: [POST,DELETE]
104+
ignore_ports: [8080]
105+
schemes: ["http","https"]

0 commit comments

Comments
 (0)