diff --git a/policy/executor/internal/nodes.go b/policy/executor/internal/nodes.go index c80d55b6..7ff229ce 100644 --- a/policy/executor/internal/nodes.go +++ b/policy/executor/internal/nodes.go @@ -550,6 +550,10 @@ func (nodeData *ReportingJobNodeData) score() (*policy.Score, error) { if c.impact.GetScoring() == explorer.ScoringSystem_DISABLED { s.Type = policy.ScoreType_Disabled } else if s.Type == policy.ScoreType_Result { + // If the impact is ignore, then the score type should be Snoozed + if c.impact.GetScoring() == explorer.ScoringSystem_IGNORE_SCORE { + s.Type = policy.ScoreType_Snoozed + } // We cant just forward the score if impact is set and we have a result. // We still need to apply impact to the score if c.impact != nil { diff --git a/policy/resolved_policy_builder.go b/policy/resolved_policy_builder.go index 4f0c0819..1e0eb66a 100644 --- a/policy/resolved_policy_builder.go +++ b/policy/resolved_policy_builder.go @@ -672,6 +672,15 @@ func (b *resolvedPolicyBuilder) gatherGlobalInfoFromPolicy(policy *Policy) { action := normalizeAction(g.Type, c.Action, impact) if action != explorer.Action_UNSPECIFIED && action != explorer.Action_MODIFY { actions[c.Mrn] = action + + // If the action is ignore, then the check is snoozed + if action == explorer.Action_IGNORE { + if impact == nil { + impact = &explorer.Impact{} + } + impact.Scoring = explorer.ScoringSystem_IGNORE_SCORE + impact.Action = explorer.Action_IGNORE + } } if impact != nil { diff --git a/policy/score.go b/policy/score.go index d50daf16..e755840f 100644 --- a/policy/score.go +++ b/policy/score.go @@ -16,6 +16,7 @@ const ( ScoreType_Unscored ScoreType_OutOfScope ScoreType_Disabled + ScoreType_Snoozed ) // TypeLabel prints the score's type in a human-readable way @@ -35,6 +36,8 @@ func (s *Score) TypeLabel() string { return "out of scope" case ScoreType_Disabled: return "disabled" + case ScoreType_Snoozed: + return "snoozed" default: return "unknown type" }