Prepare intel entity data earlier in the decision process

This commit is contained in:
Patrick Pacher
2021-08-18 16:38:54 +02:00
parent f428f338b5
commit 88eb252ecb
5 changed files with 8 additions and 17 deletions

View File

@@ -17,10 +17,6 @@ type EndpointLists struct {
// Matches checks whether the given entity matches this endpoint definition.
func (ep *EndpointLists) Matches(ctx context.Context, entity *intel.Entity) (EPResult, Reason) {
if !entity.LoadLists(ctx) {
return Undeterminable, nil
}
if entity.MatchLists(ep.ListSet) {
return ep.match(ep, entity, ep.Lists, "filterlist contains", "filterlist", entity.ListBlockReason())
}

View File

@@ -326,8 +326,6 @@ func (lp *LayeredProfile) MatchFilterLists(ctx context.Context, entity *intel.En
for _, layer := range lp.layers {
// Search for the first layer that has filter lists set.
if layer.filterListsSet {
entity.LoadLists(ctx)
if entity.MatchLists(layer.filterListIDs) {
return endpoints.Denied, entity.ListBlockReason()
}
@@ -339,8 +337,6 @@ func (lp *LayeredProfile) MatchFilterLists(ctx context.Context, entity *intel.En
cfgLock.RLock()
defer cfgLock.RUnlock()
if len(cfgFilterLists) > 0 {
entity.LoadLists(ctx)
if entity.MatchLists(cfgFilterLists) {
return endpoints.Denied, entity.ListBlockReason()
}