From b2c5b79672ad1ccd5fd2aa4078c3dd71ce144202 Mon Sep 17 00:00:00 2001 From: Wagde Zabit <74212046+wagde-orca@users.noreply.github.com> Date: Fri, 12 May 2023 19:04:31 +0300 Subject: [PATCH] feat(os): support debian 12 (#1676) * feat(os): support debian 12 * chore(scanner/debian): remove unneeded warn log --------- Co-authored-by: MaineK00n --- config/os.go | 2 +- config/os_test.go | 26 +++++++++++++++++--------- gost/debian.go | 2 +- gost/debian_test.go | 4 ++-- scanner/base.go | 1 - 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/config/os.go b/config/os.go index c014921c7d..e5cb42b52d 100644 --- a/config/os.go +++ b/config/os.go @@ -127,7 +127,7 @@ func GetEOL(family, release string) (eol EOL, found bool) { "9": {StandardSupportUntil: time.Date(2022, 6, 30, 23, 59, 59, 0, time.UTC)}, "10": {StandardSupportUntil: time.Date(2024, 6, 30, 23, 59, 59, 0, time.UTC)}, "11": {StandardSupportUntil: time.Date(2026, 6, 30, 23, 59, 59, 0, time.UTC)}, - // "12": {StandardSupportUntil: time.Date(2028, 6, 30, 23, 59, 59, 0, time.UTC)}, + "12": {StandardSupportUntil: time.Date(2028, 6, 30, 23, 59, 59, 0, time.UTC)}, // "13": {StandardSupportUntil: time.Date(2030, 6, 30, 23, 59, 59, 0, time.UTC)}, // "14": {StandardSupportUntil: time.Date(2032, 6, 30, 23, 59, 59, 0, time.UTC)}, }[major(release)] diff --git a/config/os_test.go b/config/os_test.go index 721f9a8ccd..59b4bbd06c 100644 --- a/config/os_test.go +++ b/config/os_test.go @@ -364,6 +364,14 @@ func TestEOL_IsStandardSupportEnded(t *testing.T) { extEnded: false, }, //Debian + { + name: "Debian 8 supported", + fields: fields{family: Debian, release: "8"}, + now: time.Date(2021, 1, 6, 23, 59, 59, 0, time.UTC), + stdEnded: true, + extEnded: true, + found: true, + }, { name: "Debian 9 supported", fields: fields{family: Debian, release: "9"}, @@ -380,14 +388,6 @@ func TestEOL_IsStandardSupportEnded(t *testing.T) { extEnded: false, found: true, }, - { - name: "Debian 8 supported", - fields: fields{family: Debian, release: "8"}, - now: time.Date(2021, 1, 6, 23, 59, 59, 0, time.UTC), - stdEnded: true, - extEnded: true, - found: true, - }, { name: "Debian 11 supported", fields: fields{family: Debian, release: "11"}, @@ -397,8 +397,16 @@ func TestEOL_IsStandardSupportEnded(t *testing.T) { found: true, }, { - name: "Debian 12 is not supported yet", + name: "Debian 12 supported", fields: fields{family: Debian, release: "12"}, + now: time.Date(2023, 6, 10, 0, 0, 0, 0, time.UTC), + stdEnded: false, + extEnded: false, + found: true, + }, + { + name: "Debian 13 is not supported yet", + fields: fields{family: Debian, release: "13"}, now: time.Date(2021, 1, 6, 23, 59, 59, 0, time.UTC), stdEnded: false, extEnded: false, diff --git a/gost/debian.go b/gost/debian.go index 574745fd7d..9bbaff694e 100644 --- a/gost/debian.go +++ b/gost/debian.go @@ -31,7 +31,7 @@ func (deb Debian) supported(major string) bool { "9": "stretch", "10": "buster", "11": "bullseye", - // "12": "bookworm", + "12": "bookworm", // "13": "trixie", // "14": "forky", }[major] diff --git a/gost/debian_test.go b/gost/debian_test.go index f7b4cc788e..6168639f10 100644 --- a/gost/debian_test.go +++ b/gost/debian_test.go @@ -45,9 +45,9 @@ func TestDebian_Supported(t *testing.T) { want: true, }, { - name: "12 is not supported yet", + name: "12 is supported", args: "12", - want: false, + want: true, }, { name: "13 is not supported yet", diff --git a/scanner/base.go b/scanner/base.go index 0d5da0bd10..ef491dd8f1 100644 --- a/scanner/base.go +++ b/scanner/base.go @@ -139,7 +139,6 @@ func (l *base) runningKernel() (release, version string, err error) { version = ss[6] } if _, err := debver.NewVersion(version); err != nil { - l.log.Warnf("kernel running version is invalid. skip kernel vulnerability detection. actual kernel version: %s, err: %s", version, err) version = "" } }