Add wildcard port matching test to endpoints
This commit is contained in:
@@ -357,7 +357,7 @@ func TestEndpointMatching(t *testing.T) { //nolint:maintidx // TODO
|
|||||||
|
|
||||||
// ASN
|
// ASN
|
||||||
|
|
||||||
ep, err = parseEndpoint("+ AS15169")
|
ep, err = parseEndpoint("+ AS15169")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -400,6 +400,20 @@ func TestEndpointMatching(t *testing.T) { //nolint:maintidx // TODO
|
|||||||
entity.SetIP(net.ParseIP("151.101.1.164")) // nytimes.com
|
entity.SetIP(net.ParseIP("151.101.1.164")) // nytimes.com
|
||||||
testEndpointMatch(t, ep, entity, NoMatch)
|
testEndpointMatch(t, ep, entity, NoMatch)
|
||||||
|
|
||||||
|
// Port with protocol wildcard
|
||||||
|
|
||||||
|
ep, err = parseEndpoint("+ * */443")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
entity = &intel.Entity{
|
||||||
|
Domain: "",
|
||||||
|
IP: net.ParseIP("10.2.3.4"),
|
||||||
|
Protocol: 6,
|
||||||
|
Port: 443,
|
||||||
|
}
|
||||||
|
testEndpointMatch(t, ep, entity, Permitted)
|
||||||
|
|
||||||
// Lists
|
// Lists
|
||||||
|
|
||||||
// Skip test that need the filter lists in CI.
|
// Skip test that need the filter lists in CI.
|
||||||
|
|||||||
Reference in New Issue
Block a user