Documentation
¶
Overview ¶
Package netgate issues the only HTTP clients and DNS resolvers a module may use. Authorization is enforced in the transport rather than in calling code, so a module cannot reach an unauthorized host by forgetting a check: the dial is refused before a packet leaves the process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Class ¶
type Class string
Class is a module's declared activity. It decides which hosts the module's clients will dial at all.
func ParseClass ¶
ParseClass validates an activity class read from a descriptor or config.
type Gate ¶
type Gate struct {
// contains filtered or unexported fields
}
Gate holds the policy for a run and records every refusal.
func (*Gate) HTTPClient ¶
HTTPClient returns a client that refuses to dial any host outside grant.
func (*Gate) Permits ¶
Permits exposes the run's policy for recording an asset's in-scope flag. It answers a question; it does not authorize a connection.
func (*Gate) Violations ¶
Violations returns every refusal recorded so far.
type Grant ¶
type Grant struct {
ModuleID string
Class Class
// Endpoints are provider hostnames a passive module may reach. An entry
// may be a wildcard such as "*.crt.sh".
Endpoints []string
}
Grant is what a module is allowed to talk to. The pipeline builds it from the module's descriptor; a module never constructs its own.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver is the only DNS entry point a module gets. A passive module is handed one that refuses every name: resolving a discovered host is active work, and the provider hostname a passive module talks to is resolved inside the HTTP dial, not here.
func (*Resolver) LookupCNAME ¶
LookupCNAME returns the canonical name for host.
type Violation ¶
Violation is an attempt to reach a host the policy did not authorize. It is returned to the caller as an error and recorded on the Gate, because a module that swallows the error must still show up in the run summary.
func AsViolation ¶
AsViolation reports whether err was caused by a refused dial.