Skip to content

Commit b2dcdbb

Browse files
daynewleedcaraveldavdhacs
authored
Backport e2e test fix (#3054) (#3070)
Co-authored-by: David Caravello <119438707+dcaravel@users.noreply.github.com> Co-authored-by: David House <105243888+davdhacs@users.noreply.github.com>
1 parent 84e1284 commit b2dcdbb

File tree

6 files changed

+92
-9
lines changed

6 files changed

+92
-9
lines changed

.openshift-ci/pre_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Deployer:
1212
Deployer - Deploys Scanner and ScannerDB resources and port-forwards the necessary endpoints.
1313
"""
1414

15-
DEPLOY_TIMEOUT = 31 * 60
15+
DEPLOY_TIMEOUT = 41 * 60
1616

1717
def __init__(self, slim=False):
1818
self.slim = slim

cmd/clair/testdata/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ scanner:
88
options:
99
# PostgreSQL Connection string
1010
# https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
11-
source: host=scanner-db.stackrox.svc port=5432 user=postgres sslmode=verify-full statement_timeout=60000
11+
source: host=scanner-db.stackrox.svc port=5432 user=postgres sslmode=verify-full statement_timeout=180000
1212

1313
# Number of elements kept in the cache
1414
# Values unlikely to change (e.g. namespaces) are cached in order to save prevent needless roundtrips to the database.

e2etests/grpc_full_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ func checkGRPCMatch(t *testing.T, expectedVuln, matchingVuln *v1.Vulnerability)
153153
}
154154
expectedVuln.MetadataV2 = nil
155155
matchingVuln.MetadataV2 = nil
156+
157+
expectedVuln.Description = normalizeString(expectedVuln.Description)
158+
matchingVuln.Description = normalizeString(matchingVuln.Description)
159+
156160
assert.Equal(t, expectedVuln, matchingVuln)
157161
}
158162

e2etests/sanity_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"encoding/json"
88
"fmt"
99
"sort"
10+
"strings"
1011
"testing"
1112

1213
v1 "github.com/stackrox/scanner/api/v1"
@@ -58,6 +59,10 @@ func checkMatch(t *testing.T, source string, expectedVuln, matchingVuln v1.Vulne
5859
}
5960
expectedVuln.Metadata = nil
6061
matchingVuln.Metadata = nil
62+
63+
expectedVuln.Description = normalizeString(expectedVuln.Description)
64+
matchingVuln.Description = normalizeString(matchingVuln.Description)
65+
6166
assert.Equal(t, expectedVuln, matchingVuln)
6267
}
6368

@@ -183,3 +188,8 @@ func deepGet(m map[string]interface{}, keys ...string) interface{} {
183188
}
184189
return currVal
185190
}
191+
192+
// normalizeString removes newlines and collapses multiple spaces into one.
193+
func normalizeString(s string) string {
194+
return strings.Join(strings.Fields(s), " ")
195+
}

e2etests/testcase_test.go

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ var testCases = []testCase{
991991
{
992992
Name: "CVE-2018-1125",
993993
NamespaceName: "centos:7",
994-
Description: "DOCUMENTATION: If a process inspected by pgrep has an argument longer than INT_MAX bytes, \"int bytes\" could wrap around back to a large positive int (rather than approaching zero), leading to a stack buffer overflow via strncat(). MITIGATION: The procps suite on Red Hat Enterprise Linux is built with FORTIFY, which limits the impact of this stack overflow (and others like it) to a crash.",
994+
Description: "DOCUMENTATION: If a process inspected by pgrep has an argument longer than INT_MAX bytes, \"int bytes\" could wrap around back to a large positive int (rather than approaching zero), leading to a stack buffer overflow via strncat(). MITIGATION: The procps suite on Red Hat Enterprise Linux is built with FORTIFY, which limits the impact of this stack overflow (and others like it) to a crash.",
995995
Link: "https://access.redhat.com/security/cve/CVE-2018-1125",
996996
Severity: "Low",
997997
Metadata: map[string]interface{}{
@@ -1351,7 +1351,7 @@ var testCases = []testCase{
13511351
},
13521352
{
13531353
Name: "CVE-2020-1045",
1354-
Description: "<p>A security feature bypass vulnerability exists in the way Microsoft ASP.NET Core parses encoded cookie names.</p>\n<p>The ASP.NET Core cookie parser decodes entire cookie strings which could allow a malicious attacker to set a second cookie with the name being percent encoded.</p>\n<p>The security update addresses the vulnerability by fixing the way the ASP.NET Core cookie parser handles encoded names.</p>\n",
1354+
Description: "<p>A security feature bypass vulnerability exists in the way Microsoft ASP.NET Core parses encoded cookie names.</p>\n<p>The ASP.NET Core cookie parser decodes entire cookie strings which could allow a malicious attacker to set a second cookie with the name being percent encoded.</p>\n<p>The security update addresses the vulnerability by fixing the way the ASP.NET Core cookie parser handles encoded names.</p>",
13551355
Link: "https://nvd.nist.gov/vuln/detail/CVE-2020-1045",
13561356
Metadata: map[string]interface{}{
13571357
"NVD": map[string]interface{}{
@@ -1402,7 +1402,7 @@ var testCases = []testCase{
14021402
},
14031403
{
14041404
Name: "CVE-2020-1597",
1405-
Description: "A denial of service vulnerability exists when ASP.NET Core improperly handles web requests. An attacker who successfully exploited this vulnerability could cause a denial of service against an ASP.NET Core web application. The vulnerability can be exploited remotely, without authentication.\nA remote unauthenticated attacker could exploit this vulnerability by issuing specially crafted requests to the ASP.NET Core application.\nThe update addresses the vulnerability by correcting how the ASP.NET Core web application handles web requests.\n",
1405+
Description: "A denial of service vulnerability exists when ASP.NET Core improperly handles web requests. An attacker who successfully exploited this vulnerability could cause a denial of service against an ASP.NET Core web application. The vulnerability can be exploited remotely, without authentication.\nA remote unauthenticated attacker could exploit this vulnerability by issuing specially crafted requests to the ASP.NET Core application.\nThe update addresses the vulnerability by correcting how the ASP.NET Core web application handles web requests.",
14061406
Link: "https://nvd.nist.gov/vuln/detail/CVE-2020-1597",
14071407
Metadata: map[string]interface{}{
14081408
"NVD": map[string]interface{}{
@@ -3032,10 +3032,33 @@ var testCases = []testCase{
30323032
},
30333033
FixedBy: "2.12.3",
30343034
},
3035+
{
3036+
Name: "CVE-2025-68161",
3037+
Description: "The Socket Appender in Apache Log4j Core versions 2.0-beta9 through 2.25.2 does not perform TLS hostname verification of the peer certificate, even when the verifyHostName https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName configuration attribute or the log4j2.sslVerifyHostName https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName system property is set to true.\n\nThis issue may allow a man-in-the-middle attacker to intercept or redirect log traffic under the following conditions:\n\n * The attacker is able to intercept or redirect network traffic between the client and the log receiver.\n * The attacker can present a server certificate issued by a certification authority trusted by the Socket Appender’s configured trust store (or by the default Java trust store if no custom trust store is configured).\n\n\nUsers are advised to upgrade to Apache Log4j Core version 2.25.3, which addresses this issue.\n\nAs an alternative mitigation, the Socket Appender may be configured to use a private or restricted trust root to limit the set of trusted certificates.",
3038+
Link: "https://nvd.nist.gov/vuln/detail/CVE-2025-68161",
3039+
Severity: "Moderate",
3040+
Metadata: map[string]interface{}{
3041+
"NVD": map[string]interface{}{
3042+
"CVSSv3": map[string]interface{}{
3043+
"ExploitabilityScore": 2.2,
3044+
"ImpactScore": 2.5,
3045+
"Score": 4.8,
3046+
"Vectors": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N",
3047+
},
3048+
"CVSSv2": map[string]interface{}{
3049+
"ExploitabilityScore": 0.0,
3050+
"ImpactScore": 0.0,
3051+
"Score": 0.0,
3052+
"Vectors": "",
3053+
},
3054+
},
3055+
},
3056+
FixedBy: "2.25.3",
3057+
},
30353058
},
30363059
AddedBy: "sha256:477d0b4ccc14566aec80c3360aba6c84208c9d337727434c3914bd87b023dab3",
30373060
Location: "usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-tcp-6.0.10-java/vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/6.0.10/logstash-input-tcp-6.0.10.jar:log4j-core",
3038-
FixedBy: "2.12.4",
3061+
FixedBy: "2.25.3",
30393062
},
30403063
{
30413064
Name: "log4j",
@@ -3134,10 +3157,33 @@ var testCases = []testCase{
31343157
},
31353158
FixedBy: "2.17.0",
31363159
},
3160+
{
3161+
Name: "CVE-2025-68161",
3162+
Description: "The Socket Appender in Apache Log4j Core versions 2.0-beta9 through 2.25.2 does not perform TLS hostname verification of the peer certificate, even when the verifyHostName https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName configuration attribute or the log4j2.sslVerifyHostName https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName system property is set to true.\n\nThis issue may allow a man-in-the-middle attacker to intercept or redirect log traffic under the following conditions:\n\n * The attacker is able to intercept or redirect network traffic between the client and the log receiver.\n * The attacker can present a server certificate issued by a certification authority trusted by the Socket Appender’s configured trust store (or by the default Java trust store if no custom trust store is configured).\n\n\nUsers are advised to upgrade to Apache Log4j Core version 2.25.3, which addresses this issue.\n\nAs an alternative mitigation, the Socket Appender may be configured to use a private or restricted trust root to limit the set of trusted certificates.",
3163+
Link: "https://nvd.nist.gov/vuln/detail/CVE-2025-68161",
3164+
Severity: "Moderate",
3165+
Metadata: map[string]interface{}{
3166+
"NVD": map[string]interface{}{
3167+
"CVSSv3": map[string]interface{}{
3168+
"ExploitabilityScore": 2.2,
3169+
"ImpactScore": 2.5,
3170+
"Score": 4.8,
3171+
"Vectors": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N",
3172+
},
3173+
"CVSSv2": map[string]interface{}{
3174+
"ExploitabilityScore": 0.0,
3175+
"ImpactScore": 0.0,
3176+
"Score": 0.0,
3177+
"Vectors": "",
3178+
},
3179+
},
3180+
},
3181+
FixedBy: "2.25.3",
3182+
},
31373183
},
31383184
AddedBy: "sha256:477d0b4ccc14566aec80c3360aba6c84208c9d337727434c3914bd87b023dab3",
31393185
Location: "usr/share/logstash/logstash-core/lib/jars/log4j-core-2.14.0.jar",
3140-
FixedBy: "2.17.1",
3186+
FixedBy: "2.25.3",
31413187
},
31423188
},
31433189
},
@@ -3223,10 +3269,33 @@ var testCases = []testCase{
32233269
},
32243270
FixedBy: "2.12.3",
32253271
},
3272+
{
3273+
Name: "CVE-2025-68161",
3274+
Description: "The Socket Appender in Apache Log4j Core versions 2.0-beta9 through 2.25.2 does not perform TLS hostname verification of the peer certificate, even when the verifyHostName https://logging.apache.org/log4j/2.x/manual/appenders/network.html#SslConfiguration-attr-verifyHostName configuration attribute or the log4j2.sslVerifyHostName https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.sslVerifyHostName system property is set to true.\n\nThis issue may allow a man-in-the-middle attacker to intercept or redirect log traffic under the following conditions:\n\n * The attacker is able to intercept or redirect network traffic between the client and the log receiver.\n * The attacker can present a server certificate issued by a certification authority trusted by the Socket Appender’s configured trust store (or by the default Java trust store if no custom trust store is configured).\n\n\nUsers are advised to upgrade to Apache Log4j Core version 2.25.3, which addresses this issue.\n\nAs an alternative mitigation, the Socket Appender may be configured to use a private or restricted trust root to limit the set of trusted certificates.",
3275+
Link: "https://nvd.nist.gov/vuln/detail/CVE-2025-68161",
3276+
Severity: "Moderate",
3277+
Metadata: map[string]interface{}{
3278+
"NVD": map[string]interface{}{
3279+
"CVSSv3": map[string]interface{}{
3280+
"ExploitabilityScore": 2.2,
3281+
"ImpactScore": 2.5,
3282+
"Score": 4.8,
3283+
"Vectors": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N",
3284+
},
3285+
"CVSSv2": map[string]interface{}{
3286+
"ExploitabilityScore": 0.0,
3287+
"ImpactScore": 0.0,
3288+
"Score": 0.0,
3289+
"Vectors": "",
3290+
},
3291+
},
3292+
},
3293+
FixedBy: "2.25.3",
3294+
},
32263295
},
32273296
AddedBy: "sha256:d84ba7ea7803fa43fca06730523d264b31c562968cfd7020f0584f5ec1b26225",
32283297
Location: "log4j-core-2.12.2.jar",
3229-
FixedBy: "2.12.4",
3298+
FixedBy: "2.25.3",
32303299
},
32313300
},
32323301
},

scripts/ci/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _wait_for_scanner() {
3232
kubectl -n stackrox get pod
3333
POD="$(kubectl -n stackrox get pod -o jsonpath='{.items[?(@.metadata.labels.app=="scanner")].metadata.name}')"
3434
[[ -n "${POD}" ]]
35-
kubectl -n stackrox wait "--for=condition=Ready" "pod/${POD}" --timeout=30m
35+
kubectl -n stackrox wait "--for=condition=Ready" "pod/${POD}" --timeout=40m
3636
kubectl -n stackrox get pod
3737
}
3838

0 commit comments

Comments
 (0)