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

feat(fetcher/amazon): support kernel livepatch advisory in AL2023 #332

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

MaineK00n
Copy link
Collaborator

What did you implement:

Fixes #328

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

before

$ goval-dictionary fetch amazon 2023
INFO[08-01|16:30:52] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/core/mirrors/latest/x86_64/mirror.list
INFO[08-01|16:30:53] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/core/guids/9cf1057036ef7d615de550a658447fad88617805da0cfc9b854ba0fb8a668466/x86_64/repodata/repomd.xml
INFO[08-01|16:30:53] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/core/guids/9cf1057036ef7d615de550a658447fad88617805da0cfc9b854ba0fb8a668466/x86_64/repodata/updateinfo.xml.gz
INFO[08-01|16:30:53] Refreshing...                            Family=amazon Version=2023
INFO[08-01|16:30:53] Inserting new Definitions... 
269 / 269 [---------------------------------------------------------------------] 100.00% ? p/s
INFO[08-01|16:30:53] Finish                                   Updated=269

$ sqlite3 oval.sqlite3 'SELECT COUNT(id) FROM definitions WHERE title LIKE "ALAS2023LIVEPATCH%";'
0

after

$ goval-dictionary fetch amazon 2023
INFO[08-01|16:31:29] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/core/mirrors/latest/x86_64/mirror.list
INFO[08-01|16:31:29] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/core/guids/9cf1057036ef7d615de550a658447fad88617805da0cfc9b854ba0fb8a668466/x86_64/repodata/repomd.xml
INFO[08-01|16:31:29] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/core/guids/9cf1057036ef7d615de550a658447fad88617805da0cfc9b854ba0fb8a668466/x86_64/repodata/updateinfo.xml.gz
INFO[08-01|16:31:30] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/kernel-livepatch/mirrors/latest/x86_64/mirror.list
INFO[08-01|16:31:30] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/kernel-livepatch/guids/b54a8bf3df3a87890ef5518a974c92c10b97e856026b1995e9a9f641ec355137/x86_64/repodata/repomd.xml
INFO[08-01|16:31:30] Fetching...                              URL=https://cdn.amazonlinux.com/al2023/kernel-livepatch/guids/b54a8bf3df3a87890ef5518a974c92c10b97e856026b1995e9a9f641ec355137/x86_64/repodata/updateinfo.xml.gz
INFO[08-01|16:31:30] Refreshing...                            Family=amazon Version=2023
INFO[08-01|16:31:30] Inserting new Definitions... 
279 / 279 [---------------------------------------------------------------------] 100.00% ? p/s
INFO[08-01|16:31:30] Finish                                   Updated=279

$ sqlite3 oval.sqlite3 'SELECT COUNT(id) FROM definitions WHERE title LIKE "ALAS2023LIVEPATCH%";'
10

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n
Copy link
Collaborator Author

There seems to be no need to distinguish between repository.

[ec2-user@ip-000-00-0-00 ~]$ repoquery --all --installed --qf='%{NAME} %{EPOCH} %{VERSION} %{RELEASE} %{ARCH} %{FROM_REPO}' | grep kernel-livepatch
kernel-livepatch-6.1.15-28.43 0 1.0 0.amzn2023 x86_64 amazonlinux
kernel-livepatch-repo-s3 0 2023.1.20230725 0.amzn2023 noarch 
[ec2-user@ip-000-00-0-00 ~]$ dnf updateinfo list
Last metadata expiration check: 0:02:45 ago on Tue Aug  1 08:51:42 2023.
ALAS2023LIVEPATCH-2023-003 Unknown/Sec. kernel-livepatch-6.1.15-28.43-1.0-1.amzn2023.x86_64
ALAS2023LIVEPATCH-2023-009 Unknown/Sec. kernel-livepatch-6.1.15-28.43-1.0-2.amzn2023.x86_64
[ec2-user@ip-000-00-0-00 ~]$ dnf info kernel-livepatch-6.1.15-28.43
Last metadata expiration check: 0:10:47 ago on Tue Aug  1 08:51:42 2023.
Installed Packages
Name         : kernel-livepatch-6.1.15-28.43
Version      : 1.0
Release      : 0.amzn2023
Architecture : x86_64
Size         : 0.0  
Source       : kernel-6.1.15-28.43.amzn2023.src.rpm
Repository   : @System
From repo    : amazonlinux
Summary      : Livepatches for the Linux Kernel
URL          : http://www.kernel.org/
License      : GPLv2 and Redistributable, no modification permitted
Description  : This package contains the live patch modules for bug fixes
             : against the version of the kernel. This package contains
             : version 0 (no real livepatches) and helps subscribe to
             : the kernel livepatch updates for the kernel.

Available Packages
Name         : kernel-livepatch-6.1.15-28.43
Version      : 1.0
Release      : 2.amzn2023
Architecture : x86_64
Size         : 31 k
Source       : kernel-livepatch-6.1.15-28.43-1.0-2.amzn2023.src.rpm
Repository   : kernel-livepatch
Summary      : Livepatches for the Linux Kernel
License      : GPLv2 and Redistributable, no modification permitted
Description  : This package contains the live patch modules for bug fixes
             : against the version of the kernel.

@MaineK00n MaineK00n force-pushed the MaineK00n/amazon-kernel-livepatch branch from 2a40242 to 34cf56b Compare September 6, 2023 04:18
@MaineK00n MaineK00n merged commit a975cd9 into master Sep 6, 2023
@MaineK00n MaineK00n deleted the MaineK00n/amazon-kernel-livepatch branch September 6, 2023 04:23
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.

Fetch a modified version of LIVEPATCH on Amazon Linux
1 participant