fix(extension): confine each extension's network to its accepted egress hosts

This commit is contained in:
sam committed 2026-10-05 23:30:52 +11:00
1 parent 143209493a
commit 209ef6f71e
9 files changed
+516 -25

No files matched your search

+1 -1
View File
@@ -85,7 +85,7 @@ func (e *forgeExtensions) start(ctx context.Context, pkg storepkg.Installed, fil
if err != nil {
return nil, err
}
spec := extension.Spec{Name: "forge/" + instance, Path: binary, SHA256: sum, Env: slices.Clone(pkg.AcceptedAuthority.Env)}
spec := extension.Spec{Name: "forge/" + instance, Path: binary, SHA256: sum, Env: slices.Clone(pkg.AcceptedAuthority.Env), Egress: slices.Clone(pkg.AcceptedAuthority.EgressHosts)}
return forgeext.Open(ctx, e.host, forgeext.Instance{Spec: spec, Host: host, Token: token, Settings: settings}, e.log)
}
@@ -93,6 +93,6 @@ func buildExtensionChannel(ctx context.Context, host *extension.Host, source ext
}
resolved[name] = secretValue
}
spec := extension.Spec{Name: "channel/" + pkg.Name, Path: binary, SHA256: sum, Env: slices.Clone(pkg.AcceptedAuthority.Env)}
spec := extension.Spec{Name: "channel/" + pkg.Name, Path: binary, SHA256: sum, Env: slices.Clone(pkg.AcceptedAuthority.Env), Egress: slices.Clone(pkg.AcceptedAuthority.EgressHosts)}
return channelext.New(host, pkg.Name, spec, plain, resolved), nil
}