Documentation
¶
Overview ¶
Package netguard holds the shared private-address egress guard used by notification adapters and synthetic checks. Validation happens both at save time (friendly errors) and at dial time (DNS-rebinding safe).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GuardedDialContext ¶
func GuardedDialContext(timeout time.Duration) func(ctx context.Context, network, addr string) (net.Conn, error)
GuardedDialContext returns a DialContext that re-checks the resolved address at connection time, so a hostname cannot pass save-time validation and then be re-pointed at a private address (DNS rebinding).
func IsPrivateIP ¶
func ValidateHost ¶
ValidateHost resolves a hostname and rejects it when any address is private/loopback/link-local/CGNAT.
func ValidateURL ¶
ValidateURL rejects an http(s) destination that resolves to the server's own network. Callers decide whether the guard applies (allowPrivate=true short-circuits).
Types ¶
This section is empty.