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

Fix SecInfo alert filter conditions (master) #971

Merged

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Feb 4, 2020

This fixes various issues in the SecInfo filter conditions and makes them easier to use:

  • The condition description now contains the correct count
  • The filter placeholders $f and $F for the email body are now replaced with the condition filter
  • The filter condition now only counts new/updated SecInfo depending on the event type
  • The filter condition now checks the SecInfo type given in the event data
  • New SecInfo is now excluded from the "updated" lists more consistently

Checklist:

The alert_condition_description function did not get the expected
count for the text.
This makes the $f and $F placeholders in the email body work.
The filter conditions previously counted all the NVTs for the
"New/Updated SecInfo arrived" events, not just new or modified ones.
When checking if a filter count is met for SecInfo events, the SecInfo
type given in the event data is counted instead of always counting NVTs.
When generating the lists of updated SecInfo for alerts all recently
modified items are now added, no longer excluding new ones.
@timopollmeier timopollmeier changed the title Fix SecInfo alert filter condtions (master) Fix SecInfo alert filter conditions (master) Feb 4, 2020
@timopollmeier timopollmeier marked this pull request as ready for review February 4, 2020 13:36
src/manage_sql.c Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
src/manage_sql_secinfo.c Outdated Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
In email_secinfo, quoted_filter_id needs to be freed and
alert_secinfo_count contained a stray printf call.
This reverts commit f9a8310 because
omitting the existing items is the intended behavior.
@timopollmeier timopollmeier added the work in progress This pull request should not be merged yet, more commits are expected label Feb 11, 2020
The functions counting the SecInfo items for the filter condition and
the ones generating the list for alert messages now all use the same
conditions for the selection in the "Updated" case:
The modification time must be newer than the feed time while the
creation time must be older or the same.
@timopollmeier timopollmeier removed the work in progress This pull request should not be merged yet, more commits are expected label Feb 13, 2020
@mattmundell mattmundell merged commit ffae551 into greenbone:master Feb 13, 2020
@timopollmeier timopollmeier deleted the secinfo-alert-filter-master branch June 9, 2020 06:55
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.

2 participants