Skip to content

Commit 121bef8

Browse files
modify include and ignore rules
1 parent d5cbf2b commit 121bef8

File tree

4 files changed

+25
-26
lines changed

4 files changed

+25
-26
lines changed

examples/nullify.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ integrations:
113113
attack_surface:
114114
enable: true
115115
enable_dns_enumeration: true
116-
ip_addresses: [10.11.12.13, 10.0.0.1-254]
117-
domain_names: [example.com, prod.hosting.com]
116+
hosts: [example.com, prod.hosting.com, 10.11.12.13, 10.0.0.*]
118117
include_only:
119-
- domain_names: [live.prod.hosting.com]
118+
- hosts: [live.prod.hosting.com]
120119
http:
120+
methods: [GET, POST]
121121
paths: [/main, /api/**/create]
122122
aws_integration:
123123
enable: true
@@ -128,11 +128,11 @@ attack_surface:
128128
ignore:
129129
- http:
130130
methods: [DELETE]
131-
- domain_names: [jira.example.com, "*.testing.example.com"]
132-
- ip_addresses: [100.110.120.130]
131+
- hosts: [jira.example.com, "*.testing.example.com"]
132+
- hosts: [100.110.120.130]
133133
transport_protocols: [tcp]
134134
ports: [22, 8080, 9990-9999]
135-
- domain_names: ["dev.*", "staging.*"]
135+
- hosts: ["dev.*", "staging.*"]
136136
http:
137137
paths: [/auth]
138138
methods: [POST]

pkg/models/attack_surface.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ type AttackSurface struct {
55
Enable bool `yaml:"enable"`
66
EnableDNSEnumeration bool `yaml:"enable_dns_enumeration"`
77
AWSIntegration *AWSIntegration `yaml:"aws_integration"`
8-
IPAddresses []string `yaml:"ip_addresses,omitempty"`
9-
DomainNames []string `yaml:"domain_names,omitempty"`
8+
Hosts []string `yaml:"hosts,omitempty"`
109
IncludeOnly []AttackSurfaceIncludeOnly `yaml:"include_only,omitempty"`
1110
Ignore []AttackSurfaceIgnore `yaml:"ignore,omitempty"`
1211
}
@@ -20,18 +19,18 @@ type AWSIntegration struct {
2019
}
2120

2221
type AttackSurfaceIncludeOnly struct {
23-
DomainNames []string `yaml:"domain_names,omitempty"`
24-
HTTP *HTTPAttackSurfaceIncludeOnly `yaml:"http,omitempty"`
22+
Hosts []string `yaml:"hosts,omitempty"`
23+
HTTP *HTTPAttackSurfaceIncludeOnly `yaml:"http,omitempty"`
2524
}
2625

2726
type HTTPAttackSurfaceIncludeOnly struct {
28-
Paths []string `yaml:"paths,omitempty"`
27+
Methods []string `yaml:"methods,omitempty"`
28+
Paths []string `yaml:"paths,omitempty"`
2929
}
3030

3131
type AttackSurfaceIgnore struct {
3232
// empty fields are equivalent to *
33-
IPAddresses []string `yaml:"ip_addresses,omitempty"`
34-
DomainNames []string `yaml:"domain_names,omitempty"`
33+
Hosts []string `yaml:"hosts,omitempty"`
3534
TransportProtocols []string `yaml:"transport_protocols,omitempty"`
3635
Ports []string `yaml:"ports,omitempty"`
3736
HTTP *HTTPAttackSurfaceIgnore `yaml:"http,omitempty"`

tests/integration_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ func TestIntegration(t *testing.T) {
156156
AttackSurface: &models.AttackSurface{
157157
Enable: true,
158158
EnableDNSEnumeration: true,
159-
IPAddresses: []string{"10.11.12.13", "10.0.0.1-254"},
160-
DomainNames: []string{"example.com", "prod.hosting.com"},
159+
Hosts: []string{"example.com", "prod.hosting.com", "10.11.12.13", "10.0.0.*"},
161160
IncludeOnly: []models.AttackSurfaceIncludeOnly{
162161
{
163-
DomainNames: []string{"live.prod.hosting.com"},
162+
Hosts: []string{"live.prod.hosting.com"},
164163
HTTP: &models.HTTPAttackSurfaceIncludeOnly{
165-
Paths: []string{"/main", "/api/**/create"},
164+
Methods: []string{"GET", "POST"},
165+
Paths: []string{"/main", "/api/**/create"},
166166
},
167167
},
168168
},
@@ -173,15 +173,15 @@ func TestIntegration(t *testing.T) {
173173
},
174174
},
175175
{
176-
DomainNames: []string{"jira.example.com", "*.testing.example.com"},
176+
Hosts: []string{"jira.example.com", "*.testing.example.com"},
177177
},
178178
{
179-
IPAddresses: []string{"100.110.120.130"},
179+
Hosts: []string{"100.110.120.130"},
180180
TransportProtocols: []string{"tcp"},
181181
Ports: []string{"22", "8080", "9990-9999"},
182182
},
183183
{
184-
DomainNames: []string{"dev.*", "staging.*"},
184+
Hosts: []string{"dev.*", "staging.*"},
185185
HTTP: &models.HTTPAttackSurfaceIgnore{
186186
Paths: []string{"/auth"},
187187
Methods: []string{"POST"},

tests/nullify.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,20 @@ integrations:
9797
attack_surface:
9898
enable: true
9999
enable_dns_enumeration: true
100-
ip_addresses: [10.11.12.13, 10.0.0.1-254]
101-
domain_names: [example.com, prod.hosting.com]
100+
hosts: [example.com, prod.hosting.com, 10.11.12.13, 10.0.0.*]
102101
include_only:
103-
- domain_names: [live.prod.hosting.com]
102+
- hosts: [live.prod.hosting.com]
104103
http:
104+
methods: [GET, POST]
105105
paths: [/main, /api/**/create]
106106
ignore:
107107
- http:
108108
methods: [DELETE]
109-
- domain_names: [jira.example.com, "*.testing.example.com"]
110-
- ip_addresses: [100.110.120.130]
109+
- hosts: [jira.example.com, "*.testing.example.com"]
110+
- hosts: [100.110.120.130]
111111
transport_protocols: [tcp]
112112
ports: [22, 8080, 9990-9999]
113-
- domain_names: ["dev.*", "staging.*"]
113+
- hosts: ["dev.*", "staging.*"]
114114
http:
115115
paths: [/auth]
116116
methods: [POST]

0 commit comments

Comments
 (0)