Skip to content

Commit f83327f

Browse files
authored
Merge branch 'master' into script
2 parents bc42b86 + 204d50d commit f83327f

File tree

5 files changed

+45
-75
lines changed

5 files changed

+45
-75
lines changed

gcp/website/frontend3/src/styles.scss

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ dl.vulnerability-details,
999999
}
10001000
}
10011001

1002-
.ecosystem-content-panel {
1002+
.ecosystem-content-panel {
10031003
position: relative;
10041004
padding: 8px 0 16px 16px;
10051005

@@ -1014,6 +1014,28 @@ dl.vulnerability-details,
10141014
background: #555;
10151015
}
10161016
}
1017+
1018+
$last-ecosystem-border-offset: 12px;
1019+
$last-ecosystem-border-gap: 8px;
1020+
$last-ecosystem-border-thickness: 1px;
1021+
1022+
.ecosystem-content-panel--last {
1023+
padding-bottom: $last-ecosystem-border-offset + $last-ecosystem-border-gap;
1024+
1025+
&::before {
1026+
bottom: $last-ecosystem-border-offset + $last-ecosystem-border-thickness;
1027+
}
1028+
1029+
&::after {
1030+
content: '';
1031+
position: absolute;
1032+
left: 0;
1033+
right: 0;
1034+
bottom: $last-ecosystem-border-offset;
1035+
height: $last-ecosystem-border-thickness;
1036+
background: $osv-grey-600;
1037+
}
1038+
}
10171039

10181040
.package-accordion {
10191041
position: relative;
@@ -1031,6 +1053,14 @@ dl.vulnerability-details,
10311053
}
10321054
}
10331055

1056+
.package-accordion--last {
1057+
margin-bottom: 0;
1058+
1059+
.package-details-card {
1060+
margin-bottom: $last-ecosystem-border-gap;
1061+
}
1062+
}
1063+
10341064
.package-accordion h3.package-name-title {
10351065
font-family: $osv-heading-font-family;
10361066
font-size: 1.1rem;

gcp/website/frontend3/src/templates/vulnerability.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,13 @@ <h2 class="title">Affected packages</h2>
179179
{% set ecosystems = vulnerability.affected | group_by_ecosystem %}
180180
<spicy-sections class="vulnerability-packages force-collapse">
181181
{% for ecosystem_name, packages in ecosystems.items() -%}
182+
{% set is_last_ecosystem = loop.last %}
182183
<h2 class="package-header">
183184
<span class="vuln-ecosystem spicy-sections-workaround">{{ ecosystem_name }}</span>
184185
</h2>
185-
<div class="ecosystem-content-panel">
186+
<div class="ecosystem-content-panel{% if is_last_ecosystem %} ecosystem-content-panel--last{% endif %}">
186187
{% for affected in packages -%}
187-
<spicy-sections class="package-accordion">
188+
<spicy-sections class="package-accordion{% if is_last_ecosystem and loop.last %} package-accordion--last{% endif %}">
188189
<h3 class="package-name-title">
189190
{% if 'package' in affected %}{{ affected.package.name }}{% else %}{{ vulnerability.repo | strip_scheme }}{% endif %}
190191
</h3>
@@ -603,4 +604,4 @@ <h3 class="mdc-layout-grid__cell--span-3">
603604
setupExpandibleList('.expandible-list', 'li');
604605
});
605606
</script>
606-
{% endblock -%}
607+
{% endblock -%}

vulnfeeds/cmd/combine-to-osv/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const (
2424
defaultCVEListPath = "."
2525

2626
alpineEcosystem = "Alpine"
27+
debianEcosystem = "Debian"
2728
alpineSecurityTrackerURL = "https://security.alpinelinux.org/vuln"
2829
)
2930

@@ -166,6 +167,10 @@ func combineIntoOSV(loadedCves map[cves.CVEID]cves.Vulnerability, allParts map[c
166167

167168
addedAlpineURL := false
168169
for _, pkgInfo := range allParts[cveID] {
170+
// skip debian parts, but still write out the CVEs.
171+
if strings.HasPrefix(pkgInfo.Ecosystem, debianEcosystem) {
172+
continue
173+
}
169174
convertedCve.AddPkgInfo(pkgInfo)
170175
if strings.HasPrefix(pkgInfo.Ecosystem, alpineEcosystem) && !addedAlpineURL {
171176
addReference(string(cveID), alpineEcosystem, convertedCve)

vulnfeeds/cmd/combine-to-osv/main_test.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func loadTestData2(cveName string) cves.Vulnerability {
3838

3939
func TestLoadParts(t *testing.T) {
4040
allParts, _ := loadParts("../../test_data/parts")
41-
expectedPartCount := 15
41+
expectedPartCount := 14
4242
actualPartCount := len(allParts)
4343

4444
if actualPartCount != expectedPartCount {
@@ -86,15 +86,14 @@ func TestLoadParts(t *testing.T) {
8686

8787
func TestCombineIntoOSV(t *testing.T) {
8888
cveStuff := map[cves.CVEID]cves.Vulnerability{
89-
"CVE-2022-33745": loadTestData2("CVE-2022-33745"),
90-
"CVE-2022-32746": loadTestData2("CVE-2022-32746"),
91-
"CVE-2018-1000500": loadTestData2("CVE-2018-1000500"),
89+
"CVE-2022-33745": loadTestData2("CVE-2022-33745"),
90+
"CVE-2022-32746": loadTestData2("CVE-2022-32746"),
9291
}
9392
allParts, cveModifiedTime := loadParts("../../test_data/parts")
9493

9594
combinedOSV := combineIntoOSV(cveStuff, allParts, "", cveModifiedTime)
9695

97-
expectedCombined := 3
96+
expectedCombined := 2
9897
actualCombined := len(combinedOSV)
9998

10099
if actualCombined != expectedCombined {
@@ -107,13 +106,6 @@ func TestCombineIntoOSV(t *testing.T) {
107106

108107
found := false
109108
switch cve {
110-
case "CVE-2018-1000500":
111-
for _, reference := range combinedOSV[cve].References {
112-
if reference.Type == "ADVISORY" &&
113-
reference.URL == "https://security-tracker.debian.org/tracker/CVE-2018-1000500" {
114-
t.Errorf("Found unexpected Debian advisory URL for %s", cve)
115-
}
116-
}
117109
case "CVE-2022-33745":
118110
for _, reference := range combinedOSV[cve].References {
119111
if reference.Type == "ADVISORY" &&
@@ -129,7 +121,7 @@ func TestCombineIntoOSV(t *testing.T) {
129121
}
130122
}
131123
}
132-
if !found && cve != "CVE-2018-1000500" {
124+
if !found {
133125
t.Errorf("%s doesn't have all expected references", cve)
134126
}
135127
}

vulnfeeds/test_data/parts/debian/CVE-2018-1000500.debian.json

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)