We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2994487 commit 89fbf1bCopy full SHA for 89fbf1b
1 file changed
internal/app/app.go
@@ -160,6 +160,16 @@ func (a *App) Process(ctx context.Context, evt events.SecurityHubEventInput) err
160
a.Logger.Debug("finding matched rule", "rule", matchedRule.Name)
161
}
162
163
+ // skip if finding is already in the desired state to avoid feedback loops
164
+ if int32(finding.StatusID) == matchedRule.Action.StatusID {
165
+ if a.Config.DebugEnabled {
166
+ a.Logger.Debug("finding already in desired state, skipping update",
167
+ "uid", finding.Metadata.UID,
168
+ "status_id", finding.StatusID)
169
+ }
170
+ return nil
171
172
+
173
err := a.CloseFinding(ctx, finding, matchedRule.Action.StatusID, matchedRule.Action.Comment)
174
if err != nil {
175
return errors.Wrap(err, "failed to auto-close finding")
0 commit comments