Skip to content

Commit

Permalink
Evaluate all applied posture checks on source peers only
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 076d6d8 commit feb8e90
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions management/server/types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -1319,15 +1319,16 @@ func (a *Account) GetNetworkResourcesRoutesToSync(ctx context.Context, peerID st
}
}

var peerPostureChecks []string
for _, policy := range resourcePolicies[resource.ID] {
peerPostureChecks = append(peerPostureChecks, policy.SourcePostureChecks...)
}
if !addSourcePeers {
var peerPostureChecks []string
for _, policy := range resourcePolicies[resource.ID] {
peerPostureChecks = append(peerPostureChecks, policy.SourcePostureChecks...)
}

// validate the peer based on policy posture checks applied
isValid := a.validatePostureChecksOnPeer(ctx, peerPostureChecks, peerID)
if !isValid {
continue
isValid := a.validatePostureChecksOnPeer(ctx, peerPostureChecks, peerID)
if !isValid {
continue
}
}

for _, policy := range resourcePolicies[resource.ID] {
Expand Down

0 comments on commit feb8e90

Please sign in to comment.