mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
fix: correctly check denied domains and ips for actions (#8810)
# Which Problems Are Solved System administrators can block hosts and IPs for HTTP calls in actions. Using DNS, blocked IPs could be bypassed. # How the Problems Are Solved - Hosts are resolved (DNS lookup) to check whether their corresponding IP is blocked. # Additional Changes - Added complete lookup ip address range and "unspecified" address to the default `DenyList`
This commit is contained in:
@@ -47,9 +47,9 @@ Log:
|
||||
`},
|
||||
want: func(t *testing.T, config *Config) {
|
||||
assert.Equal(t, config.Actions.HTTP.DenyList, []actions.AddressChecker{
|
||||
&actions.DomainChecker{Domain: "localhost"},
|
||||
&actions.IPChecker{IP: net.ParseIP("127.0.0.1")},
|
||||
&actions.DomainChecker{Domain: "foobar"}})
|
||||
&actions.HostChecker{Domain: "localhost"},
|
||||
&actions.HostChecker{IP: net.ParseIP("127.0.0.1")},
|
||||
&actions.HostChecker{Domain: "foobar"}})
|
||||
},
|
||||
}, {
|
||||
name: "actions deny list string ok",
|
||||
@@ -63,9 +63,9 @@ Log:
|
||||
`},
|
||||
want: func(t *testing.T, config *Config) {
|
||||
assert.Equal(t, config.Actions.HTTP.DenyList, []actions.AddressChecker{
|
||||
&actions.DomainChecker{Domain: "localhost"},
|
||||
&actions.IPChecker{IP: net.ParseIP("127.0.0.1")},
|
||||
&actions.DomainChecker{Domain: "foobar"}})
|
||||
&actions.HostChecker{Domain: "localhost"},
|
||||
&actions.HostChecker{IP: net.ParseIP("127.0.0.1")},
|
||||
&actions.HostChecker{Domain: "foobar"}})
|
||||
},
|
||||
}, {
|
||||
name: "features ok",
|
||||
|
Reference in New Issue
Block a user