Title: ROX-34519: Populate VM scan OS from Sensor by vikin91 · Pull Request #20337 · stackrox/stackrox · GitHub
Open Graph Title: ROX-34519: Populate VM scan OS from Sensor by vikin91 · Pull Request #20337 · stackrox/stackrox
X Title: ROX-34519: Populate VM scan OS from Sensor by vikin91 · Pull Request #20337 · stackrox/stackrox
Description: Description After enrichment, look up the VM's guest_os (populated from KubeVirt informer data via Sensor) and use it as scan.operating_system. This provides a human-readable OS name (e.g. "Red Hat Enterprise Linux 10") instead of relying solely on the Scanner V4 distribution identifier. The lookupGuestOS helper queries the v2 datastore (VirtualMachineV2.guest_os) when the enhanced data model is enabled, falling back to the v1 facts map. Values that are empty or "unknown" are ignored, preserving the enricher's default. See also a fallback option that populates OS from Scanner if the one added in this PR fails: #20336 Partially AI-generated. User-facing documentation CHANGELOG.md is updated OR update is not needed documentation PR is created and is linked above OR is not needed Testing and quality the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag CI results are inspected Automated testing added unit tests added e2e tests added regression tests added compatibility tests modified existing tests How I validated my change CI (unit tests) Manually on a cluster Install ACS, create a VM and run an agent. Wait for the scan to arrive. Before this change: ➜ curl -sk -u admin:admin 'https://localhost:8443/v2/virtualmachines' | jq '.virtualMachines[] | {id, name, namespace, scanOS: .scan.operatingSystem}' { "id": "09164dea-8d42-4c00-a2f2-8bf97b69c79a", "name": "rhel10-1", "namespace": "openshift-cnv", "scanOS": null } after this change: ➜ curl -sk -u admin:admin 'https://localhost:8443/v2/virtualmachines' | jq '.virtualMachines[] | {id, name, namespace, scanOS: .scan.operatingSystem}' { "id": "09164dea-8d42-4c00-a2f2-8bf97b69c79a", "name": "rhel10-1", "namespace": "openshift-cnv", "scanOS": "Red Hat Enterprise Linux" }
Open Graph Description: Description After enrichment, look up the VM's guest_os (populated from KubeVirt informer data via Sensor) and use it as scan.operating_system. This provides a human-readable OS name (e.g. &quo...
X Description: Description After enrichment, look up the VM's guest_os (populated from KubeVirt informer data via Sensor) and use it as scan.operating_system. This provides a human-readable OS name (e.g. ...
Opengraph URL: https://github.com/stackrox/stackrox/pull/20337
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6abe9c35-275e-105f-dccb-8da627c604fa |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B7BA:1C7367:68BCF2:998D5F:6A4E1226 |
| html-safe-nonce | e361d5b7450101db6937f296c5033f05c9f5b2f50903c50b1fe12a499b6072bc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0JBOjFDNzM2Nzo2OEJDRjI6OTk4RDVGOjZBNEUxMjI2IiwidmlzaXRvcl9pZCI6IjEzNzg5NDk0NzYzODM1MDM3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 595ebc28e0c324b15541fb1f353df520884e78a0ca4c01ffdf8b115b5655a434 |
| hovercard-subject-tag | pull_request:3623485118 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/stackrox/stackrox/pull/20337/files |
| twitter:image | https://avatars.githubusercontent.com/u/114479?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/114479?s=400&v=4 |
| og:image:alt | Description After enrichment, look up the VM's guest_os (populated from KubeVirt informer data via Sensor) and use it as scan.operating_system. This provides a human-readable OS name (e.g. &quo... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/stackrox/stackrox git https://github.com/stackrox/stackrox.git |
| octolytics-dimension-user_id | 40638982 |
| octolytics-dimension-user_login | stackrox |
| octolytics-dimension-repository_id | 434017296 |
| octolytics-dimension-repository_nwo | stackrox/stackrox |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 434017296 |
| octolytics-dimension-repository_network_root_nwo | stackrox/stackrox |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ea9187571e3edc5f2780f750631138669441ca50 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width