Skip to content

Commit f3f0d93

Browse files
yenienserranowazuhcigonzaarancibiafelipegonzalezmvDesvelao
authored
Merge 5.0.1 into main (#1462)
* feat: bump 5.0.1 * Merge 5.0.0 into 5.0.1 (#1461) * Dashboard - Changelog standardization & enforcement (#1417) * chore(devx): add changelog enforcer CI workflow * chore(devx): standardize CHANGELOG format * chore(devx): standardize CHANGELOG format * chore(devx): update bumper to regenerate CHANGELOG on version bump The update_changelog() function now rewrites CHANGELOG.md using the new standard format: version header, Added section with support entry, and Prior versions section with links pruned to the last 2 minor versions. * fix(devx): use branch name without v prefix in prior version links * chore(devx): use actions/checkout@v6 in changelog verifier workflows * feat: add changelog verifier GitHub Action - Introduced a new workflow to verify that CHANGELOG.md is updated for pull requests unless the 'no-changelog' label is applied. feat: implement unit tests for tools scripts - Created a new workflow to run unit tests for tools scripts located under the tools/ directory on pull requests. - Tests are executed in isolated environments using throwaway fixture repositories. feat: add changelog_bump.sh script - Implemented a script to manage the CHANGELOG.md file during version bumps, ensuring proper formatting and prior version references. chore: add .gitignore for test temporary files - Added a .gitignore file to exclude temporary files generated during testing. docs: create README for tools unit tests - Documented the usage and structure of unit tests for tools scripts, including instructions for running tests. test: add run_all.sh to execute all unit tests - Created a script to run all unit tests for tools scripts and report results. test: implement unit tests for changelog_bump.sh - Added comprehensive tests for changelog_bump.sh, covering argument validation, version bumps, and changelog updates. test: implement unit tests for repository_bumper.sh - Added unit tests for repository_bumper.sh, validating argument handling, version bumps, and file updates. * chore: update changelog verifier workflow to use Ubuntu 24.04 and enhance concurrency settings --------- Co-authored-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> * Make Discover CSV download row limit configurable (#1442) * feat: make Discover CSV download row limit configurable via reports.csv.maxRows (#1434) * Add change log * feat(discover): add reference to max row in csv export setting --------- Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> * Update CLAUDE configuration and add new skills (#1444) * Update CLAUDE configuration and add new skills - Enhance .gitignore to include specific CLAUDE settings and temporary files. - Revise CLAUDE.md to clarify project context and architecture. - Introduce new skills for analyzing vulnerabilities, checking standards, creating pull requests, developing issues, and resolving CVEs. - Add settings.json for CLAUDE permissions management. - Document workflows and commands for new skills in their respective SKILL.md files. * Enhance CLAUDE.md documentation for local development - Clarify the usage of the yarn run v1.22.22 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. command for the raw OSD dev server. - Introduce a new section detailing the local run model using the repo's Docker dev environment. - Provide instructions for running the full stack locally, including mounting external plugin repositories. * change message to no reference local routes --------- Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com> * Create issue-creation skill and update PR template (#1447) * Enhance issue and PR templates for clarity and consistency; add new issue creation skill Signed-off-by: Diego Garcia <diego.garcia@wazuh.com> * Remove redundant label type/task from task issue template Signed-off-by: Diego Garcia diego.garcia@wazuh.com * Document stale enhancement label in issue-creation skill for consistency Signed-off-by: Diego Garcia <diego.garcia@wazuh.com> * Standardize issue-creation skill to apply real Wazuh labels instead of stale template frontmatter Signed-off-by: Diego Garcia <diego.garcia@wazuh.com> * Align issue-creation skill section 3 style with sibling repos (prose, not a redundant label bullet list) Signed-off-by: Diego Garcia <diego.garcia@wazuh.com> * Fix task_template.md label claim: remove non-existent type/task, use level/task only Signed-off-by: Diego Garcia <diego.garcia@wazuh.com> * fix(skills): point create-pr example at a filled body, not the template The gh pr create example in step 6 pointed --body-file at the blank pull_request_template.md itself, which would file a PR with unfilled placeholder text if run verbatim. Point it at a filled temp file instead. Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> * docs: remove How to Test section from PR template Manual verification steps are now covered elsewhere; drop the redundant section to simplify the template. Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> * docs: rework PR template review checklist Replace the fixed test-command checklist with broader review items covering evidence, documentation, dependencies, and labeling. Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> --------- Signed-off-by: Diego Garcia <diego.garcia@wazuh.com> Signed-off-by: Diego Garcia diego.garcia@wazuh.com Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> * feat: bump 5.0.0 * feat: revert 5.0.0 references * Enforce Prettier formatting check on commit to prevent Prettier failures in PR pipelines (#1449) chore(devx): add prettier check to pre-commit hook and CI workflow * feat: bump 5.0.0 * Merge 4.14.8 into 5.0.0 (#1460) * feat: bump 4.14.8 * Merge 4.14.7 into 4.14.8 (#1458) * feat: bump 4.14.7 * Change tag reference for 4.14.7 (#1432) fix: update tag references to 4.14.7 in dashboard build workflows --------- Co-authored-by: wazuhci <22834044+wazuhci@users.noreply.github.com> --------- Co-authored-by: wazuhci <22834044+wazuhci@users.noreply.github.com> * Fix prettier --------- Signed-off-by: Diego Garcia <diego.garcia@wazuh.com> Signed-off-by: Diego Garcia diego.garcia@wazuh.com Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> Co-authored-by: Gonzalo Arancibia <72573241+gonzaarancibia@users.noreply.github.com> Co-authored-by: Juan Felipe Gonzalez Ortiz <53414652+felipegonzalezmv@users.noreply.github.com> Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com> Co-authored-by: Diego García <82405377+Ripdiegozz@users.noreply.github.com> Co-authored-by: wazuhci <22834044+wazuhci@users.noreply.github.com> --------- Signed-off-by: Diego Garcia <diego.garcia@wazuh.com> Signed-off-by: Diego Garcia diego.garcia@wazuh.com Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> Co-authored-by: wazuhci <22834044+wazuhci@users.noreply.github.com> Co-authored-by: Gonzalo Arancibia <72573241+gonzaarancibia@users.noreply.github.com> Co-authored-by: Juan Felipe Gonzalez Ortiz <53414652+felipegonzalezmv@users.noreply.github.com> Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com> Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com> Co-authored-by: Diego García <82405377+Ripdiegozz@users.noreply.github.com>
1 parent 9d6eba7 commit f3f0d93

40 files changed

Lines changed: 2385 additions & 468 deletions

.claude/settings.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
3+
"permissions": {
4+
"allow": [
5+
"Bash(git status:*)",
6+
"Bash(git diff:*)",
7+
"Bash(git log:*)",
8+
"Bash(git branch:*)",
9+
"Bash(git show:*)",
10+
"Bash(git remote -v)",
11+
"Bash(gh pr view:*)",
12+
"Bash(gh pr diff:*)",
13+
"Bash(gh pr checks:*)",
14+
"Bash(gh pr list:*)",
15+
"Bash(gh issue view:*)",
16+
"Bash(gh issue list:*)",
17+
"Bash(gh run view:*)",
18+
"Bash(gh run list:*)",
19+
"Bash(ls:*)",
20+
"Bash(cat:*)",
21+
"Bash(head:*)",
22+
"Bash(tail:*)",
23+
"Bash(rg:*)",
24+
"Bash(find:*)",
25+
"Bash(yarn lint)",
26+
"Bash(yarn lint:*)",
27+
"Bash(yarn typecheck)",
28+
"Bash(yarn typecheck:*)",
29+
"Bash(yarn test:jest)",
30+
"Bash(yarn test:jest:*)",
31+
"Bash(yarn test:jest_integration)",
32+
"Bash(yarn test:jest_integration:*)"
33+
],
34+
"deny": [],
35+
"ask": []
36+
}
37+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
name: analyze-dashboard-vuln
3+
description: Analyze a Wazuh dashboard vulnerability row, decide whether the affected library is reachable in production, fill the sheet's CVSS-Overall→Notes columns, and draft a GitHub issue body. User-invoked. Use when triaging Artifactory CVE rows across the Wazuh dashboard repos, before remediation.
4+
---
5+
6+
Analyze an Artifactory vulnerability against the Wazuh dashboard repos (and their upstream OpenSearch forks), then produce two things: the **sheet row fragment** (`CVSS Overall Score → Notes`) the user pastes back, and a **GitHub issue body** `.md` the user creates manually.
7+
8+
The whole analysis turns on one **verdict**: is the affected library **reachable in the production runtime**, or only a dev/test/transitive dependency? That verdict is binary and drives every filled column.
9+
10+
Run in **two beats**: investigate and present findings for confirmation (Beat 1), then — only on the user's "go" — write the artifacts (Beat 2). Never create the GitHub issue yourself; you only write its body to a file and print its title.
11+
12+
Once a row is confirmed **affected** and the user wants it fixed, hand off to the **resolve-cve** skill for remediation.
13+
14+
> **repo-specific (local environment):** the Wazuh dashboard repos sit side by side under the workspace root (the parent directory that contains the sibling dashboard checkouts). This repo, `wazuh-dashboard`, is the platform (upstream `OpenSearch-Dashboards`). Write scratch files and issue drafts to a git-ignored dir such as `tmp/vuln-issues/`.
15+
16+
## Input
17+
18+
The user pastes one or more tab-separated rows copied from the Artifactory vulnerabilities sheet. Columns through **CVSS Base Severity** are filled; `Tentative release` reads `Not evaluated` or blank, `CVSS Overall Score`/`Severity` are blank.
19+
20+
**There is a separate sheet per shipped Wazuh version** (e.g. a 4.10.4 sheet, a 4.14.5 sheet). That version is the **scanned ref** — what to inspect to confirm presence. If the user hasn't said which sheet, **ask** before investigating. The same CVE often recurs across version sheets as separate rows.
21+
22+
Relevant fields per row: **CVE ID**, **GHSA ID**, **Affected library**, **Path** (e.g. `/usr/share/wazuh-dashboard/plugins/securityDashboards/yarn.lock`), **Affected library version**, **CVSS Vector**, **CVSS Base Score**, **CVSS Base Severity**.
23+
24+
Group rows by **CVE** — one CVE produces **one** consolidated issue covering every affected repo, plus one row fragment per input row.
25+
26+
## Beat 1 — Investigate and report
27+
28+
1. **Parse & group.** Split rows by tab, group by CVE ID. For each row, map its `Path` plugin dir to a local repo via [the repo map](#repo-map).
29+
30+
2. **Pick the refs.** Two refs matter and they are different things:
31+
32+
- **Scanned ref** = the sheet's Wazuh version. Inspect the release **tag `v<version>`** (e.g. `v4.10.4`); fall back to `origin/<version>`. **Never read the bare local branch** — local branches drift from origin and will silently disagree with the scan (a stale `4.10.4` showed 0 handlebars while `v4.10.4` had it). Always `git fetch` first if unsure.
33+
- **Resolution refs** = where the finding gets fixed/removed: check `origin/5.0.0` and the `5.0.0`/`main` tags to find the release that resolves it (drives `Tentative release`).
34+
35+
3. **Locate + classify (the verdict).** On the scanned ref:
36+
37+
- Read the repo's `yarn.lock` via `git show <ref>:yarn.lock`, confirm the library and version match the row.
38+
- Trace why it is pulled in (`yarn why <lib>` in the repo, or follow the dependency chain in the lockfile). If **every** path to it is a `devDependency` (cypress, mocha, mochawesome, build tooling, etc.) → **not affected**. If **any** production dependency pulls it in → **affected**.
39+
- Record the dependency chain as evidence.
40+
41+
4. **Sweep for extras.** `grep -rl "<lib>" */**/yarn.lock` (or per-repo) across all local dashboard repos to find any repo carrying the library that the pasted rows did **not** include. Report extras so the user can decide whether to add sheet rows; the issue Description lists the union.
42+
43+
5. **Upstream fix status (only if affected).** Our repos are forks of `opensearch-project/*` ([map](#repo-map)). Read upstream via GitHub (don't clone): check tags/branches and the lockfile at a tag (`gh api` or raw `yarn.lock`) to find whether a patched version exists and which OpenSearch release carries it. For dependencies that come straight from upstream's lockfile, link the exact upstream lockfile line as evidence.
44+
45+
6. **Propose + pause.** Present a per-row table: library@version on the scanned ref, prod/dev chain, **verdict**, the resolution ref, proposed **Overall Score/Severity** ([scoring](#scoring)), proposed **Tentative release** with reasoning ([release rules](#tentative-release) — flag the version-mapping guess explicitly), and proposed **Notes**. List any swept extras. **Stop and ask the user to confirm** before Beat 2. (Skip this pause only if the user passed `--yolo`.)
46+
47+
## Beat 2 — Produce artifacts (on confirmation)
48+
49+
7. **Draft the issue body.** First dedup: `gh issue list --repo wazuh/internal-devel-requests --search "<CVE> in:title" --state all`. If one already exists, reuse its URL and skip drafting. Otherwise write the [full template](#issue-template) to a git-ignored scratch file `tmp/vuln-issues/<CVE>.md`, reasoning each impact section for this CVE in Wazuh's context and enumerating all affected repos in the Description.
50+
51+
8. **Print the issue title + labels** for manual creation: title per [convention](#title-convention); labels `level/task`, `type/vulnerability`.
52+
53+
9. **Emit row fragments.** One tab-separated line per input row, in input order, containing exactly `Overall Score → Notes`: `<score>\t<severity>\t<tentative>\t<ISSUE_URL>\t<notes>`. Leave the literal `<ISSUE_URL>` placeholder. Leave the `Origin` column untouched.
54+
55+
## Scoring
56+
57+
Binary, no intermediate environmental score:
58+
59+
- **affected**`Overall Score = Base Score`, `Overall Severity = Base Severity`.
60+
- **not affected**`Overall Score = 0`, `Overall Severity = None`.
61+
62+
## Tentative release
63+
64+
This column tracks **the Wazuh release that resolves the finding** (the library is patched or removed) — it is **independent of the exploitability verdict**. A not-affected, dev-only finding still gets the resolving version if the library is bumped/removed there (e.g. handlebars is a non-exploitable devDependency yet its rows read `5.0.0`, because it's patched to 4.7.9 in 5.0.0).
65+
66+
- **resolved in a known Wazuh release** → that version (e.g. `5.0.0`). Always a **Wazuh** version, never an OpenSearch one (Notes may reference the OpenSearch version).
67+
- **affected and unfixed anywhere upstream**`No fix available yet`.
68+
- **not affected and nothing tracks a resolution**`Not affected`.
69+
70+
Version-mapping heuristic (**still firming up — surface the reasoning and let the user confirm**): fix/bump landing in OpenSearch `3.x` → Wazuh `5.0.0`; the `4.14.x` line tracks OpenSearch `~2.19.x`. Confirmed data point: handlebars patched `4.7.9` lands in `5.0.0`.
71+
72+
## Notes
73+
74+
Terse verdict justification, plus an evidence link when one exists. Patterns:
75+
76+
- not affected → `It is a development sub-dependency, therefore it cannot be exploited.`
77+
- no fix → `OpenSearch <ver> still has the <lib> <ver> version, which is vulnerable. <upstream yarn.lock#Lxxxx>`
78+
- fixed → `Fixed in Wazuh <ver>` (or `Fixed in this pr <PR url>`).
79+
80+
## Repo map
81+
82+
Sheet `Path` plugin dir → local repo (under the workspace root) → upstream fork source:
83+
84+
| Plugin dir in Path | Local repo | Upstream (`opensearch-project/…`) |
85+
| ------------------------------------------------ | ------------------------------------ | -------------------------------------- |
86+
| `securityDashboards` | `wazuh-security-dashboards-plugin` | `security-dashboards-plugin` |
87+
| `alertingDashboards` | `wazuh-dashboard-alerting` | `alerting-dashboards-plugin` |
88+
| `notificationsDashboards` | `wazuh-dashboard-notifications` | `dashboards-notifications` |
89+
| `reportsDashboards` | `wazuh-dashboard-reporting` | `dashboards-reporting` |
90+
| (security analytics) | `wazuh-dashboard-security-analytics` | `security-analytics-dashboards-plugin` |
91+
| `wazuh`, `wazuhCore`, `wazuhCheckUpdates` | `wazuh-dashboard-plugins` | — (Wazuh-owned) |
92+
| base app / `/usr/share/wazuh-dashboard/...` core | `wazuh-dashboard` | `OpenSearch-Dashboards` |
93+
94+
Other OpenSearch plugin dirs (`customImportMapDashboards`, `ganttChartDashboards`, `indexManagementDashboards`, …) may have no Wazuh fork — note that and treat upstream as the source.
95+
96+
## Title convention
97+
98+
`Artifactory wazuh-dashboard CVE-XXXX-XXXXX` — current issues use the umbrella `wazuh-dashboard` even for a single sub-repo path (matching the sheet's `Vulnerability` column, which is `wazuh-dashboard` for this whole sheet). The specific sub-repo and path go in the issue body, not the title.
99+
100+
## Issue template
101+
102+
Write this verbatim structure, filling each section for the specific CVE:
103+
104+
```markdown
105+
# Description
106+
107+
CVE or steps to reproduce.
108+
109+
# Availability impact
110+
111+
Provide a brief description/explanation of how the vulnerability can be used to cause network outages/downtime or impact emergency services.
112+
113+
# Confidentiality impact
114+
115+
Provide a brief description/explanation of how the vulnerability can be used for unauthorized monitoring/disclosure of proprietary/classified systems/information.
116+
117+
# Integrity impact
118+
119+
Provide a brief description/explanation of how the vulnerability can result in theft, destruction, modification or loss of private/sensitive data.
120+
121+
# Exploitability
122+
123+
Provide a brief description of the potential attack scenario, e.g. - how can the vulnerability be exploited?
124+
125+
# Mitigation/Containment plan
126+
127+
Provide details of any workarounds or containment actions that can be taken.
128+
```
129+
130+
For a **not-affected** CVE, still produce all six sections (each stating no production impact and why), matching the `uuid`/`xmldom` precedent.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
name: check-standards
3+
description: Run the same code-quality checks CI runs (Prettier format, ESLint, typecheck, and unit tests) over the current diff before pushing or marking a PR ready. Use before opening/updating a PR, when the user asks to verify standards, lint, format, or check that CI will pass.
4+
---
5+
6+
# Check standards (mirror CI locally)
7+
8+
Runs, over the **changed files only**, the same gates CI applies on Wazuh Dashboard
9+
PRs, so failures are caught before they burn CI minutes. Fix issues, then re-run
10+
until clean.
11+
12+
The approach is generic; blocks marked **repo-specific** cover this repo's exact
13+
commands (test runner, typecheck, lint).
14+
15+
## Workflow
16+
17+
```
18+
- [ ] 1. Compute changed files vs the base branch
19+
- [ ] 2. Prettier --check (autofix with --write)
20+
- [ ] 3. ESLint (autofix with --fix)
21+
- [ ] 4. Typecheck
22+
- [ ] 5. Unit tests for touched code
23+
- [ ] 6. Report pass/fail summary
24+
```
25+
26+
### 1. Compute changed files
27+
28+
Match how CI computes them (diff against the base branch, excluding deletions):
29+
30+
```bash
31+
BASE=<version-branch> # e.g. 5.0.0 — the PR base
32+
git fetch origin "$BASE"
33+
CHANGED=$(git diff --name-status --diff-filter=d "origin/$BASE"...HEAD | awk '{print $NF}')
34+
CODE=$(echo "$CHANGED" | grep -E '\.[jt]sx?$' || true) # js/jsx/ts/tsx only
35+
echo "$CHANGED"
36+
```
37+
38+
### 2. Prettier (format)
39+
40+
CI runs `prettier --check --ignore-unknown` on changed files. Same locally:
41+
42+
```bash
43+
npx prettier $CHANGED --check --ignore-unknown --config .prettierrc
44+
# autofix:
45+
npx prettier $CHANGED --write --ignore-unknown --config .prettierrc
46+
```
47+
48+
### 3. ESLint
49+
50+
> **repo-specific (wazuh-dashboard):** a single root ESLint config
51+
> (`.eslintrc.js`) covers the whole workspace. Run from the repo root (as CI
52+
> does). `yarn lint` runs **ESLint + Stylelint**; for just the changed code files:
53+
>
54+
> ```bash
55+
> node scripts/eslint $CODE
56+
> # autofix:
57+
> node scripts/eslint $CODE --fix
58+
> ```
59+
>
60+
> If you touched `.scss` files, also run Stylelint (`yarn lint:style`).
61+
62+
### 4. Typecheck
63+
64+
> **repo-specific (wazuh-dashboard):** use the repo script (runs on the host —
65+
> the full OSD checkout ships `setup_node_env`):
66+
>
67+
> ```bash
68+
> yarn typecheck # node scripts/ts_error_checker.js
69+
> ```
70+
71+
### 5. Unit tests (touched code)
72+
73+
> **repo-specific (wazuh-dashboard):** Jest runs **on the host** here (no Docker
74+
> container needed). Scope to the changed files for speed:
75+
>
76+
> ```bash
77+
> yarn test:jest <path-or-pattern>
78+
> # integration tests, if you touched **/integration_tests/**:
79+
> yarn test:jest_integration <path>
80+
> ```
81+
82+
Remember: unit tests are **colocated** (`*.test.ts` / `*.test.tsx` next to the
83+
source). New source files should ship with their colocated test.
84+
85+
> **repo-specific (wazuh-dashboard):** if you changed a Core public/server API
86+
> under `src/core/`, also run `yarn docs:acceptApiChanges` and commit the updated
87+
> `*.api.md` files (CI verifies these).
88+
89+
### 6. Report
90+
91+
Summarize each gate as pass/fail; if anything failed, list the offending files and
92+
either fix them or explain what needs manual attention:
93+
94+
```
95+
Prettier: PASS
96+
ESLint: FAIL (2 files) → src/plugins/foo/public/bar.tsx, src/core/server/baz.ts
97+
Typecheck: PASS
98+
Jest: PASS
99+
```
100+
101+
Only report "ready for review" once every applicable gate passes.

0 commit comments

Comments
 (0)