Conversation
|
Thanks for your contribution, I will try to take a Look on your PR this Week |
b17bb87 to
5b55497
Compare
|
I'll need to make some additional changes, but wanted to get an idea of if this is a good direction so far. |
pkg/target/pagerduty/pagerduty.go
Outdated
|
|
||
| // Create a unique key for tracking incidents | ||
| func incidentKey(result v1alpha2.PolicyReportResult) string { | ||
| key := result.Policy |
There was a problem hiding this comment.
you might want to add the rule as well. One policy can have multiple rules which fail against one resource.
pkg/target/pagerduty/pagerduty.go
Outdated
| } | ||
|
|
||
| // Store the incident ID for later resolution | ||
| p.incidents.Store(key, resp.Id) |
There was a problem hiding this comment.
What happens when the pod restarts or you run it in a HA setup? This approach not working really.
You also missing the case when a Policy or Resource is deleted. Then the result is just removed from the report.
Signed-off-by: B Pearson <git@me.resnostyle.dev>
51dd6c6 to
d909403
Compare
for multiple clusters Signed-off-by: B Pearson <git@me.resnostyle.dev>
d909403 to
e1ba6a6
Compare
| defer cancel() | ||
|
|
||
| // For pass results or deletions, resolve any existing incidents | ||
| if result.Result == v1alpha2.StatusPass || result.Result == "" { |
There was a problem hiding this comment.
Targets only receive fail / warn / error results in the Send method.
Currently the SecurityHub is the only target that has the possibility to resolve fails after a result changes or is removed. Maybe its worth looking into it and check how we can handle it for this target as well.
|
Hello @resnostyle |
No description provided.