Documentation
¶
Overview ¶
Package publicnet restricts outbound connections to the public internet, for fetches whose destination comes from untrusted input.
Index ¶
- Variables
- func DialContext(dialer *net.Dialer) func(ctx context.Context, network, address string) (net.Conn, error)
- func IsPublicIP(ip net.IP) bool
- func NewHTTPClient() *http.Client
- func RequirePublicHost(ctx context.Context, host string) error
- func ResolvePublic(ctx context.Context, host string) ([]net.IPAddr, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNonPublic = errors.New("non-public address")
Functions ¶
func DialContext ¶
func DialContext(dialer *net.Dialer) func(ctx context.Context, network, address string) (net.Conn, error)
DialContext wraps dialer so it only connects to public addresses, pinning the connection to the address that was checked.
func IsPublicIP ¶
func NewHTTPClient ¶ added in v0.19.1277
func RequirePublicHost ¶
RequirePublicHost rejects host unless every address it resolves to is on the public internet. Callers that then connect should also dial through DialContext, so a record that changes between the check and the connection is still caught.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package templatefetch is the HTTP client for vendor-supplied stack template URLs.
|
Package templatefetch is the HTTP client for vendor-supplied stack template URLs. |
Click to show internal directories.
Click to hide internal directories.