Skip to content

Commit

Permalink
feat(os): support debian 12 (#1676)
Browse files Browse the repository at this point in the history
* feat(os): support debian 12

* chore(scanner/debian): remove unneeded warn log

---------

Co-authored-by: MaineK00n <mainek00n.1229@gmail.com>
  • Loading branch information
wagde-orca and MaineK00n authored May 12, 2023
1 parent b0cc908 commit b2c5b79
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion config/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
26 changes: 17 additions & 9 deletions config/os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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"},
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion gost/debian.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions gost/debian_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion scanner/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}
}
Expand Down

0 comments on commit b2c5b79

Please sign in to comment.