mirror of
https://github.com/netbirdio/netbird.git
synced 2025-02-02 19:39:17 +01:00
Evaluate all applied posture checks once
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
parent
c8c25221bd
commit
076d6d8a87
@ -1319,13 +1319,18 @@ func (a *Account) GetNetworkResourcesRoutesToSync(ctx context.Context, peerID st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var peerPostureChecks []string
|
||||||
for _, policy := range resourcePolicies[resource.ID] {
|
for _, policy := range resourcePolicies[resource.ID] {
|
||||||
// validate the peer based on policy posture checks applied
|
peerPostureChecks = append(peerPostureChecks, policy.SourcePostureChecks...)
|
||||||
isValid := a.validatePostureChecksOnPeer(ctx, policy.SourcePostureChecks, peerID)
|
}
|
||||||
if !isValid {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// validate the peer based on policy posture checks applied
|
||||||
|
isValid := a.validatePostureChecksOnPeer(ctx, peerPostureChecks, peerID)
|
||||||
|
if !isValid {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, policy := range resourcePolicies[resource.ID] {
|
||||||
for _, sourceGroup := range policy.SourceGroups() {
|
for _, sourceGroup := range policy.SourceGroups() {
|
||||||
group := a.GetGroup(sourceGroup)
|
group := a.GetGroup(sourceGroup)
|
||||||
if group == nil {
|
if group == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user