Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the main HTTP handler: intercepts downloads, applies SC filter, caches, proxies.
func NewHandler ¶
func NewHandler(cfg HandlerConfig) *Handler
NewHandler creates a new ProxyHandler.
type HandlerConfig ¶
type HandlerConfig struct {
Adapter gate.RegistryAdapter
Filter gate.SCFilter
Cache gate.ArtifactCache
Logger zerolog.Logger
CVEScanner gate.CVEScanner // optional; nil disables CVE scanning
Policy gate.PolicyDecider // optional; nil allows all when CVEScanner is set
AVScanner gate.AVScanner // optional; nil disables malware scanning
Recorder gate.Recorder // optional; nil disables telemetry
// CVERecheckTTL / MalwareRecheckTTL: a cache hit whose respective check is
// older than this re-runs that gate before serving (0 disables). A scanner
// failure serves the stale entry and leaves the timestamp untouched.
CVERecheckTTL time.Duration
MalwareRecheckTTL time.Duration
// MetadataFilterMaxMB caps the decompressed size of a metadata document the
// handler will buffer in order to hide versions policy would block at
// download time. A larger document is streamed through unfiltered, and the
// artifact gate blocks it at download time instead. Zero disables metadata
// filtering entirely.
MetadataFilterMaxMB int
// HTTPClient downloads artifacts and serves transparent proxy requests.
// Optional; nil uses a private client with a 60s timeout. Pass a client whose
// transport caps per-host concurrency (shared with the adapters) so artifact
// downloads count against the same upstream rate limit as metadata fetches.
HTTPClient *http.Client
}
HandlerConfig groups dependencies for the ProxyHandler.
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux routes requests to per-registry handlers by URL path prefix. A request to /<prefix>/... is dispatched to the handler registered for <prefix> with the prefix stripped, so each registry adapter sees the same paths it would without the proxy wrapper.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adapters implements per-registry RegistryAdapter implementations.
|
Package adapters implements per-registry RegistryAdapter implementations. |
|
Package dockerproxy implements a pull-through Docker Registry V2 proxy that gates images on Trivy (CVE/secrets) and ClamAV (signature malware) before serving them.
|
Package dockerproxy implements a pull-through Docker Registry V2 proxy that gates images on Trivy (CVE/secrets) and ClamAV (signature malware) before serving them. |
Click to show internal directories.
Click to hide internal directories.