Documentation
¶
Overview ¶
Package httpx is the outbound HTTP layer for everything the scanner fetches: MCP endpoints, package registries, vulnerability data and model providers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndpointSchemes ¶
EndpointSchemes is https only unless the operator allowed an insecure endpoint. A third-party endpoint receives the API key on every request, so plain http would send it, and the declared MCP surface being inspected, in the clear.
func SameOrigin ¶
SameOrigin compares scheme and host, treating a missing port as the scheme's default
func SameOriginRedirect ¶
SameOriginRedirect refuses a redirect that changes scheme or host
Types ¶
type ErrBlocked ¶
ErrBlocked is returned by the dial guard
func (*ErrBlocked) Error ¶
func (e *ErrBlocked) Error() string
type Policy ¶
type Policy struct {
// AllowPrivateNetworks permits loopback, link-local and private-range
// destinations. Off by default: the scanner is pointed at things the
// operator does not trust, and the interesting target for a hostile
// server is the network the scanner runs on.
AllowPrivateNetworks bool
// AllowedSchemes defaults to https and http
AllowedSchemes []string
}
Policy decides which destinations the scanner may reach
func DefaultPolicy ¶
func DefaultPolicy() Policy
DefaultPolicy blocks private destinations and allows only http and https
func (Policy) CheckURL ¶
CheckURL rejects a URL on its scheme and, when the host is a literal address, on the address itself. It is only a fast preflight check; the dial guard is the SSRF boundary because it checks the address actually selected after DNS resolution.
func (Policy) Client ¶
Client builds a guarded http.Client.
Redirects are held to the origin the request started from. A server the scanner does not trust has no legitimate reason to bounce it to another host, and following one is how a credential ends up somewhere it was never meant to go.