Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Changelog
Entries in this file should be limited to:
- Any changes that introduce a deprecation in functionality, OR
Expand Down Expand Up @@ -51,6 +52,7 @@ Please avoid adding duplicate information across this changelog and JIRA/doc inp
- ROX-13265: Fix missing rationale and remediation texts for default policy "Deployments should have at least one ingress Network Policy"
- ROX-13500: Previously, deployment YAML check on V1 CronJob workload would cause Central to panic. This is now fixed.
- `cves.ids` field of `storage.VulnerabilityRequest` object, which is in the response of `VulnerabilityRequestService` (`/v1/cve/requests/`) endpoints, has been renamed to `cves.cves`.
- ROX-13347: Vulnerability reporting scopes specifying cluster and/or namespace names now perform exact matches on those entities, as opposed to the erroneous prefix match.

## [3.72.0]

Expand Down
2 changes: 1 addition & 1 deletion central/reports/common/query_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ func TestBuildQuery(t *testing.T) {
rq, err := qb.BuildQuery()
assert.NoError(t, err)

assert.ElementsMatch(t, []string{"Cluster:remote+Namespace:ns1", "Cluster:secured+Namespace:ns2"}, rq.ScopeQueries)
assert.ElementsMatch(t, []string{`Cluster:"remote"+Namespace:"ns1"`, `Cluster:"secured"+Namespace:"ns2"`}, rq.ScopeQueries)
assert.Equal(t, "Fixable:true+Severity:\"CRITICAL_VULNERABILITY_SEVERITY\",\"IMPORTANT_VULNERABILITY_SEVERITY\"", rq.CveFieldsQuery)
}
4 changes: 2 additions & 2 deletions pkg/sac/effectiveaccessscope/compacted.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ func (c ScopeTreeCompacted) ToScopeQueries() []string {
scopeQueries := make([]string, 0, len(c))
for cluster, namespaces := range c {
if len(namespaces) == 1 && namespaces[0] == "*" {
scopeQueries = append(scopeQueries, fmt.Sprintf("%s:%s", search.Cluster.String(), cluster))
scopeQueries = append(scopeQueries, fmt.Sprintf("%s:%q", search.Cluster.String(), cluster))
continue
}
for _, ns := range namespaces {
scopeQueries = append(scopeQueries, fmt.Sprintf("%s:%s+%s:%s",
scopeQueries = append(scopeQueries, fmt.Sprintf("%s:%q+%s:%q",
search.Cluster.String(), cluster,
search.Namespace.String(), ns))
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/sac/effectiveaccessscope/compacted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ func TestScopeQueries(t *testing.T) {
stc: map[string][]string{
"prodCluster": {"*"},
},
expectedScopeQueries: []string{"Cluster:prodCluster"},
expectedScopeQueries: []string{`Cluster:"prodCluster"`},
},
{
desc: "single cluster scope tree with specific namespaces",
stc: map[string][]string{
"prodCluster": {"webserver", "db"},
},
expectedScopeQueries: []string{"Cluster:prodCluster+Namespace:webserver", "Cluster:prodCluster+Namespace:db"},
expectedScopeQueries: []string{`Cluster:"prodCluster"+Namespace:"webserver"`, `Cluster:"prodCluster"+Namespace:"db"`},
},
{
desc: "multiple cluster scope tree with specific namespaces",
stc: map[string][]string{
"prodCluster": {"webserver", "db"},
"testCluster": {"test1", "test2"},
},
expectedScopeQueries: []string{"Cluster:prodCluster+Namespace:webserver",
"Cluster:prodCluster+Namespace:db",
"Cluster:testCluster+Namespace:test1",
"Cluster:testCluster+Namespace:test2",
expectedScopeQueries: []string{`Cluster:"prodCluster"+Namespace:"webserver"`,
`Cluster:"prodCluster"+Namespace:"db"`,
`Cluster:"testCluster"+Namespace:"test1"`,
`Cluster:"testCluster"+Namespace:"test2"`,
},
},
}
Expand Down