ROX-33978: Add item to create scheduled image vulnerabilities report#19879
Open
pedrottimark wants to merge 1 commit intomasterfrom
Open
ROX-33978: Add item to create scheduled image vulnerabilities report#19879pedrottimark wants to merge 1 commit intomasterfrom
pedrottimark wants to merge 1 commit intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19879 +/- ##
==========================================
- Coverage 49.60% 49.58% -0.02%
==========================================
Files 2763 2766 +3
Lines 208339 208530 +191
==========================================
+ Hits 103342 103408 +66
- Misses 97331 97450 +119
- Partials 7666 7672 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
🚀 Build Images ReadyImages are ready for commit 57bdeac. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-568-g57bdeac7d1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Review: hide space in case changed files displays scoped search filter more clearly
Objective
Provide equivalent filter for scheduled reports as view-based reports
Analysis
Find in Files
<CreateReportDropdownFind in Files
<CreateViewBasedReportModalditto and observe:isViewBasedReportsEnabledrequires read'WorkflowAdministration'permission to create view-based reportTherefore, conditional rendering of dropdown item to require write permission to create scheduled report
queryprop has the string for backend requestTherefore, use the same value or call the same function
vulnerabilityViewBasedReportsPathfor linkTherefore, use sibling
vulnerabilityConfigurationReportsPathpathSolution
Edit CreateReportDropdown.tsx file.
onSelectasonSelectExportReportAsCSVprop.onSelectCreateScheduledReportprop.Edit ImageVulnerabilityReports.utils.ts file.
?action=createFromFilter&…query string from?action=generate&…prototype to create policy in ROX-33943: Replace createStructuredSelector in PolicyPage #19805Edit 3 files that render
CreateReportDropdownelement.Unlike view-based report that needs request query directly, scheduled report receives it indirectly (that is, from search filter to URL query, from URL query to search filter, and then from search fiter to request query) therefore factor out and search filter as local variable.
deploymentScopedSearchFilterForReportimageScopedSearchFilterForReportworkloadCvesScopedSearchFilterAdd
wrapInQuotes(deploymentId)for exact match to close existing loophole.Residue
?action=createFromFilter&…query string.User-facing documentation
Testing and quality
Automated testing
How I validated my change
npm run tscin ui/apps/platform folder.npm run lint:fast-devin ui/apps/platform folder.npm run startin ui/apps/platform folder with staging demo as centralManual testing
Temporarily edit code to enable
'ROX_VULNERABILITY_REPORTS_ENHANCED_FILTERING'feature flag.See step 3 for picture of Create scheduled report dropdown item.
Visit /main/vulnerabilities/platform select search filters, click Create report, and then click Create scheduled report
See query string in request payload which is same as for view-based report
query: "Platform Component:true+SEVERITY:CRITICAL_VULNERABILITY_SEVERITY,IMPORTANT_VULNERABILITY_SEVERITY,MODERATE_VULNERABILITY_SEVERITY+FIXABLE:true+Cluster:\"staging-secured-cluster\"+Namespace:\"stackrox\"+Vulnerability State:OBSERVED"See query string in address of Vulnerability Reporting page
?action=createFromFilter&s[Platform%20Component]=true&s[SEVERITY]=CRITICAL_VULNERABILITY_SEVERITY&s[SEVERITY]=IMPORTANT_VULNERABILITY_SEVERITY&s[SEVERITY]=MODERATE_VULNERABILITY_SEVERITY&s[FIXABLE]=true&s[Cluster]="staging-secured-cluster"&s[Namespace]="stackrox"&s[Vulnerability%20State]=OBSERVEDVisit /main/vulnerabilities/user-workloads click Deployments, click a deployment link, select search filters, click Create report, and then click Create scheduled report
See query string in request payload
query: "Platform Component:false+EPSS Probability:>=0.9+CVE Created Time:>01/01/2026+Vulnerability State:OBSERVED"See query string in view-based report without
wrapInQuotesfunction call"Platform Component:false+Deployment ID:r/89a416b4-1135-4f4c-ba22-5b3b30f23d74+EPSS Probability:>=0.9+CVE Created Time:>01/01/2026"See query string in view-based report with
wrapInQuotesfunction callquery: "Platform Component:false+Deployment ID:\"89a416b4-1135-4f4c-ba22-5b3b30f23d74\"+EPSS Probability:>=0.9+CVE Created Time:>01/01/2026"See query string in address of Vulnerability Reporting page without
wrapInQuotesfunction call?action=createFromFilter&s[Platform%20Component]=false&s[Deployment%20ID]=89a416b4-1135-4f4c-ba22-5b3b30f23d74&s[EPSS%20Probability]=>%3D0.9&s[CVE%20Created%20Time]=>01%2F01%2F2026See query string in address of Vulnerability Reporting page without
wrapInQuotesfunction call?action=createFromFilter&s[Platform%20Component]=false&s[Deployment%20ID]="89a416b4-1135-4f4c-ba22-5b3b30f23d74"&s[EPSS%20Probability]=>%3D0.9&s[CVE%20Created%20Time]=>01%2F01%2F2026Visit /main/vulnerabilities/all-images click Images, click an image link, select search filters, click Create report, and then click Create scheduled report
See query string in request payload
"Platform Component:false+EPSS Probability:>=0.9+CVE Created Time:>01/01/2026+Vulnerability State:OBSERVED"See query string in view-based report
query: "Platform Component:true,false,-+Image SHA:sha256:54de823e633ff29d46924d0a121e0896def54587ce9c84918ae71e7fa7245002+Component Layer Type:BASE_IMAGE+Component Source:OS+Vulnerability State:OBSERVED"See query string in address of Vulnerability Reporting page
?action=createFromFilter&s[Platform%20Component]=true&s[Platform%20Component]=false&s[Platform%20Component]=-&s[Image%20SHA]=sha256%3A54de823e633ff29d46924d0a121e0896def54587ce9c84918ae71e7fa7245002&s[Component%20Layer%20Type]=BASE_IMAGE&s[Component%20Source]=OS&s[Vulnerability%20State]=OBSERVED