Skip to content

Conversation

@resnostyle
Copy link

No description provided.

@fjogeleit
Copy link
Member

Thanks for your contribution, I will try to take a Look on your PR this Week

@resnostyle resnostyle force-pushed the add-pagerduty-support branch from b17bb87 to 5b55497 Compare February 26, 2025 02:09
@resnostyle
Copy link
Author

I'll need to make some additional changes, but wanted to get an idea of if this is a good direction so far.


// Create a unique key for tracking incidents
func incidentKey(result v1alpha2.PolicyReportResult) string {
key := result.Policy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to add the rule as well. One policy can have multiple rules which fail against one resource.

}

// Store the incident ID for later resolution
p.incidents.Store(key, resp.Id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@resnostyle resnostyle force-pushed the add-pagerduty-support branch from 51dd6c6 to d909403 Compare March 1, 2025 13:00
@resnostyle resnostyle force-pushed the add-pagerduty-support branch from d909403 to e1ba6a6 Compare March 1, 2025 13:02
defer cancel()

// For pass results or deletions, resolve any existing incidents
if result.Result == v1alpha2.StatusPass || result.Result == "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aerosouund
Copy link
Member

Hello @resnostyle
Can you please resolve the merge conflicts so we can address this PR ? thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants