-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(ui): filter empty Attack Paths queries from the selector in Cloud #12010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| In Prowler Cloud, the Attack Paths query selector now lists only queries that returned data for the selected scan, hiding empty ones | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,6 +129,15 @@ export interface AttackPathQueryDocumentationLink { | |
| link: string; | ||
| } | ||
|
|
||
| // Precomputed per-query result summary from the scan (Prowler Cloud only). | ||
| // `has_data` is null when the query errored; the whole object is null/absent | ||
| // when the query was never precomputed (parameterized, a scan predating the | ||
| // precompute step, or one the bounded pass did not reach). | ||
| export interface AttackPathQueryResultSummary { | ||
| status: "ok" | "error"; | ||
| has_data: boolean | null; | ||
|
Comment on lines
+136
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== ui/types/attack-paths.ts =="
nl -ba ui/types/attack-paths.ts | sed -n '1,240p'
echo
echo "== string-literal unions in ui/types =="
rg -n --glob 'ui/types/**/*.ts' '"[^"]+"\s*\|\s*"[^"]+"' ui/types
echo
echo "== const-object union patterns in ui/types =="
rg -n --glob 'ui/types/**/*.ts' 'as const;' ui/typesRepository: prowler-cloud/prowler Length of output: 230 🏁 Script executed: #!/bin/bash
set -euo pipefail
file="ui/types/attack-paths.ts"
if [ -f "$file" ]; then
echo "== $file (around target lines) =="
nl -ba "$file" | sed -n '120,180p'
else
echo "missing file: $file" >&2
exit 1
fi
echo
echo "== nearby union patterns in ui/types/attack-paths.ts =="
rg -n '"[^"]+"\s*\|\s*"[^"]+"' "$file" || true
echo
echo "== usages of AttackPathQueryResultSummary =="
rg -n 'AttackPathQueryResultSummary' ui || trueRepository: prowler-cloud/prowler Length of output: 252 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== ui/types/attack-paths.ts (lines 120-180) =="
sed -n '120,180p' ui/types/attack-paths.ts | cat -n
echo
echo "== string-literal unions in ui/types =="
rg -n --glob 'ui/types/**/*.ts' '"[^"]+"\s*\|\s*"[^"]+"' ui/types || true
echo
echo "== const-object patterns in ui/types =="
rg -n --glob 'ui/types/**/*.ts' 'as const;' ui/types || true
echo
echo "== usages of AttackPathQueryResultSummary =="
rg -n 'AttackPathQueryResultSummary' ui || trueRepository: prowler-cloud/prowler Length of output: 7091 Use the const-object pattern for
🤖 Prompt for AI AgentsSources: Coding guidelines, Path instructions |
||
| } | ||
|
|
||
| export interface AttackPathQueryAttributes { | ||
| name: string; | ||
| short_description: string; | ||
|
|
@@ -137,6 +146,7 @@ export interface AttackPathQueryAttributes { | |
| parameters: AttackPathQueryParameter[]; | ||
| attribution: AttackPathQueryAttribution | null; | ||
| documentation_link?: AttackPathQueryDocumentationLink | null; | ||
| result_summary?: AttackPathQueryResultSummary | null; | ||
| } | ||
|
|
||
| export interface AttackPathQuery { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Describe only confirmed-empty queries as hidden.
This says only queries that returned data remain, but errored, parameterized, and precompute-missing queries intentionally remain visible. Update it to say that queries confirmed empty for the selected scan are hidden.
📝 Committable suggestion
🤖 Prompt for AI Agents