Skip to content

Feature 6096: Scan RHEL/CentOS hosts using OVAL definitions#6241

Merged
juan-fdz-hawa merged 40 commits intomainfrom
6096-use-oval-to-detect-centosred-hat-vulnerabilities
Jun 23, 2022
Merged

Feature 6096: Scan RHEL/CentOS hosts using OVAL definitions#6241
juan-fdz-hawa merged 40 commits intomainfrom
6096-use-oval-to-detect-centosred-hat-vulnerabilities

Conversation

@juan-fdz-hawa
Copy link
Copy Markdown
Contributor

@juan-fdz-hawa juan-fdz-hawa commented Jun 15, 2022

#6096

Apologies for the huge PR - I took the opportunity to do a fair bit of clean up and add some missing tests.

This PR extends the OVAL parser/analyzer so that we can scan RHEL based systems. While working on this I discovered that the way we store RHEL software versions is a little bit inconsistent with the way Ubuntu software versions are stored (see #6236 ), that said, ignoring the Epoch didn't affect the accuracy of the results at all (probably because epoch numbers don't change that much).

Checklist for submitter

  • Changes file added for user-visible changes (in changes/ and/or orbit/changes/).
  • Ensured that input data is properly validated, SQL injection is prevented (using placeholders for values in statements)
  • Added/updated tests
  • Manual QA for all new/changed functionality

Juan Fernandez and others added 30 commits June 8, 2022 14:49
…_type, skip epoch when processing RPM evr strings
@juan-fdz-hawa juan-fdz-hawa changed the title 6096 use oval to detect centos red hat vulnerabilities Feature 6096: Scan RHEL/CentOS hosts using OVAL definitions Jun 16, 2022
@juan-fdz-hawa juan-fdz-hawa temporarily deployed to Docker Hub June 16, 2022 14:11 Inactive
@juan-fdz-hawa juan-fdz-hawa temporarily deployed to Docker Hub June 16, 2022 14:19 Inactive
@juan-fdz-hawa juan-fdz-hawa marked this pull request as ready for review June 16, 2022 14:21
@juan-fdz-hawa juan-fdz-hawa requested a review from a team as a code owner June 16, 2022 14:21
@juan-fdz-hawa
Copy link
Copy Markdown
Contributor Author

@lucasmrod - I think I got all the CentOS post-processing code, but could you please double check? Thanks

@juan-fdz-hawa juan-fdz-hawa temporarily deployed to Docker Hub June 20, 2022 19:22 Inactive
@juan-fdz-hawa juan-fdz-hawa temporarily deployed to Docker Hub June 20, 2022 19:23 Inactive
@juan-fdz-hawa juan-fdz-hawa temporarily deployed to Docker Hub June 21, 2022 12:40 Inactive
Arch string `json:"arch"`
}

func extract(src, dst string, t require.TestingT) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should move this to pkg/ to a testing package.

)

type ObjectInfoState struct {
Name *ObjectStateString `json:",omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be obvious to others, but what does this empty json field name do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on the object associated with the state, for example, in case the object is a dpkg package Name refers to the name of the package. It has omitempty because is not required.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh... Does it default to Name if the tag itself is not specified? TIL

chiiph
chiiph previously approved these changes Jun 23, 2022
Copy link
Copy Markdown
Contributor

@chiiph chiiph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Have we load tested this?

@juan-fdz-hawa juan-fdz-hawa self-assigned this Jun 23, 2022
@juan-fdz-hawa
Copy link
Copy Markdown
Contributor Author

juan-fdz-hawa commented Jun 23, 2022

Looks good! Have we load tested this?

No, but I expect to see the same performance characteristics as with Ubuntu - the only difference is that this will consume more memory because the OVAL files for RHEL are bigger - I'll add a bench mark test for this

  • Benchmark this

@juan-fdz-hawa juan-fdz-hawa temporarily deployed to Docker Hub June 23, 2022 20:24 Inactive
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.

3 participants