Commit Graph

68 Commits

Author SHA1 Message Date
Devyansh Somvanshi ceaa3b6d03 webui: include feature type in global search (match, regex, api, …) (#2906)
* webui: include feature type in global search (match, regex, etc.)

Searching for "match" or "regex" in the capa Explorer web UI produced
no results because PrimeVue's globalFilterFields only included the
name field, while the feature kind (e.g. "match", "regex", "api") is
stored in the separate typeValue field.

Add 'typeValue' to globalFilterFields so that the global search box
matches nodes by both their value (name) and their kind (typeValue).
No change to rendering or data structure; only the set of fields
consulted during filtering is widened.

Fixes #2349.

* changelog: add entry for #2349 webui global search fix
2026-03-12 10:43:49 -06:00
Devyansh Somvanshi d97b61551d webui: show error when JSON does not follow expected result document schema (#2871)
* webui: show error when JSON does not follow expected schema

Validate result document has required fields (meta, meta.version,
meta.analysis, meta.analysis.layout, rules) after parse. Show
user-friendly error; for URL loads suggest reanalyzing (e.g. VT).

Fixes #2363

* webui: fix array validation bug and deduplicate VT suggestion string

- introduce isInvalidObject() helper (checks !v || typeof !== "object" || Array.isArray)
  so that arrays are correctly rejected in schema validation
- extract VT_REANALYZE_SUGGESTION constant to eliminate the duplicated string
  in loadRdoc()

Addresses review feedback on #2871

* webui: address review - validate feature_counts, hoist VT_REANALYZE_SUGGESTION

- Add validation for meta.analysis.feature_counts in validateRdocSchema()
  so parseFunctionCapabilities and other consumers do not hit missing/invalid
  feature_counts at runtime.
- Require feature_counts to have either 'functions' or 'processes' array
  (static vs dynamic result documents).
- Move VT_REANALYZE_SUGGESTION to module top level to avoid redefining
  on every loadRdoc call.

* webui: allow file-scoped-only result documents in schema validation

- Validation: allow feature_counts without functions/processes arrays; if
  present they must be arrays.
- rdocParser: default feature_counts.functions to [] when missing so
  file-scoped-only docs do not throw.

* webui: remove leading space from VT_REANALYZE_SUGGESTION constant

Per review feedback: the concatenation at call sites handles spacing,
so the constant should not carry a leading space.
2026-02-26 09:35:24 -07:00
Devyansh Somvanshi e41b5fb150 webui: fix 404 for "View rule in capa-rules" by using proper URL encoding (#2868)
* webui: fix 404 for \"View rule in capa-rules\" links

The createCapaRulesUrl function was constructing URLs by lowercasing
the rule name and replacing spaces with hyphens, which produced URLs
like /rules/packaged-as-single-file-.net-application/ (404).

The capa-rules website uses the original rule name with URL encoding
(e.g. /rules/packaged%20as%20single-file%20.NET%20application/).

Use encodeURIComponent() on the rule name to produce correct URLs.

Fixes #2482

* refactor: extract baseUrl constant in createCapaRulesUrl per code review
2026-02-23 13:10:31 -07:00
Ana Maria Martinez Gomez df7697db84 [copyright + license] Add missing headers
Add copyright and license information headers to the source code files
inside the `web` directory and the `capa/render/proto/capa.proto` file.
I have used addlicense to add the headers.
2025-01-15 08:52:42 -07:00
Fariss 6447319cc7 explorer web: wrap long function calls (#2447)
Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
2024-10-10 13:40:04 +02:00
Soufiane Fariss 2a13bf6c0b capa Explorer Web: fix lint 2024-10-02 16:10:23 +02:00
Fariss e9f4f5bc31 capa Explorer Web: remove unneeded attribute 2024-10-02 16:05:38 +02:00
Soufiane Fariss e7400be99a capa Explorer Web: add provide feedback buttom 2024-10-02 15:54:07 +02:00
Soufiane Fariss 2f5a227fb0 capa Explorer Web: fix import features 2024-10-02 14:49:58 +02:00
Fariss 16eae70c17 capa Explorer Web: improve url navigation (#2425)
* explorer web: improve url navigation

This commit enhances the navigation guard for the /analysis route to
provide a better user experience when loading data from a URL:

Previously: users browsing to /analysis were always redirected to
the homepage (/).

With this commit:
- If a user accesses /analysis without an rdoc parameter, they are still
  redirected to the homepage.
- If a user accesses /analysis with an rdoc parameter, the following
  occurs:
  The user is redirected to the homepage (/) and the rdoc parameter is
  preserved in the URL, capa Explorer Web then loads the rdoc from URL.

---------

Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
2024-10-01 19:25:20 +02:00
mr-tz f024e1d54c bump upload size limit to 100MB from 10MB 2024-09-24 12:09:38 +00:00
Moritz e07ff1c76c Update web pages (#2354)
* extend descriptions and improve styling

* s/capa explorer web/capa Explorer Web

* set htmlWhitespaceSensitivity to ignore and reformat
2024-09-11 20:28:04 +02:00
Fariss e70d5b3e27 webui: show capabilities by function - make function count reactive (#2352)
* web explorer: make function count reflective when show-lib-func is
toggled on/off

* introduce match-count class to mute and minimize match count text labels

* fix typo
2024-09-10 16:46:42 +02:00
Fariss 68e07fbb9a web: omit unneeded function param in createCapaRulesUrl (#2342) 2024-08-29 10:42:23 -06:00
Willi Ballenthin 729a1a85b7 cli: link to rule names to capa rules website (#2338)
* web: rules: redirect from various rule names to canonical rule URL

closes #2319

Update index.html

Co-authored-by: Moritz <mr-tz@users.noreply.github.com>

* cli: link to rule names to capa rules website

* just: make `just lint` run all steps, not fail on first error

---------

Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
2024-08-29 16:56:14 +02:00
Fariss b4f60eca64 web: fix class feature type (#2331) 2024-08-26 05:12:55 -06:00
Soufiane Fariss 1ffee81cea introduce getting started step to explorer landing page 2024-08-23 17:13:43 +02:00
Soufiane Fariss f2ed09861e web: modify theming and add info to landing page 2024-08-21 18:49:26 +02:00
Soufiane Fariss 9959eb6bae web: edit explorer README 2024-08-21 18:33:58 +02:00
Fariss 980814f7df update code comment
Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
2024-08-21 16:24:58 +02:00
Soufiane Fariss 6049062173 fix: typo Preview Dynamic 2024-08-21 11:05:21 +02:00
Soufiane Fariss 05083cfb6e refactor and optimize parseRules routine 2024-08-21 11:05:21 +02:00
Soufiane Fariss 0bdfb37287 use monospace font for match location nodes 2024-08-21 11:05:21 +02:00
Soufiane Fariss 5f5393af69 dynamic: disable process column and collapse pid into process 2024-08-21 11:05:21 +02:00
Soufiane Fariss 5c1c1b0ba9 remove default option scrollable and minify text 2024-08-21 11:05:21 +02:00
Soufiane Fariss 8fd90883b4 web: refactor and add support for laoding remote .gz using rdoc query param 2024-08-21 11:05:21 +02:00
Soufiane Fariss c4c35e914d fix lint 2024-08-19 17:19:57 +02:00
Soufiane Fariss 1593779d6b use preview buttons as redirect to static URLs 2024-08-19 17:17:07 +02:00
Soufiane Fariss 5c6faaefff relax version down to 6.1.0 2024-08-19 17:17:07 +02:00
Soufiane Fariss 864cd77f9f remove loading function for preview data 2024-08-19 17:17:07 +02:00
Soufiane Fariss 164e075ca9 fix preview data placeholders 2024-08-19 15:51:06 +02:00
Soufiane Fariss 7592cfe268 don't include preview files in bundle mode 2024-08-19 15:22:12 +02:00
Soufiane Fariss 6a2039e7a6 bump max matches in dynamic mode to 25 matches per rule 2024-08-19 15:21:38 +02:00
Soufiane Fariss 0e4872507d process gzipped files 2024-08-19 15:20:27 +02:00
Soufiane Fariss 7e766048fa remove preview buttons in release mode 2024-08-19 15:13:02 +02:00
Soufiane Fariss 7c26490caa remove download button in release mode 2024-08-19 15:12:33 +02:00
Soufiane Fariss 4501955728 remove octal repr for hex values 2024-08-16 23:37:30 +02:00
Soufiane Fariss 00cce585d6 remove sorting from columns 2024-08-16 18:52:53 +02:00
Soufiane Fariss 19e2097f79 change placeholder text 2024-08-16 18:52:02 +02:00
Soufiane Fariss b67bd4d084 add file-level rules to capabilities by function 2024-08-16 18:23:44 +02:00
Soufiane Fariss 854759cb43 add tooltip to show decimal/octal rep 2024-08-16 18:17:34 +02:00
Soufiane Fariss 03e2195582 add copy rule name and description to VT 2024-08-16 16:49:51 +02:00
Soufiane Fariss 8ca88d94d5 disable show lib rules button if none 2024-08-16 14:14:29 +02:00
Soufiane Fariss d3e3c966d6 web: introduce column filters and UI tweaks 2024-08-16 12:57:44 +02:00
Soufiane Fariss c73abb8855 add 'distinct' keyword to clarify count is distinct 2024-08-15 17:05:47 +02:00
Soufiane Fariss 04071606cd fix global search in shhow capabilities by function 2024-08-15 17:03:02 +02:00
Soufiane Fariss 25e9e18097 rearrange navbar icons
moves FLARE logo to the right left side, and make a link to /
2024-08-15 16:48:54 +02:00
Soufiane Fariss 8dcb7a473e web: diplay results in new /analysis route 2024-08-15 16:10:41 +02:00
Soufiane Fariss 216bfb968d fix typo, and move release asset to public dir
This commit -
- fixes a a typo in package.json (outDir)
- sets the href of the zip file to ./
- moves the zip asset to the public dir.

Note: public dir is a special dir which hosts files that would be served
as is, so it makes sense to put the release for download there.
2024-08-12 17:26:50 +02:00
Fariss 32fefa60cc Merge branch 'master' into add-download-button 2024-08-12 15:25:41 +02:00