RPM analysis UI and API#220
Conversation
|
depends on RHEcosystemAppEng/vulnerability-analysis#222 |
aaf2dbc to
112dd9e
Compare
544e801 to
551a44e
Compare
8527aa1 to
cbf573f
Compare
|
/retest |
|
/re-test |
|
/retest |
|
/test morpheus-client-on-pr |
| @Schema(required = true) String name, | ||
| @Schema(required = true) String version, | ||
| @Schema(required = true) String release, | ||
| @Schema(required = true) String arch, |
There was a problem hiding this comment.
@batzionb Better have it as enum or validated using hibernate validator' regex to be one of "x86_64", "amd64", "i686","i386", "aarch64", "arm64", "ppc64le", "s390x" , and also allow it to be blank as well.
There was a problem hiding this comment.
@zvigrinberg what do u mean "( accepting also "blank" value means "all" architectures)."
there can be only one Arch per test , a blank can mean we take the default arch
There was a problem hiding this comment.
@batzionb Empty can be default arch ( x86_64/amd64) for that purpose or means that we want it without arch ( architecture agnostic , most vulnerabilities are for all architectures by nature, as relatively only small parts of code are coupled only to a specific cpu arch)...
Anyway needs to be correlated with the agent behavior and logic
@RedTanny can you remind me, are you treating a blank value as some default ( e.g. amd64) or as all arches? ( arch agnostic), this is what i'm remembering from one of the iterations of the review i've made, and also saw this to confirm it:
https://github.com/RedTanny/vulnerability-analysis/blob/1941f95bd2b7fbce18de3c0d7e69a619cfbe8620/src/vuln_analysis/utils/rpm_checker_prompts.py#L97-L103
But maybe you're doing some pre-processing and this is not the assumption on the input.
There was a problem hiding this comment.
Seems from here if arch is not sent it defaults to x86_64
https://github.com/redtanny/vulnerability-analysis/blob/APPENG-4467-Rpm-Checker/src/exploit_iq_commons/data_models/common.py#L71
There was a problem hiding this comment.
@zvigrinberg yes what you see in prompt is related to the cve info trying to figure out if the cve is tied to a specific Arch and if not mention we assume it is vulnerable for all arch
There was a problem hiding this comment.
In the UI there's a dropdown to select architecture, the selected one by default is x86_64
I'll make the API force one of these values for now
We can change it later if need be
zvigrinberg
left a comment
There was a problem hiding this comment.
@batzionb OK Sounds good to me.
LGTM Approved.
| * Allowed RPM target architectures for {@code POST /api/v1/reports/new-rpm-report} | ||
| * (aligned with Request Analysis RPM UI). | ||
| */ | ||
| public enum RpmArchitecture { |
There was a problem hiding this comment.
@batzionb Just don't forget to add RegisterForReflection annotation.
|
@vbelouso |
|
/test morpheus-client-on-pr |
RPM package checker analysis (API, UI, reports)
Summary
Implements end-to-end RPM package checker support: users can submit standalone RPM analyses via
POST /api/v1/reports/new-rpm-report, browse them on a dedicated reports experience, and open report detail UIs that branch onpipeline_mode === rpm_package_checker. The goal and behavior are specified in OpenSpec underopenspec/specs/(see Related specifications below).Related specifications (OpenSpec)
openspec/specs/new-rpm-report-api/spec.mdPOST /api/v1/reports/new-rpm-report, validation parity with upload-spdx-style field maps, Morpheusinput.image(pipeline_mode,analysis_type,target_package), OpenAPIopenspec/specs/request-analysis-modal-rpm-fields/spec.mduseApisubmit, 202 navigationopenspec/specs/rpm-package-checker-report/spec.mdreport.input.image.pipeline_modeisrpm_package_checkerinputTypeopenspec/specs/reports-input-type/spec.mdGET /api/v1/reports?inputType=repository|rpm; product-scoped reports excluded; pipeline mode filteropenspec/specs/repository-reports-table/spec.md/reports/rpm), Package / Architecture columns,rpmPackageliteral substring filter, no git repo filter on RPM tabopenspec/specs/request-analysis-modal/spec.mdSupporting updates also appear in
document-titles,reports-table,repository-report-page, and schema/template files underopenspec/schemas/research-first/.Backend
NewRpmReportRequest,TargetPackage,PipelineMode,CveIdRules: typed request + CVE validation aligned with existing upload flows.RpmReportService: builds Morpheus-compatibleinput(rpm_package_checker,analysis_type: source,target_packagewithecosystem: rpm), persists, and submits likePOST /api/v1/reports/new.ReportEndpoint: new RPM route; list reports gainsinputTypeandrpmPackagequery handling per specs.ReportRepositoryService: list filters for standalone RPM vs repository rows; Mongo$regexMatchon concatenated N-V-R for literalrpmPackagesubstring (see unit tests).Report,Image: API model extensions (rpmPackage,rpmArchitecture, target package on image) for list/detail consumers.SbomReportService: small refactors where report creation paths are shared.Frontend
useAnalysisRequestForm,requestAnalysisRpm, modal components.inputType=rpm, Package toolbar search →rpmPackage, table columns for package NVR and arch.RpmAnalysisDetailsSection,RpmTargetPackageArtifactDetails,ContainerRepositoryArtifactDetails, etc.).Tests & fixtures
NewRpmReportRestTest: HTTP contract forPOST .../new-rpm-report(202, storedtarget_package, CVE under scan).ReportListInputTypeRestTest:inputType+ RPM tab behavior; seed row identified byrpmPackageNVR (aligned withrpm.json, not hardcoded scan UUID).ReportRepositoryServiceTest: regex escaping forrpmPackagefilter.src/test/resources/devservices/reports/rpm.json: devservices seed for RPM checker UI/API tests.Tooling
scripts/submit-rpm-report.sh: example curl helper for the new endpoint (optional for operators).Test plan
GET /api/v1/reportswith invalidinputType→ 400;inputType=repositoryexcludesrpm_package_checkerrows../mvnw test(or CI) with Mongo available; spot-check OpenAPI UI fornew-rpm-report.Notes for reviewers
openspec/AGENTS.mdremoval and.cursor/commands/*deletions in the diff are ancillary to the RPM feature; skim if your review scope is product code only.