Implement posture check execution in policy

This commit is contained in:
bcmmbaga 2023-12-22 14:25:27 +03:00
parent 3a717368f7
commit ea01ef79f7
No known key found for this signature in database
GPG Key ID: 7249A19D20613553

View File

@ -219,6 +219,21 @@ func (a *Account) getPeerConnectionResources(peerID string) ([]*nbpeer.Peer, []*
continue
}
// TODO: implement posture checks executions based on policy
peer, ok := a.Peers[peerID]
if !ok && peer == nil {
continue
}
if policy.PostureCheck.OSVersionCheck.Enabled {
err := policy.PostureCheck.OSVersionCheck.Check(*peer)
if err != nil {
log.Debugf(err.Error())
continue
}
}
for _, rule := range policy.Rules {
if !rule.Enabled {
continue