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

remotematcher: Implement RemoteMatcher for CRDA #3

Closed
wants to merge 62 commits into from

Conversation

arajkumar
Copy link
Owner

This is a WIP PR to supplement quay#202. This is not ready for formal review.

RemoteMatcher is an additional interface that a Matcher can implement.

When called the interface should call the remote matcher using the RESTful API
to fetch new vulnerabilites associated with the given IndexRecords.

The information retrived from this interface will not be persisted into ClairCore database.
arajkumar and others added 4 commits July 17, 2020 01:41
* matcher: Add preliminary support for Remote Matcher

RemoteMatcher is an additional interface that a Matcher can implement.

When called the interface can invoke the remote matcher using the RESTful API
to fetch new vulnerabilities associated with the given IndexRecords.

The information retrieved from this interface **won't be persisted** into ClairCore database.

* Update internal/matcher/controller.go

Co-authored-by: Louis DeLosSantos <louis.delos@gmail.com>

* remotematcher: Add a realistic deadline for QueryRemoteMatcher call

* remotematcher: Change deadline to 60s according to review comments

Co-authored-by: Louis DeLosSantos <louis.delos@gmail.com>
@arajkumar arajkumar changed the base branch from remote-matcher-v1 to master July 17, 2020 15:22
@arajkumar arajkumar changed the base branch from master to remote-matcher-v1 July 17, 2020 15:23
arajkumar and others added 16 commits July 17, 2020 23:01
When package is associated with multiple repositories a database query
returns duplicated vulnerability. The map is used as a set to determine
whether vulnerability is already present in slice.
…t) (quay#204)

* Add support for embedded content-sets

Content manifest file is stored in image layer and contain information
about used content-sets. Content-sets are translated using mapping file
provided by Red Hat's product security team.

Mapping file is update every N hours.

* Allow embedded content-sets in RHEL repo scanner

Rhel repository scanner gets content manifest from layer and translates
it to CPEs using mapping file.

* Pull dependencies when spinning podman environment

This avoid situation when local dependencies are outdated.

* RHEL Matcher: translate content-sets to CPEs

Translation of content-sets to CPEs happens in Matching part now instead
of in indexing part. This should prevent situation when mapping is is
missing some data when image is indexed.

* Remove updates from request path, make concurrent safe

This commit changes the LocalUpdateJob in such a way that updating the
MappingFile will not occur during ClairCore matching process.

It also adapts the LocaUpdateJob to be concurrent safe and allows the
RHEL matcher to be shared between goroutines.

Signed-off-by: ldelossa <ldelossa@redhat.com>

* Revert line breaks in md doc

The line break are needed for html rendering.

* Increase update interval to 10 minutes

30 seconds is too low value and it could cause a traffic to Red Hat
ProdSec endpoints.

Co-authored-by: ldelossa <ldelossa@redhat.com>
For integration testing purposes we should be able to point claircore to
different oval stream using env var.
* consistent conainter names

* etc: update podman.yaml.in

Co-authored-by: Hank Donnay <hdonnay@redhat.com>
* Add Repository key to RHEL oval parser

The key identifies Red Hat repositories.

* Add binary kind to oval parser

Packages in oval are binary packages and its type should be stored in
database to be able differentiate whether it affects all sub-binary
package or just binary package.

* Use and fetch cpe mapping in indexer

Previous implementation of cpe mapping in matcher has lot of corner
cases. So we decided to put a mapping code into indexer instead.

* use do once to ensure single updater job

this commit adds a sync.once to the Updater constructor to ensure only a
single UpdaterJob is created on constructions.

Signed-off-by: ldelossa <ldelossa@redhat.com>

Co-authored-by: ldelossa <ldelossa@redhat.com>
Ensures all vuln's have an updater field and ensures all vulns provide a
package.Kind for their affected packages.

Currently all sec databases only provide vulnerabilities for BINARY
packages.

Support for a security database to provide vulnerabilities for SOURCE
packages still exists.

Signed-off-by: ldelossa <ldelossa@redhat.com>
By adding package kind to database vulnerability query we query only
real affected packages. Without this code Clair produce false negatives
in case source package and binary package has same name.

When vulnerability is issued with source package all binary package that
have come from same source are marked as vulnerable.
hdonnay and others added 29 commits August 21, 2020 13:38
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
This PR implements correct OVAL parsing for debian and ubuntu moving
away from incorrect regex parsing of the oval data.

goval-parser is bumped to obtain the necessary datastructures.

Signed-off-by: ldelossa <ldelossa@redhat.com>
This function is needed to access some internal packages when importing
updates from an artifact produced by the offline updater.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: ldelossa <ldelossa@redhat.com>
this commit overhauls md book with new content and images.

Signed-off-by: Louis Delossantos <ldelossa.ld@gmail.com>
this commit fixes all issues with prose via peer review

Co-authored-by: Hank Donnay <hdonnay@redhat.com>
Signed-off-by: ldelossa <ldelossa@redhat.com>
Signed-off-by: ldelossa <ldelossa@redhat.com>
Signed-off-by: ldelossa <ldelossa@redhat.com>
this commit introduces automated change log generation and github
workflows to support it

Signed-off-by: ldelossa <ldelossa@redhat.com>
this commit introduces automated change log generation and github
workflows to support it

Signed-off-by: ldelossa <ldelossa@redhat.com>
Previously, this table could grow without bound, which is suboptimal.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
@arajkumar arajkumar closed this Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants