Record time of last successful updater runs #489
Replies: 3 comments 6 replies
-
@paulaldridge Doesn't the
I've limited the output to just 5 entries, out of 552 that I have inside my database. |
Beta Was this translation helpful? Give feedback.
-
The edge case I'm worried about is when the updaters aren't even called, like with the RHEL updater. In this patten, the factory does some work to determine the updater doesn't need to be run, and then doesn't even bother to construct one. I think the behavior would have to change to have some stub updater that goes through the system to get recorded as having "run"? |
Beta Was this translation helpful? Give feedback.
-
Put together a PR for this for consideration: #558 |
Beta Was this translation helpful? Give feedback.
-
Problem
There is currently no record or way to see when the last time each updater successfully ran, and therefore no way to know how up to date vulnerabilities are in the database.
Required solution
A way to record and expose the time each updater last ran, in a form that shows each updater by name along with a timestamp of when it was last successfully run.
A successful updater run must meet one of these criteria:
Proposed solution
During the regular update operation, a successful run for each individual updater will be recorded in a new table ‘updaters_last_run’. This will contain two fields: ‘updater_name’ and ‘last_successful_run’. The table can then be queried to find all or a subset of the updaters and when they were last successfully run.
Where
driveUpdater
is called:driveUpdater
is calleddriveUpdater
returns without an error call a funtion which writes the updater name and recored time to theupdaters_last_run
table.As an extension or second iteration:
To make the data more consumable we could add an endpoint to the clair matcher such as ‘matcher/api/v1/updaters_last_run’, which queries the above table and returns a json response containing a mapping of ‘updater_name’ and ‘last_successful_run’.
Does the solution satisfisfy?
This solution records the data required in a table that can be queried, showing a view of how up to date each updater. It will only be recorded in the table as a successful run if an update has happened, including where no new vulnerabilites have been found. Nothing will be recorded if the updater fails to run, fails to commit every new vulnerability, or is skipped.
Beta Was this translation helpful? Give feedback.
All reactions