Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CWS] Report rule actions in events #20960

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Conversation

lebauce
Copy link
Contributor

@lebauce lebauce commented Nov 20, 2023

What does this PR do?

Report the actions associated to the triggered rule in the event sent to the backend.

Motivation

Actions are not part of the sent event which makes it necessary to correlate with
remote config to match event with the rule actions.

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • If applicable, the config template has been updated.

@lebauce lebauce requested a review from a team as a code owner November 20, 2023 15:18
@lebauce lebauce added this to the 7.51.0 milestone Nov 20, 2023
@lebauce lebauce changed the title Report rule actions in events [CWS] Report rule actions in events Nov 20, 2023
@lebauce lebauce force-pushed the lebauce/rule-actions-in-events branch from 7fcd3cb to 7cf2a38 Compare November 20, 2023 15:25
@lebauce lebauce requested a review from a team as a code owner November 20, 2023 15:25
@lebauce lebauce force-pushed the lebauce/rule-actions-in-events branch 3 times, most recently from 66bfdc7 to 2064280 Compare November 20, 2023 18:10
Copy link
Contributor

@alai97 alai97 left a comment

Choose a reason for hiding this comment

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

No docs review needed.

Arch string `json:"arch,omitempty"`
RuleID string `json:"rule_id"`
RuleVersion string `json:"rule_version,omitempty"`
RuleActions []map[string]interface{} `json:"rule_actions,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of map[string]interface{}, why not using a real struct type ? This would simplify the SendEvent later down

@Gui774ume Gui774ume self-requested a review November 22, 2023 09:02
Copy link
Contributor

@Gui774ume Gui774ume left a comment

Choose a reason for hiding this comment

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

LGTM !
I think we can simply use a string instead of an interface, unless you have something in mind. But overall it doesn't change anything for the backend and more specifically the kill action, so we can always revisit later if need be.

@lebauce lebauce force-pushed the lebauce/rule-actions-in-events branch from 2064280 to 71e8847 Compare November 22, 2023 11:43
@lebauce lebauce requested a review from paulcacheux November 22, 2023 11:45
@lebauce lebauce merged commit 9fac6f8 into main Nov 22, 2023
147 checks passed
@lebauce lebauce deleted the lebauce/rule-actions-in-events branch November 22, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants