Add an egress CIDR allowlist to the SSRF guard (closes #204) (#217)
All checks were successful
check / check (push) Successful in 3m1s

This commit was merged in pull request #217.
This commit is contained in:
2026-08-20 10:34:42 +02:00
parent f0512f1c3c
commit 03cd1859d7
17 changed files with 1244 additions and 61 deletions

View File

@@ -18,8 +18,9 @@ func newSSRFTestEngine() *delivery.Engine {
log := slog.New(slog.DiscardHandler)
client := &http.Client{
Timeout: 30 * time.Second,
Transport: delivery.NewSSRFSafeTransport(),
Timeout: 30 * time.Second,
Transport: delivery.NewTestGuard().
NewSSRFSafeTransport(),
}
return delivery.NewTestEngine(log, client, 1)
@@ -36,8 +37,8 @@ func TestClientForConfig_TimeoutKeepsSSRFGuard(t *testing.T) {
engine := newSSRFTestEngine()
blocked := []string{
"http://127.0.0.1/hook",
"http://169.254.169.254/latest/meta-data/",
loopbackHookURL,
metadataURL,
"http://[fe80::1]/hook",
}