Skip to content

Commit

Permalink
Evaluate all applied posture checks once
Browse files Browse the repository at this point in the history
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
  • Loading branch information
bcmmbaga committed Dec 27, 2024
1 parent c8c2522 commit 076d6d8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions management/server/types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -1319,13 +1319,18 @@ func (a *Account) GetNetworkResourcesRoutesToSync(ctx context.Context, peerID st
}
}

var peerPostureChecks []string
for _, policy := range resourcePolicies[resource.ID] {
// validate the peer based on policy posture checks applied
isValid := a.validatePostureChecksOnPeer(ctx, policy.SourcePostureChecks, peerID)
if !isValid {
continue
}
peerPostureChecks = append(peerPostureChecks, policy.SourcePostureChecks...)
}

// 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() {
group := a.GetGroup(sourceGroup)
if group == nil {
Expand Down

0 comments on commit 076d6d8

Please sign in to comment.