Skip to content

Commit 9ef4b52

Browse files
CopilotMossaka
andauthored
Expand Java ecosystem allowlist for firewall-enabled workflows (#12400)
* Initial plan * chore: plan domain additions for java profile Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> * feat: expand java ecosystem allowed domains Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> Co-authored-by: Jiaxiao Zhou <duibao55328@gmail.com>
1 parent f94a16e commit 9ef4b52

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

pkg/workflow/data/ecosystem_domains.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@
8686
"repo.grails.org",
8787
"download.eclipse.org",
8888
"download.oracle.com",
89-
"jcenter.bintray.com"
89+
"jcenter.bintray.com",
90+
"dlcdn.apache.org",
91+
"archive.apache.org",
92+
"download.java.net",
93+
"api.foojay.io",
94+
"cdn.azul.com"
9095
],
9196
"linux-distros": [
9297
"deb.debian.org",

pkg/workflow/ecosystem_domains_test.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,37 @@ func TestEcosystemDomainExpansion(t *testing.T) {
171171
}
172172
})
173173

174+
t.Run("java ecosystem includes Java package and tooling domains", func(t *testing.T) {
175+
permissions := &NetworkPermissions{
176+
Allowed: []string{"java"},
177+
}
178+
domains := GetAllowedDomains(permissions)
179+
180+
expectedDomains := []string{
181+
"repo.maven.apache.org",
182+
"services.gradle.org",
183+
"download.oracle.com",
184+
"dlcdn.apache.org",
185+
"archive.apache.org",
186+
"download.java.net",
187+
"api.foojay.io",
188+
"cdn.azul.com",
189+
}
190+
191+
for _, expectedDomain := range expectedDomains {
192+
found := false
193+
for _, domain := range domains {
194+
if domain == expectedDomain {
195+
found = true
196+
break
197+
}
198+
}
199+
if !found {
200+
t.Errorf("Expected domain '%s' to be included in java ecosystem, but it was not found", expectedDomain)
201+
}
202+
}
203+
})
204+
174205
t.Run("node ecosystem includes Node.js package domains", func(t *testing.T) {
175206
permissions := &NetworkPermissions{
176207
Allowed: []string{"node"},

0 commit comments

Comments
 (0)