File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,16 @@ func (a *App) Process(ctx context.Context, evt events.SecurityHubEventInput) err
160160 a .Logger .Debug ("finding matched rule" , "rule" , matchedRule .Name )
161161 }
162162
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+
163173 err := a .CloseFinding (ctx , finding , matchedRule .Action .StatusID , matchedRule .Action .Comment )
164174 if err != nil {
165175 return errors .Wrap (err , "failed to auto-close finding" )
You can’t perform that action at this time.
0 commit comments