Hello,
On Mon, Sep 06, 2021 at 03:08:31AM -0700, David H. wrote:
>I'm trying to implement the Clair Scan process in a CI/CD pipeline using
>GitHub Actions.
Awesome! This is one of the use cases Louis and I talked about when
working on v4, but haven't implemented.
>It's great what you can do with that. However, I realized
>that creating a new full Clair instance up and running each time a build is
>triggered is such a long process. So, I'm taking advantage of the updaters
>set configuration to restrict the distribution to load to the only one
>necessary. The process is too long when the set is RHEL, so I'm trying to
>filter de distributions load by the RHEL updater set.
I think a more immediately fruitful approach would be to use the
import/export subcommands of clairctl.
>[...]
>
>Does it mean that the filter option is not working as expected and loads
>the updater anyway, increasing the vulnerability load process?
The updater list is dynamically generated _after_ that filter mechanism
happens. It was added mostly for testing, and prior to dynamic updaters,
so its unsurprising but annoying that it happens as you describe. If
using the export command of clairctl, you could pass it through a jq
filter -- the output is gzipped json, if I remember off the top of my
head.
Ultimately, I think the Correct solution is to write a new wrapper
around the claircore module and add an SQLite backend to claircore.
The new command can make assumptions about the layers (e.g. that they're
local and novel) and the SQLite backend could just be pre-populated by
an Actions cronjob or the like.
I've started poking at an SQLite backend, as it'd be useful to help
build out an acceptance test quite, but don't have a prototype yet. I
can lay out a design document if anyone would like, but it'll be some
time before I can start in on the needed new code.
--
hank