This commit is contained in:
Eric Sim 2018-12-11 16:11:04 -08:00
parent 8fb9097dbd
commit 803cf4a29e
4 changed files with 39 additions and 39 deletions

View File

@ -35,14 +35,14 @@ import (
)
const (
amazonLinux1Name = "Amazon Linux 2018.03"
amazonLinux1Namespace = "amzn:2018.03"
amazonLinux1UpdaterFlag = "amazonLinux1Updater"
amazonLinux1MirrorListURI = "http://repo.us-west-2.amazonaws.com/2018.03/updates/x86_64/mirror.list"
amazonLinux2Name = "Amazon Linux 2"
amazonLinux2Namespace = "amzn:2"
amazonLinux2UpdaterFlag = "amazonLinux2Updater"
amazonLinux2MirrorListURI = "https://cdn.amazonlinux.com/2/core/latest/x86_64/mirror.list"
amazonLinux1Name = "Amazon Linux 2018.03"
amazonLinux1Namespace = "amzn:2018.03"
amazonLinux1UpdaterFlag = "amazonLinux1Updater"
amazonLinux1MirrorListURI = "http://repo.us-west-2.amazonaws.com/2018.03/updates/x86_64/mirror.list"
amazonLinux2Name = "Amazon Linux 2"
amazonLinux2Namespace = "amzn:2"
amazonLinux2UpdaterFlag = "amazonLinux2Updater"
amazonLinux2MirrorListURI = "https://cdn.amazonlinux.com/2/core/latest/x86_64/mirror.list"
)
type updater struct {
@ -54,7 +54,7 @@ type updater struct {
func init() {
// Register updater for Amazon Linux 2018.03.
amazonLinux1Updater := updater {
amazonLinux1Updater := updater{
Name: amazonLinux1Name,
Namespace: amazonLinux1Namespace,
UpdaterFlag: amazonLinux1UpdaterFlag,
@ -63,7 +63,7 @@ func init() {
vulnsrc.RegisterUpdater("amzn", &amazonLinux1Updater)
// Register updater for Amazon Linux 2.
amazonLinux2Updater := updater {
amazonLinux2Updater := updater{
Name: amazonLinux2Name,
Namespace: amazonLinux2Namespace,
UpdaterFlag: amazonLinux2UpdaterFlag,
@ -82,7 +82,7 @@ func (u *updater) Update(datastore database.Datastore) (response vulnsrc.UpdateR
}
if !found {
flagValue = "";
flagValue = ""
}
var timestamp string
@ -316,4 +316,4 @@ func compareTimestamp(date0 string, date1 string) int {
} else {
return 0
}
}
}

View File

@ -64,20 +64,20 @@ func TestAmazonLinux1(t *testing.T) {
Name: "amzn:2018.03",
VersionFormat: rpm.ParserName,
},
FeatureName: "httpd-devel",
FeatureName: "httpd-devel",
AffectedVersion: "2.2.21-1.18.amzn1",
FixedInVersion: "2.2.21-1.18.amzn1",
AffectedType: database.AffectBinaryPackage,
FixedInVersion: "2.2.21-1.18.amzn1",
AffectedType: database.AffectBinaryPackage,
},
{
Namespace: database.Namespace{
Name: "amzn:2018.03",
VersionFormat: rpm.ParserName,
},
FeatureName: "httpd-debuginfo",
FeatureName: "httpd-debuginfo",
AffectedVersion: "2.2.21-1.18.amzn1",
FixedInVersion: "2.2.21-1.18.amzn1",
AffectedType: database.AffectBinaryPackage,
FixedInVersion: "2.2.21-1.18.amzn1",
AffectedType: database.AffectBinaryPackage,
},
}
@ -97,20 +97,20 @@ func TestAmazonLinux1(t *testing.T) {
Name: "amzn:2018.03",
VersionFormat: rpm.ParserName,
},
FeatureName: "cyrus-imapd-debuginfo",
FeatureName: "cyrus-imapd-debuginfo",
AffectedVersion: "2.3.16-6.4.amzn1",
FixedInVersion: "2.3.16-6.4.amzn1",
AffectedType: database.AffectBinaryPackage,
FixedInVersion: "2.3.16-6.4.amzn1",
AffectedType: database.AffectBinaryPackage,
},
{
Namespace: database.Namespace{
Name: "amzn:2018.03",
VersionFormat: rpm.ParserName,
},
FeatureName: "cyrus-imapd-utils",
FeatureName: "cyrus-imapd-utils",
AffectedVersion: "2.3.16-6.4.amzn1",
FixedInVersion: "2.3.16-6.4.amzn1",
AffectedType: database.AffectBinaryPackage,
FixedInVersion: "2.3.16-6.4.amzn1",
AffectedType: database.AffectBinaryPackage,
},
}
@ -120,7 +120,7 @@ func TestAmazonLinux1(t *testing.T) {
}
func TestAmazonLinux2(t *testing.T) {
amazonLinux2Updater := updater {
amazonLinux2Updater := updater{
Name: "Amazon Linux 2",
Namespace: "amzn:2",
UpdaterFlag: "amazonLinux2Updater",
@ -157,20 +157,20 @@ func TestAmazonLinux2(t *testing.T) {
Name: "amzn:2",
VersionFormat: rpm.ParserName,
},
FeatureName: "kernel",
FeatureName: "kernel",
AffectedVersion: "4.9.76-38.79.amzn2",
FixedInVersion: "4.9.76-38.79.amzn2",
AffectedType: database.AffectBinaryPackage,
FixedInVersion: "4.9.76-38.79.amzn2",
AffectedType: database.AffectBinaryPackage,
},
{
Namespace: database.Namespace{
Name: "amzn:2",
VersionFormat: rpm.ParserName,
},
FeatureName: "kernel-headers",
FeatureName: "kernel-headers",
AffectedVersion: "4.9.76-38.79.amzn2",
FixedInVersion: "4.9.76-38.79.amzn2",
AffectedType: database.AffectBinaryPackage,
FixedInVersion: "4.9.76-38.79.amzn2",
AffectedType: database.AffectBinaryPackage,
},
}
@ -190,20 +190,20 @@ func TestAmazonLinux2(t *testing.T) {
Name: "amzn:2",
VersionFormat: rpm.ParserName,
},
FeatureName: "qemu-kvm",
FeatureName: "qemu-kvm",
AffectedVersion: "10:1.5.3-141.amzn2.5.3",
FixedInVersion: "10:1.5.3-141.amzn2.5.3",
AffectedType: database.AffectBinaryPackage,
FixedInVersion: "10:1.5.3-141.amzn2.5.3",
AffectedType: database.AffectBinaryPackage,
},
{
Namespace: database.Namespace{
Name: "amzn:2",
VersionFormat: rpm.ParserName,
},
FeatureName: "qemu-img",
FeatureName: "qemu-img",
AffectedVersion: "10:1.5.3-141.amzn2.5.3",
FixedInVersion: "10:1.5.3-141.amzn2.5.3",
AffectedType: database.AffectBinaryPackage,
FixedInVersion: "10:1.5.3-141.amzn2.5.3",
AffectedType: database.AffectBinaryPackage,
},
}

View File

@ -25,4 +25,4 @@ type Repo struct {
type Location struct {
Href string `xml:"href,attr"`
}
}

View File

@ -35,4 +35,4 @@ type Package struct {
Epoch string `xml:"epoch,attr"`
Version string `xml:"version,attr"`
Release string `xml:"release,attr"`
}
}