feat(vulnerability): adapt API to v13s vulnerability priority model - #452
feat(vulnerability): adapt API to v13s vulnerability priority model#452ybelMekk wants to merge 39 commits into
Conversation
f9eb406 to
3a773f3
Compare
There was a problem hiding this comment.
Pull request overview
Updates the vulnerability domain in nais/api to match the latest v13s “risk-tier” model, while keeping GraphQL/API naming stable and exposing additional CVE signal data needed by the frontend.
Changes:
- Adds EPSS/KEV/ransomware signals (and fix version) to
ImageVulnerability, and introduces derivedCVEPriorityonCVE. - Extends sorting/filtering to support priority-based ordering for image vulnerabilities, CVEs, and workload vulnerability summaries.
- Updates issue generation to use tier counts (ACT_NOW/HIGH_RISK) and introduces a new issue type for external-ingress workloads with ACT_NOW vulnerabilities.
Reviewed changes
Copilot reviewed 15 out of 19 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/vulnerability/transform.go | Maps new CVE signal fields and tier summary fields into API models. |
| internal/vulnerability/transform_test.go | Adds unit tests for CVE priority derivation. |
| internal/vulnerability/sortfilter.go | Registers new sort fields for priority/tier counts. |
| internal/vulnerability/queries.go | Adds priority ordering for CVEs and hardens totalCount → int32 conversion. |
| internal/vulnerability/models.go | Extends models with CVE priority enum + new fields (EPSS/KEV/etc). |
| internal/vulnerability/fake/fakedata.go | Updates fake vulnerability summaries/findings to include tier and signal fields. |
| internal/issue/queries.go | Adds conversion support for the new issue type details payload. |
| internal/issue/model.go | Defines the new issue type and its details struct. |
| internal/issue/checker/workload_v13s.go | Updates issue logic to use tier counts; adds external-ingress ACT_NOW issue emission. |
| internal/graph/schema/vulnerability.graphqls | Extends public GraphQL schema with new fields/enums/sort options. |
| internal/graph/schema/issues.graphqls | Adds the new issue type + GraphQL type. |
| internal/graph/issues.resolvers.go | Wires resolvers for the new issue GraphQL type. |
| internal/graph/gengql/vulnerability.generated.go | Regenerates gqlgen output for vulnerability schema changes. |
| internal/graph/gengql/schema.generated.go | Regenerates gqlgen output for schema/type additions. |
| internal/graph/gengql/root_.generated.go | Regenerates gqlgen resolver root + complexity updates. |
| internal/graph/gengql/issues.generated.go | Regenerates gqlgen output for the new issue type. |
| integration_tests/issues_for_team.lua | Updates expected message/severity for vulnerable image issues. |
| go.mod | Bumps v13s API dependency to include risk-tier summary model updates. |
| go.sum | Updates dependency checksums accordingly. |
Files not reviewed (3)
- internal/graph/gengql/issues.generated.go: Language not supported
- internal/graph/gengql/schema.generated.go: Language not supported
- internal/graph/gengql/vulnerability.generated.go: Language not supported
3d8ae28 to
c82b22d
Compare
a580717 to
82b803e
Compare
thokra-nav
left a comment
There was a problem hiding this comment.
Nå er det veldig mange tall på f.eks. ImageVulnerabilitySummary. Skal noen av de gamle få en @deprecated? Hvordan skal brukerne vite hva som skal brukes og ikke?
Godt poeng 👍 Dette er ikke ment som “gamle vs nye” tall, men ulike dimensjoner
|
4277e04 to
fd27b92
Compare
|
Enig med @thokra-nav her, det blir veldig mange int / float felt direkte på den Det hadde vært fint å kunne markere "det gamle" med |
2de4d20 to
2e9d9f6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 21 changed files in this pull request and generated 7 comments.
Files not reviewed (3)
- internal/graph/gengql/issues.generated.go: Generated file
- internal/graph/gengql/schema.generated.go: Generated file
- internal/graph/gengql/vulnerability.generated.go: Generated file
589763e to
7d3d693
Compare
5abc538 to
a673558
Compare
a673558 to
ac964f8
Compare
…checker - Add priorityActNow, priorityHigh, priorityElevated, priorityMonitor fields to ImageVulnerabilitySummary model - Expose priority fields in vulnerability.graphqls and GraphQL resolvers - Add VULNERABILITY_PRIORITY_ACT_NOW and VULNERABILITY_PRIORITY_HIGH sort fields - Add ExternalIngressActNowVulnerabilityIssue type and issue checker - Map priority signals (EPSS, KEV, ransomware) via VulnerabilityPrioritySignals - Bump golang.org/x/net to v0.55.0 and golang.org/x/crypto to v0.52.0 to fix known vulnerabilities - Update v13s/pkg/api to v0.0.0-20260525171357-13563f32226d (priority_elevated, priority_monitor support)
…; fix ExternalIngressActNow resolver stubs; add priority sort fields
…ier to ImageVulnerabilitySummary
…ue type and resolvers
…s for consistency
…dling in workload processing
ac964f8 to
6cbc049
Compare
…ate related GraphQL schema
…with counts by severity and priority
This pull request introduces support for a new "urgent" severity level for external ingress vulnerability issues in the GraphQL API, deprecating the previous "critical" level for this use case. It also enhances the vulnerability summary returned by the API by adding breakdowns by severity and priority. Additionally, several dependencies have been updated.
GraphQL API changes:
Added the
ExternalIngressUrgentVulnerabilityIssuetype, including its resolver, GraphQL schema definition, and support for resolving its fields and returning it from theIssueandNodeinterfaces. This enables clients to query for urgent ingress vulnerability issues separately from the deprecated critical type. [1] [2] [3] [4] [5] [6] [7] [8] [9]Deprecated the
EXTERNAL_INGRESS_CRITICAL_VULNERABILITYissue type in the GraphQL schema and introduced the newEXTERNAL_INGRESS_URGENT_VULNERABILITYtype.Enhanced the vulnerability summary GraphQL response to include
countsBySeverityandcountsByPriorityfields, providing more granular statistics for clients. [1] [2]Test updates:
Dependency updates:
go.mod, includinggithub.com/nais/v13s/pkg/api,golang.org/x/sync,google.golang.org/api, andgithub.com/googleapis/enterprise-certificate-proxy. [1] [2] [3]