Skip to content

Commit 33fb35f

Browse files
authored
deprecate asm from config (#176)
1 parent 6cd1a7b commit 33fb35f

File tree

7 files changed

+4
-223
lines changed

7 files changed

+4
-223
lines changed

examples/nullify.yaml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -110,31 +110,4 @@ integrations:
110110
assignee:
111111
id: 123456:abcd1234-abcd-1234-abcd-abcde12345666
112112
name: John Smith
113-
aws:
114-
enable: true
115-
primary_account_id: 123456789012
116-
primary_region: ap-southeast-2
117-
target_regions: [ap-southeast-2, us-east-2]
118-
target_accounts: [123456789012, 123456789013]
119-
attack_surface:
120-
enable: true
121-
enable_dns_enumeration: true
122-
hosts: [example.com, prod.hosting.com, 10.11.12.13, 10.0.0.*]
123-
include_only:
124-
- hosts: [live.prod.hosting.com]
125-
transport_protocols: [tcp]
126-
ports: [80, 443]
127-
http:
128-
methods: [GET, POST]
129-
paths: [/main, /api/**/create]
130-
ignore:
131-
- http:
132-
methods: [DELETE]
133-
- hosts: [jira.example.com, "*.testing.example.com"]
134-
- hosts: [100.110.120.130]
135-
transport_protocols: [tcp]
136-
ports: [22, 8080, 9990-9999]
137-
- hosts: ["dev.*", "staging.*"]
138-
http:
139-
paths: [/auth]
140-
methods: [POST]
113+

pkg/merger/merger.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ func MergeConfigFiles(
125125
}
126126
}
127127

128-
if extraConfig.AttackSurface != nil {
129-
config.AttackSurface = extraConfig.AttackSurface
130-
}
131-
132128
if len(extraConfig.Notifications) > 0 && config.Notifications == nil {
133129
config.Notifications = map[string]models.Notification{}
134130
}

pkg/merger/merger_test.go

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

pkg/models/attack_surface.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

pkg/models/models.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ type Configuration struct {
1818
Integrations Integrations `yaml:"integrations,omitempty"`
1919

2020
// features
21-
Code Code `yaml:"code"`
22-
Dependencies Dependencies `yaml:"dependencies"`
23-
Secrets Secrets `yaml:"secrets"`
24-
AttackSurface *AttackSurface `yaml:"attack_surface,omitempty"`
21+
Code Code `yaml:"code"`
22+
Dependencies Dependencies `yaml:"dependencies"`
23+
Secrets Secrets `yaml:"secrets"`
2524

2625
// TODO deprecate
2726
SecretsWhitelist []string `yaml:"secrets_whitelist,omitempty"`

tests/integration_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -154,44 +154,6 @@ func TestIntegration(t *testing.T) {
154154
OnFixTransition: "Done",
155155
},
156156
},
157-
AttackSurface: &models.AttackSurface{
158-
Enable: true,
159-
EnableDNSEnumeration: true,
160-
Hosts: []string{"example.com", "prod.hosting.com", "10.11.12.13", "10.0.0.*"},
161-
IncludeOnly: []models.AttackSurfaceScopingRule{
162-
{
163-
Hosts: []string{"live.prod.hosting.com"},
164-
TransportProtocols: []string{"tcp"},
165-
Ports: []string{"80", "443"},
166-
HTTP: &models.HTTPAttackSurfaceScopingRuleHTTP{
167-
Methods: []string{"GET", "POST"},
168-
Paths: []string{"/main", "/api/**/create"},
169-
},
170-
},
171-
},
172-
Ignore: []models.AttackSurfaceScopingRule{
173-
{
174-
HTTP: &models.HTTPAttackSurfaceScopingRuleHTTP{
175-
Methods: []string{"DELETE"},
176-
},
177-
},
178-
{
179-
Hosts: []string{"jira.example.com", "*.testing.example.com"},
180-
},
181-
{
182-
Hosts: []string{"100.110.120.130"},
183-
TransportProtocols: []string{"tcp"},
184-
Ports: []string{"22", "8080", "9990-9999"},
185-
},
186-
{
187-
Hosts: []string{"dev.*", "staging.*"},
188-
HTTP: &models.HTTPAttackSurfaceScopingRuleHTTP{
189-
Paths: []string{"/auth"},
190-
Methods: []string{"POST"},
191-
},
192-
},
193-
},
194-
},
195157
}
196158

197159
config, err := parser.LoadFromFile("nullify.yaml")

tests/nullify.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,4 @@ integrations:
102102
primary_region: ap-southeast-2
103103
target_regions: [ap-southeast-2, us-east-2]
104104
target_accounts: [123456789012, 123456789013]
105-
attack_surface:
106-
enable: true
107-
enable_dns_enumeration: true
108-
hosts: [example.com, prod.hosting.com, 10.11.12.13, 10.0.0.*]
109-
include_only:
110-
- hosts: [live.prod.hosting.com]
111-
transport_protocols: [tcp]
112-
ports: [80, 443]
113-
http:
114-
methods: [GET, POST]
115-
paths: [/main, /api/**/create]
116-
ignore:
117-
- http:
118-
methods: [DELETE]
119-
- hosts: [jira.example.com, "*.testing.example.com"]
120-
- hosts: [100.110.120.130]
121-
transport_protocols: [tcp]
122-
ports: [22, 8080, 9990-9999]
123-
- hosts: ["dev.*", "staging.*"]
124-
http:
125-
paths: [/auth]
126-
methods: [POST]
127105

0 commit comments

Comments
 (0)