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

Cogburn/refactor changed by user #611

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

coreyogburn
Copy link
Contributor

Removed context approach to indicating a change to a detection needs to stick. Instead we can now mark the detection itself using the transient (i.e. never returned to user, never stored in ES) bool field PersistChange. This field is respected by Suricata and will put the rule in the correct pillar file rather than relying on the community rule's commented-in/commented-out status in rules file.

MarkChangedByUser being a context value is being deprecated for a transient field on detections called PersistChange.

Todo: Test.
… for detections. We'd set the value, update the detection, overwrite the detection with the result returned from the update that doesn't have the transient value set, then sync with PersistChange = false. Fixed.

When walking back the MarkChangedByUser context changes, the migration was updated to use context.Background. Instead we should use the server context, just don't call MarkChangedByUser on it.
@coreyogburn coreyogburn merged commit d65dff6 into 2.4/dev Aug 9, 2024
3 checks passed
@coreyogburn coreyogburn deleted the cogburn/refactor-changed-by-user branch August 9, 2024 21:10
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants