fix(sandbox-control): allow github.com by default so public repos clone without a GitHub App install (#34)

This commit is contained in:
Neil
2026-11-09 04:31:59 -08:00
committed by GitHub
parent 2c75223dca
commit e232ea8580
2 changed files with 7 additions and 0 deletions
@@ -33,6 +33,9 @@ export const DEFAULT_EGRESS_ALLOWLIST: readonly string[] = [
'nodejs.org',
'archive.ubuntu.com',
'security.ubuntu.com',
// Public clones/fetches work without a GitHub App install; a minted repo token adds the credential
// route on top (placeholder in, real token out, everything else on that host 403s).
'github.com',
'codeload.github.com',
'objects.githubusercontent.com',
'raw.githubusercontent.com',
@@ -50,6 +50,10 @@ describe('compileNetworkPolicy', () => {
})
})
it('allows github.com by default so public repos clone without a GitHub App install', () => {
expect(compileNetworkPolicy({ mode: 'allowlist' }).allow['github.com']).toEqual([])
})
it('adds the wildcard only when a workspace opts into open egress', () => {
expect(compileNetworkPolicy({ mode: 'open', allowlist: [] })).toEqual({ allow: { '*': [] } })
})