Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
4bcc913
feat: throw error if the server API context filter could not be creat…
Desvelao Aug 22, 2025
afa7a53
fix: minor problems in withDataSourceInitiated HOC
Desvelao Aug 22, 2025
d76820f
feat: move creation of data source in EventsCount component
Desvelao Aug 22, 2025
fa132b9
change: refactor vulnerability detection on agent welcome
Desvelao Aug 22, 2025
25e399d
change: refactor last 24 houts alerts panel in home
Desvelao Aug 25, 2025
89d0d27
fix: FIM table fetch dependencies in agent welcome
Desvelao Aug 25, 2025
440d6b8
chore: add some todos to review
Desvelao Aug 25, 2025
88ca0cb
remove(cluster): uneeded render
Desvelao Aug 25, 2025
3ebbd17
feat(home): add error management to agents summary visualization rela…
Desvelao Aug 25, 2025
fea7595
fix: throw an error if there is not selected server API on request
Desvelao Aug 26, 2025
843552b
fix(datasource): manage error when setting filters in the useDataSour…
Desvelao Aug 26, 2025
0d12cdc
fix: remove retries in the server API login expecting external setup …
Desvelao Aug 26, 2025
7491031
feat: enhance withDataSource HOCs
Desvelao Aug 27, 2025
e3655a7
feat: enhance messages in WzAuthentication service
Desvelao Aug 27, 2025
96f5212
feat: create withServerAPIAvailable HOC
Desvelao Aug 27, 2025
b1e548f
refactor(settings): refactor settings component, about section and de…
gonzaarancibia Aug 27, 2025
93fcf98
feat: add observable to manage the server API availability
Desvelao Aug 27, 2025
f8987ba
Merge branch 'enhancement/7680-rework-healthcheck-manage-error-missin…
Desvelao Aug 27, 2025
19ce1b9
feat: add observable to manage teh selected API and a HOC to display …
Desvelao Aug 27, 2025
dddf781
feat: add withSelectedServerAPI to withUserAuthorizationPrompt HOC
Desvelao Aug 27, 2025
f26cc86
feat: add missing prop definition to createPanel
Desvelao Aug 27, 2025
cd2987d
feat(menu): refactor menu, enhance selectors, sync state
Desvelao Aug 28, 2025
007b03b
remove: unused import
Desvelao Aug 28, 2025
872b080
remove: console.log
Desvelao Aug 28, 2025
9946051
feat: add the setup of the alerts index pattern on mount app
Desvelao Aug 29, 2025
99ecac3
feat(statistics): add error creating the filter related to selected API
Desvelao Aug 29, 2025
f92e443
comment(groups): add related to permissions requirements
Desvelao Aug 29, 2025
bba8d36
remove(statistics): unused code
Desvelao Aug 29, 2025
1f5f93f
fix(endpoints-summary): protect view with permissions
Desvelao Sep 1, 2025
c2b18cf
chore(sample-data): add fixme messages
Desvelao Sep 1, 2025
b8e808b
chore(event-count-evolution): add fixme message
Desvelao Sep 1, 2025
0a08889
fix(datasource): withDataSourceFetchOnStart HOC request cache intial …
Desvelao Sep 1, 2025
b7a98a3
fix: double request in agent welcome components
Desvelao Sep 1, 2025
568125f
fix(appstate): observable changed despite the object was similar but …
Desvelao Sep 1, 2025
f053bfb
fix: memoize filter in AgentUpgradesTaskDetailsModal component
Desvelao Sep 1, 2025
2ccc8d4
feat(wzrequest): throttle the warning toast about API is not available
Desvelao Sep 1, 2025
aae494c
fix(groups): add permissions requirement to group section
Desvelao Sep 1, 2025
13a2dc4
fix(tablewzapi): error with thruthy values as initial value for reloa…
Desvelao Sep 1, 2025
25fdf6e
fix(docker): dashboard was not visible
Desvelao Sep 2, 2025
6fb3f71
change(ms-graph): render dashboard tab using createDashboard
Desvelao Sep 2, 2025
db0ac40
change(search-bar): remove critical error management
Desvelao Sep 2, 2025
7a4e936
change(logs): remove critical error management
Desvelao Sep 2, 2025
f919aba
change(agents): remove critical error management, refactor MainEndpoi…
Desvelao Sep 2, 2025
c4c98d7
fix(wzrequest): throw enhanced error due to server API availability w…
Desvelao Sep 2, 2025
a4637d0
remove(route-resolver): settingsWizard
Desvelao Sep 2, 2025
acd1ac0
remove(blank-screen): Remove /blank-screen route
Desvelao Sep 2, 2025
c47f6ff
feat(docs): add information about prompts
Desvelao Sep 3, 2025
7e89850
change: message in the prompt related to server API is not available
Desvelao Sep 3, 2025
bdea1e7
remove(route-resolver): import of missing file
Desvelao Sep 3, 2025
456757c
change(sample-data): WzRequest.genericReq by GenericRequest.request i…
Desvelao Sep 3, 2025
d0a7211
fix: missing dependencies in useMemo
Desvelao Sep 3, 2025
c66c087
remove: comment
Desvelao Sep 3, 2025
1251880
Merge branch 'enhancement/7610-rework-healthcheck' of https://github.…
Desvelao Sep 3, 2025
a88b69a
Merge branch 'enhancement/7610-rework-healthcheck' of https://github.…
Desvelao Sep 3, 2025
80a5421
fix(test): changes in AppState using getCookies needed to mock the se…
Desvelao Sep 4, 2025
41df8ed
remove: unused useAboutData hook
Desvelao Sep 4, 2025
f1a9798
fix(test): server api check
Desvelao Sep 4, 2025
51f2e09
change: convert PatternDataSourceRepository to abstract class
Desvelao Sep 12, 2025
8adde25
remove: comments
Desvelao Sep 12, 2025
14207e2
fix: code suggestion
Desvelao Sep 12, 2025
a16dff3
Apply suggestions from code review
Desvelao Sep 12, 2025
af74be7
fix: apply edited suggestion patch
Desvelao Sep 12, 2025
776d421
Merge branch 'enhancement/7680-rework-healthcheck-manage-error-missin…
Desvelao Sep 12, 2025
43698ba
fix: apply suggestion patch
Desvelao Sep 12, 2025
856726d
fix: add explaination to comment
Desvelao Sep 12, 2025
5fc5c07
change: variable name related to code suggestion
Desvelao Sep 12, 2025
6f673d7
fix: apply edited suggestion patch
Desvelao Sep 12, 2025
923c368
fix: review cluster info cookie in the server API setup
Desvelao Sep 12, 2025
de3222c
fix: check selected index pattern exists in the index pattern list of…
Desvelao Sep 12, 2025
6bee6b4
remove: comment
Desvelao Sep 12, 2025
33ec5c0
fix(prettier): files
Desvelao Sep 12, 2025
bfea2d6
fix(test): remove test and fix function arguments
Desvelao Sep 12, 2025
4526ad0
Adds source directory exports for dashboard components
yenienserrano Sep 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/osd-dev/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ export OSD_MAJOR_NUMBER=$(echo $OSD_VERSION | cut -d. -f1)
export COMPOSE_PROJECT_NAME=os-dev-${OSD_VERSION//./}
export WAZUH_STACK=""
export WAZUH_VERSION_DEVELOPMENT=$(jq -r '.version' $PACKAGE_PATH)
export SRC_DASHBOARD=$(realpath ../../../wazuh-dashboard)
export SRC_SECURITY_PLUGIN=$(realpath ../../../wazuh-security-dashboards-plugin)

if [[ "$OSD_MAJOR_NUMBER" -ge 2 ]]; then
export OSD_MAJOR="2.x"
Expand Down
3 changes: 0 additions & 3 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,6 @@ export const PLUGIN_PLATFORM_WAZUH_DOCUMENTATION_URL_PATH_TROUBLESHOOTING =
'user-manual/wazuh-dashboard/troubleshooting.html';
export const PLUGIN_PLATFORM_WAZUH_DOCUMENTATION_URL_PATH_APP_CONFIGURATION =
'user-manual/wazuh-dashboard/settings.html';
export const PLUGIN_PLATFORM_URL_GUIDE =
'https://opensearch.org/docs/2.10/about';
export const PLUGIN_PLATFORM_URL_GUIDE_TITLE = 'OpenSearch guide';

export const PLUGIN_PLATFORM_REQUEST_HEADERS = {
'osd-xsrf': 'kibana',
Expand Down
101 changes: 101 additions & 0 deletions plugins/main/docs/prompts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Prompts

The plugin uses prompts to display some problems or missing dependencies for the views.

## Data source has an error. The filter related to the server API context can not be created due to the required data was not found. This is usually caused because there is no selected a server API. Ensure the server API is available and select it in the server API selector.

This means the filter related to the selected server API (`cluster.name`/`manager.name` in the alerts case or `wazuh.cluster.name` in the inventories data) can not be created due to the required information is not available in some dashboard or inventory view. The required data to create the filter is stored in the `clusterInfo` cookie in the client browser.

The cookie is set when getting the cluster information after the server API is selected through the selector or automatically when enters to some apps of Wazuh dashboard if possible.

### Troubleshooting

1. Ensure there is an server API selected in the selector (Wazuh dashboard header top right corner)
2. Server API is available and the Wazuh dashboard can communicate with it.
> Use the `ping` command or try to do a request (`cURL`) from the Wazuh dashboard host to the server API to ensure teh communication using the host configuration in the `wazuh.yml`.
3. Review the server API host configuration (URL, port, user credentials of the Wazuh server) are valid. The internal user should have permissions to retrieve the cluster information data so this can be set in the cookie.
4. Ensure the `clusterInfo` cookie is set in the browser.

## Data source has an error. Index pattern with ID or title [INDEX_PATTERN] not found. Review if you have at least one index pattern with this configuration. You can create the index patterns from Dashboard Management application if there are matching indices. If there are no matching indices, this could indicate the data collection is disabled or there is a problem in the collection or ingestion.

This means the index pattern, that is used in some view or panel where the error is visible, could not be found.

This could be caused because the expected index pattern does not exist. The Wazuh dashboard could try to create the index patterns if this find matching indices, so this could mean there is no matching indices due to the data collection could be disabled or there is a problem in the data collection (server) or ingestion (server and indexer).

In some cases, it searches by index pattern ID, and in others, this could be the ID or title. This requirement is specified in the error depending on the view or panel.

### Troubleshooting

1. Ensure you have an index pattern with the requirements of ID or title that are speficied in the error.
The available index patterns can be listed in the **Dashboard Management** > **Index patterns**.

In the case the index pattern is not created, you can create in the **Dashboard Management** > **Index patterns** if there are matching indices.

If there is not matching indices, this could indicate:

- the data collection is disabled: in this case the prompt is expected because the related indices do not exist
- the data collection or ingestion has a problem: review the logs of the components (server and indexer) that run these actions for more information

## Data source has an error. There is no selected index pattern for alerts. Ensure there is a compatible index pattern and select it using the index pattern selector. The index pattern selector is only available when there are multiple compatibles index patterns. If there is only a compatible index pattern, the selector is not visible, and it could indicate the index pattern was not selected due to some error or you could need to select it.

This error indicates the index pattern related to alerts is not selected.

The selection of the alerts index pattern is stored in the `currentPattern` cookie that stores the ID in the browser. If this cookie is not present or this has a falsy value, the error is thrown.

Ensure the alerts index pattern is selected if this is available.

### Troubleshooting

1. Ensure the index pattern related to alerts is selected in the selector (Wazuh dashboard header top right corner).
2. Ensure the environment has compatible index patterns with the alerts data. You can list the index patterns in **Dashboard Management** > **Index patterns**. The compatible index patterns are these have the following fields:

- `timestamp`
- `rule.groups`
- `manager.name`
- `agent.id`

If there is not a compatible index pattern, it can be created if there are matching indices in **Dashboard Management** > **Index patterns**.

If there is no matching indices and the alerts generation is enabled, this could indicate a problem in the
data collection (server) or ingestion (server, Filebeat, indexer). Review the components responsibles of these actions.

3. Ensure the `currentPattern` cookie is set in the browser with the ID of the index.

## Server API is not available. The server API is currently not available. Review the connection with the selected server API, the service is running and the API host configuration is valid.

This means the dashboard can not connect with the server API host.

This could be caused by:

- Server API host is not reachable from the Wazuh dashboard host.
- Network problem (firewall).
- Server API is down/stopped.
- Wrong server API host configuration (URL, port and credentials)

### Troubleshooting

1. Ensure the server API is running

```
systemctl status wazuh-manager
```

2. Ensure the server API host is reachable from the Wazuh dashboard host.

Use the `ping` command or `cURL` to try the communication using the configuration for the server API host in the Wazuh dashboard.

3. Review the server API host configuration in the Wazuh dashboard side (URL, port and credentials)

## Server API is not selected. The server API is not selected. Select it using the server API selector.

This means the server API host is not selected.

The selection of the server API host is set in the `currentApi` cookie in the browser. If this is not set or has a falsy value, the error is displayed.

This can be caused because the server API host is not selected or this could be set when entering to some apps in Wazuh dashboard.

### Troubleshooting

1. Ensure the server API host is selected in the selector (Wazuh dashboard header top right corner).
2. Ensure the server API is available (online).
3. Ensure the server API is reachable by the Wazuh dashboard host and its configuration (URL, port and creandentials) is ok.
12 changes: 6 additions & 6 deletions plugins/main/public/app-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { WzMenuWrapper } from './components/wz-menu/wz-menu-wrapper';
import { WzAgentSelectorWrapper } from './components/wz-agent-selector/wz-agent-selector-wrapper';
import { ToastNotificationsModal } from './components/notifications/modal';
import { WzUpdatesNotification } from './components/wz-updates-notification';
import { WzBlankScreen } from './components/wz-blank-screen/wz-blank-screen';
import { RegisterAgent } from './components/endpoints-summary/register-agent';
import { MainEndpointsSummary } from './components/endpoints-summary';
import { AgentView } from './components/endpoints-summary/agent';
Expand All @@ -23,6 +22,7 @@ import NavigationService from './react-services/navigation-service';
import { SECTIONS } from './sections';
import { withGuardAsync } from './components/common/hocs';
import { WzRequest } from './react-services/wz-request';
import { AlertsDataSourceSetup } from './components/common/data-source';

export const Application = withGuardAsync(
async (_props: any) => {
Expand All @@ -34,6 +34,11 @@ export const Application = withGuardAsync(
// Load the app state
loadAppConfig(),
]);

await Promise.allSettled([
// Setup the alerts index pattern
AlertsDataSourceSetup(),
]);
} catch {}

return {
Expand Down Expand Up @@ -112,11 +117,6 @@ export const Application = withGuardAsync(
exact
render={props => <ToolsRouter {...props} />}
></Route>
<Route
path={`/${SECTIONS.BLANK_SCREEN}`}
exact
render={props => <WzBlankScreen {...props} />}
></Route>
<Redirect from='/' to={getWzMainParams()} />
</Switch>
</Router>
Expand Down
15 changes: 14 additions & 1 deletion plugins/main/public/components/add-modules-data/sample-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
sampleSecurityInformationApplication,
sampleThreatDetectionApplication,
} from './helper';
import { GenericRequest } from '../../react-services';

export default class WzSampleData extends Component {
categories: {
Expand Down Expand Up @@ -148,7 +149,7 @@ export default class WzSampleData extends Component {
// Check if sample data for each category was added
const results = await DeepPromiseResolver(
this.categories.reduce((accum, cur) => {
accum[cur.categorySampleDataIndex] = WzRequest.genericReq(
accum[cur.categorySampleDataIndex] = GenericRequest.request(
'GET',
`/indexer/sampledata/${cur.categorySampleDataIndex}`,
);
Expand All @@ -173,10 +174,22 @@ export default class WzSampleData extends Component {
const clusterName = AppState.getClusterInfo().cluster;
const managerName = AppState.getClusterInfo().manager;

if (!clusterName && !managerName) {
throw new Error(
'The data related to the server API context could not be obtained. This is required when adding sample data to match the server API context.',
);
}

// eslint-disable-next-line camelcase
this.generateAlertsParams.api_id = JSON.parse(
AppState.getCurrentAPI() || '{}',
)?.id;

if (!this.generateAlertsParams.api_id) {
throw new Error(
'The server API is not selected. Select it using the server API selector.',
);
}
this.generateAlertsParams.manager = {
name: managerName,
};
Expand Down
5 changes: 5 additions & 0 deletions plugins/main/public/components/agents/stats/table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jest.mock('../../../kibana-services', () => ({
prepend: str => str,
},
}),
getCookies: () => {
return {
get: () => 'test',
};
},
}));
jest.mock(
'../../../../../../node_modules/@elastic/eui/lib/services/accessibility/html_id_generator',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const InventoryMetrics = withSystemInventoryDataSource(
};
fetchInventoryHardwareSystemData();
}
}, [itHygieneDataSource.isLoading, agent.id]);
}, [itHygieneDataSource.isLoading, itHygieneDataSource.fetchFilters]);

const items: IRibbonItem[] = [
{
Expand Down
1 change: 1 addition & 0 deletions plugins/main/public/components/common/dashboards/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const createPanel = ({
withDataSourceInitiated({
isLoadingNameProp: 'dataSource.isLoading',
dataSourceNameProp: 'dataSource.dataSource',
dataSourceErrorNameProp: 'dataSource.error',
}),
)(
({
Expand Down
Loading
Loading